Class ModuloPartitionFunction
- java.lang.Object
-
- org.apache.pinot.segment.spi.partition.ModuloPartitionFunction
-
- All Implemented Interfaces:
Serializable,PartitionFunction
public class ModuloPartitionFunction extends Object implements PartitionFunction
Modulo operation based partition function, where:- partitionId = value %
_numPartitions
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ModuloPartitionFunction(int numPartitions)Constructor for the class.
-
Method Summary
Modifier and Type Method Description StringgetName()Returns the name of the partition function.intgetNumPartitions()Returns the total number of possible partitions.intgetPartition(Object value)Returns partition id for a given value.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.pinot.segment.spi.partition.PartitionFunction
getFunctionConfig
-
-
-
-
Method Detail
-
getPartition
public int getPartition(Object value)
Returns partition id for a given value. Assumes that the passed in object is either an Integer, or a string representation of an Integer.- Specified by:
getPartitionin interfacePartitionFunction- Parameters:
value- Value for which to determine the partition id.- Returns:
- Partition id for the given value.
-
getName
public String getName()
Description copied from interface:PartitionFunctionReturns the name of the partition function.- Specified by:
getNamein interfacePartitionFunction- Returns:
- Name of the partition function.
-
getNumPartitions
public int getNumPartitions()
Description copied from interface:PartitionFunctionReturns the total number of possible partitions.- Specified by:
getNumPartitionsin interfacePartitionFunction- Returns:
- Number of possible partitions.
-
-