@InterfaceAudience.LimitedPrivate(value={"Coprocesssor","Phoenix"}) @InterfaceStability.Evolving public class SimpleRpcScheduler extends RpcScheduler implements ConfigurationObserver
RpcScheduler.Context| Modifier and Type | Field and Description | 
|---|---|
static int | 
CALL_QUEUE_CODEL_DEFAULT_INTERVAL  | 
static double | 
CALL_QUEUE_CODEL_DEFAULT_LIFO_THRESHOLD  | 
static int | 
CALL_QUEUE_CODEL_DEFAULT_TARGET_DELAY  | 
static String | 
CALL_QUEUE_CODEL_INTERVAL  | 
static String | 
CALL_QUEUE_CODEL_LIFO_THRESHOLD  | 
static String | 
CALL_QUEUE_CODEL_TARGET_DELAY  | 
static String | 
CALL_QUEUE_HANDLER_FACTOR_CONF_KEY  | 
static String | 
CALL_QUEUE_READ_SHARE_CONF_KEY  | 
static String | 
CALL_QUEUE_SCAN_SHARE_CONF_KEY  | 
static String | 
CALL_QUEUE_TYPE_CODEL_CONF_VALUE  | 
static String | 
CALL_QUEUE_TYPE_CONF_DEFAULT  | 
static String | 
CALL_QUEUE_TYPE_CONF_KEY
The default, 'fifo', has the least friction but is dumb. 
 | 
static String | 
CALL_QUEUE_TYPE_DEADLINE_CONF_VALUE  | 
static String | 
CALL_QUEUE_TYPE_FIFO_CONF_VALUE  | 
static Log | 
LOG  | 
static String | 
QUEUE_MAX_CALL_DELAY_CONF_KEY
max delay in msec used to bound the deprioritized requests 
 | 
IPC_SERVER_MAX_CALLQUEUE_LENGTH, IPC_SERVER_PRIORITY_MAX_CALLQUEUE_LENGTH| Constructor and Description | 
|---|
SimpleRpcScheduler(Configuration conf,
                  int handlerCount,
                  int priorityHandlerCount,
                  int replicationHandlerCount,
                  PriorityFunction priority,
                  Abortable server,
                  int highPriorityLevel)  | 
SimpleRpcScheduler(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 | 
getActiveRpcHandlerCount()
Retrieves the number of active handler. 
 | 
int | 
getGeneralQueueLength()
Retrieves length of the general 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 | 
getReplicationQueueLength()
Retrieves length of the replication queue for metrics. 
 | 
void | 
init(RpcScheduler.Context context)
Does some quick initialization. 
 | 
void | 
onConfigurationChange(Configuration conf)
Resize call queues; 
 | 
void | 
start()
Prepares for request serving. 
 | 
void | 
stop()
Stops serving new requests. 
 | 
public static final Log LOG
public static final String CALL_QUEUE_READ_SHARE_CONF_KEY
public static final String CALL_QUEUE_SCAN_SHARE_CONF_KEY
public static final String CALL_QUEUE_HANDLER_FACTOR_CONF_KEY
public static final String CALL_QUEUE_TYPE_CONF_KEY
public static final String CALL_QUEUE_TYPE_CODEL_CONF_VALUE
public static final String CALL_QUEUE_TYPE_DEADLINE_CONF_VALUE
public static final String CALL_QUEUE_TYPE_FIFO_CONF_VALUE
public static final String CALL_QUEUE_TYPE_CONF_DEFAULT
public static final String QUEUE_MAX_CALL_DELAY_CONF_KEY
public static final String CALL_QUEUE_CODEL_TARGET_DELAY
public static final String CALL_QUEUE_CODEL_INTERVAL
public static final String CALL_QUEUE_CODEL_LIFO_THRESHOLD
public static final int CALL_QUEUE_CODEL_DEFAULT_TARGET_DELAY
public static final int CALL_QUEUE_CODEL_DEFAULT_INTERVAL
public static final double CALL_QUEUE_CODEL_DEFAULT_LIFO_THRESHOLD
public SimpleRpcScheduler(Configuration conf,
                          int handlerCount,
                          int priorityHandlerCount,
                          int replicationHandlerCount,
                          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(Configuration conf,
                          int handlerCount,
                          int priorityHandlerCount,
                          int replicationHandlerCount,
                          PriorityFunction priority,
                          int highPriorityLevel)
public void onConfigurationChange(Configuration conf)
onConfigurationChange in interface ConfigurationObserverconf - new configurationpublic void init(RpcScheduler.Context context)
RpcSchedulerRpcScheduler.start(). This method is called before start.init in class RpcSchedulercontext - provides methods to retrieve runtime information frompublic void start()
RpcSchedulerstart in class RpcSchedulerpublic void stop()
RpcSchedulerstop in class RpcSchedulerpublic boolean dispatch(CallRunner callTask) throws InterruptedException
RpcSchedulerdispatch in class RpcSchedulercallTask - the request to be dispatchedInterruptedExceptionpublic int getGeneralQueueLength()
RpcSchedulergetGeneralQueueLength in class RpcSchedulerpublic int getPriorityQueueLength()
RpcSchedulergetPriorityQueueLength in class RpcSchedulerpublic int getReplicationQueueLength()
RpcSchedulergetReplicationQueueLength in class RpcSchedulerpublic int getActiveRpcHandlerCount()
RpcSchedulergetActiveRpcHandlerCount in class RpcSchedulerpublic long getNumGeneralCallsDropped()
RpcSchedulergetNumGeneralCallsDropped in class RpcSchedulerpublic long getNumLifoModeSwitches()
RpcSchedulergetNumLifoModeSwitches in class RpcScheduler