public class RedisKeyValueStateIterator<K,V> extends BaseBinaryStateIterator<K,V>
An iterator over 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)
Constructor.
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
Load some part of state KVs from storage and returns iterator of cached data from storage.
loadChunkFromStateStorage
in class BaseBinaryStateIterator<K,V>
protected boolean isEndOfDataFromStorage()
BaseBinaryStateIterator
Check whether end of data is reached from storage state KVs.
isEndOfDataFromStorage
in class BaseBinaryStateIterator<K,V>
protected K decodeKey(byte[] key)
BaseBinaryStateIterator
Decode key to convert byte array to state key type.
decodeKey
in class BaseBinaryStateIterator<K,V>
key
- byte array encoded keyprotected V decodeValue(byte[] value)
BaseBinaryStateIterator
Decode value to convert byte array to state value type.
decodeValue
in class BaseBinaryStateIterator<K,V>
value
- byte array encoded valueprotected boolean isTombstoneValue(byte[] value)
BaseBinaryStateIterator
Check whether the value is tombstone (deletion mark) value.
isTombstoneValue
in class BaseBinaryStateIterator<K,V>
value
- the value to checkCopyright © 2022 The Apache Software Foundation. All Rights Reserved.