Partition.PartitionFn (Google Cloud Dataflow SDK 1.9.1 API)

Google Cloud Dataflow SDK for Java, version 1.9.1

com.google.cloud.dataflow.sdk.transforms

Interface Partition.PartitionFn<T>

  • Type Parameters:
    T - the type of the elements being partitioned
    All Superinterfaces:
    Serializable
    Enclosing class:
    Partition<T>


    public static interface Partition.PartitionFn<T>
    extends Serializable
    A function object that chooses an output partition for an element.
    • Method Detail

      • partitionFor

        int partitionFor(T elem,
                         int numPartitions)
        Chooses the partition into which to put the given element.
        Parameters:
        elem - the element to be partitioned
        numPartitions - the total number of partitions (>= 1)
        Returns:
        index of the selected partition (in the range [0..numPartitions-1])


Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Dataflow