@InterfaceAudience.Private public class FifoRpcScheduler extends RpcScheduler
| Modifier and Type | Class and Description |
|---|---|
private static class |
FifoRpcScheduler.FifoCallRunner |
RpcScheduler.Context| Modifier and Type | Field and Description |
|---|---|
protected ThreadPoolExecutor |
executor |
protected int |
handlerCount |
private static org.slf4j.Logger |
LOG |
protected int |
maxQueueLength |
protected AtomicInteger |
queueSize |
IPC_SERVER_MAX_CALLQUEUE_LENGTH, IPC_SERVER_PRIORITY_MAX_CALLQUEUE_LENGTH| Constructor and Description |
|---|
FifoRpcScheduler(org.apache.hadoop.conf.Configuration conf,
int handlerCount) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
dispatch(CallRunner task)
Dispatches an RPC request asynchronously.
|
protected boolean |
executeRpcCall(ThreadPoolExecutor executor,
AtomicInteger queueSize,
CallRunner task) |
int |
getActiveGeneralRpcHandlerCount()
Retrieves the number of active general handler.
|
int |
getActiveMetaPriorityRpcHandlerCount()
Retrieves the number of active meta priority handler.
|
int |
getActivePriorityRpcHandlerCount()
Retrieves the number of active priority handler.
|
int |
getActiveReadRpcHandlerCount()
Retrieves the number of active write rpc handler when use RWQueueRpcExecutor.
|
int |
getActiveReplicationRpcHandlerCount()
Retrieves the number of active replication handler.
|
int |
getActiveRpcHandlerCount()
Retrieves the total number of active handler.
|
int |
getActiveScanRpcHandlerCount()
Retrieves the number of active write rpc handler when use RWQueueRpcExecutor.
|
int |
getActiveWriteRpcHandlerCount()
Retrieves the number of active write rpc handler when use RWQueueRpcExecutor.
|
protected String |
getCallMethod(CallRunner task) |
CallQueueInfo |
getCallQueueInfo()
Get call queue information
|
int |
getGeneralQueueLength()
Retrieves length of the general queue for metrics.
|
int |
getMetaPriorityQueueLength()
Retrieves length of the meta priority 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 |
getReadQueueLength()
Retrieves length of the read queue for metrics when use RWQueueRpcExecutor.
|
int |
getReplicationQueueLength()
Retrieves length of the replication queue for metrics.
|
int |
getScanQueueLength()
Retrieves length of the scan queue for metrics when use RWQueueRpcExecutor.
|
int |
getWriteQueueLength()
Retrieves length of the write queue for metrics when use RWQueueRpcExecutor.
|
void |
init(RpcScheduler.Context context)
Does some quick initialization.
|
void |
start()
Prepares for request serving.
|
void |
stop()
Stops serving new requests.
|
protected void |
updateMethodCountAndSizeByQueue(BlockingQueue<Runnable> queue,
HashMap<String,Long> methodCount,
HashMap<String,Long> methodSize) |
private static final org.slf4j.Logger LOG
protected final int handlerCount
protected final int maxQueueLength
protected final AtomicInteger queueSize
protected ThreadPoolExecutor executor
public FifoRpcScheduler(org.apache.hadoop.conf.Configuration conf, int handlerCount)
public 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 task) throws IOException, InterruptedException
RpcSchedulerdispatch in class RpcSchedulertask - the request to be dispatchedIOExceptionInterruptedExceptionprotected boolean executeRpcCall(ThreadPoolExecutor executor, AtomicInteger queueSize, CallRunner task)
public int getGeneralQueueLength()
RpcSchedulergetGeneralQueueLength in class RpcSchedulerpublic int getPriorityQueueLength()
RpcSchedulergetPriorityQueueLength in class RpcSchedulerpublic int getReplicationQueueLength()
RpcSchedulergetReplicationQueueLength in class RpcSchedulerpublic int getActiveRpcHandlerCount()
RpcSchedulergetActiveRpcHandlerCount in class RpcSchedulerpublic int getActiveGeneralRpcHandlerCount()
RpcSchedulergetActiveGeneralRpcHandlerCount in class RpcSchedulerpublic int getActivePriorityRpcHandlerCount()
RpcSchedulergetActivePriorityRpcHandlerCount in class RpcSchedulerpublic int getActiveReplicationRpcHandlerCount()
RpcSchedulergetActiveReplicationRpcHandlerCount in class RpcSchedulerpublic int getActiveMetaPriorityRpcHandlerCount()
RpcSchedulergetActiveMetaPriorityRpcHandlerCount in class RpcSchedulerpublic long getNumGeneralCallsDropped()
RpcSchedulergetNumGeneralCallsDropped in class RpcSchedulerpublic long getNumLifoModeSwitches()
RpcSchedulergetNumLifoModeSwitches in class RpcSchedulerpublic int getWriteQueueLength()
RpcSchedulergetWriteQueueLength in class RpcSchedulerpublic int getReadQueueLength()
RpcSchedulergetReadQueueLength in class RpcSchedulerpublic int getScanQueueLength()
RpcSchedulergetScanQueueLength in class RpcSchedulerpublic int getActiveWriteRpcHandlerCount()
RpcSchedulergetActiveWriteRpcHandlerCount in class RpcSchedulerpublic int getActiveReadRpcHandlerCount()
RpcSchedulergetActiveReadRpcHandlerCount in class RpcSchedulerpublic int getActiveScanRpcHandlerCount()
RpcSchedulergetActiveScanRpcHandlerCount in class RpcSchedulerpublic int getMetaPriorityQueueLength()
RpcSchedulergetMetaPriorityQueueLength in class RpcSchedulerpublic CallQueueInfo getCallQueueInfo()
RpcSchedulergetCallQueueInfo in class RpcSchedulerprotected void updateMethodCountAndSizeByQueue(BlockingQueue<Runnable> queue, HashMap<String,Long> methodCount, HashMap<String,Long> methodSize)
protected String getCallMethod(CallRunner task)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.