use of org.apache.flink.runtime.checkpoint.PendingCheckpoint.TaskAcknowledgeResult in project flink by apache.
the class PendingCheckpointTest method testDuplicateAcknowledgeCoordinator.
@Test
public void testDuplicateAcknowledgeCoordinator() throws Exception {
final OperatorInfo coordinator = new TestingOperatorInfo();
final PendingCheckpoint checkpoint = createPendingCheckpointWithCoordinators(coordinator);
checkpoint.acknowledgeCoordinatorState(coordinator, new TestingStreamStateHandle());
final TaskAcknowledgeResult secondAck = checkpoint.acknowledgeCoordinatorState(coordinator, null);
assertEquals(TaskAcknowledgeResult.DUPLICATE, secondAck);
}
use of org.apache.flink.runtime.checkpoint.PendingCheckpoint.TaskAcknowledgeResult in project flink by apache.
the class PendingCheckpointTest method testAcknowledgedCoordinatorStates.
@Test
public void testAcknowledgedCoordinatorStates() throws Exception {
final OperatorInfo coord1 = new TestingOperatorInfo();
final OperatorInfo coord2 = new TestingOperatorInfo();
final PendingCheckpoint checkpoint = createPendingCheckpointWithCoordinators(coord1, coord2);
final TaskAcknowledgeResult ack1 = checkpoint.acknowledgeCoordinatorState(coord1, new TestingStreamStateHandle());
final TaskAcknowledgeResult ack2 = checkpoint.acknowledgeCoordinatorState(coord2, null);
assertEquals(TaskAcknowledgeResult.SUCCESS, ack1);
assertEquals(TaskAcknowledgeResult.SUCCESS, ack2);
assertEquals(0, checkpoint.getNumberOfNonAcknowledgedOperatorCoordinators());
assertTrue(checkpoint.isFullyAcknowledged());
assertThat(checkpoint.getOperatorStates().keySet(), containsInAnyOrder(OPERATOR_ID, coord1.operatorId(), coord2.operatorId()));
}
use of org.apache.flink.runtime.checkpoint.PendingCheckpoint.TaskAcknowledgeResult in project flink by apache.
the class PendingCheckpointTest method testAcknowledgeUnknownCoordinator.
@Test
public void testAcknowledgeUnknownCoordinator() throws Exception {
final PendingCheckpoint checkpoint = createPendingCheckpointWithCoordinators(new TestingOperatorInfo());
final TaskAcknowledgeResult ack = checkpoint.acknowledgeCoordinatorState(new TestingOperatorInfo(), null);
assertEquals(TaskAcknowledgeResult.UNKNOWN, ack);
}
Aggregations