kezhuw commented on code in PR #2230:
URL: https://github.com/apache/zookeeper/pull/2230#discussion_r1997636906


##########
zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java:
##########
@@ -1490,7 +1490,7 @@ public String create(
         final String serverPath = prependChroot(clientPath);
 
         RequestHeader h = new RequestHeader();
-        setCreateHeader(createMode, h);
+        setCreateHeader(createMode, h, stat != null);
         Create2Response response = new Create2Response();

Review Comment:
   ```diff
   --- a/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java
   +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java
   @@ -1482,6 +1482,9 @@ public String create(
            CreateMode createMode,
            Stat stat,
            long ttl) throws KeeperException, InterruptedException {
   +        if (stat == null && ttl == -1) {
   +            return create(path, data, acl, createMode);
   +        }
            final String clientPath = path;
            PathUtils.validatePath(clientPath, createMode.isSequential());
            EphemeralType.validateTTL(createMode, ttl);
   ```
   
   How about this ?
   
   I think it is a good to provide generic(a.k.a. full parameters) method to 
fallback protocol code for compatibilities either with 3.4.x or ClickHouse 
Keeper if the code space is restricted. Any thoughts ? cc @tisonkun @eolivelli 
@cnauroth 
   
   I saw `getChildren2`, it is similar. If we are going this way, we should do 
it for `getChildren` also. I thought it is similar to `include_data` in 
`kazoo`'s 
[`create`](https://kazoo.readthedocs.io/en/latest/api/client.html#kazoo.client.KazooClient.create)
 and 
[`get_children`](https://kazoo.readthedocs.io/en/latest/api/client.html#kazoo.client.KazooClient.get_children).
   
   I do think clients have option to wrap themselves if they want such.



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