Search in sources :

Example 1 with SavepointRestoreResult

use of org.apache.flink.runtime.state.restore.SavepointRestoreResult in project flink by apache.

the class HeapSavepointRestoreOperation method restore.

@Override
public Void restore() throws Exception {
    registeredKVStates.clear();
    registeredPQStates.clear();
    try (ThrowingIterator<SavepointRestoreResult> restore = this.savepointRestoreOperation.restore()) {
        while (restore.hasNext()) {
            SavepointRestoreResult restoreResult = restore.next();
            List<StateMetaInfoSnapshot> restoredMetaInfos = restoreResult.getStateMetaInfoSnapshots();
            final Map<Integer, StateMetaInfoSnapshot> kvStatesById = this.heapMetaInfoRestoreOperation.createOrCheckStateForMetaInfo(restoredMetaInfos, registeredKVStates, registeredPQStates);
            try (ThrowingIterator<KeyGroup> keyGroups = restoreResult.getRestoredKeyGroups()) {
                while (keyGroups.hasNext()) {
                    readKeyGroupStateData(keyGroups.next(), keySerializerProvider.previousSchemaSerializer(), kvStatesById);
                }
            }
        }
    }
    return null;
}
Also used : CompositeKeySerializationUtils.readKeyGroup(org.apache.flink.runtime.state.CompositeKeySerializationUtils.readKeyGroup) KeyGroup(org.apache.flink.runtime.state.restore.KeyGroup) StateMetaInfoSnapshot(org.apache.flink.runtime.state.metainfo.StateMetaInfoSnapshot) SavepointRestoreResult(org.apache.flink.runtime.state.restore.SavepointRestoreResult)

Aggregations

CompositeKeySerializationUtils.readKeyGroup (org.apache.flink.runtime.state.CompositeKeySerializationUtils.readKeyGroup)1 StateMetaInfoSnapshot (org.apache.flink.runtime.state.metainfo.StateMetaInfoSnapshot)1 KeyGroup (org.apache.flink.runtime.state.restore.KeyGroup)1 SavepointRestoreResult (org.apache.flink.runtime.state.restore.SavepointRestoreResult)1