xyuanlu commented on code in PR #2930:
URL: https://github.com/apache/helix/pull/2930#discussion_r1832164102


##########
helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java:
##########
@@ -423,6 +423,16 @@ public boolean update(String path, DataUpdater<T> updater, 
int options) {
    * sync update
    */
   public AccessResult doUpdate(String path, DataUpdater<T> updater, int 
options) {
+    return doUpdate(path, updater, options, ZkClient.TTL_NOT_SET);
+  }
+
+  /**
+   * sync update with ttl
+   *
+   * ttl is only used when creating new znode, hence if znode is already 
created with a ttl, further
+   * update operations will not update the znode ttl even if ttl is provided 
in the options
+   */
+  public AccessResult doUpdate(String path, DataUpdater<T> updater, int 
options, long ttl) {

Review Comment:
   Normally if the fuc is not used outside class, we would set as private. 
   Also more importantly, it is a bit odd to allow user to set `ttl` but not 
actually update ttl in `update`.  If user provide a new `ttl` value and the 
node already exit, this function will return `RetCode.OK `without actually 
change anything. 



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