Search in sources :

Example 16 with JobManagerTaskRestore

use of org.apache.flink.runtime.checkpoint.JobManagerTaskRestore in project flink by apache.

the class StatefulOperatorChainedTaskTest method testMultipleStatefulOperatorChainedSnapshotAndRestore.

@Test
public void testMultipleStatefulOperatorChainedSnapshotAndRestore() throws Exception {
    OperatorID headOperatorID = new OperatorID(42L, 42L);
    OperatorID tailOperatorID = new OperatorID(44L, 44L);
    JobManagerTaskRestore restore = createRunAndCheckpointOperatorChain(headOperatorID, new CounterOperator("head"), tailOperatorID, new CounterOperator("tail"), Optional.empty());
    TaskStateSnapshot stateHandles = restore.getTaskStateSnapshot();
    assertEquals(2, stateHandles.getSubtaskStateMappings().size());
    createRunAndCheckpointOperatorChain(headOperatorID, new CounterOperator("head"), tailOperatorID, new CounterOperator("tail"), Optional.of(restore));
    assertEquals(new HashSet<>(Arrays.asList(headOperatorID, tailOperatorID)), RESTORED_OPERATORS);
}
Also used : TaskStateSnapshot(org.apache.flink.runtime.checkpoint.TaskStateSnapshot) JobManagerTaskRestore(org.apache.flink.runtime.checkpoint.JobManagerTaskRestore) OperatorID(org.apache.flink.runtime.jobgraph.OperatorID) Test(org.junit.Test)

Aggregations

JobManagerTaskRestore (org.apache.flink.runtime.checkpoint.JobManagerTaskRestore)16 TaskStateSnapshot (org.apache.flink.runtime.checkpoint.TaskStateSnapshot)13 OperatorID (org.apache.flink.runtime.jobgraph.OperatorID)10 Test (org.junit.Test)10 JobID (org.apache.flink.api.common.JobID)7 ExecutionAttemptID (org.apache.flink.runtime.executiongraph.ExecutionAttemptID)6 OperatorSubtaskState (org.apache.flink.runtime.checkpoint.OperatorSubtaskState)5 StateObjectCollection (org.apache.flink.runtime.checkpoint.StateObjectCollection)3 KeyGroupRange (org.apache.flink.runtime.state.KeyGroupRange)3 KeyedStateHandle (org.apache.flink.runtime.state.KeyedStateHandle)3 OperatorStateHandle (org.apache.flink.runtime.state.OperatorStateHandle)3 OperatorStreamStateHandle (org.apache.flink.runtime.state.OperatorStreamStateHandle)3 TestTaskStateManager (org.apache.flink.runtime.state.TestTaskStateManager)3 CheckpointResponder (org.apache.flink.runtime.taskmanager.CheckpointResponder)3 IOException (java.io.IOException)2 HashMap (java.util.HashMap)2 Configuration (org.apache.flink.configuration.Configuration)2 CloseableRegistry (org.apache.flink.core.fs.CloseableRegistry)2 UnregisteredMetricsGroup (org.apache.flink.metrics.groups.UnregisteredMetricsGroup)2 JobInformation (org.apache.flink.runtime.executiongraph.JobInformation)2