@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 |
getActiveRpcHandlerCount()
Retrieves the number of active handler.
|
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)
RpcScheduler
RpcScheduler.start()
. This method is called before start
.init
in interface RpcScheduler
context
- provides methods to retrieve runtime information frompublic void start()
RpcScheduler
start
in interface RpcScheduler
public void stop()
RpcScheduler
stop
in interface RpcScheduler
public void dispatch(CallRunner callTask) throws InterruptedException
RpcScheduler
dispatch
in interface RpcScheduler
callTask
- the request to be dispatchedInterruptedException
public int getGeneralQueueLength()
RpcScheduler
getGeneralQueueLength
in interface RpcScheduler
public int getPriorityQueueLength()
RpcScheduler
getPriorityQueueLength
in interface RpcScheduler
public int getReplicationQueueLength()
RpcScheduler
getReplicationQueueLength
in interface RpcScheduler
public int getActiveRpcHandlerCount()
RpcScheduler
getActiveRpcHandlerCount
in interface RpcScheduler
Copyright © 2014 The Apache Software Foundation. All rights reserved.