@Internal @NotThreadSafe public final class HeapKeyValueStateIterator extends Object implements KeyValueStateIterator
KeyValueStateIterator over Heap backend snapshot
resources.| 构造器和说明 |
|---|
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) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 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 在接口中 KeyValueStateIteratorpublic boolean isNewKeyValueState()
KeyValueStateIteratorisNewKeyValueState 在接口中 KeyValueStateIteratorpublic boolean isNewKeyGroup()
KeyValueStateIteratorisNewKeyGroup 在接口中 KeyValueStateIteratorpublic int keyGroup()
KeyValueStateIteratorkeyGroup 在接口中 KeyValueStateIteratorpublic int kvStateId()
KeyValueStateIteratorkvStateId 在接口中 KeyValueStateIteratorpublic void next()
throws IOException
KeyValueStateIteratorKeyValueStateIterator.isValid() returned true. Valid flag
can only change after calling KeyValueStateIterator.next().next 在接口中 KeyValueStateIteratorIOExceptionpublic byte[] key()
key 在接口中 KeyValueStateIteratorpublic byte[] value()
value 在接口中 KeyValueStateIteratorpublic void close()
close 在接口中 AutoCloseableclose 在接口中 KeyValueStateIteratorCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.