curcur commented on a change in pull request #13614:
URL: https://github.com/apache/flink/pull/13614#discussion_r507148578
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/ResultPartitionTest.java
##########
@@ -526,6 +526,44 @@ public void testFlushBoundedBlockingResultPartition()
throws IOException {
assertNull(readView2.getNextBuffer());
}
+ @Test
+ public void testEmitRecordWithRecordSpanningMultipleBuffers() throws
Exception {
+ BufferWritingResultPartition bufferWritingResultPartition =
createResultPartition(ResultPartitionType.PIPELINED);
+ PipelinedSubpartition pipelinedSubpartition =
(PipelinedSubpartition) bufferWritingResultPartition.subpartitions[0];
+ int partialLength = bufferSize / 3;
+
+ try {
+ // emit the first record, record length = partialLength
+
bufferWritingResultPartition.emitRecord(ByteBuffer.allocate(partialLength), 0);
+ // emit the second record, record length = bufferSize
+
bufferWritingResultPartition.emitRecord(ByteBuffer.allocate(bufferSize), 0);
+ } finally {
+ assertEquals(2,
pipelinedSubpartition.getCurrentNumberOfBuffers());
+ assertEquals(0,
pipelinedSubpartition.getNextBuffer().getPartialRecordLength());
Review comment:
the view can only read `BufferAndBacklog`, that's the sliced buffer +
some other information.
What I need is `PartialRecordLength` in the buffer queue cell in
`PrioritizedDeque<BufferConsumerWithPartialRecordLength> buffers`.
If you really do not like this, I can remove this assertion. This
information is tested in later PRs in different ways as well.
----------------------------------------------------------------
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]