T
- Type of object in the partitionpublic class RangePartitioner<T> extends Object implements Partitioner<T>
RangePartitioner
partitions data of a known size into a predefined
number of equally sized partitions. If the time taken for processing each
partition with Operation
s varies, then this partitioner is not
load-balancing (so threads may end up waiting whilst others are still
working).Constructor and Description |
---|
RangePartitioner(Collection<T> c)
Construct with a
Collection of data and the number of partitions
equal to the number of hardware threads. |
RangePartitioner(Collection<T> c,
int numPartitions)
Construct with a
Collection of data and the given number of
partitions. |
RangePartitioner(List<T> list)
Construct with a
List of data and the number of partitions equal
to the number of hardware threads. |
RangePartitioner(List<T> list,
int numPartitions)
Construct with a
List of data and the given number of partitions. |
RangePartitioner(T[] array)
Construct with an array of data and the number of partitions equal to the
number of hardware threads.
|
RangePartitioner(T[] array,
int numPartitions)
Construct with an array of data and the given number of partitions.
|
public RangePartitioner(List<T> list, int numPartitions)
List
of data and the given number of partitions.list
- the datanumPartitions
- the number of partitionspublic RangePartitioner(Collection<T> c, int numPartitions)
Collection
of data and the given number of
partitions.c
- the datanumPartitions
- the number of partitionspublic RangePartitioner(T[] array, int numPartitions)
array
- the datanumPartitions
- the number of partitionspublic RangePartitioner(List<T> list)
List
of data and the number of partitions equal
to the number of hardware threads.list
- the datapublic RangePartitioner(Collection<T> c)
Collection
of data and the number of partitions
equal to the number of hardware threads.c
- the datapublic RangePartitioner(T[] array)
array
- the datapublic Iterator<Iterator<T>> getPartitions()
getPartitions
in interface Partitioner<T>