java.lang.Object
org.apache.beam.runners.flink.translation.wrappers.streaming.FlinkKeyUtils

public class FlinkKeyUtils extends Object
Utility functions for dealing with key encoding. Beam requires keys to be compared in binary format. The helpers here ensure that a consistent encoding is used.
  • Constructor Details

    • FlinkKeyUtils

      public FlinkKeyUtils()
  • Method Details

    • encodeKey

      public static <K> ByteBuffer encodeKey(K key, Coder<K> keyCoder)
      Encodes a key to a byte array wrapped inside a ByteBuffer.
    • decodeKey

      public static <K> K decodeKey(ByteBuffer byteBuffer, Coder<K> keyCoder)
      Decodes a key from a ByteBuffer containing a byte array.