K - type of the key.@NotThreadSafe @Internal public final class SerializedCompositeKeyBuilder<K> extends Object
| 构造器和说明 |
|---|
SerializedCompositeKeyBuilder(org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer,
int keyGroupPrefixBytes,
int initialSize) |
| 限定符和类型 | 方法和说明 |
|---|---|
byte[] |
build()
Returns a serialized composite key, from whatever was set so far.
|
<N> byte[] |
buildCompositeKeyNamespace(N namespace,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer)
Returns a serialized composite key, from the key and key-group provided in a previous call to
setKeyAndKeyGroup(Object, int) and the given namespace. |
<N,UK> byte[] |
buildCompositeKeyNamesSpaceUserKey(N namespace,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
UK userKey,
org.apache.flink.api.common.typeutils.TypeSerializer<UK> userKeySerializer)
Returns a serialized composite key, from the key and key-group provided in a previous call to
setKeyAndKeyGroup(Object, int) and the given namespace, followed by the given
user-key. |
<UK> byte[] |
buildCompositeKeyUserKey(UK userKey,
org.apache.flink.api.common.typeutils.TypeSerializer<UK> userKeySerializer)
Returns a serialized composite key, from the key and key-group provided in a previous call to
setKeyAndKeyGroup(Object, int) and the namespace provided in setNamespace(Object, TypeSerializer), followed by the given user-key. |
void |
setKeyAndKeyGroup(K key,
int keyGroupId)
Sets the key and key-group as prefix.
|
<N> void |
setNamespace(N namespace,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer) |
public SerializedCompositeKeyBuilder(@Nonnull org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, @Nonnegative int keyGroupPrefixBytes, @Nonnegative int initialSize)
public void setKeyAndKeyGroup(@Nonnull K key, @Nonnegative int keyGroupId)
key - the key.keyGroupId - the key-group id for the key.public <N> void setNamespace(@Nonnull N namespace, @Nonnull org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer)
@Nonnull public <N> byte[] buildCompositeKeyNamespace(@Nonnull N namespace, @Nonnull org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer)
setKeyAndKeyGroup(Object, int) and the given namespace.N - the type of the namespace.namespace - the namespace to concatenate for the serialized composite key bytes.namespaceSerializer - the serializer to obtain the serialized form of the namespace.@Nonnull public <N,UK> byte[] buildCompositeKeyNamesSpaceUserKey(@Nonnull N namespace, @Nonnull org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer, @Nonnull UK userKey, @Nonnull org.apache.flink.api.common.typeutils.TypeSerializer<UK> userKeySerializer) throws IOException
setKeyAndKeyGroup(Object, int) and the given namespace, followed by the given
user-key.N - the type of the namespace.UK - the type of the user-key.namespace - the namespace to concatenate for the serialized composite key bytes.namespaceSerializer - the serializer to obtain the serialized form of the namespace.userKey - the user-key to concatenate for the serialized composite key, after the
namespace.userKeySerializer - the serializer to obtain the serialized form of the user-key.IOException@Nonnull public <UK> byte[] buildCompositeKeyUserKey(@Nonnull UK userKey, @Nonnull org.apache.flink.api.common.typeutils.TypeSerializer<UK> userKeySerializer) throws IOException
setKeyAndKeyGroup(Object, int) and the namespace provided in setNamespace(Object, TypeSerializer), followed by the given user-key.UK - the type of the user-key.userKey - the user-key to concatenate for the serialized composite key, after the
namespace.userKeySerializer - the serializer to obtain the serialized form of the user-key.IOException@Nonnull public byte[] build() throws IOException
IOExceptionCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.