zuston commented on code in PR #494:
URL: https://github.com/apache/incubator-uniffle/pull/494#discussion_r1080767249
##########
server/src/test/java/org/apache/uniffle/server/ShuffleTaskInfoTest.java:
##########
@@ -17,15 +17,47 @@
package org.apache.uniffle.server;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class ShuffleTaskInfoTest {
+ @BeforeAll
+ public static void setup() {
+ ShuffleServerMetrics.register();
+ }
+
+ @AfterAll
+ public static void tearDown() {
+ ShuffleServerMetrics.clear();
+ }
+
+ @Test
+ public void hugePartitionTest() {
Review Comment:
Done
##########
server/src/main/java/org/apache/uniffle/server/ShuffleTaskInfo.java:
##########
@@ -124,4 +136,32 @@ public long getPartitionDataSize(int shuffleId, int
partitionId) {
return size;
}
+ public boolean hasHugePartition() {
+ return existHugePartition;
+ }
+
+ public int getHugePartitionSize() {
+ return hugePartitionTags.values().stream().map(x -> x.size()).reduce((x,
y) -> x + y).orElse(0);
+ }
+
+ public void markHugePartition(int shuffleId, int partitionId) {
+ if (!existHugePartition) {
+ synchronized (this) {
+ if (!existHugePartition) {
+ ShuffleServerMetrics.gaugeAppWithHugePartitionNum.inc();
+ ShuffleServerMetrics.counterTotalAppWithHugePartitionNum.inc();
+ existHugePartition = true;
+ }
+ }
+ }
+
+ hugePartitionTags.computeIfAbsent(shuffleId, key ->
Maps.newConcurrentMap());
+
+ hugePartitionTags.get(shuffleId).computeIfAbsent(partitionId, key -> {
Review Comment:
Done
--
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]