wsry commented on a change in pull request #13924:
URL: https://github.com/apache/flink/pull/13924#discussion_r602195976
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/SortMergeResultPartitionTest.java
##########
@@ -336,12 +384,79 @@ private SortMergeResultPartition
createSortMergedPartition(
ResultPartitionType.BLOCKING,
numSubpartitions,
numSubpartitions,
- bufferSize,
+ readBufferPool,
+ readIOExecutor,
new ResultPartitionManager(),
fileChannelManager.createChannel().getPath(),
null,
() -> bufferPool);
sortMergedResultPartition.setup();
return sortMergedResultPartition;
}
+
+ private SortMergeResultPartition createSortMergeResultPartitionWithData()
throws Exception {
+ return createSortMergeResultPartitionWithData(readBufferPool);
+ }
+
+ private SortMergeResultPartition createSortMergeResultPartitionWithData(
+ BatchShuffleReadBufferPool readBufferPool) throws Exception {
+ int numBuffers = 10;
+ int numWriteBuffers = numBuffers / 2;
+
+ BufferPool bufferPool = globalPool.createBufferPool(numBuffers,
numBuffers);
+ SortMergeResultPartition partition =
+ createSortMergedPartition(10, bufferPool, readBufferPool);
+ assertEquals(numWriteBuffers,
bufferPool.bestEffortGetNumOfUsedBuffers());
+
+ int numDataBuffers = 2 * readBufferPool.getNumTotalBuffers();
+ for (int i = 0; i < numDataBuffers; ++i) {
+ partition.emitRecord(ByteBuffer.allocate(bufferSize), 0);
+ }
+ partition.finish();
+ partition.close();
+
+ assertEquals(16384, partition.getResultFile().getNumRegions());
Review comment:
After some tests were moved to SortMergeResultPartitionReadSchedulerTest
and some changes were made, this is not needed any more.
--
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]