Package org.apache.flink.runtime.state
Class CompositeKeySerializationUtils
- java.lang.Object
-
- org.apache.flink.runtime.state.CompositeKeySerializationUtils
-
public class CompositeKeySerializationUtils extends Object
Utils for RocksDB state serialization and deserialization.
-
-
Constructor Summary
Constructors Constructor Description CompositeKeySerializationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
computeRequiredBytesInKeyGroupPrefix(int totalKeyGroupsInJob)
static int
extractKeyGroup(int keyGroupPrefixBytes, byte[] rocksDBKey)
static boolean
isAmbiguousKeyPossible(TypeSerializer keySerializer, TypeSerializer namespaceSerializer)
static boolean
isSerializerTypeVariableSized(TypeSerializer<?> serializer)
static <K> K
readKey(TypeSerializer<K> keySerializer, DataInputDeserializer inputView, boolean ambiguousKeyPossible)
static int
readKeyGroup(int keyGroupPrefixBytes, DataInputView inputView)
static <N> N
readNamespace(TypeSerializer<N> namespaceSerializer, DataInputDeserializer inputView, boolean ambiguousKeyPossible)
static void
readVariableIntBytes(DataInputView inputView, int value)
static void
serializeKeyGroup(int keyGroup, byte[] startKeyGroupPrefixBytes)
static <K> void
writeKey(K key, TypeSerializer<K> keySerializer, DataOutputSerializer keySerializationDataOutputView, boolean ambiguousKeyPossible)
static void
writeKeyGroup(int keyGroup, int keyGroupPrefixBytes, DataOutputView keySerializationDateDataOutputView)
static <N> void
writeNameSpace(N namespace, TypeSerializer<N> namespaceSerializer, DataOutputSerializer keySerializationDataOutputView, boolean ambiguousKeyPossible)
static void
writeVariableIntBytes(int value, DataOutputView keySerializationDateDataOutputView)
-
-
-
Method Detail
-
readKeyGroup
public static int readKeyGroup(int keyGroupPrefixBytes, DataInputView inputView) throws IOException
- Throws:
IOException
-
extractKeyGroup
public static int extractKeyGroup(int keyGroupPrefixBytes, byte[] rocksDBKey)
-
readKey
public static <K> K readKey(TypeSerializer<K> keySerializer, DataInputDeserializer inputView, boolean ambiguousKeyPossible) throws IOException
- Throws:
IOException
-
readNamespace
public static <N> N readNamespace(TypeSerializer<N> namespaceSerializer, DataInputDeserializer inputView, boolean ambiguousKeyPossible) throws IOException
- Throws:
IOException
-
writeNameSpace
public static <N> void writeNameSpace(N namespace, TypeSerializer<N> namespaceSerializer, DataOutputSerializer keySerializationDataOutputView, boolean ambiguousKeyPossible) throws IOException
- Throws:
IOException
-
isSerializerTypeVariableSized
public static boolean isSerializerTypeVariableSized(@Nonnull TypeSerializer<?> serializer)
-
isAmbiguousKeyPossible
public static boolean isAmbiguousKeyPossible(TypeSerializer keySerializer, TypeSerializer namespaceSerializer)
-
writeKeyGroup
public static void writeKeyGroup(int keyGroup, int keyGroupPrefixBytes, DataOutputView keySerializationDateDataOutputView) throws IOException
- Throws:
IOException
-
writeKey
public static <K> void writeKey(K key, TypeSerializer<K> keySerializer, DataOutputSerializer keySerializationDataOutputView, boolean ambiguousKeyPossible) throws IOException
- Throws:
IOException
-
readVariableIntBytes
public static void readVariableIntBytes(DataInputView inputView, int value) throws IOException
- Throws:
IOException
-
writeVariableIntBytes
public static void writeVariableIntBytes(int value, DataOutputView keySerializationDateDataOutputView) throws IOException
- Throws:
IOException
-
serializeKeyGroup
public static void serializeKeyGroup(int keyGroup, byte[] startKeyGroupPrefixBytes)
-
computeRequiredBytesInKeyGroupPrefix
public static int computeRequiredBytesInKeyGroupPrefix(int totalKeyGroupsInJob)
-
-