Package org.apache.flink.state.forst
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 Summary
Constructors Constructor Description ContextKey(RecordContext<K> recordContext, N namespace)
ContextKey(RecordContext<K> recordContext, N namespace, Object userKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
getKeyGroup()
N
getNamespace()
byte[]
getOrCreateSerializedKey(FunctionWithException<ContextKey<K,N>,byte[],IOException> serializeKeyFunc)
Get the serialized key.K
getRawKey()
Object
getUserKey()
int
hashCode()
void
resetExtra()
void
setUserKey(Object userKey)
String
toString()
-
-
-
Constructor Detail
-
ContextKey
public ContextKey(RecordContext<K> recordContext, @Nullable N namespace)
-
ContextKey
public ContextKey(RecordContext<K> recordContext, @Nullable N namespace, Object userKey)
-
-
Method Detail
-
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(FunctionWithException<ContextKey<K,N>,byte[],IOException> serializeKeyFunc) throws IOException
Get the serialized key. If the cached serialized key withinRecordContext#payload
is null, the provided serialization function will be called, and the serialization result will be cached byRecordContext#payload
.- Parameters:
serializeKeyFunc
- the provided serialization function for this contextKey.- Returns:
- the serialized bytes.
- Throws:
IOException
-
-