public interface KeyValueStateIterator extends AutoCloseable
KeyedStateBackend. For use during
snapshotting.
This is required to partition all states into contiguous key-groups. The resulting iteration sequence is ordered by (key-group, kv-state).
| 限定符和类型 | 方法和说明 |
|---|---|
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() |
void next() throws IOException
isValid() returned true. Valid flag
can only change after calling next().IOExceptionint keyGroup()
byte[] key()
byte[] value()
int kvStateId()
boolean isNewKeyValueState()
boolean isNewKeyGroup()
boolean isValid()
key(), value(), etc. as
well as next() should only be called if valid returned true. Should be checked after
each call to next() before accessing iterator state.void close()
close 在接口中 AutoCloseableCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.