Package org.apache.storm.state
Class BaseBinaryStateIterator<K,V> 
java.lang.Object
org.apache.storm.state.BaseStateIterator<K,V,byte[],byte[]>
   
org.apache.storm.state.BaseBinaryStateIterator<K,V> 
- Direct Known Subclasses:
- RedisKeyValueStateIterator
Base implementation of iterator over 
KeyValueState which encoded types of key and value are both binary type.- 
Constructor SummaryConstructorsConstructorDescriptionBaseBinaryStateIterator(Iterator<Map.Entry<byte[], byte[]>> pendingPrepareIterator, Iterator<Map.Entry<byte[], byte[]>> pendingCommitIterator) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract KdecodeKey(byte[] key) Decode key to convert byte array to state key type.protected abstract VdecodeValue(byte[] value) Decode value to convert byte array to state value type.protected abstract booleanCheck whether end of data is reached from storage state KVs.protected abstract booleanisTombstoneValue(byte[] value) Check whether the value is tombstone (deletion mark) value.Load some part of state KVs from storage and returns iterator of cached data from storage.Methods inherited from class org.apache.storm.state.BaseStateIteratorhasNext, next, removeMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.IteratorforEachRemaining
- 
Constructor Details- 
BaseBinaryStateIteratorpublic BaseBinaryStateIterator(Iterator<Map.Entry<byte[], byte[]>> pendingPrepareIterator, Iterator<Map.Entry<byte[], byte[]>> pendingCommitIterator) Constructor.- Parameters:
- pendingPrepareIterator- The iterator of pendingPrepare
- pendingCommitIterator- The iterator of pendingCommit
 
 
- 
- 
Method Details- 
loadChunkFromStateStorageLoad some part of state KVs from storage and returns iterator of cached data from storage.- Specified by:
- loadChunkFromStateStoragein class- BaseStateIterator<K,- V, - byte[], - byte[]> 
- Returns:
- Iterator of loaded state KVs
 
- 
isEndOfDataFromStorageprotected abstract boolean isEndOfDataFromStorage()Check whether end of data is reached from storage state KVs.- Specified by:
- isEndOfDataFromStoragein class- BaseStateIterator<K,- V, - byte[], - byte[]> 
- Returns:
- whether end of data is reached from storage state KVs
 
- 
decodeKeyDecode key to convert byte array to state key type.- Specified by:
- decodeKeyin class- BaseStateIterator<K,- V, - byte[], - byte[]> 
- Parameters:
- key- byte array encoded key
- Returns:
- Decoded value of key
 
- 
decodeValueDecode value to convert byte array to state value type.- Specified by:
- decodeValuein class- BaseStateIterator<K,- V, - byte[], - byte[]> 
- Parameters:
- value- byte array encoded value
- Returns:
- Decoded value of value
 
- 
isTombstoneValueprotected abstract boolean isTombstoneValue(byte[] value) Check whether the value is tombstone (deletion mark) value.- Specified by:
- isTombstoneValuein class- BaseStateIterator<K,- V, - byte[], - byte[]> 
- Parameters:
- value- the value to check
- Returns:
- true if the value is tombstone, false otherwise
 
 
-