Class ComplexVenicePartitioner

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

public abstract class ComplexVenicePartitioner extends VenicePartitioner
Determines partitioning but offers more complex partitioning API that could partition not just based on "immutable" fields of the value. In addition, it provides the option to partition a record to multiple partitions.
  • Constructor Details

    • ComplexVenicePartitioner

      public ComplexVenicePartitioner()
    • ComplexVenicePartitioner

      public ComplexVenicePartitioner(VeniceProperties props)
    • ComplexVenicePartitioner

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

    • getPartitionId

      public abstract int[] getPartitionId(byte[] keyBytes, org.apache.avro.generic.GenericRecord value, int numPartitions)
      A complex partitioner API that could be used in materialized views to partition based on value. The resulting partition could also be an array of partition ids instead of just a single partition (one-to-many).
      Parameters:
      value - that will be mapped to partition(s)
      numPartitions - of total available partitions
      Returns:
      int array containing the partition id(s)