You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "qqu0127 (via GitHub)" <gi...@apache.org> on 2023/03/03 16:46:23 UTC

[GitHub] [helix] qqu0127 commented on a diff in pull request #2388: TTL Node Interface Methods

qqu0127 commented on code in PR #2388:
URL: https://github.com/apache/helix/pull/2388#discussion_r1124730621


##########
meta-client/src/main/java/org/apache/helix/metaclient/api/MetaClientInterface.java:
##########
@@ -113,7 +142,22 @@ public Stat (EntryMode mode, int version) {
    */
   void create(final String key, final T data, final EntryMode mode);
 
-  // TODO: add TTL create and renew API
+  /**
+   * Create an entry of given EntryMode with given key, data, and expiry time (ttl).
+   * The entry will automatically purge when reached expiry time and has no children.
+   * The entry will not be created if there is an existing entry with the same key.
+   * @param key key to identify the entry
+   * @param data value of the entry
+   * @param ttl Time-to-live value of the node in milliseconds.
+   */
+  void createWithTTL(final String key, final T data, final long ttl);
+
+  /**
+   * Renews the specified TTL node adding its original expiry time
+   * to the current time.
+   * @param key key to identify the entry
+   */

Review Comment:
   nit: it will be great to document some edge cases behavior if you want them to be consistent. e.g. the node isn't TTL type, or doesn't exist at all. 



-- 
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: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org