Class WorkItemKeySelector<K,V>

java.lang.Object
org.apache.beam.runners.flink.translation.wrappers.streaming.WorkItemKeySelector<K,V>
All Implemented Interfaces:
Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.java.functions.KeySelector<WindowedValue<org.apache.beam.runners.core.KeyedWorkItem<K,V>>,FlinkKey>, org.apache.flink.api.java.typeutils.ResultTypeQueryable<FlinkKey>

public class WorkItemKeySelector<K,V> extends Object implements org.apache.flink.api.java.functions.KeySelector<WindowedValue<org.apache.beam.runners.core.KeyedWorkItem<K,V>>,FlinkKey>, org.apache.flink.api.java.typeutils.ResultTypeQueryable<FlinkKey>
KeySelector that retrieves a key from a KeyedWorkItem. This will return the key as encoded by the provided Coder in a ByteBuffer. This ensures that all key comparisons/hashing happen on the encoded form.
See Also:
  • Constructor Details

    • WorkItemKeySelector

      public WorkItemKeySelector(Coder<K> keyCoder)
  • Method Details

    • getKey

      public FlinkKey getKey(WindowedValue<org.apache.beam.runners.core.KeyedWorkItem<K,V>> value) throws Exception
      Specified by:
      getKey in interface org.apache.flink.api.java.functions.KeySelector<K,V>
      Throws:
      Exception
    • getProducedType

      public org.apache.flink.api.common.typeinfo.TypeInformation<FlinkKey> getProducedType()
      Specified by:
      getProducedType in interface org.apache.flink.api.java.typeutils.ResultTypeQueryable<K>