T
- Type of object in the partitionpublic class FixedSizeBlockingChunkPartitioner<T> extends Object implements Partitioner<T>
FixedSizeBlockingChunkPartitioner
dynamically partitions data into
chunks of a fixed length. The partitioner does not need to know about the
length of the data apriori. Beyond a FixedSizeChunkPartitioner
this
implementation doesn't use an underlying iterator. It can only be
instantiated on queues and will always report to have more items available
while it waits for the queue to be filled.Constructor and Description |
---|
FixedSizeBlockingChunkPartitioner(Queue<T> objects)
Construct with data in the form of a
Queue . |
FixedSizeBlockingChunkPartitioner(Queue<T> objects,
int chunkSize)
Construct with data in the form of an
Queue and the given number
of items per chunk. |
public FixedSizeBlockingChunkPartitioner(Queue<T> objects)
Queue
. The number of items
per chunk is set at the default value (20).objects
- the Queue
representing the data.public FixedSizeBlockingChunkPartitioner(Queue<T> objects, int chunkSize)
Queue
and the given number
of items per chunk.objects
- the Queue
representing the data.chunkSize
- number of items in each chunk.public Iterator<Iterator<T>> getPartitions()
getPartitions
in interface Partitioner<T>