@InterfaceAudience.Private public abstract class RpcExecutor extends Object
dispatch(CallRunner)
. Subclass and add particular
scheduling behavior.Modifier and Type | Class and Description |
---|---|
protected class |
RpcExecutor.Handler
Handler thread run the
CallRunner.run() in. |
static class |
RpcExecutor.QueueBalancer |
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_TYPE_CODEL_CONF_VALUE
The default, 'fifo', has the least friction but is dumb.
|
static String |
CALL_QUEUE_TYPE_CONF_DEFAULT |
static String |
CALL_QUEUE_TYPE_CONF_KEY |
static String |
CALL_QUEUE_TYPE_DEADLINE_CONF_VALUE |
static String |
CALL_QUEUE_TYPE_FIFO_CONF_VALUE |
protected int |
currentQueueLimit |
protected static int |
DEFAULT_CALL_QUEUE_SIZE_HARD_LIMIT |
protected int |
numCallQueues |
static String |
QUEUE_MAX_CALL_DELAY_CONF_KEY
max delay in msec used to bound the deprioritized requests
|
protected List<BlockingQueue<CallRunner>> |
queues |
Constructor and Description |
---|
RpcExecutor(String name,
int handlerCount,
int maxQueueLength,
PriorityFunction priority,
org.apache.hadoop.conf.Configuration conf,
Abortable abortable) |
RpcExecutor(String name,
int handlerCount,
String callQueueType,
int maxQueueLength,
PriorityFunction priority,
org.apache.hadoop.conf.Configuration conf,
Abortable abortable) |
Modifier and Type | Method and Description |
---|---|
protected int |
computeNumCallQueues(int handlerCount,
float callQueuesHandlersFactor) |
abstract boolean |
dispatch(CallRunner callTask)
Add the request to the executor queue
|
int |
getActiveHandlerCount() |
int |
getActiveReadHandlerCount() |
int |
getActiveScanHandlerCount() |
int |
getActiveWriteHandlerCount() |
static RpcExecutor.QueueBalancer |
getBalancer(int queueSize) |
Map<String,Long> |
getCallQueueCountsSummary() |
Map<String,Long> |
getCallQueueSizeSummary() |
protected RpcExecutor.Handler |
getHandler(String name,
double handlerFailureThreshhold,
BlockingQueue<CallRunner> q,
AtomicInteger activeHandlerCount)
Override if providing alternate Handler implementation.
|
String |
getName() |
long |
getNumGeneralCallsDropped() |
long |
getNumLifoModeSwitches() |
int |
getQueueLength()
Returns the length of the pending queue
|
protected List<BlockingQueue<CallRunner>> |
getQueues()
Returns the list of request queues
|
int |
getReadQueueLength() |
int |
getScanQueueLength() |
int |
getWriteQueueLength() |
protected void |
initializeQueues(int numQueues) |
static boolean |
isCodelQueueType(String callQueueType) |
static boolean |
isDeadlineQueueType(String callQueueType) |
static boolean |
isFifoQueueType(String callQueueType) |
void |
onConfigurationChange(org.apache.hadoop.conf.Configuration conf) |
void |
resizeQueues(org.apache.hadoop.conf.Configuration conf)
Update current soft limit for executor's call queues
|
void |
start(int port) |
protected void |
startHandlers(int port) |
protected void |
startHandlers(String nameSuffix,
int numHandlers,
List<BlockingQueue<CallRunner>> callQueues,
int qindex,
int qsize,
int port,
AtomicInteger activeHandlerCount)
Start up our handlers.
|
void |
stop() |
protected static final int DEFAULT_CALL_QUEUE_SIZE_HARD_LIMIT
public static final String CALL_QUEUE_HANDLER_FACTOR_CONF_KEY
public static final String QUEUE_MAX_CALL_DELAY_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_KEY
public static final String CALL_QUEUE_TYPE_CONF_DEFAULT
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
protected final int numCallQueues
protected final List<BlockingQueue<CallRunner>> queues
protected volatile int currentQueueLimit
public RpcExecutor(String name, int handlerCount, int maxQueueLength, PriorityFunction priority, org.apache.hadoop.conf.Configuration conf, Abortable abortable)
public RpcExecutor(String name, int handlerCount, String callQueueType, int maxQueueLength, PriorityFunction priority, org.apache.hadoop.conf.Configuration conf, Abortable abortable)
protected int computeNumCallQueues(int handlerCount, float callQueuesHandlersFactor)
protected void initializeQueues(int numQueues)
public void start(int port)
public void stop()
public abstract boolean dispatch(CallRunner callTask) throws InterruptedException
InterruptedException
protected List<BlockingQueue<CallRunner>> getQueues()
protected void startHandlers(int port)
protected RpcExecutor.Handler getHandler(String name, double handlerFailureThreshhold, BlockingQueue<CallRunner> q, AtomicInteger activeHandlerCount)
protected void startHandlers(String nameSuffix, int numHandlers, List<BlockingQueue<CallRunner>> callQueues, int qindex, int qsize, int port, AtomicInteger activeHandlerCount)
public static RpcExecutor.QueueBalancer getBalancer(int queueSize)
public static boolean isDeadlineQueueType(String callQueueType)
public static boolean isCodelQueueType(String callQueueType)
public static boolean isFifoQueueType(String callQueueType)
public long getNumGeneralCallsDropped()
public long getNumLifoModeSwitches()
public int getActiveHandlerCount()
public int getActiveWriteHandlerCount()
public int getActiveReadHandlerCount()
public int getActiveScanHandlerCount()
public int getQueueLength()
public int getReadQueueLength()
public int getScanQueueLength()
public int getWriteQueueLength()
public String getName()
public void resizeQueues(org.apache.hadoop.conf.Configuration conf)
conf
- updated configurationpublic void onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
Copyright © 2007–2019 Cloudera. All rights reserved.