diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java index 483ce86..07d1009 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java @@ -184,7 +184,7 @@ public class RpcServer implements RpcServerInterface, ConfigurationObserver { static final int DEFAULT_MAX_CALLQUEUE_LENGTH_PER_HANDLER = 10; /** - * The maximum size that we can hold in the RPC queue + * The maximum size that we can hold in the RPC queue in bytes. */ private static final int DEFAULT_MAX_CALLQUEUE_SIZE = 1024 * 1024 * 1024; @@ -691,7 +691,7 @@ public class RpcServer implements RpcServerInterface, ConfigurationObserver { try { readSelector.select(); while (adding) { - this.wait(1000); + this.wait(1); } Iterator iter = readSelector.selectedKeys().iterator(); @@ -1218,7 +1218,7 @@ public class RpcServer implements RpcServerInterface, ConfigurationObserver { try { if (call.connection.responseQueue.isEmpty()) { // If we're alone, we can try to do a direct call to the socket. It's - // an optimisation to save on context switches and data transfer between cores.. + // an optimization to save on context switches and data transfer between cores. if (processResponse(call)) { return; // we're done. } @@ -1963,6 +1963,7 @@ public class RpcServer implements RpcServerInterface, ConfigurationObserver { ", too many items queued ?"); responder.doRespond(call); } + /*(new CallRunner(RpcServer.this, call)).run();*/ } private boolean authorizeConnection() throws IOException { @@ -2095,7 +2096,8 @@ public class RpcServer implements RpcServerInterface, ConfigurationObserver { this.socketSendBufferSize = 0; this.maxQueueSize = this.conf.getInt("hbase.ipc.server.max.callqueue.size", DEFAULT_MAX_CALLQUEUE_SIZE); - this.readThreads = conf.getInt("hbase.ipc.server.read.threadpool.size", 10); + this.readThreads = conf.getInt("hbase.ipc.server.read.threadpool.size", + Runtime.getRuntime().availableProcessors() + 1); this.maxIdleTime = 2 * conf.getInt("hbase.ipc.client.connection.maxidletime", 1000); this.maxConnectionsToNuke = conf.getInt("hbase.ipc.client.kill.max", 10); this.thresholdIdleConnections = conf.getInt("hbase.ipc.client.idlethreshold", 4000); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java index 431aeeb..384fd66 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java @@ -270,6 +270,10 @@ public class SimpleRpcScheduler extends RpcScheduler implements ConfigurationObs @Override public boolean dispatch(CallRunner callTask) throws InterruptedException { + callTask.setStatus(RpcServer.getStatus()); + callTask.run(); + return true; + /* RpcServer.Call call = callTask.getCall(); int level = priority.getPriority(call.getHeader(), call.param, call.getRequestUser()); if (priorityExecutor != null && level > highPriorityLevel) { @@ -278,7 +282,7 @@ public class SimpleRpcScheduler extends RpcScheduler implements ConfigurationObs return replicationExecutor.dispatch(callTask); } else { return callExecutor.dispatch(callTask); - } + }*/ } @Override diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 6522fde..5dc9754 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -6734,6 +6734,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi public List get(Get get, boolean withCoprocessor) throws IOException { List results = new ArrayList(); + // if (!this.getRegionInfo().isMetaRegion()) return results; // pre-get CP hook if (withCoprocessor && (coprocessorHost != null)) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java index e09e0e3..d297079 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java @@ -2108,6 +2108,7 @@ public class RSRpcServices implements HBaseRPCErrorHandler, Region region = getRegion(request.getRegion()); GetResponse.Builder builder = GetResponse.newBuilder(); + if (!region.getRegionInfo().isMetaRegion()) return builder.build(); ClientProtos.Get get = request.getGet(); Boolean existence = null; Result r = null;