Package org.apache.hadoop.hbase.ipc
Class RpcExecutor
java.lang.Object
org.apache.hadoop.hbase.ipc.RpcExecutor
- Direct Known Subclasses:
BalancedQueueRpcExecutor,RWQueueRpcExecutor
@LimitedPrivate({"Coprocesssor","Phoenix"})
@Evolving
public abstract class RpcExecutor
extends Object
Runs the CallRunners passed here via
dispatch(CallRunner). Subclass and add particular
scheduling behavior.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classComparator used by the "normal callQueue" if DEADLINE_CALL_QUEUE_CONF_KEY is set to true. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Abortableprivate final AtomicIntegerstatic final intstatic final doublestatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Class<?>static final StringThe default, 'fifo', has the least friction but is dumb.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprivate final org.apache.hadoop.conf.Configurationprotected intprotected static final intprivate final AtomicIntegerprivate final intprivate final List<RpcHandler>private static final org.slf4j.Loggerprivate Stringprotected final intprivate final LongAdderprivate final LongAdderprivate static final QueueBalancerAll requests go to the first queue, at index 0static final Stringstatic final Stringstatic final Stringmax delay in msec used to bound the de-prioritized requestsprivate final Class<? extends BlockingQueue>private final Object[]protected final List<BlockingQueue<CallRunner>> -
Constructor Summary
ConstructorsConstructorDescriptionRpcExecutor(String name, int handlerCount, int maxQueueLength, PriorityFunction priority, org.apache.hadoop.conf.Configuration conf, Abortable abortable) RpcExecutor(String name, int handlerCount, String callQueueType, int maxQueueLength, PriorityFunction priority, org.apache.hadoop.conf.Configuration conf, Abortable abortable) -
Method Summary
Modifier and TypeMethodDescriptionprotected intcomputeNumCallQueues(int handlerCount, float callQueuesHandlersFactor) abstract booleandispatch(CallRunner callTask) Add the request to the executor queueintintintintstatic QueueBalancergetBalancer(String executorName, org.apache.hadoop.conf.Configuration conf, List<BlockingQueue<CallRunner>> queues) protected floatgetCallQueueHandlerFactor(org.apache.hadoop.conf.Configuration conf) protected RpcHandlergetHandler(String name, double handlerFailureThreshhold, int handlerCount, BlockingQueue<CallRunner> q, AtomicInteger activeHandlerCount, AtomicInteger failedHandlerCount, Abortable abortable) Override if providing alternate Handler implementation.private static StringgetMethodName(CallRunner callRunner) Return theDescriptors.MethodDescriptor.getName()fromcallRunneror "Unknown".getName()longlongprivate Optional<Class<? extends BlockingQueue<CallRunner>>>intReturns the length of the pending queueprotected List<BlockingQueue<CallRunner>>Returns the list of request queuesintprivate static longgetRpcCallSize(CallRunner callRunner) Return theRpcCall.getSize()fromcallRunneror 0L.intintprotected voidinitializeQueues(int numQueues) static booleanisCodelQueueType(String callQueueType) static booleanisDeadlineQueueType(String callQueueType) static booleanisFifoQueueType(String callQueueType) static booleanisPluggableQueueType(String callQueueType) static booleanisPluggableQueueWithFastPath(String callQueueType, org.apache.hadoop.conf.Configuration conf) voidonConfigurationChange(org.apache.hadoop.conf.Configuration conf) voidresizeQueues(org.apache.hadoop.conf.Configuration conf) Update current soft limit for executor's call queuesvoidstart(int port) protected voidstartHandlers(int port) protected voidstartHandlers(String nameSuffix, int numHandlers, List<BlockingQueue<CallRunner>> callQueues, int qindex, int qsize, int port, AtomicInteger activeHandlerCount) Start up our handlers.voidstop()
-
Field Details
-
LOG
-
DEFAULT_CALL_QUEUE_SIZE_HARD_LIMIT
- See Also:
-
CALL_QUEUE_HANDLER_FACTOR_CONF_KEY
- See Also:
-
QUEUE_MAX_CALL_DELAY_CONF_KEY
max delay in msec used to bound the de-prioritized requests- See Also:
-
CALL_QUEUE_TYPE_CODEL_CONF_VALUE
The default, 'fifo', has the least friction but is dumb. If set to 'deadline', uses a priority queue and de-prioritizes long-running scans. Sorting by priority comes at a cost, reduced throughput.- See Also:
-
CALL_QUEUE_TYPE_DEADLINE_CONF_VALUE
- See Also:
-
CALL_QUEUE_TYPE_FIFO_CONF_VALUE
- See Also:
-
CALL_QUEUE_TYPE_PLUGGABLE_CONF_VALUE
- See Also:
-
CALL_QUEUE_TYPE_CONF_KEY
- See Also:
-
CALL_QUEUE_TYPE_CONF_DEFAULT
- See Also:
-
CALL_QUEUE_QUEUE_BALANCER_CLASS
- See Also:
-
CALL_QUEUE_QUEUE_BALANCER_CLASS_DEFAULT
-
CALL_QUEUE_CODEL_TARGET_DELAY
- See Also:
-
CALL_QUEUE_CODEL_INTERVAL
- See Also:
-
CALL_QUEUE_CODEL_LIFO_THRESHOLD
- See Also:
-
CALL_QUEUE_CODEL_DEFAULT_TARGET_DELAY
- See Also:
-
CALL_QUEUE_CODEL_DEFAULT_INTERVAL
- See Also:
-
CALL_QUEUE_CODEL_DEFAULT_LIFO_THRESHOLD
- See Also:
-
PLUGGABLE_CALL_QUEUE_CLASS_NAME
- See Also:
-
PLUGGABLE_CALL_QUEUE_WITH_FAST_PATH_ENABLED
- See Also:
-
numGeneralCallsDropped
-
numLifoModeSwitches
-
numCallQueues
-
queues
-
queueClass
-
queueInitArgs
-
currentQueueLimit
-
activeHandlerCount
-
handlers
-
handlerCount
-
failedHandlerCount
-
name
-
conf
-
abortable
-
ONE_QUEUE
All requests go to the first queue, at index 0
-
-
Constructor Details
-
RpcExecutor
public RpcExecutor(String name, int handlerCount, int maxQueueLength, PriorityFunction priority, org.apache.hadoop.conf.Configuration conf, Abortable abortable) -
RpcExecutor
public RpcExecutor(String name, int handlerCount, String callQueueType, int maxQueueLength, PriorityFunction priority, org.apache.hadoop.conf.Configuration conf, Abortable abortable)
-
-
Method Details
-
computeNumCallQueues
-
getMethodName
Return theDescriptors.MethodDescriptor.getName()fromcallRunneror "Unknown". -
getRpcCallSize
Return theRpcCall.getSize()fromcallRunneror 0L. -
getCallQueueCountsSummary
-
getCallQueueSizeSummary
-
initializeQueues
-
start
-
stop
-
dispatch
Add the request to the executor queue -
getQueues
Returns the list of request queues -
startHandlers
-
getHandler
protected RpcHandler getHandler(String name, double handlerFailureThreshhold, int handlerCount, BlockingQueue<CallRunner> q, AtomicInteger activeHandlerCount, AtomicInteger failedHandlerCount, Abortable abortable) Override if providing alternate Handler implementation. -
startHandlers
protected void startHandlers(String nameSuffix, int numHandlers, List<BlockingQueue<CallRunner>> callQueues, int qindex, int qsize, int port, AtomicInteger activeHandlerCount) Start up our handlers. -
getBalancer
public static QueueBalancer getBalancer(String executorName, org.apache.hadoop.conf.Configuration conf, List<BlockingQueue<CallRunner>> queues) -
isDeadlineQueueType
-
isCodelQueueType
-
isFifoQueueType
-
isPluggableQueueType
-
isPluggableQueueWithFastPath
public static boolean isPluggableQueueWithFastPath(String callQueueType, org.apache.hadoop.conf.Configuration conf) -
getPluggableQueueClass
-
getNumGeneralCallsDropped
-
getNumLifoModeSwitches
-
getActiveHandlerCount
-
getActiveWriteHandlerCount
-
getActiveReadHandlerCount
-
getActiveScanHandlerCount
-
getQueueLength
Returns the length of the pending queue -
getReadQueueLength
-
getScanQueueLength
-
getWriteQueueLength
-
getName
-
resizeQueues
Update current soft limit for executor's call queues- Parameters:
conf- updated configuration
-
onConfigurationChange
-
getCallQueueHandlerFactor
-