@InterfaceAudience.LimitedPrivate(value={"Coprocesssor","Phoenix"}) @InterfaceStability.Evolving public class BalancedQueueRpcExecutor extends RpcExecutor
RpcExecutor
that will balance requests evenly across all its queues, but still remains
efficient with a single queue via an inlinable queue balancing mechanism.RpcExecutor.QueueBalancer
Modifier and Type | Field and Description |
---|---|
private RpcExecutor.QueueBalancer |
balancer |
protected List<BlockingQueue<CallRunner>> |
queues |
Constructor and Description |
---|
BalancedQueueRpcExecutor(String name,
int handlerCount,
int numQueues,
Class<? extends BlockingQueue> queueClass,
Object... initargs) |
BalancedQueueRpcExecutor(String name,
int handlerCount,
int numQueues,
org.apache.hadoop.conf.Configuration conf,
Abortable abortable,
Class<? extends BlockingQueue> queueClass,
Object... initargs) |
BalancedQueueRpcExecutor(String name,
int handlerCount,
int numQueues,
int maxQueueLength) |
BalancedQueueRpcExecutor(String name,
int handlerCount,
int numQueues,
int maxQueueLength,
org.apache.hadoop.conf.Configuration conf,
Abortable abortable) |
Modifier and Type | Method and Description |
---|---|
boolean |
dispatch(CallRunner callTask)
Add the request to the executor queue
|
int |
getQueueLength()
Returns the length of the pending queue
|
List<BlockingQueue<CallRunner>> |
getQueues()
Returns the list of request queues
|
protected void |
initializeQueues(int numQueues,
Class<? extends BlockingQueue> queueClass,
Object... initargs) |
consumerLoop, getActiveHandlerCount, getBalancer, start, startHandlers, startHandlers, stop
protected final List<BlockingQueue<CallRunner>> queues
private final RpcExecutor.QueueBalancer balancer
public BalancedQueueRpcExecutor(String name, int handlerCount, int numQueues, int maxQueueLength)
public BalancedQueueRpcExecutor(String name, int handlerCount, int numQueues, int maxQueueLength, org.apache.hadoop.conf.Configuration conf, Abortable abortable)
public BalancedQueueRpcExecutor(String name, int handlerCount, int numQueues, Class<? extends BlockingQueue> queueClass, Object... initargs)
public BalancedQueueRpcExecutor(String name, int handlerCount, int numQueues, org.apache.hadoop.conf.Configuration conf, Abortable abortable, Class<? extends BlockingQueue> queueClass, Object... initargs)
protected void initializeQueues(int numQueues, Class<? extends BlockingQueue> queueClass, Object... initargs)
public boolean dispatch(CallRunner callTask) throws InterruptedException
RpcExecutor
dispatch
in class RpcExecutor
InterruptedException
public int getQueueLength()
RpcExecutor
getQueueLength
in class RpcExecutor
public List<BlockingQueue<CallRunner>> getQueues()
RpcExecutor
getQueues
in class RpcExecutor
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.