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
Modifier and TypeFieldDescriptionprivate Abortable
private final RpcExecutor
private final RpcExecutor
private final int
What level a high priority call is at.private final RpcExecutor
This executor is only for meta transitionprivate int
private final PriorityFunction
private final RpcExecutor
private final RpcExecutor
Fields 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
ConstructorDescriptionSimpleRpcScheduler
(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 TypeMethodDescriptionboolean
dispatch
(CallRunner callTask) Dispatches an RPC request asynchronously.int
Retrieves the number of active bulkload handler.int
Retrieves the number of active general handler.int
Retrieves the number of active meta priority handler.int
Retrieves the number of active priority handler.int
Retrieves the number of active write rpc handler when use RWQueueRpcExecutor.int
Retrieves the number of active replication handler.int
Retrieves the total number of active handler.int
Retrieves the number of active write rpc handler when use RWQueueRpcExecutor.int
Retrieves the number of active write rpc handler when use RWQueueRpcExecutor.int
Retrieves length of the bulkload queue for metrics.Get call queue informationint
Retrieves length of the general queue for metrics.int
Retrieves length of the meta priority queue for metrics.long
If 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.long
If 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.int
Retrieves length of the priority queue for metrics.int
Retrieves length of the read queue for metrics when use RWQueueRpcExecutor.int
Retrieves length of the replication queue for metrics.int
Retrieves length of the scan queue for metrics when use RWQueueRpcExecutor.int
Retrieves length of the write queue for metrics when use RWQueueRpcExecutor.void
init
(RpcScheduler.Context context) Does some quick initialization.void
onConfigurationChange
(org.apache.hadoop.conf.Configuration conf) Resize call queues;void
start()
Prepares for request serving.void
stop()
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:
onConfigurationChange
in interfaceConfigurationObserver
- Parameters:
conf
- new configuration
-
init
Description copied from class:RpcScheduler
Does some quick initialization. Heavy tasks (e.g. starting threads) should be done inRpcScheduler.start()
. This method is called beforestart
.- Specified by:
init
in classRpcScheduler
- Parameters:
context
- provides methods to retrieve runtime information from
-
start
Description copied from class:RpcScheduler
Prepares for request serving. An implementation may start some handler threads here.- Specified by:
start
in classRpcScheduler
-
stop
Description copied from class:RpcScheduler
Stops serving new requests.- Specified by:
stop
in classRpcScheduler
-
dispatch
Description copied from class:RpcScheduler
Dispatches an RPC request asynchronously. An implementation is free to choose to process the request immediately or delay it for later processing.- Specified by:
dispatch
in classRpcScheduler
- Parameters:
callTask
- the request to be dispatched
-
getMetaPriorityQueueLength
Description copied from class:RpcScheduler
Retrieves length of the meta priority queue for metrics.- Specified by:
getMetaPriorityQueueLength
in classRpcScheduler
-
getGeneralQueueLength
Description copied from class:RpcScheduler
Retrieves length of the general queue for metrics.- Specified by:
getGeneralQueueLength
in classRpcScheduler
-
getPriorityQueueLength
Description copied from class:RpcScheduler
Retrieves length of the priority queue for metrics.- Specified by:
getPriorityQueueLength
in classRpcScheduler
-
getReplicationQueueLength
Description copied from class:RpcScheduler
Retrieves length of the replication queue for metrics.- Specified by:
getReplicationQueueLength
in classRpcScheduler
-
getBulkLoadQueueLength
Description copied from class:RpcScheduler
Retrieves length of the bulkload queue for metrics.- Specified by:
getBulkLoadQueueLength
in classRpcScheduler
-
getActiveRpcHandlerCount
Description copied from class:RpcScheduler
Retrieves the total number of active handler.- Specified by:
getActiveRpcHandlerCount
in classRpcScheduler
-
getActiveMetaPriorityRpcHandlerCount
Description copied from class:RpcScheduler
Retrieves the number of active meta priority handler.- Specified by:
getActiveMetaPriorityRpcHandlerCount
in classRpcScheduler
-
getActiveGeneralRpcHandlerCount
Description copied from class:RpcScheduler
Retrieves the number of active general handler.- Specified by:
getActiveGeneralRpcHandlerCount
in classRpcScheduler
-
getActivePriorityRpcHandlerCount
Description copied from class:RpcScheduler
Retrieves the number of active priority handler.- Specified by:
getActivePriorityRpcHandlerCount
in classRpcScheduler
-
getActiveReplicationRpcHandlerCount
Description copied from class:RpcScheduler
Retrieves the number of active replication handler.- Specified by:
getActiveReplicationRpcHandlerCount
in classRpcScheduler
-
getActiveBulkLoadRpcHandlerCount
Description copied from class:RpcScheduler
Retrieves the number of active bulkload handler.- Specified by:
getActiveBulkLoadRpcHandlerCount
in classRpcScheduler
-
getNumGeneralCallsDropped
Description copied from class:RpcScheduler
If 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:
getNumGeneralCallsDropped
in classRpcScheduler
-
getNumLifoModeSwitches
Description copied from class:RpcScheduler
If 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:
getNumLifoModeSwitches
in classRpcScheduler
-
getWriteQueueLength
Description copied from class:RpcScheduler
Retrieves length of the write queue for metrics when use RWQueueRpcExecutor.- Specified by:
getWriteQueueLength
in classRpcScheduler
-
getReadQueueLength
Description copied from class:RpcScheduler
Retrieves length of the read queue for metrics when use RWQueueRpcExecutor.- Specified by:
getReadQueueLength
in classRpcScheduler
-
getScanQueueLength
Description copied from class:RpcScheduler
Retrieves length of the scan queue for metrics when use RWQueueRpcExecutor.- Specified by:
getScanQueueLength
in classRpcScheduler
-
getActiveWriteRpcHandlerCount
Description copied from class:RpcScheduler
Retrieves the number of active write rpc handler when use RWQueueRpcExecutor.- Specified by:
getActiveWriteRpcHandlerCount
in classRpcScheduler
-
getActiveReadRpcHandlerCount
Description copied from class:RpcScheduler
Retrieves the number of active write rpc handler when use RWQueueRpcExecutor.- Specified by:
getActiveReadRpcHandlerCount
in classRpcScheduler
-
getActiveScanRpcHandlerCount
Description copied from class:RpcScheduler
Retrieves the number of active write rpc handler when use RWQueueRpcExecutor.- Specified by:
getActiveScanRpcHandlerCount
in classRpcScheduler
-
getCallQueueInfo
Description copied from class:RpcScheduler
Get call queue information- Specified by:
getCallQueueInfo
in classRpcScheduler
-