zuston commented on code in PR #1425:
URL:
https://github.com/apache/incubator-uniffle/pull/1425#discussion_r1444150953
##########
integration-test/common/src/test/java/org/apache/uniffle/test/ShuffleServerGrpcTest.java:
##########
@@ -428,7 +437,97 @@ public void registerTest() {
}
@Test
- public void sendDataWithoutRegisterTest() throws Exception {
+ public void sendDataAndRequireBufferTest() throws IOException {
+ String appId = "sendDataAndRequireBufferTest";
+ int shuffleId = 0;
+ int partitionId = 0;
+ // bigger than the config above: HUGE_PARTITION_SIZE_THRESHOLD : 1024 *
1024 * 10L
+ int hugePartitionDataLength = 1024 * 1024 * 11;
+ List<PartitionRange> partitionIds = Lists.newArrayList(new
PartitionRange(0, 3));
+
+ RssRegisterShuffleRequest registerShuffleRequest =
+ new RssRegisterShuffleRequest(appId, shuffleId, partitionIds, "");
+ RssRegisterShuffleResponse registerResponse =
+ shuffleServerClient.registerShuffle(registerShuffleRequest);
+ assertSame(StatusCode.SUCCESS, registerResponse.getStatusCode());
+
+ List<ShuffleBlockInfo> blockInfos =
+ Lists.newArrayList(
+ new ShuffleBlockInfo(
+ shuffleId,
+ partitionId,
+ 0,
+ hugePartitionDataLength,
+ 0,
+ new byte[] {},
+ Lists.newArrayList(),
+ 0,
+ 100,
+ 0));
+
+ Map<Integer, List<ShuffleBlockInfo>> partitionToBlocks = Maps.newHashMap();
+ partitionToBlocks.put(partitionId, blockInfos);
+ Map<Integer, Map<Integer, List<ShuffleBlockInfo>>> shuffleToBlocks =
Maps.newHashMap();
+ shuffleToBlocks.put(shuffleId, partitionToBlocks);
+
+ RssSendShuffleDataRequest sendShuffleDataRequest =
+ new RssSendShuffleDataRequest(appId, 3, 1000, shuffleToBlocks);
+ RssSendShuffleDataResponse response =
+ shuffleServerClient.sendShuffleData(sendShuffleDataRequest);
+ assertSame(StatusCode.SUCCESS, response.getStatusCode());
+
+ // trigger NoBufferForHugePartitionException and get FAILED_REQUIRE_ID
+ long requireId =
+ shuffleServerClient.requirePreAllocation(
+ appId, shuffleId, Lists.newArrayList(partitionId),
hugePartitionDataLength, 3, 100);
+ assertEquals(FAILED_REQUIRE_ID, requireId);
+
+ // Add NoBufferForHugePartitionException check
+ // and ShuffleServerMetrics.TOTAL_REQUIRE_BUFFER_FAILED_FOR_HUGE_PARTITION
metric should be 1
+ String content = TestUtils.httpGet(SHUFFLE_SERVER_METRICS_URL);
Review Comment:
This is really weird. Maybe we could optimize this in the another PR.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]