@InterfaceAudience.LimitedPrivate(value={"Coprocesssor","Phoenix"}) @InterfaceStability.Evolving public class SimpleRpcScheduler extends RpcScheduler implements ConfigurationObserver
RpcScheduler.Context
Modifier and Type | Field and Description |
---|---|
private Abortable |
abortable |
private RpcExecutor |
callExecutor |
private int |
highPriorityLevel
What level a high priority call is at.
|
private RpcExecutor |
metaTransitionExecutor
This executor is only for meta transition
|
private int |
port |
private PriorityFunction |
priority |
private RpcExecutor |
priorityExecutor |
private RpcExecutor |
replicationExecutor |
IPC_SERVER_MAX_CALLQUEUE_LENGTH, IPC_SERVER_PRIORITY_MAX_CALLQUEUE_LENGTH
Constructor and Description |
---|
SimpleRpcScheduler(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) |
Modifier and Type | Method and Description |
---|---|
boolean |
dispatch(CallRunner callTask)
Dispatches an RPC request asynchronously.
|
int |
getActiveReadRpcHandlerCount()
Retrieves the number of active write rpc handler when use RWQueueRpcExecutor.
|
int |
getActiveRpcHandlerCount()
Retrieves the number of active handler.
|
int |
getActiveScanRpcHandlerCount()
Retrieves the number of active write rpc handler when use RWQueueRpcExecutor.
|
int |
getActiveWriteRpcHandlerCount()
Retrieves the number of active write rpc handler when use RWQueueRpcExecutor.
|
CallQueueInfo |
getCallQueueInfo()
Get call queue information
|
int |
getGeneralQueueLength()
Retrieves length of the general queue for metrics.
|
int |
getMetaPriorityQueueLength()
Retrieves length of the meta priority queue for metrics.
|
long |
getNumGeneralCallsDropped()
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 |
getNumLifoModeSwitches()
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 |
getPriorityQueueLength()
Retrieves length of the priority queue for metrics.
|
int |
getReadQueueLength()
Retrieves length of the read queue for metrics when use RWQueueRpcExecutor.
|
int |
getReplicationQueueLength()
Retrieves length of the replication queue for metrics.
|
int |
getScanQueueLength()
Retrieves length of the scan queue for metrics when use RWQueueRpcExecutor.
|
int |
getWriteQueueLength()
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.
|
private int port
private final PriorityFunction priority
private final RpcExecutor callExecutor
private final RpcExecutor priorityExecutor
private final RpcExecutor replicationExecutor
private final RpcExecutor metaTransitionExecutor
private final int highPriorityLevel
public SimpleRpcScheduler(org.apache.hadoop.conf.Configuration conf, int handlerCount, int priorityHandlerCount, int replicationHandlerCount, int metaTransitionHandler, PriorityFunction priority, Abortable server, int highPriorityLevel)
conf
- 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.highPriorityLevel
- priority
- Function to extract request priority.public SimpleRpcScheduler(org.apache.hadoop.conf.Configuration conf, int handlerCount, int priorityHandlerCount, int replicationHandlerCount, PriorityFunction priority, int highPriorityLevel)
public void onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
onConfigurationChange
in interface ConfigurationObserver
conf
- new configurationpublic void init(RpcScheduler.Context context)
RpcScheduler
RpcScheduler.start()
. This method is called before start
.init
in class RpcScheduler
context
- provides methods to retrieve runtime information frompublic void start()
RpcScheduler
start
in class RpcScheduler
public void stop()
RpcScheduler
stop
in class RpcScheduler
public boolean dispatch(CallRunner callTask) throws InterruptedException
RpcScheduler
dispatch
in class RpcScheduler
callTask
- the request to be dispatchedInterruptedException
public int getMetaPriorityQueueLength()
RpcScheduler
getMetaPriorityQueueLength
in class RpcScheduler
public int getGeneralQueueLength()
RpcScheduler
getGeneralQueueLength
in class RpcScheduler
public int getPriorityQueueLength()
RpcScheduler
getPriorityQueueLength
in class RpcScheduler
public int getReplicationQueueLength()
RpcScheduler
getReplicationQueueLength
in class RpcScheduler
public int getActiveRpcHandlerCount()
RpcScheduler
getActiveRpcHandlerCount
in class RpcScheduler
public long getNumGeneralCallsDropped()
RpcScheduler
getNumGeneralCallsDropped
in class RpcScheduler
public long getNumLifoModeSwitches()
RpcScheduler
getNumLifoModeSwitches
in class RpcScheduler
public int getWriteQueueLength()
RpcScheduler
getWriteQueueLength
in class RpcScheduler
public int getReadQueueLength()
RpcScheduler
getReadQueueLength
in class RpcScheduler
public int getScanQueueLength()
RpcScheduler
getScanQueueLength
in class RpcScheduler
public int getActiveWriteRpcHandlerCount()
RpcScheduler
getActiveWriteRpcHandlerCount
in class RpcScheduler
public int getActiveReadRpcHandlerCount()
RpcScheduler
getActiveReadRpcHandlerCount
in class RpcScheduler
public int getActiveScanRpcHandlerCount()
RpcScheduler
getActiveScanRpcHandlerCount
in class RpcScheduler
public CallQueueInfo getCallQueueInfo()
RpcScheduler
getCallQueueInfo
in class RpcScheduler
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.