java.lang.Iterable<E>, java.util.Collection<E>, java.util.concurrent.BlockingQueue<E>, java.util.Queue<E>public class CallQueueManager<E extends Schedulable>
extends java.util.AbstractQueue<E>
implements java.util.concurrent.BlockingQueue<E>
| Modifier and Type | Field | Description |
|---|---|---|
static org.slf4j.Logger |
LOG |
| Constructor | Description |
|---|---|
CallQueueManager(java.lang.Class<? extends java.util.concurrent.BlockingQueue<E>> backingClass,
java.lang.Class<? extends RpcScheduler> schedulerClass,
boolean clientBackOffEnabled,
int maxQueueSize,
java.lang.String namespace,
Configuration conf) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
add(E e) |
|
int |
drainTo(java.util.Collection<? super E> c) |
|
int |
drainTo(java.util.Collection<? super E> c,
int maxElements) |
|
static int[] |
getDefaultQueueCapacityWeights(int priorityLevels) |
By default, queue capacity is the same for all priority levels.
|
boolean |
isServerFailOverEnabled() |
|
boolean |
isServerFailOverEnabledByQueue() |
|
java.util.Iterator<E> |
iterator() |
|
boolean |
offer(E e) |
Insert e into the backing queue.
|
boolean |
offer(E e,
long timeout,
java.util.concurrent.TimeUnit unit) |
|
E |
peek() |
|
E |
poll() |
|
E |
poll(long timeout,
java.util.concurrent.TimeUnit unit) |
|
void |
put(E e) |
Insert e into the backing queue or block until we can.
|
int |
remainingCapacity() |
|
int |
size() |
|
void |
swapQueue(java.lang.Class<? extends RpcScheduler> schedulerClass,
java.lang.Class<? extends java.util.concurrent.BlockingQueue<E>> queueClassToUse,
int maxSize,
java.lang.String ns,
Configuration conf) |
Replaces active queue with the newly requested one and transfers
all calls to the newQ before returning.
|
E |
take() |
Retrieve an E from the backing queue or block until we can.
|
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic CallQueueManager(java.lang.Class<? extends java.util.concurrent.BlockingQueue<E>> backingClass, java.lang.Class<? extends RpcScheduler> schedulerClass, boolean clientBackOffEnabled, int maxQueueSize, java.lang.String namespace, Configuration conf)
@VisibleForTesting public boolean isServerFailOverEnabled()
@VisibleForTesting public boolean isServerFailOverEnabledByQueue()
public void put(E e) throws java.lang.InterruptedException
put in interface java.util.concurrent.BlockingQueue<E extends Schedulable>java.lang.InterruptedExceptionpublic boolean add(E e)
add in interface java.util.concurrent.BlockingQueue<E extends Schedulable>add in interface java.util.Collection<E extends Schedulable>add in interface java.util.Queue<E extends Schedulable>add in class java.util.AbstractQueue<E extends Schedulable>public boolean offer(E e)
offer in interface java.util.concurrent.BlockingQueue<E extends Schedulable>offer in interface java.util.Queue<E extends Schedulable>public boolean offer(E e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
offer in interface java.util.concurrent.BlockingQueue<E extends Schedulable>java.lang.InterruptedExceptionpublic E peek()
peek in interface java.util.Queue<E extends Schedulable>public E poll()
poll in interface java.util.Queue<E extends Schedulable>public E poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
poll in interface java.util.concurrent.BlockingQueue<E extends Schedulable>java.lang.InterruptedExceptionpublic E take() throws java.lang.InterruptedException
take in interface java.util.concurrent.BlockingQueue<E extends Schedulable>java.lang.InterruptedExceptionpublic int size()
size in interface java.util.Collection<E extends Schedulable>size in class java.util.AbstractCollection<E extends Schedulable>public int remainingCapacity()
remainingCapacity in interface java.util.concurrent.BlockingQueue<E extends Schedulable>public static int[] getDefaultQueueCapacityWeights(int priorityLevels)
priorityLevels - number of levelspublic void swapQueue(java.lang.Class<? extends RpcScheduler> schedulerClass, java.lang.Class<? extends java.util.concurrent.BlockingQueue<E>> queueClassToUse, int maxSize, java.lang.String ns, Configuration conf)
schedulerClass - input schedulerClass.queueClassToUse - input queueClassToUse.maxSize - input maxSize.ns - input ns.conf - input configuration.public int drainTo(java.util.Collection<? super E> c)
drainTo in interface java.util.concurrent.BlockingQueue<E extends Schedulable>public int drainTo(java.util.Collection<? super E> c, int maxElements)
drainTo in interface java.util.concurrent.BlockingQueue<E extends Schedulable>public java.util.Iterator<E> iterator()
iterator in interface java.util.Collection<E extends Schedulable>iterator in interface java.lang.Iterable<E extends Schedulable>iterator in class java.util.AbstractCollection<E extends Schedulable>Copyright © 2008–2025 Apache Software Foundation. All rights reserved.