Class DataflowGroupByKey<K,V>

java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PCollection<KV<K,V>>,PCollection<KV<K,Iterable<V>>>>
org.apache.beam.runners.dataflow.internal.DataflowGroupByKey<K,V>
All Implemented Interfaces:
Serializable, HasDisplayData

public class DataflowGroupByKey<K,V> extends PTransform<PCollection<KV<K,V>>,PCollection<KV<K,Iterable<V>>>>
Specialized implementation of GroupByKey for translating Redistribute transform into Dataflow service protos.
See Also:
  • Method Details

    • create

      public static <K, V> DataflowGroupByKey<K,V> create()
      Returns a DataflowGroupByKey<K, V> PTransform.
      Type Parameters:
      K - the type of the keys of the input and output PCollections
      V - the type of the values of the input PCollection and the elements of the Iterables in the output PCollection
    • createWithAllowDuplicates

      public static <K, V> DataflowGroupByKey<K,V> createWithAllowDuplicates()
      Returns a DataflowGroupByKey<K, V> PTransform that its output can have duplicated elements.
      Type Parameters:
      K - the type of the keys of the input and output PCollections
      V - the type of the values of the input PCollection and the elements of the Iterables in the output PCollection
    • allowDuplicates

      public boolean allowDuplicates()
      Returns whether it allows duplicated elements in the output.
    • applicableTo

      public static void applicableTo(PCollection<?> input)
    • updateWindowingStrategy

      public WindowingStrategy<?,?> updateWindowingStrategy(WindowingStrategy<?,?> inputStrategy)
    • expand

      public PCollection<KV<K,Iterable<V>>> expand(PCollection<KV<K,V>> input)
      Description copied from class: PTransform
      Override this method to specify how this PTransform should be expanded on the given InputT.

      NOTE: This method should not be called directly. Instead apply the PTransform should be applied to the InputT using the apply method.

      Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).

      Specified by:
      expand in class PTransform<PCollection<KV<K,V>>,PCollection<KV<K,Iterable<V>>>>
    • getInputValueCoder

      public static <K, V> Coder<V> getInputValueCoder(Coder<KV<K,V>> inputCoder)
      Returns the Coder of the values of the input to this transform.
    • getOutputKvCoder

      public static <K, V> KvCoder<K,Iterable<V>> getOutputKvCoder(Coder<KV<K,V>> inputCoder)
      Returns the Coder of the output of this transform.