|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.netflix.curator.framework.recipes.queue.DistributedPriorityQueue<T>
public class DistributedPriorityQueue<T>
An implementation of the Distributed Priority Queue ZK recipe.
Internally, this uses a DistributedQueue. The only difference is that you specify a
priority when putting into the queue.
IMPORTANT NOTE: The priority queue will perform far worse than a standard queue. Every time an item is added to/removed from the queue, every watcher must re-get all the nodes
s
| Method Summary | |
|---|---|
void |
close()
|
static String |
defaultPriorityToString(int priority)
The default method of converting a priority into a sortable string |
protected String |
priorityToString(int priority)
|
void |
put(T item,
int priority)
Add an item into the queue. |
void |
putMulti(MultiItem<T> items,
int priority)
Add a set of items with the same priority into the queue. |
void |
start()
Start the queue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void start()
throws Exception
Exception - startup errors
public void close()
throws IOException
close in interface CloseableIOException
public void put(T item,
int priority)
throws Exception
item - item to addpriority - item's priority - lower numbers come out of the queue first
Exception - connection issues
public void putMulti(MultiItem<T> items,
int priority)
throws Exception
items - items to addpriority - item priority - lower numbers come out of the queue first
Exception - connection issuespublic static String defaultPriorityToString(int priority)
priority - the priority
protected String priorityToString(int priority)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||