Package org.apache.hadoop.hbase.ipc
Class SimpleRpcScheduler
java.lang.Object
org.apache.hadoop.hbase.ipc.RpcScheduler
org.apache.hadoop.hbase.ipc.SimpleRpcScheduler
- All Implemented Interfaces:
ConfigurationObserver
@LimitedPrivate({"Coprocesssor","Phoenix"})
@Evolving
public class SimpleRpcScheduler
extends RpcScheduler
implements ConfigurationObserver
The default scheduler. Configurable. Maintains isolated handler pools for general ('default'),
high-priority ('priority'), and replication ('replication') requests. Default behavior is to
balance the requests across handlers. Add configs to enable balancing by read vs writes, etc. See
below article for explanation of options.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.ipc.RpcScheduler
RpcScheduler.Context -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Abortableprivate final RpcExecutorprivate final RpcExecutorprivate final intWhat level a high priority call is at.private final RpcExecutorThis executor is only for meta transitionprivate intprivate final PriorityFunctionprivate final RpcExecutorprivate final RpcExecutorFields inherited from class org.apache.hadoop.hbase.ipc.RpcScheduler
IPC_SERVER_BULKLOAD_MAX_CALLQUEUE_LENGTH, IPC_SERVER_MAX_CALLQUEUE_LENGTH, IPC_SERVER_PRIORITY_MAX_CALLQUEUE_LENGTH, IPC_SERVER_REPLICATION_MAX_CALLQUEUE_LENGTH -
Constructor Summary
ConstructorsConstructorDescriptionSimpleRpcScheduler(org.apache.hadoop.conf.Configuration conf, int handlerCount, int priorityHandlerCount, int replicationHandlerCount, int metaTransitionHandler, PriorityFunction priority, Abortable server, int highPriorityLevel) SimpleRpcScheduler(org.apache.hadoop.conf.Configuration conf, int handlerCount, int priorityHandlerCount, int replicationHandlerCount, PriorityFunction priority, int highPriorityLevel) -
Method Summary
Modifier and TypeMethodDescriptionbooleandispatch(CallRunner callTask) Dispatches an RPC request asynchronously.intRetrieves the number of active bulkload handler.intRetrieves the number of active general handler.intRetrieves the number of active meta priority handler.intRetrieves the number of active priority handler.intRetrieves the number of active write rpc handler when use RWQueueRpcExecutor.intRetrieves the number of active replication handler.intRetrieves the total number of active handler.intRetrieves the number of active write rpc handler when use RWQueueRpcExecutor.intRetrieves the number of active write rpc handler when use RWQueueRpcExecutor.intRetrieves length of the bulkload queue for metrics.Get call queue informationintRetrieves length of the general queue for metrics.intRetrieves length of the meta priority queue for metrics.longIf CoDel-based RPC executors are used, retrieves the number of Calls that were dropped from general queue because RPC executor is under high load; returns 0 otherwise.longIf CoDel-based RPC executors are used, retrieves the number of Calls that were picked from the tail of the queue (indicating adaptive LIFO mode, when in the period of overloade we serve last requests first); returns 0 otherwise.intRetrieves length of the priority queue for metrics.intRetrieves length of the read queue for metrics when use RWQueueRpcExecutor.intRetrieves length of the replication queue for metrics.intRetrieves length of the scan queue for metrics when use RWQueueRpcExecutor.intRetrieves length of the write queue for metrics when use RWQueueRpcExecutor.voidinit(RpcScheduler.Context context) Does some quick initialization.voidonConfigurationChange(org.apache.hadoop.conf.Configuration conf) Resize call queues;voidstart()Prepares for request serving.voidstop()Stops serving new requests.
-
Field Details
-
port
-
priority
-
callExecutor
-
priorityExecutor
-
replicationExecutor
-
metaTransitionExecutor
This executor is only for meta transition -
bulkloadExecutor
-
highPriorityLevel
What level a high priority call is at. -
abortable
-
-
Constructor Details
-
SimpleRpcScheduler
public SimpleRpcScheduler(org.apache.hadoop.conf.Configuration conf, int handlerCount, int priorityHandlerCount, int replicationHandlerCount, int metaTransitionHandler, PriorityFunction priority, Abortable server, int highPriorityLevel) - Parameters:
handlerCount- the number of handler threads that will be used to process callspriorityHandlerCount- How many threads for priority handling.replicationHandlerCount- How many threads for replication handling.priority- Function to extract request priority.
-
SimpleRpcScheduler
public SimpleRpcScheduler(org.apache.hadoop.conf.Configuration conf, int handlerCount, int priorityHandlerCount, int replicationHandlerCount, PriorityFunction priority, int highPriorityLevel)
-
-
Method Details
-
onConfigurationChange
Resize call queues;- Specified by:
onConfigurationChangein interfaceConfigurationObserver- Parameters:
conf- new configuration
-
init
Description copied from class:RpcSchedulerDoes some quick initialization. Heavy tasks (e.g. starting threads) should be done inRpcScheduler.start(). This method is called beforestart.- Specified by:
initin classRpcScheduler- Parameters:
context- provides methods to retrieve runtime information from
-
start
Description copied from class:RpcSchedulerPrepares for request serving. An implementation may start some handler threads here.- Specified by:
startin classRpcScheduler
-
stop
Description copied from class:RpcSchedulerStops serving new requests.- Specified by:
stopin classRpcScheduler
-
dispatch
Description copied from class:RpcSchedulerDispatches an RPC request asynchronously. An implementation is free to choose to process the request immediately or delay it for later processing.- Specified by:
dispatchin classRpcScheduler- Parameters:
callTask- the request to be dispatched
-
getMetaPriorityQueueLength
Description copied from class:RpcSchedulerRetrieves length of the meta priority queue for metrics.- Specified by:
getMetaPriorityQueueLengthin classRpcScheduler
-
getGeneralQueueLength
Description copied from class:RpcSchedulerRetrieves length of the general queue for metrics.- Specified by:
getGeneralQueueLengthin classRpcScheduler
-
getPriorityQueueLength
Description copied from class:RpcSchedulerRetrieves length of the priority queue for metrics.- Specified by:
getPriorityQueueLengthin classRpcScheduler
-
getReplicationQueueLength
Description copied from class:RpcSchedulerRetrieves length of the replication queue for metrics.- Specified by:
getReplicationQueueLengthin classRpcScheduler
-
getBulkLoadQueueLength
Description copied from class:RpcSchedulerRetrieves length of the bulkload queue for metrics.- Specified by:
getBulkLoadQueueLengthin classRpcScheduler
-
getActiveRpcHandlerCount
Description copied from class:RpcSchedulerRetrieves the total number of active handler.- Specified by:
getActiveRpcHandlerCountin classRpcScheduler
-
getActiveMetaPriorityRpcHandlerCount
Description copied from class:RpcSchedulerRetrieves the number of active meta priority handler.- Specified by:
getActiveMetaPriorityRpcHandlerCountin classRpcScheduler
-
getActiveGeneralRpcHandlerCount
Description copied from class:RpcSchedulerRetrieves the number of active general handler.- Specified by:
getActiveGeneralRpcHandlerCountin classRpcScheduler
-
getActivePriorityRpcHandlerCount
Description copied from class:RpcSchedulerRetrieves the number of active priority handler.- Specified by:
getActivePriorityRpcHandlerCountin classRpcScheduler
-
getActiveReplicationRpcHandlerCount
Description copied from class:RpcSchedulerRetrieves the number of active replication handler.- Specified by:
getActiveReplicationRpcHandlerCountin classRpcScheduler
-
getActiveBulkLoadRpcHandlerCount
Description copied from class:RpcSchedulerRetrieves the number of active bulkload handler.- Specified by:
getActiveBulkLoadRpcHandlerCountin classRpcScheduler
-
getNumGeneralCallsDropped
Description copied from class:RpcSchedulerIf CoDel-based RPC executors are used, retrieves the number of Calls that were dropped from general queue because RPC executor is under high load; returns 0 otherwise.- Specified by:
getNumGeneralCallsDroppedin classRpcScheduler
-
getNumLifoModeSwitches
Description copied from class:RpcSchedulerIf CoDel-based RPC executors are used, retrieves the number of Calls that were picked from the tail of the queue (indicating adaptive LIFO mode, when in the period of overloade we serve last requests first); returns 0 otherwise.- Specified by:
getNumLifoModeSwitchesin classRpcScheduler
-
getWriteQueueLength
Description copied from class:RpcSchedulerRetrieves length of the write queue for metrics when use RWQueueRpcExecutor.- Specified by:
getWriteQueueLengthin classRpcScheduler
-
getReadQueueLength
Description copied from class:RpcSchedulerRetrieves length of the read queue for metrics when use RWQueueRpcExecutor.- Specified by:
getReadQueueLengthin classRpcScheduler
-
getScanQueueLength
Description copied from class:RpcSchedulerRetrieves length of the scan queue for metrics when use RWQueueRpcExecutor.- Specified by:
getScanQueueLengthin classRpcScheduler
-
getActiveWriteRpcHandlerCount
Description copied from class:RpcSchedulerRetrieves the number of active write rpc handler when use RWQueueRpcExecutor.- Specified by:
getActiveWriteRpcHandlerCountin classRpcScheduler
-
getActiveReadRpcHandlerCount
Description copied from class:RpcSchedulerRetrieves the number of active write rpc handler when use RWQueueRpcExecutor.- Specified by:
getActiveReadRpcHandlerCountin classRpcScheduler
-
getActiveScanRpcHandlerCount
Description copied from class:RpcSchedulerRetrieves the number of active write rpc handler when use RWQueueRpcExecutor.- Specified by:
getActiveScanRpcHandlerCountin classRpcScheduler
-
getCallQueueInfo
Description copied from class:RpcSchedulerGet call queue information- Specified by:
getCallQueueInfoin classRpcScheduler
-