|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.curator.framework.recipes.queue.DistributedDelayQueue<T>
public class DistributedDelayQueue<T>
A variation of the DistributedPriorityQueue that uses time as the priority. When items are added to the queue, a delay value is given. The item will not be sent to a consumer until the time elapses.
| Method Summary | |
|---|---|
void |
close()
|
boolean |
flushPuts(long waitTime,
java.util.concurrent.TimeUnit timeUnit)
Wait until any pending puts are committed |
int |
getLastMessageCount()
Return the most recent message count from the queue. |
com.netflix.curator.framework.listen.ListenerContainer<QueuePutListener<T>> |
getPutListenerContainer()
Return the manager for put listeners |
void |
put(T item,
long delayUntilEpoch)
Add an item into the queue. |
boolean |
put(T item,
long delayUntilEpoch,
int maxWait,
java.util.concurrent.TimeUnit unit)
Same as put(Object, long) but allows a maximum wait time if an upper bound was set
via QueueBuilder.maxItems. |
void |
putMulti(MultiItem<T> items,
long delayUntilEpoch)
Add a set of items with the same priority into the queue. |
boolean |
putMulti(MultiItem<T> items,
long delayUntilEpoch,
int maxWait,
java.util.concurrent.TimeUnit unit)
Same as putMulti(MultiItem, long) but allows a maximum wait time if an upper bound was set
via QueueBuilder.maxItems. |
void |
setErrorMode(ErrorMode newErrorMode)
Used when the queue is created with a QueueBuilder.lockPath(String). |
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 java.lang.Exception
start in interface QueueBase<T>java.lang.Exception - startup errors
public void close()
throws java.io.IOException
close in interface java.io.Closeablejava.io.IOException
public void put(T item,
long delayUntilEpoch)
throws java.lang.Exception
QueueBuilder.maxItems, this method will
block until there is available space in the queue.
item - item to adddelayUntilEpoch - future epoch (milliseconds) when this item will be available to consumers
java.lang.Exception - connection issues
public boolean put(T item,
long delayUntilEpoch,
int maxWait,
java.util.concurrent.TimeUnit unit)
throws java.lang.Exception
put(Object, long) but allows a maximum wait time if an upper bound was set
via QueueBuilder.maxItems.
item - item to adddelayUntilEpoch - future epoch (milliseconds) when this item will be available to consumersmaxWait - maximum waitunit - wait unit
java.lang.Exception
public void putMulti(MultiItem<T> items,
long delayUntilEpoch)
throws java.lang.Exception
QueueBuilder.maxItems, this method will
block until there is available space in the queue.
items - items to adddelayUntilEpoch - future epoch (milliseconds) when this item will be available to consumers
java.lang.Exception - connection issues
public boolean putMulti(MultiItem<T> items,
long delayUntilEpoch,
int maxWait,
java.util.concurrent.TimeUnit unit)
throws java.lang.Exception
putMulti(MultiItem, long) but allows a maximum wait time if an upper bound was set
via QueueBuilder.maxItems.
items - items to adddelayUntilEpoch - future epoch (milliseconds) when this item will be available to consumersmaxWait - maximum waitunit - wait unit
java.lang.Exceptionpublic void setErrorMode(ErrorMode newErrorMode)
QueueBaseQueueBuilder.lockPath(String). Determines
the behavior when the queue consumer throws an exception
setErrorMode in interface QueueBase<T>newErrorMode - the new error mode (the default is ErrorMode.REQUEUE
public boolean flushPuts(long waitTime,
java.util.concurrent.TimeUnit timeUnit)
throws java.lang.InterruptedException
QueueBase
flushPuts in interface QueueBase<T>waitTime - max wait timetimeUnit - time unit
java.lang.InterruptedException - if thread was interruptedpublic com.netflix.curator.framework.listen.ListenerContainer<QueuePutListener<T>> getPutListenerContainer()
getPutListenerContainer in interface QueueBase<T>public int getLastMessageCount()
getLastMessageCount in interface QueueBase<T>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||