tillrohrmann commented on a change in pull request #15893:
URL: https://github.com/apache/flink/pull/15893#discussion_r630837844



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java
##########
@@ -493,14 +522,17 @@ public static String generateZookeeperPath(String root, 
String namespace) {
      */
     public static CuratorFramework useNamespaceAndEnsurePath(
             final CuratorFramework client, final String path) throws Exception 
{
-        Preconditions.checkNotNull(client, "client must not be null");
-        Preconditions.checkNotNull(path, "path must not be null");
+        checkNotNull(client, "client must not be null");
+        checkNotNull(path, "path must not be null");
 
         // Ensure that the checkpoints path exists
         
client.newNamespaceAwareEnsurePath(path).ensure(client.getZookeeperClient());
 
         // All operations will have the path as root
-        return 
client.usingNamespace(generateZookeeperPath(client.getNamespace(), path));
+        return client.usingNamespace(
+                // Curator prepends a '/' manually and throws an Exception if 
the
+                // namespace starts with a '/'.
+                generateZookeeperPath(client.getNamespace(), 
path).substring(1));

Review comment:
       I solved this problem a bit differently. I introduced a 
`trimStartingSlash` function.




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


Reply via email to