Package org.apache.storm.redis.state
Class RedisKeyValueStateIterator<K,V> 
java.lang.Object
org.apache.storm.state.BaseStateIterator<K,V,byte[],byte[]>
   
org.apache.storm.state.BaseBinaryStateIterator<K,V>
 
org.apache.storm.redis.state.RedisKeyValueStateIterator<K,V> 
An iterator over 
RedisKeyValueState.- 
Constructor SummaryConstructorsConstructorDescriptionRedisKeyValueStateIterator(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.
- 
Method SummaryModifier and TypeMethodDescriptionprotected KdecodeKey(byte[] key) Decode key to convert byte array to state key type.protected VdecodeValue(byte[] value) Decode value to convert byte array to state value type.protected booleanCheck whether end of data is reached from storage state KVs.protected 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- 
RedisKeyValueStateIteratorpublic 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.- Parameters:
- namespace- The namespace of State
- container- The instance of RedisCommandsInstanceContainer
- pendingPrepareIterator- The iterator of pendingPrepare
- pendingCommitIterator- The iterator of pendingCommit
- chunkSize- The size of chunk to get entries from Redis
- keySerializer- The serializer of key
- valueSerializer- The serializer of value
 
 
- 
- 
Method Details- 
loadChunkFromStateStorageDescription copied from class:BaseBinaryStateIteratorLoad some part of state KVs from storage and returns iterator of cached data from storage.- Specified by:
- loadChunkFromStateStoragein class- BaseBinaryStateIterator<K,- V> 
- Returns:
- Iterator of loaded state KVs
 
- 
isEndOfDataFromStorageprotected boolean isEndOfDataFromStorage()Description copied from class:BaseBinaryStateIteratorCheck whether end of data is reached from storage state KVs.- Specified by:
- isEndOfDataFromStoragein class- BaseBinaryStateIterator<K,- V> 
- Returns:
- whether end of data is reached from storage state KVs
 
- 
decodeKeyDescription copied from class:BaseBinaryStateIteratorDecode key to convert byte array to state key type.- Specified by:
- decodeKeyin class- BaseBinaryStateIterator<K,- V> 
- Parameters:
- key- byte array encoded key
- Returns:
- Decoded value of key
 
- 
decodeValueDescription copied from class:BaseBinaryStateIteratorDecode value to convert byte array to state value type.- Specified by:
- decodeValuein class- BaseBinaryStateIterator<K,- V> 
- Parameters:
- value- byte array encoded value
- Returns:
- Decoded value of value
 
- 
isTombstoneValueprotected boolean isTombstoneValue(byte[] value) Description copied from class:BaseBinaryStateIteratorCheck whether the value is tombstone (deletion mark) value.- Specified by:
- isTombstoneValuein class- BaseBinaryStateIterator<K,- V> 
- Parameters:
- value- the value to check
- Returns:
- true if the value is tombstone, false otherwise
 
 
-