hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhara...@apache.org
Subject [hbase] branch branch-1 updated: HBASE-24477: Move ConfigurationObserver and related classes to hbase-common
Date Sun, 31 May 2020 21:27:01 GMT
This is an automated email from the ASF dual-hosted git repository.

bharathv pushed a commit to branch branch-1
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-1 by this push:
     new ee869b9  HBASE-24477: Move ConfigurationObserver and related classes to hbase-common
ee869b9 is described below

commit ee869b9aea78bc877b9052b91a5ccc47228327b1
Author: Bharath Vissapragada <bharathv@apache.org>
AuthorDate: Fri Dec 13 15:53:33 2019 -0800

    HBASE-24477: Move ConfigurationObserver and related classes to hbase-common
    
    This utility is useful for any module that wants to detect
    dynamic config changes. Having it to hbase-common makes it
    accessible to all the other modules.
    
    Signed-off-by: Michael Stack <stack@apache.org>
    Signed-off-by: Viraj Jasani <vjasani@apache.org>
---
 .../hadoop/hbase/conf/ConfigurationManager.java       | 19 +++++--------------
 .../hadoop/hbase/conf/ConfigurationObserver.java      |  0
 .../hbase/conf/PropagatingConfigurationObserver.java  |  0
 .../hadoop/hbase/conf/TestConfigurationManager.java   |  0
 4 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/conf/ConfigurationManager.java
b/hbase-common/src/main/java/org/apache/hadoop/hbase/conf/ConfigurationManager.java
similarity index 90%
rename from hbase-server/src/main/java/org/apache/hadoop/hbase/conf/ConfigurationManager.java
rename to hbase-common/src/main/java/org/apache/hadoop/hbase/conf/ConfigurationManager.java
index 1e9bc8b..bd98eef 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/conf/ConfigurationManager.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/conf/ConfigurationManager.java
@@ -19,13 +19,10 @@ package org.apache.hadoop.hbase.conf;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.classification.InterfaceAudience;
-import org.apache.hadoop.hbase.classification.InterfaceStability;
-
 import java.util.Collections;
 import java.util.Set;
 import java.util.WeakHashMap;
+import org.apache.hadoop.conf.Configuration;
 
 /**
  * Maintains the set of all the classes which would like to get notified
@@ -56,9 +53,7 @@ import java.util.WeakHashMap;
  * 2. Register the appropriate instance of the class with the
  *    {@link ConfigurationManager} instance, using the
  *    {@link ConfigurationManager#registerObserver(ConfigurationObserver)}
- *    method. For the RS side of things, the ConfigurationManager is a static
- *    member of the {@link org.apache.hadoop.hbase.regionserver.HRegionServer}
- *    class. Be careful not to do this in the constructor, as you might cause
+ *    method. Be careful not to do this in the constructor, as you might cause
  *    the 'this' reference to escape. Use a factory method, or an initialize()
  *    method which is called after the construction of the object.
  *
@@ -68,10 +63,7 @@ import java.util.WeakHashMap;
  *    for any reason, it is still okay, since entries for dead observers are
  *    automatically collected during GC. But nonetheless, it is still a good
  *    practice to deregister your observer, whenever possible.
- *
  */
-@InterfaceAudience.Private
-@InterfaceStability.Evolving
 public class ConfigurationManager {
   private static final Log LOG = LogFactory.getLog(ConfigurationManager.class);
 
@@ -80,12 +72,11 @@ public class ConfigurationManager {
   // constructed from a WeakHashMap, whose entries would be removed if the
   // observer classes go out of scope.
   private final Set<ConfigurationObserver> configurationObservers =
-    Collections.newSetFromMap(new WeakHashMap<ConfigurationObserver,
-                                              Boolean>());
+      Collections.newSetFromMap(new WeakHashMap<ConfigurationObserver, Boolean>());
 
   /**
    * Register an observer class
-   * @param observer
+   * @param observer observer to be registered.
    */
   public void registerObserver(ConfigurationObserver observer) {
     synchronized (configurationObservers) {
@@ -98,7 +89,7 @@ public class ConfigurationManager {
 
   /**
    * Deregister an observer class
-   * @param observer
+   * @param observer to be deregistered.
    */
   public void deregisterObserver(ConfigurationObserver observer) {
     synchronized (configurationObservers) {
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/conf/ConfigurationObserver.java
b/hbase-common/src/main/java/org/apache/hadoop/hbase/conf/ConfigurationObserver.java
similarity index 100%
rename from hbase-server/src/main/java/org/apache/hadoop/hbase/conf/ConfigurationObserver.java
rename to hbase-common/src/main/java/org/apache/hadoop/hbase/conf/ConfigurationObserver.java
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/conf/PropagatingConfigurationObserver.java
b/hbase-common/src/main/java/org/apache/hadoop/hbase/conf/PropagatingConfigurationObserver.java
similarity index 100%
rename from hbase-server/src/main/java/org/apache/hadoop/hbase/conf/PropagatingConfigurationObserver.java
rename to hbase-common/src/main/java/org/apache/hadoop/hbase/conf/PropagatingConfigurationObserver.java
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/conf/TestConfigurationManager.java
b/hbase-common/src/test/java/org/apache/hadoop/hbase/conf/TestConfigurationManager.java
similarity index 100%
rename from hbase-server/src/test/java/org/apache/hadoop/hbase/conf/TestConfigurationManager.java
rename to hbase-common/src/test/java/org/apache/hadoop/hbase/conf/TestConfigurationManager.java


Mime
View raw message