public class RedisKeyValueStateIterator<K,V> extends BaseBinaryStateIterator<K,V>
RedisKeyValueState
.Constructor and Description |
---|
RedisKeyValueStateIterator(byte[] namespace,
RedisCommandsInstanceContainer container,
Iterator<Map.Entry<byte[],byte[]>> pendingPrepareIterator,
Iterator<Map.Entry<byte[],byte[]>> pendingCommitIterator,
int chunkSize,
Serializer<K> keySerializer,
Serializer<V> valueSerializer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected K |
decodeKey(byte[] key)
Decode key to convert byte array to state key type.
|
protected V |
decodeValue(byte[] value)
Decode value to convert byte array to state value type.
|
protected boolean |
isEndOfDataFromStorage()
Check whether end of data is reached from storage state KVs.
|
protected boolean |
isTombstoneValue(byte[] value)
Check whether the value is tombstone (deletion mark) value.
|
protected Iterator<Map.Entry<byte[],byte[]>> |
loadChunkFromStateStorage()
Load some part of state KVs from storage and returns iterator of cached data from storage.
|
hasNext, next, remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public RedisKeyValueStateIterator(byte[] namespace, RedisCommandsInstanceContainer container, Iterator<Map.Entry<byte[],byte[]>> pendingPrepareIterator, Iterator<Map.Entry<byte[],byte[]>> pendingCommitIterator, int chunkSize, Serializer<K> keySerializer, Serializer<V> valueSerializer)
namespace
- The namespace of Statecontainer
- The instance of RedisCommandsInstanceContainerpendingPrepareIterator
- The iterator of pendingPreparependingCommitIterator
- The iterator of pendingCommitchunkSize
- The size of chunk to get entries from RediskeySerializer
- The serializer of keyvalueSerializer
- The serializer of valueprotected Iterator<Map.Entry<byte[],byte[]>> loadChunkFromStateStorage()
BaseBinaryStateIterator
loadChunkFromStateStorage
in class BaseBinaryStateIterator<K,V>
protected boolean isEndOfDataFromStorage()
BaseBinaryStateIterator
isEndOfDataFromStorage
in class BaseBinaryStateIterator<K,V>
protected K decodeKey(byte[] key)
BaseBinaryStateIterator
decodeKey
in class BaseBinaryStateIterator<K,V>
key
- byte array encoded keyprotected V decodeValue(byte[] value)
BaseBinaryStateIterator
decodeValue
in class BaseBinaryStateIterator<K,V>
value
- byte array encoded valueprotected boolean isTombstoneValue(byte[] value)
BaseBinaryStateIterator
isTombstoneValue
in class BaseBinaryStateIterator<K,V>
value
- the value to checkCopyright © 2023 The Apache Software Foundation. All rights reserved.