Package org.apache.beam.sdk.transforms
Interface Partition.PartitionFn<T>
- Type Parameters:
T- the type of the elements being partitioned
- All Superinterfaces:
Serializable
A function object that chooses an output partition for an element.
-
Method Summary
Modifier and TypeMethodDescriptionintpartitionFor(T elem, int numPartitions) Chooses the partition into which to put the given element.
-
Method Details
-
partitionFor
Chooses the partition into which to put the given element.- Parameters:
elem- the element to be partitionednumPartitions- the total number of partitions (>= 1)- Returns:
- index of the selected partition (in the range
[0..numPartitions-1])
-