use of org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent in project flink by apache.
the class CheckpointBarrierTrackerTest method testSingleChannelWithSkippedBarriers.
@Test
public void testSingleChannelWithSkippedBarriers() throws Exception {
BufferOrEvent[] sequence = { createBuffer(0), createBarrier(1, 0), createBuffer(0), createBuffer(0), createBarrier(3, 0), createBuffer(0), createBarrier(4, 0), createBarrier(6, 0), createBuffer(0), createBarrier(7, 0), createBuffer(0), createBarrier(10, 0), createBuffer(0) };
CheckpointSequenceValidator validator = new CheckpointSequenceValidator(1, 3, 4, 6, 7, 10);
inputGate = createCheckpointedInputGate(1, sequence, validator);
for (BufferOrEvent boe : sequence) {
assertEquals(boe, inputGate.pollNext().get());
}
}
use of org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent in project flink by apache.
the class CheckpointBarrierTrackerTest method testAbortCheckpointsAfterEndOfPartitionReceived.
@Test
public void testAbortCheckpointsAfterEndOfPartitionReceived() throws Exception {
BufferOrEvent[] sequence = { /* 0 */
createEndOfPartition(2), /* 1 */
createBarrier(5, 0), /* 2 */
createBarrier(6, 0), /* 3 */
createCancellationBarrier(6, 1), /* 4 */
createEndOfPartition(1), /* 5 */
createCancellationBarrier(7, 0) };
ValidatingCheckpointHandler validator = new ValidatingCheckpointHandler(-1);
inputGate = createCheckpointedInputGate(3, sequence, validator);
for (BufferOrEvent boe : sequence) {
assertEquals(boe, inputGate.pollNext().get());
}
assertThat(validator.abortedCheckpoints, contains(5L, 6L, 7L));
assertEquals(0, validator.getTriggeredCheckpointCounter());
}
use of org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent in project flink by apache.
the class CheckpointBarrierTrackerTest method testMultiChannelNoBarriers.
@Test
public void testMultiChannelNoBarriers() throws Exception {
BufferOrEvent[] sequence = { createBuffer(2), createBuffer(2), createBuffer(0), createBuffer(1), createBuffer(0), createBuffer(3), createBuffer(1), createBuffer(1), createBuffer(2) };
inputGate = createCheckpointedInputGate(4, sequence);
for (BufferOrEvent boe : sequence) {
assertEquals(boe, inputGate.pollNext().get());
}
}
use of org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent in project flink by apache.
the class CheckpointBarrierTrackerTest method testSingleChannelNoBarriers.
@Test
public void testSingleChannelNoBarriers() throws Exception {
BufferOrEvent[] sequence = { createBuffer(0), createBuffer(0), createBuffer(0) };
inputGate = createCheckpointedInputGate(1, sequence);
for (BufferOrEvent boe : sequence) {
assertEquals(boe, inputGate.pollNext().get());
}
}
use of org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent in project flink by apache.
the class CheckpointBarrierTrackerTest method testTriggerCheckpointsAfterReceivedEndOfPartition.
@Test
public void testTriggerCheckpointsAfterReceivedEndOfPartition() throws Exception {
BufferOrEvent[] sequence = { /* 0 */
createEndOfPartition(2), /* 1 */
createBarrier(5, 0), /* 2 */
createBarrier(6, 0), /* 3 */
createBarrier(6, 1), /* 4 */
createEndOfPartition(1), /* 5 */
createBarrier(7, 0) };
ValidatingCheckpointHandler validator = new ValidatingCheckpointHandler(-1);
inputGate = createCheckpointedInputGate(3, sequence, validator);
for (BufferOrEvent boe : sequence) {
assertEquals(boe, inputGate.pollNext().get());
}
assertThat(validator.triggeredCheckpoints, contains(6L, 7L));
assertEquals(0, validator.getAbortedCheckpointCounter());
}
Aggregations