public class GenericDistributedQueue extends Object implements DistributedQueue
DistribStateManager as the underlying distributed store.
Implementation based on ZkDistributedQueue| Constructor and Description |
|---|
GenericDistributedQueue(DistribStateManager stateManager,
String dir)
Deprecated.
|
GenericDistributedQueue(DistribStateManager stateManager,
String dir,
Stats stats)
Deprecated.
|
GenericDistributedQueue(DistribStateManager stateManager,
String dir,
Stats stats,
int maxQueueSize)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
getStats()
Deprecated.
|
Stats |
getZkStats()
Deprecated.
|
void |
offer(byte[] data)
Deprecated.
Inserts data into queue.
|
byte[] |
peek()
Deprecated.
Returns the data at the first element of the queue, or null if the queue is
empty.
|
byte[] |
peek(boolean block)
Deprecated.
Returns the data at the first element of the queue, or null if the queue is
empty and block is false.
|
byte[] |
peek(long wait)
Deprecated.
Returns the data at the first element of the queue, or null if the queue is
empty after wait ms.
|
Collection<Pair<String,byte[]>> |
peekElements(int max,
long waitMillis,
Predicate<String> acceptFilter)
Deprecated.
Return the currently-known set of elements, using child names from memory.
|
byte[] |
poll()
Deprecated.
Attempts to remove the head of the queue and return it.
|
byte[] |
remove()
Deprecated.
Attempts to remove the head of the queue and return it.
|
void |
remove(Collection<String> paths)
Deprecated.
|
byte[] |
take()
Deprecated.
Removes the head of the queue and returns it, blocks until it succeeds.
|
public GenericDistributedQueue(DistribStateManager stateManager, String dir)
public GenericDistributedQueue(DistribStateManager stateManager, String dir, Stats stats)
public GenericDistributedQueue(DistribStateManager stateManager, String dir, Stats stats, int maxQueueSize)
public byte[] peek()
throws Exception
peek in interface DistributedQueueExceptionpublic byte[] peek(boolean block)
throws Exception
peek in interface DistributedQueueblock - if true, blocks until an element enters the queueExceptionpublic byte[] peek(long wait)
throws Exception
peek in interface DistributedQueuewait - max wait time in ms.Exceptionpublic byte[] poll()
throws Exception
poll in interface DistributedQueueExceptionpublic byte[] remove()
throws Exception
remove in interface DistributedQueueExceptionpublic void remove(Collection<String> paths) throws Exception
Exceptionpublic byte[] take()
throws Exception
take in interface DistributedQueueExceptionpublic void offer(byte[] data)
throws Exception
offer in interface DistributedQueueExceptionpublic Stats getZkStats()
public Map<String,Object> getStats()
getStats in interface DistributedQueuepublic Collection<Pair<String,byte[]>> peekElements(int max, long waitMillis, Predicate<String> acceptFilter) throws Exception
acceptFilter, waits up to waitMillis for at least one child to become available.
Package-private to support OverseerTaskQueue specifically.
peekElements in interface DistributedQueueExceptionCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.