rabashizade commented on code in PR #2107:
URL: https://github.com/apache/helix/pull/2107#discussion_r878560152


##########
helix-core/src/main/java/org/apache/helix/BaseDataAccessor.java:
##########
@@ -43,6 +43,18 @@
    */
   boolean create(String path, T record, int options);
 
+  /**
+   * This will always attempt to create the znode, if it exists it will return 
false. Will
+   * create parents if they do not exist. For performance reasons, it may try 
to create
+   * child first and only if it fails it will try to create parents
+   * @param path path to the ZNode to create
+   * @param record the data to write to the ZNode
+   * @param options Set the type of ZNode see the valid values in {@link 
AccessOption}
+   * @param ttl TTL of the node in milliseconds, if options supports it
+   * @return true if creation succeeded, false otherwise (e.g. if the ZNode 
exists)
+   */
+  boolean create(String path, T record, int options, long ttl);

Review Comment:
   Zookeeper only supports setting this property at create time, so it can't be 
overridden later. But now that you bring it up, I realized we create ZNode in 
set and update API as well when the node doesn't exist. But since the objective 
in those APIs is to actually update an existing ZNode, I think it's better to 
not add this capability to them. Please let me know what you think.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to