@InterfaceAudience.LimitedPrivate(value={"Coprocesssor","Phoenix"}) @InterfaceStability.Evolving public class SimpleRpcScheduler extends RpcScheduler
Modifier and Type | Class and Description |
---|---|
private static class |
SimpleRpcScheduler.CallPriorityComparator
Comparator used by the "normal callQueue" if DEADLINE_CALL_QUEUE_CONF_KEY is set to true.
|
RpcScheduler.Context
Modifier and Type | Field and Description |
---|---|
private Abortable |
abortable |
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_CONF_KEY
If set to 'deadline', uses a priority queue and deprioritize long-running scans
|
static String |
CALL_QUEUE_TYPE_DEADLINE_CONF_VALUE |
static String |
CALL_QUEUE_TYPE_FIFO_CONF_VALUE |
private RpcExecutor |
callExecutor |
private int |
highPriorityLevel
What level a high priority call is at.
|
private static org.apache.commons.logging.Log |
LOG |
private int |
port |
private PriorityFunction |
priority |
private RpcExecutor |
priorityExecutor |
static String |
QUEUE_MAX_CALL_DELAY_CONF_KEY
max delay in msec used to bound the deprioritized requests
|
private RpcExecutor |
replicationExecutor |
Constructor and Description |
---|
SimpleRpcScheduler(org.apache.hadoop.conf.Configuration conf,
int handlerCount,
int priorityHandlerCount,
int replicationHandlerCount,
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 |
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.
|
private static final org.apache.commons.logging.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_DEADLINE_CONF_VALUE
public static final String CALL_QUEUE_TYPE_FIFO_CONF_VALUE
public static final String QUEUE_MAX_CALL_DELAY_CONF_KEY
private int port
private final PriorityFunction priority
private final RpcExecutor callExecutor
private final RpcExecutor priorityExecutor
private final RpcExecutor replicationExecutor
private final int highPriorityLevel
private Abortable abortable
public SimpleRpcScheduler(org.apache.hadoop.conf.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(org.apache.hadoop.conf.Configuration conf, int handlerCount, int priorityHandlerCount, int replicationHandlerCount, PriorityFunction priority, int highPriorityLevel)
public 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 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
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.