rickyma commented on code in PR #1758:
URL:
https://github.com/apache/incubator-uniffle/pull/1758#discussion_r1620083970
##########
server/src/main/java/org/apache/uniffle/server/ShuffleTaskInfo.java:
##########
@@ -198,6 +201,25 @@ public Set<Integer> getShuffleIds() {
return partitionDataSizes.keySet();
}
+ public void incrBlockNumber(int shuffleId, int partitionId) {
+ this.partitionBlockCounters
+ .computeIfAbsent(shuffleId, x -> JavaUtils.newConcurrentMap())
+ .computeIfAbsent(partitionId, x -> new AtomicLong())
+ .incrementAndGet();
+ }
+
+ public long getBlockNumber(int shuffleId, int partitionId) {
+ Map<Integer, AtomicLong> partitionBlockCounters =
this.partitionBlockCounters.get(shuffleId);
+ if (partitionBlockCounters == null) {
Review Comment:
I think we can use `getOrDefault` to simplify the following codes.
##########
server/src/main/java/org/apache/uniffle/server/ShuffleTaskInfo.java:
##########
@@ -198,6 +201,25 @@ public Set<Integer> getShuffleIds() {
return partitionDataSizes.keySet();
}
+ public void incrBlockNumber(int shuffleId, int partitionId) {
Review Comment:
incrBlockNumber -> incBlockNumber
This should be a better naming.
--
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]