use of org.apache.flink.runtime.checkpoint.CheckpointOptions in project flink by apache.
the class CheckpointSerializationTest method testSuspendingCheckpointBarrierSerialization.
@Test
public void testSuspendingCheckpointBarrierSerialization() throws Exception {
CheckpointOptions suspendSavepointToSerialize = new CheckpointOptions(SavepointType.suspend(SavepointFormatType.CANONICAL), new CheckpointStorageLocationReference(STORAGE_LOCATION_REF));
testCheckpointBarrierSerialization(suspendSavepointToSerialize);
}
use of org.apache.flink.runtime.checkpoint.CheckpointOptions in project flink by apache.
the class CheckpointSerializationTest method testSavepointBarrierSerialization.
@Test
public void testSavepointBarrierSerialization() throws Exception {
CheckpointOptions savepointToSerialize = new CheckpointOptions(SavepointType.savepoint(SavepointFormatType.CANONICAL), new CheckpointStorageLocationReference(STORAGE_LOCATION_REF));
testCheckpointBarrierSerialization(savepointToSerialize);
}
use of org.apache.flink.runtime.checkpoint.CheckpointOptions in project flink by apache.
the class StateSnapshotTransformerTest method testNonConcurrentSnapshotTransformerAccess.
void testNonConcurrentSnapshotTransformerAccess() throws Exception {
List<TestState> testStates = Arrays.asList(new TestValueState(), new TestListState(), new TestMapState());
for (TestState state : testStates) {
for (int i = 0; i < 100; i++) {
backend.setCurrentKey(i);
state.setToRandomValue();
}
CheckpointOptions checkpointOptions = CheckpointOptions.forCheckpointWithDefaultLocation();
RunnableFuture<SnapshotResult<KeyedStateHandle>> snapshot1 = backend.snapshot(1L, 0L, streamFactory, checkpointOptions);
RunnableFuture<SnapshotResult<KeyedStateHandle>> snapshot2 = backend.snapshot(2L, 0L, streamFactory, checkpointOptions);
Thread runner1 = new Thread(snapshot1, "snapshot1");
runner1.start();
Thread runner2 = new Thread(snapshot2, "snapshot2");
runner2.start();
runner1.join();
runner2.join();
snapshot1.get();
snapshot2.get();
}
}
Aggregations