pvary commented on a change in pull request #698: HIVE-21912: Implement 
DisablingDaemonStatisticsHandler
URL: https://github.com/apache/hive/pull/698#discussion_r300312540
 
 

 ##########
 File path: 
llap-client/src/java/org/apache/hadoop/hive/llap/registry/impl/LlapZookeeperRegistryImpl.java
 ##########
 @@ -416,4 +423,65 @@ protected String getZkPathUser(Configuration conf) {
     // rather than relying on RegistryUtils.currentUser().
     return HiveConf.getVar(conf, ConfVars.LLAP_ZK_REGISTRY_USER, 
RegistryUtils.currentUser());
   }
+
+  /**
+   * Locks the Llap Cluster for configuration change by setting the next 
possible configuration
+   * change time. Until this time is reached the configuration should not be 
changed.
+   * @param nextMinConfigChangeTime The next time when the cluster can be 
reconfigured
+   * @return The result of the change (success if the lock is succeeded, and 
the next possible
+   * configuration change time
+   */
+  public ConfigChangeLockResult lockForConfigChange(long 
nextMinConfigChangeTime) {
+    try {
+      if (nextChangeTime == null) {
+        // Create the node with the 
/llap-sasl/hiveuser/hostname/config-change/next-change path without retry
+        nextChangeTime = new DistributedAtomicLong(zooKeeperClient,
+            String.join("/", workersPath.substring(0, 
workersPath.lastIndexOf('/')), CONFIG_CHANGE_PATH,
+                CONFIG_CHANGE_NODE), (i, j, sleeper) -> false);
 
 Review comment:
   My understanding is that Curator keeps the ZooKeeper communication 
errors/retries under the hood. If I understand correctly the retries in this 
recipe is for incr/decr so we get the correct value. Since we use only 
initialize/compareAndSet we should not be affected.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to