ndimiduk commented on a change in pull request #2523:
URL: https://github.com/apache/hbase/pull/2523#discussion_r508884289



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
##########
@@ -140,39 +188,76 @@ private static int parseMergeMinRegionSizeMb(final 
Configuration conf) {
       key, parsedValue, settledValue);
   }
 
+  private static <T> void logConfigurationUpdated(final String key, final T 
oldValue,
+    final T newValue) {
+    if (!Objects.equals(oldValue, newValue)) {
+      LOG.info("Updated configuration for key '{}' from {} to {}", key, 
oldValue, newValue);
+    }
+  }
+
   /**
    * Return this instance's configured value for {@value #SPLIT_ENABLED_KEY}.
    */
   public boolean isSplitEnabled() {
-    return splitEnabled;
+    final Lock readLock = configUpdateLock.readLock();
+    readLock.lock();
+    try {
+      return splitEnabled;
+    } finally {
+      readLock.unlock();
+    }
   }
 
   /**
    * Return this instance's configured value for {@value #MERGE_ENABLED_KEY}.
    */
   public boolean isMergeEnabled() {
-    return mergeEnabled;
+    final Lock readLock = configUpdateLock.readLock();
+    readLock.lock();
+    try {
+      return mergeEnabled;
+    } finally {
+      readLock.unlock();
+    }
   }
 
   /**
    * Return this instance's configured value for {@value 
#MIN_REGION_COUNT_KEY}.
    */
   public int getMinRegionCount() {
-    return minRegionCount;
+    final Lock readLock = configUpdateLock.readLock();
+    readLock.lock();
+    try {
+      return minRegionCount;
+    } finally {
+      readLock.unlock();
+    }
   }
 
   /**
    * Return this instance's configured value for {@value 
#MERGE_MIN_REGION_AGE_DAYS_KEY}.
    */
   public Period getMergeMinRegionAge() {
-    return mergeMinRegionAge;
+    final Lock readLock = configUpdateLock.readLock();
+    readLock.lock();
+    try {
+      return mergeMinRegionAge;
+    } finally {
+      readLock.unlock();
+    }
   }
 
   /**
    * Return this instance's configured value for {@value 
#MERGE_MIN_REGION_SIZE_MB_KEY}.
    */
   public int getMergeMinRegionSizeMb() {

Review comment:
       In light of 
[HBASE-24640](https://issues.apache.org/jira/browse/HBASE-24640), I didn't want 
to introduce any new uses of this annotation.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to