smallzhongfeng commented on code in PR #156:
URL: https://github.com/apache/incubator-uniffle/pull/156#discussion_r944169869


##########
coordinator/src/test/java/org/apache/uniffle/coordinator/ApplicationManagerTest.java:
##########
@@ -98,6 +98,24 @@ public void refreshTest() {
     assertFalse(applicationManager.hasErrorInStatusCheck());
   }
 
+  @Test
+  public void pickRemoteStorageTest() {
+    String remoteStoragePath = remotePath1 + Constants.COMMA_SPLIT_CHAR + 
remotePath2;

Review Comment:
   ```
   sizeList.add(null);
   sizeList.sort((entry1, entry2) -> {
     if (entry1 == null && entry2 == null) {
       return 0;
     }
     if (entry1 == null) {
       return -1;
     }
     if (entry2 == null) {
       return 1;
     }
     if (entry1.getValue().get() > entry2.getValue().get()) {
       return 1;
     } else if (entry1.getValue().get() == entry2.getValue().get()) {
       return 0;
     }
     return -1;
   });
   ```
   I added like this, in this way, the sub sorting causes null to be placed in 
front of `sizeList`, and null pointer will be thrown during traversal. Another 
point is that I'm not sure about the reason for sorting null here. I think 
`remoteStotoragePathCounter. entrySet()` should not contain null values.



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