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
Modifier and TypeClassDescriptionprivate static class
Comparator used by the "normal callQueue" if DEADLINE_CALL_QUEUE_CONF_KEY is set to true. -
Field Summary
Modifier and TypeFieldDescriptionprivate final Abortable
private final AtomicInteger
static final int
static final double
static final int
static final String
static final String
static final String
static final String
static final String
static final Class<?>
static final String
The default, 'fifo', has the least friction but is dumb.static final String
static final String
static final String
static final String
static final String
private final org.apache.hadoop.conf.Configuration
protected int
protected static final int
private final AtomicInteger
private final int
private final List<RpcHandler>
private static final org.slf4j.Logger
private String
protected final int
private final LongAdder
private final LongAdder
private static final QueueBalancer
All requests go to the first queue, at index 0static final String
static final String
static final String
max delay in msec used to bound the de-prioritized requestsprivate final Class<? extends BlockingQueue>
private final Object[]
protected final List<BlockingQueue<CallRunner>>
-
Constructor Summary
ConstructorDescriptionRpcExecutor
(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 int
computeNumCallQueues
(int handlerCount, float callQueuesHandlersFactor) abstract boolean
dispatch
(CallRunner callTask) Add the request to the executor queueint
int
int
int
static QueueBalancer
getBalancer
(String executorName, org.apache.hadoop.conf.Configuration conf, List<BlockingQueue<CallRunner>> queues) protected RpcHandler
getHandler
(String name, double handlerFailureThreshhold, int handlerCount, BlockingQueue<CallRunner> q, AtomicInteger activeHandlerCount, AtomicInteger failedHandlerCount, Abortable abortable) Override if providing alternate Handler implementation.private static String
getMethodName
(CallRunner callRunner) Return theDescriptors.MethodDescriptor.getName()
fromcallRunner
or "Unknown".getName()
long
long
private Optional<Class<? extends BlockingQueue<CallRunner>>>
int
Returns the length of the pending queueprotected List<BlockingQueue<CallRunner>>
Returns the list of request queuesint
private static long
getRpcCallSize
(CallRunner callRunner) Return theRpcCall.getSize()
fromcallRunner
or 0L.int
int
protected void
initializeQueues
(int numQueues) static boolean
isCodelQueueType
(String callQueueType) static boolean
isDeadlineQueueType
(String callQueueType) static boolean
isFifoQueueType
(String callQueueType) static boolean
isPluggableQueueType
(String callQueueType) static boolean
isPluggableQueueWithFastPath
(String callQueueType, org.apache.hadoop.conf.Configuration conf) void
onConfigurationChange
(org.apache.hadoop.conf.Configuration conf) void
resizeQueues
(org.apache.hadoop.conf.Configuration conf) Update current soft limit for executor's call queuesvoid
start
(int port) protected void
startHandlers
(int port) protected void
startHandlers
(String nameSuffix, int numHandlers, List<BlockingQueue<CallRunner>> callQueues, int qindex, int qsize, int port, AtomicInteger activeHandlerCount) Start up our handlers.void
stop()
-
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()
fromcallRunner
or "Unknown". -
getRpcCallSize
Return theRpcCall.getSize()
fromcallRunner
or 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
-