public class DefaultStateEncoder<K,V> extends Object implements StateEncoder<K,V,byte[],byte[]>
| Modifier and Type | Field and Description |
|---|---|
static Serializer<Optional<byte[]>> |
INTERNAL_VALUE_SERIALIZER |
static byte[] |
TOMBSTONE |
| Constructor and Description |
|---|
DefaultStateEncoder(Serializer<K> keySerializer,
Serializer<V> valueSerializer) |
| Modifier and Type | Method and Description |
|---|---|
K |
decodeKey(byte[] encodedKey)
Decode key.
|
V |
decodeValue(byte[] encodedValue)
Decode value.
|
byte[] |
encodeKey(K key)
Encode key.
|
byte[] |
encodeValue(V value)
Encode value.
|
Serializer<K> |
getKeySerializer() |
byte[] |
getTombstoneValue()
Get the tombstone value (deletion mark).
|
Serializer<V> |
getValueSerializer() |
public static final Serializer<Optional<byte[]>> INTERNAL_VALUE_SERIALIZER
public static final byte[] TOMBSTONE
public DefaultStateEncoder(Serializer<K> keySerializer, Serializer<V> valueSerializer)
public Serializer<K> getKeySerializer()
public Serializer<V> getValueSerializer()
public byte[] encodeKey(K key)
StateEncoderencodeKey in interface StateEncoder<K,V,byte[],byte[]>key - the value of key (K type)public byte[] encodeValue(V value)
StateEncoderencodeValue in interface StateEncoder<K,V,byte[],byte[]>value - the value of value (V type)public K decodeKey(byte[] encodedKey)
StateEncoderdecodeKey in interface StateEncoder<K,V,byte[],byte[]>encodedKey - the value of key (KRAW type)public V decodeValue(byte[] encodedValue)
StateEncoderdecodeValue in interface StateEncoder<K,V,byte[],byte[]>encodedValue - the value of key (VENCODEDT type)public byte[] getTombstoneValue()
StateEncodergetTombstoneValue in interface StateEncoder<K,V,byte[],byte[]>Copyright © 2023 The Apache Software Foundation. All rights reserved.