Package com.linkedin.venice.partitioner
Class ComplexVenicePartitioner
java.lang.Object
com.linkedin.venice.partitioner.VenicePartitioner
com.linkedin.venice.partitioner.ComplexVenicePartitioner
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.
-
Field Summary
Fields inherited from class com.linkedin.venice.partitioner.VenicePartitioner
props
-
Constructor Summary
ConstructorsConstructorDescriptionComplexVenicePartitioner
(VeniceProperties props, org.apache.avro.Schema schema) -
Method Summary
Modifier and TypeMethodDescriptionabstract 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.Methods inherited from class com.linkedin.venice.partitioner.VenicePartitioner
checkSchema, getPartitionId, getPartitionId, getPartitionId
-
Constructor Details
-
ComplexVenicePartitioner
public ComplexVenicePartitioner() -
ComplexVenicePartitioner
-
ComplexVenicePartitioner
-
-
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)
-