Class InvalidKeySchemaPartitioner

java.lang.Object
com.linkedin.venice.partitioner.VenicePartitioner
com.linkedin.venice.partitioner.InvalidKeySchemaPartitioner

public class InvalidKeySchemaPartitioner extends VenicePartitioner
Implementation of the VenicePartitioner class for test purpose.
  • Constructor Details

    • InvalidKeySchemaPartitioner

      public InvalidKeySchemaPartitioner(VeniceProperties props, org.apache.avro.Schema schema)
  • Method Details

    • 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 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

      public int getPartitionId(ByteBuffer keyByteBuffer, int numPartitions)
      Specified by:
      getPartitionId in class VenicePartitioner
    • 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 class VenicePartitioner
      Parameters:
      keySchema - the schema to be validated
      Throws:
      PartitionerSchemaMismatchException - should the provided schema not match the partitioner (with a message that explains why).