Package com.linkedin.venice.partitioner
Class UserPartitionAwarePartitioner
- java.lang.Object
-
- com.linkedin.venice.partitioner.VenicePartitioner
-
- com.linkedin.venice.partitioner.UserPartitionAwarePartitioner
-
public class UserPartitionAwarePartitioner extends VenicePartitioner
UserPartitionAwarePartitioner takes a partitioner and amplification factor as input params. When partitioning, the partitioner is run twice in a row, once to determine the application partition, and a second time to determine the sub-partition. Algorithm: subPartition = partition(key, userPartitions) * amplificationFactor + partition(key, amplificationFactor)
-
-
Field Summary
-
Fields inherited from class com.linkedin.venice.partitioner.VenicePartitioner
props
-
-
Constructor Summary
Constructors Constructor Description UserPartitionAwarePartitioner(VenicePartitioner partitioner, int amplificationFactor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPartitionId(byte[] keyBytes, int subPartitionCount)
A function that returns the partitionId based on the key and partition count.int
getPartitionId(java.nio.ByteBuffer keyByteBuffer, int subPartitionCount)
-
Methods inherited from class com.linkedin.venice.partitioner.VenicePartitioner
checkSchema, getPartitionId
-
-
-
-
Constructor Detail
-
UserPartitionAwarePartitioner
public UserPartitionAwarePartitioner(VenicePartitioner partitioner, int amplificationFactor)
-
-
Method Detail
-
getPartitionId
public int getPartitionId(byte[] keyBytes, int subPartitionCount)
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 partitionsubPartitionCount
- - The number of total partitions available in Kafka/storage- Returns:
-
getPartitionId
public int getPartitionId(java.nio.ByteBuffer keyByteBuffer, int subPartitionCount)
- Specified by:
getPartitionId
in classVenicePartitioner
-
-