@Internal @NotThreadSafe public final class HeapKeyValueStateIterator extends Object implements KeyValueStateIterator
KeyValueStateIterator over Heap backend snapshot
resources.| Constructor and Description |
|---|
HeapKeyValueStateIterator(KeyGroupRange keyGroupRange,
org.apache.flink.api.common.typeutils.TypeSerializer<?> keySerializer,
int totalKeyGroups,
Map<org.apache.flink.runtime.state.heap.StateUID,Integer> stateNamesToId,
Map<org.apache.flink.runtime.state.heap.StateUID,StateSnapshot> stateSnapshots) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
isNewKeyGroup()
Indicates if current key starts a new key-group, i.e.
|
boolean |
isNewKeyValueState()
Indicates if current key starts a new k/v-state, i.e.
|
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 HeapKeyValueStateIterator(@Nonnull KeyGroupRange keyGroupRange, @Nonnull org.apache.flink.api.common.typeutils.TypeSerializer<?> keySerializer, @Nonnegative int totalKeyGroups, @Nonnull Map<org.apache.flink.runtime.state.heap.StateUID,Integer> stateNamesToId, @Nonnull Map<org.apache.flink.runtime.state.heap.StateUID,StateSnapshot> stateSnapshots) throws IOException
IOExceptionpublic boolean isValid()
KeyValueStateIteratorKeyValueStateIterator.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 KeyValueStateIteratorpublic boolean isNewKeyValueState()
KeyValueStateIteratorisNewKeyValueState in interface KeyValueStateIteratorpublic boolean isNewKeyGroup()
KeyValueStateIteratorisNewKeyGroup in interface KeyValueStateIteratorpublic int keyGroup()
KeyValueStateIteratorkeyGroup in interface KeyValueStateIteratorpublic int kvStateId()
KeyValueStateIteratorkvStateId in interface KeyValueStateIteratorpublic void next()
throws IOException
KeyValueStateIteratorKeyValueStateIterator.isValid() returned true. Valid flag
can only change after calling KeyValueStateIterator.next().next in interface KeyValueStateIteratorIOExceptionpublic byte[] key()
key in interface KeyValueStateIteratorpublic byte[] value()
value in interface KeyValueStateIteratorpublic void close()
close in interface AutoCloseableclose in interface KeyValueStateIteratorCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.