advancedxy commented on code in PR #471:
URL: https://github.com/apache/incubator-uniffle/pull/471#discussion_r1069611212


##########
server/src/main/java/org/apache/uniffle/server/ShuffleServerGrpcService.java:
##########
@@ -353,7 +353,22 @@ public void finishShuffle(FinishShuffleRequest req,
   @Override
   public void requireBuffer(RequireBufferRequest request,
       StreamObserver<RequireBufferResponse> responseObserver) {
-    long requireBufferId = 
shuffleServer.getShuffleTaskManager().requireBuffer(request.getRequireSize());
+    String appId = request.getAppId();
+    long requireBufferId;
+    if (appId == null) {

Review Comment:
   I believe this might be wrong. The default value for a string field is 
""(empty string) according to 
https://developers.google.com/protocol-buffers/docs/proto3#default doc.



##########
server/src/main/java/org/apache/uniffle/server/ShuffleTaskManager.java:
##########
@@ -200,7 +199,13 @@ public StatusCode registerShuffle(
   public StatusCode cacheShuffleData(
       String appId, int shuffleId, boolean isPreAllocated, 
ShufflePartitionedData spd) {
     refreshAppId(appId);
-    return shuffleBufferManager.cacheShuffleData(appId, shuffleId, 
isPreAllocated, spd);
+    return shuffleBufferManager.cacheShuffleData(
+        appId,
+        shuffleId,
+        isPreAllocated,
+        spd,
+        (appIdx, shuffleIdx, partitionIdx) -> getPartitionDataSize(appIdx, 
shuffleIdx, partitionIdx)

Review Comment:
   Java prefers to use Method Reference directly? -> 
`this::getPartitionDataSize`
   
   I have another concern about this, `getPartitionDataSize` refers 
`shuffleTaskInfos`, which might leaking `shuffleTaskInfos` to 
`ShuffleBufferManager`, is there any better ways?



##########
server/src/main/java/org/apache/uniffle/server/ShuffleTaskManager.java:
##########
@@ -630,5 +656,4 @@ private void triggerFlush() {
       this.shuffleBufferManager.flushIfNecessary();
     }
   }
-

Review Comment:
   unrelated?



-- 
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]

Reply via email to