Package com.linkedin.venice.partitioner
Class InvalidKeySchemaPartitioner
- java.lang.Object
-
- com.linkedin.venice.partitioner.VenicePartitioner
-
- com.linkedin.venice.partitioner.InvalidKeySchemaPartitioner
-
public class InvalidKeySchemaPartitioner extends VenicePartitioner
Implementation of theVenicePartitioner
class for test purpose.
-
-
Field Summary
-
Fields inherited from class com.linkedin.venice.partitioner.VenicePartitioner
props
-
-
Constructor Summary
Constructors Constructor Description InvalidKeySchemaPartitioner(VeniceProperties props, org.apache.avro.Schema schema)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkSchema(org.apache.avro.Schema keySchema)
Implementors of this class can optionally provide an implementation of this function, which can perform validation of schemas to be certain that they are compatible with the partitioner implementation.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
getPartitionId
-
-
-
-
Constructor Detail
-
InvalidKeySchemaPartitioner
public InvalidKeySchemaPartitioner(VeniceProperties props, 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
-
checkSchema
protected void checkSchema(org.apache.avro.Schema keySchema) throws PartitionerSchemaMismatchException
Description copied from class:VenicePartitioner
Implementors of this class can optionally provide an implementation of this function, which can perform validation of schemas to be certain that they are compatible with the partitioner implementation.- Overrides:
checkSchema
in classVenicePartitioner
- Parameters:
keySchema
- the schema to be validated- Throws:
PartitionerSchemaMismatchException
- should the provided schema not match the partitioner (with a message that explains why).
-
-