K
- The data type of the key.@Internal public class FullSnapshotRestoreOperation<K> extends Object implements RestoreOperation<ThrowingIterator<SavepointRestoreResult>>
The format was adopted from the RocksDB state backend. It is as follows:
+-------------------------------------------------------------+ | Keyed Backend Meta Information | Meta Information +--------------------+-----+----------------------------------+ | State Meta 0 | ... | State Meta M | +-------------------------------------------------------------+ | State ID (short) | State 0 +--------------------+-----+----------------------------------+ | State (K,V) pair 0 | ... | State (K,V) pair X (flipped MSB) | +--------------------+-----+----------------------------------+ | State ID (short) | State 1 +--------------------+-----+----------------------------------+ | State (K,V) pair 0 | ... | State (K,V) pair X (flipped MSB) | +--------------------+-----+----------------------------------+ | State ID (short) | +--------------------+-----+----------------------------------+ State M | State (K,V) pair 0 | ... | State (K,V) pair X (flipped MSB) | +--------------------+-----+----------------------------------+ | END_OF_KEY_GROUP_MARK (0xFFFF) | +-------------------------------------------------------------+
Additionally the format of the (K,V) pairs differs slightly depending on the type of the state object:
+------------------+-------------------------------------+ | ValueState | [CompositeKey(KG, K, NS), SV] | |------------------+-------------------------------------+ | ListState | [CompositeKey(KG, K, NS), SV] | +------------------+-------------------------------------+ | MapState | [CompositeKey(KG, K, NS) :: UK, UV] | +------------------+-------------------------------------+ | AggregatingState | [CompositeKey(KG, K, NS), SV] | +------------------+-------------------------------------+ | ReducingState | [CompositeKey(KG, K, NS), SV] | | +-------------------------------------+ | | [CompositeKey(KG, K, NS), SV] | +------------------+-------------------------------------+ | Timers | [KG :: TS :: K :: NS, (empty)] | +------------------+-------------------------------------+
For detailed information see FLIP-41: https://cwiki.apache.org/confluence/x/VJDiBg
Constructor and Description |
---|
FullSnapshotRestoreOperation(KeyGroupRange keyGroupRange,
ClassLoader userCodeClassLoader,
Collection<KeyedStateHandle> restoreStateHandles,
StateSerializerProvider<K> keySerializerProvider) |
Modifier and Type | Method and Description |
---|---|
ThrowingIterator<SavepointRestoreResult> |
restore()
Restores state that was previously snapshot-ed from the provided state handles.
|
public FullSnapshotRestoreOperation(KeyGroupRange keyGroupRange, ClassLoader userCodeClassLoader, Collection<KeyedStateHandle> restoreStateHandles, StateSerializerProvider<K> keySerializerProvider)
public ThrowingIterator<SavepointRestoreResult> restore() throws IOException, StateMigrationException
RestoreOperation
restore
in interface RestoreOperation<ThrowingIterator<SavepointRestoreResult>>
IOException
StateMigrationException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.