tillrohrmann commented on a change in pull request #15893:
URL: https://github.com/apache/flink/pull/15893#discussion_r630817759
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java
##########
@@ -466,20 +475,40 @@ public static ZooKeeperCheckpointIDCounter
createCheckpointIDCounter(
prefix);
}
+ /** Creates a ZooKeeper path of the form "/root/namespace". */
public static String generateZookeeperPath(String root, String namespace) {
- if (!namespace.startsWith("/")) {
- namespace = '/' + namespace;
- }
+ final String result =
+ Stream.of(root, namespace)
+ .map(ZooKeeperUtils::trimSlashes)
+ .filter(s -> !s.isEmpty())
+ .collect(Collectors.joining("/"));
Review comment:
Good point. Will change 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.
For queries about this service, please contact Infrastructure at:
[email protected]