Search in sources :

Example 1 with IncrementalLocalKeyedStateHandle

use of org.apache.flink.runtime.state.IncrementalLocalKeyedStateHandle in project flink by apache.

the class RocksDBIncrementalRestoreOperation method restoreWithoutRescaling.

/**
 * Recovery from a single remote incremental state without rescaling.
 */
@SuppressWarnings("unchecked")
private void restoreWithoutRescaling(KeyedStateHandle keyedStateHandle) throws Exception {
    logger.info("Starting to restore from state handle: {} without rescaling.", keyedStateHandle);
    if (keyedStateHandle instanceof IncrementalRemoteKeyedStateHandle) {
        IncrementalRemoteKeyedStateHandle incrementalRemoteKeyedStateHandle = (IncrementalRemoteKeyedStateHandle) keyedStateHandle;
        restorePreviousIncrementalFilesStatus(incrementalRemoteKeyedStateHandle);
        restoreFromRemoteState(incrementalRemoteKeyedStateHandle);
    } else if (keyedStateHandle instanceof IncrementalLocalKeyedStateHandle) {
        IncrementalLocalKeyedStateHandle incrementalLocalKeyedStateHandle = (IncrementalLocalKeyedStateHandle) keyedStateHandle;
        restorePreviousIncrementalFilesStatus(incrementalLocalKeyedStateHandle);
        restoreFromLocalState(incrementalLocalKeyedStateHandle);
    } else {
        throw unexpectedStateHandleException(new Class[] { IncrementalRemoteKeyedStateHandle.class, IncrementalLocalKeyedStateHandle.class }, keyedStateHandle.getClass());
    }
    logger.info("Finished restoring from state handle: {} without rescaling.", keyedStateHandle);
}
Also used : IncrementalLocalKeyedStateHandle(org.apache.flink.runtime.state.IncrementalLocalKeyedStateHandle) IncrementalRemoteKeyedStateHandle(org.apache.flink.runtime.state.IncrementalRemoteKeyedStateHandle)

Aggregations

IncrementalLocalKeyedStateHandle (org.apache.flink.runtime.state.IncrementalLocalKeyedStateHandle)1 IncrementalRemoteKeyedStateHandle (org.apache.flink.runtime.state.IncrementalRemoteKeyedStateHandle)1