You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Hexiaoqiao (via GitHub)" <gi...@apache.org> on 2023/07/30 13:53:39 UTC

[GitHub] [hadoop] Hexiaoqiao commented on a diff in pull request #5900: HDFS-17134. RBF: Fix duplicate results of getListing through Router.

Hexiaoqiao commented on code in PR #5900:
URL: https://github.com/apache/hadoop/pull/5900#discussion_r1278571071


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java:
##########
@@ -819,20 +821,34 @@ public void renewLease(String clientName, List<String> namespaces)
     }
   }
 
+  /**
+   * For {@link this#getListing(String,byte[],boolean)} to sort results.

Review Comment:
   This java doc are not compliant with rules. try to as the following style.
   `For {@link #getListing(String,byte[],boolean) GetLisiting} to sort results.`



##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java:
##########
@@ -819,20 +821,34 @@ public void renewLease(String clientName, List<String> namespaces)
     }
   }
 
+  /**
+   * For {@link this#getListing(String,byte[],boolean)} to sort results.
+   */
+  private static class GetListingComparator
+      implements Comparator<byte[]>, Serializable {
+    @Override
+    public int compare(byte[] o1, byte[] o2) {
+      return DFSUtilClient.compareBytes(o1, o2);
+    }
+  }
+
+  private static final GetListingComparator comparator =

Review Comment:
   Don't need `final` modifier.



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org