@InterfaceAudience.Private @InterfaceStability.Evolving public class SimpleRpcScheduler extends Object implements RpcScheduler
RpcScheduler.Context| Constructor and Description |
|---|
SimpleRpcScheduler(org.apache.hadoop.conf.Configuration conf,
int handlerCount,
int priorityHandlerCount,
int replicationHandlerCount,
PriorityFunction priority,
int highPriorityLevel) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispatch(CallRunner callTask)
Dispatches an RPC request asynchronously.
|
int |
getGeneralQueueLength()
Retrieves length of the general queue for metrics.
|
int |
getPriorityQueueLength()
Retrieves length of the priority queue for metrics.
|
int |
getReplicationQueueLength()
Retrieves length of the replication queue for metrics.
|
void |
init(RpcScheduler.Context context)
Does some quick initialization.
|
void |
start()
Prepares for request serving.
|
void |
stop()
Stops serving new requests.
|
public SimpleRpcScheduler(org.apache.hadoop.conf.Configuration conf,
int handlerCount,
int priorityHandlerCount,
int replicationHandlerCount,
PriorityFunction priority,
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 void init(RpcScheduler.Context context)
RpcSchedulerRpcScheduler.start(). This method is called before start.init in interface RpcSchedulercontext - provides methods to retrieve runtime information frompublic void start()
RpcSchedulerstart in interface RpcSchedulerpublic void stop()
RpcSchedulerstop in interface RpcSchedulerpublic void dispatch(CallRunner callTask) throws InterruptedException
RpcSchedulerdispatch in interface RpcSchedulercallTask - the request to be dispatchedInterruptedExceptionpublic int getGeneralQueueLength()
RpcSchedulergetGeneralQueueLength in interface RpcSchedulerpublic int getPriorityQueueLength()
RpcSchedulergetPriorityQueueLength in interface RpcSchedulerpublic int getReplicationQueueLength()
RpcSchedulergetReplicationQueueLength in interface RpcSchedulerCopyright © 2014 The Apache Software Foundation. All Rights Reserved.