Interface PartitionFunction
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
BoundedColumnValuePartitionFunction,ByteArrayPartitionFunction,HashCodePartitionFunction,ModuloPartitionFunction,MurmurPartitionFunction
public interface PartitionFunction extends Serializable
Interface for partition function. Implementations of this interface are assumed not to be stateful. That is, two invocations ofPartitionFunction.getPartition(value)with the same value are expected to produce the same result.
-
-
Method Summary
Modifier and Type Method Description default Map<String,String>getFunctionConfig()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.
-
-
-
Method Detail
-
getPartition
int getPartition(Object value)
Method to compute and return partition id for the given value.- Parameters:
value- Value for which to determine the partition id.- Returns:
- partition id for the value.
-
getName
String getName()
Returns the name of the partition function.- Returns:
- Name of the partition function.
-
getNumPartitions
int getNumPartitions()
Returns the total number of possible partitions.- Returns:
- Number of possible partitions.
-
-