public abstract class BaseStateIterator<K,V,KENCODEDT,VENCODEDT> extends Object implements Iterator<Map.Entry<K,V>>
Base implementation of iterator over 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)
Constructor.
pendingPrepareIterator
- The iterator of pendingPreparependingCommitIterator
- The iterator of pendingCommitinitialProvidedKeys
- The initial value of provided keysprotected abstract Iterator<Map.Entry<KENCODEDT,VENCODEDT>> loadChunkFromStateStorage()
Load some part of state KVs from storage and returns iterator of cached data from storage.
protected abstract boolean isEndOfDataFromStorage()
Check whether end of data is reached from storage state KVs.
protected abstract K decodeKey(KENCODEDT key)
Decode key to convert encoded type of key to state key type.
key
- raw type of encoded keyprotected abstract V decodeValue(VENCODEDT value)
Decode value to convert encoded type of value to state value type.
value
- raw type of encoded valueprotected abstract boolean isTombstoneValue(VENCODEDT value)
Check whether the value is tombstone (deletion mark) value.
value
- the value to checkCopyright © 2020 The Apache Software Foundation. All rights reserved.