public abstract class BaseStateIterator<K,V,KENCODEDT,VENCODEDT> extends Object implements Iterator<Map.Entry<K,V>>
KeyValueState
. Encoded/Decoded types of key and value are all generic.Constructor and Description |
---|
BaseStateIterator(Iterator<Map.Entry<KENCODEDT,VENCODEDT>> pendingPrepareIterator,
Iterator<Map.Entry<KENCODEDT,VENCODEDT>> pendingCommitIterator,
Set<KENCODEDT> initialProvidedKeys)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract K |
decodeKey(KENCODEDT key)
Decode key to convert encoded type of key to state key type.
|
protected abstract V |
decodeValue(VENCODEDT value)
Decode value to convert encoded type of value to state value type.
|
boolean |
hasNext() |
protected abstract boolean |
isEndOfDataFromStorage()
Check whether end of data is reached from storage state KVs.
|
protected abstract boolean |
isTombstoneValue(VENCODEDT value)
Check whether the value is tombstone (deletion mark) value.
|
protected abstract Iterator<Map.Entry<KENCODEDT,VENCODEDT>> |
loadChunkFromStateStorage()
Load some part of state KVs from storage and returns iterator of cached data from storage.
|
Map.Entry<K,V> |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public BaseStateIterator(Iterator<Map.Entry<KENCODEDT,VENCODEDT>> pendingPrepareIterator, Iterator<Map.Entry<KENCODEDT,VENCODEDT>> pendingCommitIterator, Set<KENCODEDT> initialProvidedKeys)
pendingPrepareIterator
- The iterator of pendingPreparependingCommitIterator
- The iterator of pendingCommitinitialProvidedKeys
- The initial value of provided keysprotected abstract Iterator<Map.Entry<KENCODEDT,VENCODEDT>> loadChunkFromStateStorage()
protected abstract boolean isEndOfDataFromStorage()
protected abstract K decodeKey(KENCODEDT key)
key
- raw type of encoded keyprotected abstract V decodeValue(VENCODEDT value)
value
- raw type of encoded valueprotected abstract boolean isTombstoneValue(VENCODEDT value)
value
- the value to checkCopyright © 2023 The Apache Software Foundation. All rights reserved.