Package com.linkedin.venice.pubsub.mock
Class SimplePartitioner
java.lang.Object
com.linkedin.venice.partitioner.VenicePartitioner
com.linkedin.venice.pubsub.mock.SimplePartitioner
This 
VenicePartitioner implementation takes the first byte of the key,
 and computes the partition as such:
 firstByte % numPartitions
 It is meant to be used in tests where we want to control the partition that a
 key belongs to, but without needing to work out a proper input that yields the
 desired partition when hashed by the
 DefaultVenicePartitioner.- 
Nested Class SummaryNested classes/interfaces inherited from class com.linkedin.venice.partitioner.VenicePartitionerVenicePartitioner.VenicePartitionerType
- 
Field SummaryFields inherited from class com.linkedin.venice.partitioner.VenicePartitionerprops
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintgetPartitionId(byte[] keyBytes, int numPartitions) A function that returns the partitionId based on the key and partition count.intgetPartitionId(ByteBuffer keyByteBuffer, int numPartitions) Methods inherited from class com.linkedin.venice.partitioner.VenicePartitionercheckSchema, getPartitionerType, getPartitionId
- 
Constructor Details- 
SimplePartitionerpublic SimplePartitioner()
- 
SimplePartitioner
- 
SimplePartitioner
 
- 
- 
Method Details- 
getPartitionIdpublic int getPartitionId(byte[] keyBytes, int numPartitions) Description copied from class:VenicePartitionerA function that returns the partitionId based on the key and partition count.- Specified by:
- getPartitionIdin class- VenicePartitioner
- Parameters:
- keyBytes- - A key that will be mapped into a partition
- numPartitions- - The number of total partitions available in Kafka/storage
- Returns:
 
- 
getPartitionId- Specified by:
- getPartitionIdin class- VenicePartitioner
 
 
-