Class BoundedColumnValuePartitionFunction
- java.lang.Object
-
- org.apache.pinot.segment.spi.partition.BoundedColumnValuePartitionFunction
-
- All Implemented Interfaces:
Serializable,PartitionFunction
public class BoundedColumnValuePartitionFunction extends Object implements PartitionFunction
Implementation ofPartitionFunctionwhich partitions based configured column values. "columnPartitionMap": { "subject": { "functionName": "BoundedColumnValue", "functionConfig": { "columnValues": "Maths|English|Chemistry", "columnValuesDelimiter": "|" }, "numPartitions": 4 } } With this partition config on column "subject", partitionId would be 1 for Maths, 2 for English and 3 for Chemistry. partitionId would be "0" for all other values which may occur, therefore 'numPartitions' is set to 4.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BoundedColumnValuePartitionFunction(int numPartitions, Map<String,String> functionConfig)
-
Method Summary
Modifier and Type Method Description Map<String,String>getFunctionConfig()StringgetName()Returns the name of the partition function.intgetNumPartitions()Returns number of partitions configured for the column.intgetPartition(Object value)Method to compute and return partition id for the given value.StringtoString()
-
-
-
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()
Returns number of partitions configured for the column.- Specified by:
getNumPartitionsin interfacePartitionFunction- Returns:
- Total number of partitions for the function.
-
getFunctionConfig
public Map<String,String> getFunctionConfig()
- Specified by:
getFunctionConfigin interfacePartitionFunction
-
-