public abstract class BaseBinaryStateIterator<K,V> extends BaseStateIterator<K,V,byte[],byte[]>
Base implementation of iterator over KeyValueState
which encoded types of key and value are both binary type.
Constructor and Description |
---|
BaseBinaryStateIterator(Iterator<Map.Entry<byte[],byte[]>> pendingPrepareIterator,
Iterator<Map.Entry<byte[],byte[]>> pendingCommitIterator)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract K |
decodeKey(byte[] key)
Decode key to convert byte array to state key type.
|
protected abstract V |
decodeValue(byte[] value)
Decode value to convert byte array to state value type.
|
protected abstract boolean |
isEndOfDataFromStorage()
Check whether end of data is reached from storage state KVs.
|
protected abstract boolean |
isTombstoneValue(byte[] value)
Check whether the value is tombstone (deletion mark) value.
|
protected abstract 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 BaseBinaryStateIterator(Iterator<Map.Entry<byte[],byte[]>> pendingPrepareIterator, Iterator<Map.Entry<byte[],byte[]>> pendingCommitIterator)
Constructor.
pendingPrepareIterator
- The iterator of pendingPreparependingCommitIterator
- The iterator of pendingCommitprotected abstract Iterator<Map.Entry<byte[],byte[]>> loadChunkFromStateStorage()
Load some part of state KVs from storage and returns iterator of cached data from storage.
loadChunkFromStateStorage
in class BaseStateIterator<K,V,byte[],byte[]>
protected abstract boolean isEndOfDataFromStorage()
Check whether end of data is reached from storage state KVs.
isEndOfDataFromStorage
in class BaseStateIterator<K,V,byte[],byte[]>
protected abstract K decodeKey(byte[] key)
Decode key to convert byte array to state key type.
decodeKey
in class BaseStateIterator<K,V,byte[],byte[]>
key
- byte array encoded keyprotected abstract V decodeValue(byte[] value)
Decode value to convert byte array to state value type.
decodeValue
in class BaseStateIterator<K,V,byte[],byte[]>
value
- byte array encoded valueprotected abstract boolean isTombstoneValue(byte[] value)
Check whether the value is tombstone (deletion mark) value.
isTombstoneValue
in class BaseStateIterator<K,V,byte[],byte[]>
value
- the value to checkCopyright © 2022 The Apache Software Foundation. All rights reserved.