Class CroppedPartitioner<T>
- java.lang.Object
-
- org.openrefine.runners.local.pll.partitioning.CroppedPartitioner<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
Partitioner<T>
public class CroppedPartitioner<T> extends Object implements Partitioner<T>
A partitionner for a PLL which was amputed from some partitions.- Author:
- Antonin Delpeuch
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CroppedPartitioner(Partitioner<T> parent, int partitionsToDrop, boolean atEnd)
Constructs the partitioner based on the partitioner for the uncropped PLL.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Partitioner<T>
crop(Partitioner<T> partitioner, int partitionsToDrop, boolean atEnd)
Constructs the partitioner based on the partitioner for the uncropped PLL.int
getPartition(T key)
Retrieves the partition id given a key.int
numPartitions()
Returns the number of partitions assumed by this partitioner.
-
-
-
Constructor Detail
-
CroppedPartitioner
protected CroppedPartitioner(Partitioner<T> parent, int partitionsToDrop, boolean atEnd)
Constructs the partitioner based on the partitioner for the uncropped PLL.- Parameters:
parent
- the partitioner for the original PLLpartitionsToDrop
- the number of partitions which were dropped from that PLLatEnd
- true if the partitions were dropped at the end, false if at the beginning- See Also:
which attempts to preserve the partioner type
-
-
Method Detail
-
getPartition
public int getPartition(T key)
Description copied from interface:Partitioner
Retrieves the partition id given a key.- Specified by:
getPartition
in interfacePartitioner<T>
- Returns:
-
numPartitions
public int numPartitions()
Description copied from interface:Partitioner
Returns the number of partitions assumed by this partitioner.- Specified by:
numPartitions
in interfacePartitioner<T>
-
crop
public static <T> Partitioner<T> crop(Partitioner<T> partitioner, int partitionsToDrop, boolean atEnd)
Constructs the partitioner based on the partitioner for the uncropped PLL.- Parameters:
partitioner
- the partitioner for the original PLLpartitionsToDrop
- the number of partitions which were dropped from that PLLatEnd
- true if the partitions were dropped at the end, false if at the beginning
-
-