Class FlinkKeyUtils


  • public class FlinkKeyUtils
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      FlinkKeyUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <K> K decodeKey​(java.nio.ByteBuffer byteBuffer, org.apache.beam.sdk.coders.Coder<K> keyCoder)
      Decodes a key from a ByteBuffer containing a byte array.
      static <K> java.nio.ByteBuffer encodeKey​(K key, org.apache.beam.sdk.coders.Coder<K> keyCoder)
      Encodes a key to a byte array wrapped inside a ByteBuffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FlinkKeyUtils

        public FlinkKeyUtils()
    • Method Detail

      • encodeKey

        public static <K> java.nio.ByteBuffer encodeKey​(K key,
                                                        org.apache.beam.sdk.coders.Coder<K> keyCoder)
        Encodes a key to a byte array wrapped inside a ByteBuffer.
      • decodeKey

        public static <K> K decodeKey​(java.nio.ByteBuffer byteBuffer,
                                      org.apache.beam.sdk.coders.Coder<K> keyCoder)
        Decodes a key from a ByteBuffer containing a byte array.