pnowojski commented on a change in pull request #12034:
URL: https://github.com/apache/flink/pull/12034#discussion_r422469341
##########
File path:
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/StreamTaskNetworkInputTest.java
##########
@@ -74,29 +77,31 @@ public void tearDown() throws Exception {
@Test
public void testIsAvailableWithBufferedDataInDeserializer() throws
Exception {
- BufferBuilder bufferBuilder =
BufferBuilderTestUtils.createEmptyBufferBuilder(PAGE_SIZE);
- BufferConsumer bufferConsumer =
bufferBuilder.createBufferConsumer();
-
- serializeRecord(42L, bufferBuilder);
- serializeRecord(44L, bufferBuilder);
-
- List<BufferOrEvent> buffers = Collections.singletonList(new
BufferOrEvent(bufferConsumer.build(), 0, false));
+ List<BufferOrEvent> buffers =
Collections.singletonList(createDataBuffer());
VerifyRecordsDataOutput output = new
VerifyRecordsDataOutput<>();
- StreamTaskNetworkInput input = new StreamTaskNetworkInput<>(
- new CheckpointedInputGate(
- new MockInputGate(1, buffers, false),
- new CheckpointBarrierTracker(1, new
DummyCheckpointInvokable())),
- LongSerializer.INSTANCE,
- ioManager,
- new StatusWatermarkValve(1, output),
- 0);
+ StreamTaskNetworkInput input =
createStreamTaskNetworkInput(buffers, output);
assertHasNextElement(input, output);
assertHasNextElement(input, output);
assertEquals(2, output.getNumberOfEmittedRecords());
}
+ @Test
Review comment:
nit: add an explanation comment:
```
InputGate on CheckpointBarrier can enqueue a mailbox action to execute and
StreamTaskNetworkInput must
allow this action to execute before processing a following record.
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]