public class RocksStatesPerKeyGroupMergeIterator extends Object implements KeyValueStateIterator
Constructor and Description |
---|
RocksStatesPerKeyGroupMergeIterator(CloseableRegistry closeableRegistry,
List<Tuple2<RocksIteratorWrapper,Integer>> kvStateIterators,
List<SingleStateIterator> heapPriorityQueueIterators,
int keyGroupPrefixByteCount)
Creates a new
RocksStatesPerKeyGroupMergeIterator . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isNewKeyGroup()
Indicates if current key starts a new key-group, i.e. belong to a different key-group than
it's predecessor.
|
boolean |
isNewKeyValueState()
Indicates if current key starts a new k/v-state, i.e. belong to a different k/v-state than
it's predecessor.
|
boolean |
isValid()
Check if the iterator is still valid.
|
byte[] |
key() |
int |
keyGroup()
Returns the key-group for the current key.
|
int |
kvStateId()
Returns the Id of the K/V state to which the current key belongs.
|
void |
next()
Advances the iterator.
|
byte[] |
value() |
public RocksStatesPerKeyGroupMergeIterator(CloseableRegistry closeableRegistry, List<Tuple2<RocksIteratorWrapper,Integer>> kvStateIterators, List<SingleStateIterator> heapPriorityQueueIterators, int keyGroupPrefixByteCount) throws IOException
RocksStatesPerKeyGroupMergeIterator
. The iterator takes ownership of
passed in resources, such as the ReadOptions
, and becomes responsible for closing
them.IOException
public void next()
KeyValueStateIterator
KeyValueStateIterator.isValid()
returned true. Valid flag
can only change after calling KeyValueStateIterator.next()
.next
in interface KeyValueStateIterator
public int keyGroup()
KeyValueStateIterator
keyGroup
in interface KeyValueStateIterator
public byte[] key()
key
in interface KeyValueStateIterator
public byte[] value()
value
in interface KeyValueStateIterator
public int kvStateId()
KeyValueStateIterator
kvStateId
in interface KeyValueStateIterator
public boolean isNewKeyValueState()
KeyValueStateIterator
isNewKeyValueState
in interface KeyValueStateIterator
public boolean isNewKeyGroup()
KeyValueStateIterator
isNewKeyGroup
in interface KeyValueStateIterator
public boolean isValid()
KeyValueStateIterator
KeyValueStateIterator.key()
, KeyValueStateIterator.value()
, etc. as
well as KeyValueStateIterator.next()
should only be called if valid returned true. Should be checked after
each call to KeyValueStateIterator.next()
before accessing iterator state.isValid
in interface KeyValueStateIterator
public void close()
close
in interface AutoCloseable
close
in interface KeyValueStateIterator
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.