Class HashCodePartitionFunction
- java.lang.Object
-
- org.apache.pinot.segment.spi.partition.HashCodePartitionFunction
-
- All Implemented Interfaces:
Serializable,PartitionFunction
public class HashCodePartitionFunction extends Object implements PartitionFunction
Hash code partition function, where:- partitionId = value.hashCode() %
_numPartitions
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HashCodePartitionFunction(int numPartitions)
-
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)Method to compute and return partition id for the 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)
Description copied from interface:PartitionFunctionMethod to compute and return partition id for the given value.- Specified by:
getPartitionin interfacePartitionFunction- Parameters:
value- Value for which to determine the partition id.- Returns:
- partition id for the 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.
-
-