hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject [24/27] hbase git commit: Revert "HBASE-18511 Default no regions on master"
Date Wed, 09 Aug 2017 05:51:40 GMT
Revert "HBASE-18511 Default no regions on master"

This reverts commit a8e0267c00409da7e3e03cfb34168787873ef075.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/03390684
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/03390684
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/03390684

Branch: refs/heads/HBASE-18467
Commit: 03390684cc8967f6e733932bb03d33553c6c859a
Parents: b653d1b
Author: Michael Stack <stack@apache.org>
Authored: Tue Aug 8 13:37:56 2017 +0800
Committer: Michael Stack <stack@apache.org>
Committed: Tue Aug 8 13:37:56 2017 +0800

----------------------------------------------------------------------
 .../hbase/master/balancer/BaseLoadBalancer.java | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/03390684/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
index 445f80f..8f5b6f5 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
@@ -1111,8 +1111,12 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
   private static final Random RANDOM = new Random(System.currentTimeMillis());
   private static final Log LOG = LogFactory.getLog(BaseLoadBalancer.class);
 
-  // Master carries no regions by default.
-  private static final String[] DEFAULT_TABLES_ON_MASTER = new String[] {};
+  // Regions of these tables are put on the master by default.
+  private static final String[] DEFAULT_TABLES_ON_MASTER =
+    new String[] {AccessControlLists.ACL_TABLE_NAME.getNameAsString(),
+      TableName.NAMESPACE_TABLE_NAME.getNameAsString(),
+      TableName.META_TABLE_NAME.getNameAsString()};
+
   public static final String TABLES_ON_MASTER =
     "hbase.balancer.tablesOnMaster";
 
@@ -1123,18 +1127,18 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
   protected MasterServices services;
 
   /**
-   * By default, master carries no regions. This method returns null.
-   * If you want master to carry system tables say, then set
-   * TABLES_ON_MASTER to AccessControlLists.ACL_TABLE_NAME.getNameAsString(),
-   * TableName.NAMESPACE_TABLE_NAME.getNameAsString(),
-   * TableName.META_TABLE_NAME.getNameAsString()
+   * By default, regions of some small system tables such as meta,
+   * namespace, and acl are assigned to the active master. If you don't
+   * want to assign any region to the active master, you need to
+   * configure "hbase.balancer.tablesOnMaster" to "none".
    */
   protected static String[] getTablesOnMaster(Configuration conf) {
     String valueString = conf.get(TABLES_ON_MASTER);
     if (valueString == null) {
       return DEFAULT_TABLES_ON_MASTER;
     }
-    if (valueString == null || valueString.trim().isEmpty()) {
+    valueString = valueString.trim();
+    if (valueString.equalsIgnoreCase("none")) {
       return null;
     }
     return StringUtils.getStrings(valueString);


Mime
View raw message