Package com.linkedin.venice.partitioner
Class ConstantVenicePartitioner
- java.lang.Object
-
- com.linkedin.venice.partitioner.VenicePartitioner
-
- com.linkedin.venice.partitioner.ConstantVenicePartitioner
-
public class ConstantVenicePartitioner extends VenicePartitioner
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CONSTANT_PARTITION
-
Fields inherited from class com.linkedin.venice.partitioner.VenicePartitioner
props
-
-
Constructor Summary
Constructors Constructor Description ConstantVenicePartitioner(VeniceProperties properties)
ConstantVenicePartitioner(VeniceProperties properties, org.apache.avro.Schema schema)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPartitionId(byte[] keyBytes, int numPartitions)
A function that returns the partitionId based on the key and partition count.int
getPartitionId(java.nio.ByteBuffer keyByteBuffer, int numPartitions)
-
Methods inherited from class com.linkedin.venice.partitioner.VenicePartitioner
checkSchema, getPartitionId
-
-
-
-
Field Detail
-
CONSTANT_PARTITION
public static final java.lang.String CONSTANT_PARTITION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConstantVenicePartitioner
public ConstantVenicePartitioner(VeniceProperties properties)
-
ConstantVenicePartitioner
public ConstantVenicePartitioner(VeniceProperties properties, org.apache.avro.Schema schema)
-
-
Method Detail
-
getPartitionId
public int getPartitionId(byte[] keyBytes, int numPartitions)
Description copied from class:VenicePartitioner
A function that returns the partitionId based on the key and partition count.- Specified by:
getPartitionId
in classVenicePartitioner
- Parameters:
keyBytes
- - A key that will be mapped into a partitionnumPartitions
- - The number of total partitions available in Kafka/storage- Returns:
-
getPartitionId
public int getPartitionId(java.nio.ByteBuffer keyByteBuffer, int numPartitions)
- Specified by:
getPartitionId
in classVenicePartitioner
-
-