You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/05/01 12:36:50 UTC

[GitHub] [ozone] symious commented on a diff in pull request #3342: HDDS-6640. Node.isAncestor might return incorrect result

symious commented on code in PR #3342:
URL: https://github.com/apache/ozone/pull/3342#discussion_r862469606


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/net/NetUtils.java:
##########
@@ -149,4 +149,28 @@ public static List<Node> getAncestorList(NetworkTopology topology,
     }
     return ancestorList;
   }
+
+  /**
+   * Ensure {@link NetConstants#PATH_SEPARATOR_STR} is added to the suffix of
+   * the path.
+   * @param path path to add suffix
+   * @return the normalised path
+   * If <i>path</i>is empty, then {@link NetConstants#ROOT} is returned
+   */
+  public static String addSuffix(String path) {
+    if (path == null) {
+      return null;
+    }
+
+    int len = path.length();
+    if (len == 0) {
+      return NetConstants.PATH_SEPARATOR_STR;

Review Comment:
   Updated the doc to return `PAHT_SEPARATOR_STR` instead.



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

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


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