public class BatchingQuIP<T> extends java.lang.Object implements QueueItemProvider<java.util.List<T>>
QueueItemProvider that batches entries together.| Constructor and Description |
|---|
BatchingQuIP(QueueItemProvider<T> items,
java.lang.Integer batchSize) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
java.util.Iterator<java.util.Collection<java.util.List<T>>> |
iterator()
Generally returns
this. |
java.util.Collection<java.util.List<T>> |
next() |
void |
remove()
A means to delete the message because it is done or should not be processed again.
|
public BatchingQuIP(QueueItemProvider<T> items, java.lang.Integer batchSize)
items - providerbatchSize - (optional) size of each aggregated batch returned by next(). Defaults to 1000.public java.util.Iterator<java.util.Collection<java.util.List<T>>> iterator()
QueueItemProviderthis. QueueItemProviders are not generally reusable/resettable since the
underlying message source will often not be reversible. Mashing the two interfaces together simplifies
implementations a bit, and also supports any typical Iterable usage.iterator in interface QueueItemProvider<java.util.List<T>>iterator in interface java.lang.Iterable<java.util.Collection<java.util.List<T>>>public boolean hasNext()
hasNext in interface QueueItemProvider<java.util.List<T>>hasNext in interface java.util.Iterator<java.util.Collection<java.util.List<T>>>QueueReader should continue processing messages from this provider.public java.util.Collection<java.util.List<T>> next()
next in interface QueueItemProvider<java.util.List<T>>next in interface java.util.Iterator<java.util.Collection<java.util.List<T>>>null. The reading QueueReader may sleep after receiving an empty batch depending on its
configuration.public void remove()
QueueItemProviderremove in interface QueueItemProvider<java.util.List<T>>remove in interface java.util.Iterator<java.util.Collection<java.util.List<T>>>