use of org.apache.flink.state.api.runtime.metadata.SavepointMetadata in project flink by apache.
the class SavepointTest method testExistingSavepointEnforceUniqueUIDsWithOldSavepoint.
@Test(expected = IllegalArgumentException.class)
public void testExistingSavepointEnforceUniqueUIDsWithOldSavepoint() throws IOException {
ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(10);
DataSource<Integer> input = env.fromElements(0);
BootstrapTransformation<Integer> transformation = OperatorTransformation.bootstrapWith(input).transform(new ExampleStateBootstrapFunction());
Collection<OperatorState> operatorStates = Collections.singletonList(new OperatorState(OperatorIDGenerator.fromUid(UID), 1, 4));
SavepointMetadata metadata = new SavepointMetadata(4, Collections.emptyList(), operatorStates);
new ExistingSavepoint(env, metadata, new MemoryStateBackend()).withOperator(UID, transformation).write("");
}
use of org.apache.flink.state.api.runtime.metadata.SavepointMetadata in project flink by apache.
the class SavepointTest method testExistingSavepointEnforceUniqueUIDs.
@Test(expected = IllegalArgumentException.class)
public void testExistingSavepointEnforceUniqueUIDs() throws IOException {
ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(10);
DataSource<Integer> input = env.fromElements(0);
BootstrapTransformation<Integer> transformation = OperatorTransformation.bootstrapWith(input).transform(new ExampleStateBootstrapFunction());
Collection<OperatorState> operatorStates = Collections.singletonList(new OperatorState(OperatorIDGenerator.fromUid(UID), 1, 4));
SavepointMetadata metadata = new SavepointMetadata(4, Collections.emptyList(), operatorStates);
new ExistingSavepoint(env, metadata, new MemoryStateBackend()).withOperator(UID, transformation).withOperator(UID, transformation);
}
Aggregations