You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@livy.apache.org by GitBox <gi...@apache.org> on 2019/01/23 23:25:41 UTC

[GitHub] meisam commented on a change in pull request #103: [LIVY-239] Generate session IDs in SessionStore, not in SessionManager

meisam commented on a change in pull request #103: [LIVY-239] Generate session IDs in SessionStore, not in SessionManager
URL: https://github.com/apache/incubator-livy/pull/103#discussion_r250413416
 
 

 ##########
 File path: server/src/main/scala/org/apache/livy/server/recovery/StateStore.scala
 ##########
 @@ -70,6 +70,14 @@ abstract class StateStore(livyConf: LivyConf) extends JsonMapper {
    * @throws Exception Throw when persisting the state store fails.
    */
   def remove(key: String): Unit
+
+  /**
+    * Gets the Long value for the given key, increments the value
+    * and stores the new value before returning the value.
+    *
+    * @return incremented value
+    */
+  def increment(key: String): Long
 
 Review comment:
   How about `incrementAndGet()` to emphasize two things:
   - It is an atomic operation.
   - It is not solely for generating session IDs.
   
   My second choice is `nextValue`. But `nextSessionId` is a high level operation. It is not a good fit for StateStore whose other operations are `get`, `set`, `remove`, and 'getChildren`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services