wangyang0918 commented on code in PR #23327:
URL: https://github.com/apache/flink/pull/23327#discussion_r1311008016


##########
flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java:
##########
@@ -610,12 +611,41 @@ FileSystemStateStorageHelper<T> 
createFileSystemStateStorage(
                 prefix);
     }
 
-    /** Creates a ZooKeeper path of the form "/a/b/.../z". */
-    public static String generateZookeeperPath(String... paths) {
-        return Arrays.stream(paths)
+    /** Creates an absolute ZooKeeper path of the form "/a/b/.../z". */
+    public static String generateAbsoluteZookeeperPath(String... pathElements) 
{
+        return generateZookeeperPath("/", pathElements);
+    }
+
+    /** Creates a relative ZooKeeper path of the form "a/b/.../z". */
+    public static String generateRelativeZooKeeperPath(String... pathElements) 
{
+        return generateZookeeperPath("", pathElements);
+    }
+
+    private static String generateZookeeperPath(String prefix, String... 
pathElements) {
+        return Arrays.stream(pathElements)
                 .map(ZooKeeperUtils::trimSlashes)
                 .filter(s -> !s.isEmpty())
-                .collect(Collectors.joining("/", "/", ""));
+                .collect(Collectors.joining("/", prefix, ""));
+    }
+
+    private static boolean isAbsolutePath(String path) {
+        return path.startsWith("/");
+    }
+
+    /** Extracts the parent path from the given {@code path}. */
+    public static String extractParentPath(String path) {

Review Comment:
   Got it.



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

Reply via email to