Class ContextKey<K,N>

java.lang.Object
org.apache.flink.state.forst.ContextKey<K,N>
Type Parameters:
K - The type of the raw key.

@ThreadSafe public class ContextKey<K,N> extends Object
The composite key which contains some context information, such as keyGroup, etc.
  • Constructor Details

    • ContextKey

      public ContextKey(org.apache.flink.runtime.asyncprocessing.RecordContext<K> recordContext, @Nullable N namespace)
    • ContextKey

      public ContextKey(org.apache.flink.runtime.asyncprocessing.RecordContext<K> recordContext, @Nullable N namespace, Object userKey)
  • Method Details

    • getRawKey

      public K getRawKey()
    • getKeyGroup

      public int getKeyGroup()
    • getNamespace

      public N getNamespace()
    • getUserKey

      public Object getUserKey()
    • setUserKey

      public void setUserKey(Object userKey)
    • resetExtra

      public void resetExtra()
    • getOrCreateSerializedKey

      public byte[] getOrCreateSerializedKey(org.apache.flink.util.function.FunctionWithException<ContextKey<K,N>,byte[],IOException> serializeKeyFunc) throws IOException
      Get the serialized key. If the cached serialized key within RecordContext#payload is null, the provided serialization function will be called, and the serialization result will be cached by RecordContext#payload.
      Parameters:
      serializeKeyFunc - the provided serialization function for this contextKey.
      Returns:
      the serialized bytes.
      Throws:
      IOException
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object