Class DataflowGroupByKey<K,​V>

  • All Implemented Interfaces:
    java.io.Serializable, org.apache.beam.sdk.transforms.display.HasDisplayData

    public class DataflowGroupByKey<K,​V>
    extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,​V>>,​org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,​java.lang.Iterable<V>>>>
    Specialized implementation of GroupByKey for translating Redistribute transform into Dataflow service protos.
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  DataflowGroupByKey.Registrar
      Registers DataflowGroupByKey.DataflowGroupByKeyTranslator.
    • Field Summary

      • Fields inherited from class org.apache.beam.sdk.transforms.PTransform

        annotations, displayData, name, resourceHints
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean allowDuplicates()
      Returns whether it allows duplicated elements in the output.
      static void applicableTo​(org.apache.beam.sdk.values.PCollection<?> input)  
      static <K,​V>
      DataflowGroupByKey<K,​V>
      create()
      Returns a DataflowGroupByKey<K, V> PTransform.
      static <K,​V>
      DataflowGroupByKey<K,​V>
      createWithAllowDuplicates()
      Returns a DataflowGroupByKey<K, V> PTransform that its output can have duplicated elements.
      org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,​java.lang.Iterable<V>>> expand​(org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,​V>> input)  
      static <K,​V>
      org.apache.beam.sdk.coders.Coder<V>
      getInputValueCoder​(org.apache.beam.sdk.coders.Coder<org.apache.beam.sdk.values.KV<K,​V>> inputCoder)
      Returns the Coder of the values of the input to this transform.
      static <K,​V>
      org.apache.beam.sdk.coders.KvCoder<K,​java.lang.Iterable<V>>
      getOutputKvCoder​(org.apache.beam.sdk.coders.Coder<org.apache.beam.sdk.values.KV<K,​V>> inputCoder)
      Returns the Coder of the output of this transform.
      org.apache.beam.sdk.values.WindowingStrategy<?,​?> updateWindowingStrategy​(org.apache.beam.sdk.values.WindowingStrategy<?,​?> inputStrategy)  
      • Methods inherited from class org.apache.beam.sdk.transforms.PTransform

        addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • 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​(org.apache.beam.sdk.values.PCollection<?> input)
      • updateWindowingStrategy

        public org.apache.beam.sdk.values.WindowingStrategy<?,​?> updateWindowingStrategy​(org.apache.beam.sdk.values.WindowingStrategy<?,​?> inputStrategy)
      • expand

        public org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,​java.lang.Iterable<V>>> expand​(org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,​V>> input)
        Specified by:
        expand in class org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,​V>>,​org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,​java.lang.Iterable<V>>>>
      • getInputValueCoder

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

        public static <K,​V> org.apache.beam.sdk.coders.KvCoder<K,​java.lang.Iterable<V>> getOutputKvCoder​(org.apache.beam.sdk.coders.Coder<org.apache.beam.sdk.values.KV<K,​V>> inputCoder)
        Returns the Coder of the output of this transform.