Class SdfFlinkKeyKeySelector<K,V>

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

public class SdfFlinkKeyKeySelector<K,V> extends Object implements org.apache.flink.api.java.functions.KeySelector<WindowedValue<KV<KV<K,V>,Double>>,FlinkKey>, org.apache.flink.api.java.typeutils.ResultTypeQueryable<FlinkKey>
KeySelector that retrieves a key from a KV<KV<element, KV<restriction, watermarkState>>, size>. This will return the element as encoded by the provided Coder in a FlinkKey. This ensures that all key comparisons/hashing happen on the encoded form. Note that the reason we don't use the whole KV<KV<element, KV<restriction, watermarkState>>, Double> as the key is when checkpoint happens, we will get different restriction/watermarkState/size, which Flink treats as a new key. Using new key to set state and timer may cause defined behavior.
See Also:
  • Constructor Details

    • SdfFlinkKeyKeySelector

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

    • getKey

      public FlinkKey getKey(WindowedValue<KV<KV<K,V>,Double>> value)
      Specified by:
      getKey in interface org.apache.flink.api.java.functions.KeySelector<K,V>
    • getProducedType

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