|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.curator.framework.recipes.queue.DistributedIdQueue<T>
public class DistributedIdQueue<T>
A version of DistributedQueue that allows IDs to be associated with queue items. Items
can then be removed from the queue if needed
| 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,
java.lang.String itemId)
Put an item into the queue with the given Id NOTE: if an upper bound was set via QueueBuilder.maxItems, this method will
block until there is available space in the queue. |
boolean |
put(T item,
java.lang.String itemId,
int maxWait,
java.util.concurrent.TimeUnit unit)
Same as put(Object, String) but allows a maximum wait time if an upper bound was set
via QueueBuilder.maxItems. |
int |
remove(java.lang.String id)
Remove any items with the given Id |
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
QueueBase
start in interface QueueBase<T>java.lang.Exception - startup errors
public void close()
throws java.io.IOException
close in interface java.io.Closeablejava.io.IOExceptionpublic com.netflix.curator.framework.listen.ListenerContainer<QueuePutListener<T>> getPutListenerContainer()
QueueBase
getPutListenerContainer in interface QueueBase<T>public 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 int getLastMessageCount()
QueueBase
getLastMessageCount in interface QueueBase<T>
public void put(T item,
java.lang.String itemId)
throws java.lang.Exception
QueueBuilder.maxItems, this method will
block until there is available space in the queue.
item - itemitemId - item Id
java.lang.Exception - errors
public boolean put(T item,
java.lang.String itemId,
int maxWait,
java.util.concurrent.TimeUnit unit)
throws java.lang.Exception
put(Object, String) but allows a maximum wait time if an upper bound was set
via QueueBuilder.maxItems.
item - itemitemId - item IdmaxWait - maximum waitunit - wait unit
java.lang.Exception
public int remove(java.lang.String id)
throws java.lang.Exception
id - item Id to remove
java.lang.Exception - errors
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||