hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject git commit: HBASE-12119 Master regionserver web UI NOT_FOUND
Date Tue, 30 Sep 2014 21:43:07 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 007552861 -> c4107d530


HBASE-12119 Master regionserver web UI NOT_FOUND


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

Branch: refs/heads/master
Commit: c4107d5307293a69f62ad79028ddca8eb71dab9d
Parents: 0075528
Author: Jimmy Xiang <jxiang@cloudera.com>
Authored: Tue Sep 30 10:15:18 2014 -0700
Committer: Jimmy Xiang <jxiang@cloudera.com>
Committed: Tue Sep 30 14:42:32 2014 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/master/HMaster.java | 10 +++-------
 .../org/apache/hadoop/hbase/master/ServerManager.java     |  3 ++-
 .../hadoop/hbase/master/balancer/BaseLoadBalancer.java    | 10 +++++++++-
 3 files changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c4107d53/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index dd837d3..3d474f2 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -227,9 +227,6 @@ public class HMaster extends HRegionServer implements MasterServices,
Server {
   // monitor for distributed procedures
   MasterProcedureManagerHost mpmHost;
 
-  // A flag to indicate if any table is configured to put on the active master
-  protected final boolean tablesOnMaster;
-
   private MasterQuotaManager quotaManager;
 
   // handle table states
@@ -291,8 +288,6 @@ public class HMaster extends HRegionServer implements MasterServices,
Server {
     this.masterCheckCompression = conf.getBoolean("hbase.master.check.compression", true);
 
     this.metricsMaster = new MetricsMaster( new MetricsMasterWrapperImpl(this));
-    String[] tablesOnMaster = BaseLoadBalancer.getTablesOnMaster(conf);
-    this.tablesOnMaster = tablesOnMaster != null && tablesOnMaster.length > 0;
 
     // Do we publish the status?
     boolean shouldPublish = conf.getBoolean(HConstants.STATUS_PUBLISHED,
@@ -361,6 +356,7 @@ public class HMaster extends HRegionServer implements MasterServices,
Server {
    * Otherwise, loop till the server is stopped or aborted.
    */
   protected void waitForMasterActive(){
+    boolean tablesOnMaster = BaseLoadBalancer.tablesOnMaster(conf);
     while (!(tablesOnMaster && isActiveMaster)
         && !isStopped() && !isAborted()) {
       sleeper.sleep();
@@ -395,7 +391,7 @@ public class HMaster extends HRegionServer implements MasterServices,
Server {
   protected void configureInfoServer() {
     infoServer.addServlet("master-status", "/master-status", MasterStatusServlet.class);
     infoServer.setAttribute(MASTER, this);
-    if (tablesOnMaster) {
+    if (BaseLoadBalancer.tablesOnMaster(conf)) {
       super.configureInfoServer();
     }
   }
@@ -583,7 +579,7 @@ public class HMaster extends HRegionServer implements MasterServices,
Server {
     this.initializationBeforeMetaAssignment = true;
 
     // Wait for regionserver to finish initialization.
-    if (tablesOnMaster) {
+    if (BaseLoadBalancer.tablesOnMaster(conf)) {
       waitForServerOnline();
     }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/c4107d53/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
index dd18ca8..984b374 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
@@ -49,6 +49,7 @@ import org.apache.hadoop.hbase.ZooKeeperConnectionException;
 import org.apache.hadoop.hbase.client.HConnection;
 import org.apache.hadoop.hbase.client.HConnectionManager;
 import org.apache.hadoop.hbase.client.RetriesExhaustedException;
+import org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer;
 import org.apache.hadoop.hbase.master.handler.MetaServerShutdownHandler;
 import org.apache.hadoop.hbase.master.handler.ServerShutdownHandler;
 import org.apache.hadoop.hbase.monitoring.MonitoredTask;
@@ -855,7 +856,7 @@ public class ServerManager {
     final long timeout = this.master.getConfiguration().
       getLong(WAIT_ON_REGIONSERVERS_TIMEOUT, 4500);
     int defaultMinToStart = 1;
-    if (((HMaster)services).tablesOnMaster) {
+    if (BaseLoadBalancer.tablesOnMaster(master.getConfiguration())) {
       // If we assign regions to master, we'd like to start
       // at least another region server so that we don't
       // assign all regions to master if other region servers

http://git-wip-us.apache.org/repos/asf/hbase/blob/c4107d53/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 495f2fc..a6f457f 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
@@ -846,7 +846,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
    * want to assign any region to the active master, you need to
    * configure "hbase.balancer.tablesOnMaster" to "none".
    */
-  public static String[] getTablesOnMaster(Configuration conf) {
+  protected static String[] getTablesOnMaster(Configuration conf) {
     String valueString = conf.get(TABLES_ON_MASTER);
     if (valueString == null) {
       return DEFAULT_TABLES_ON_MASTER;
@@ -858,6 +858,14 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
     return StringUtils.getStrings(valueString);
   }
 
+  /**
+   * Check if configured to put any tables on the active master
+   */
+  public static boolean tablesOnMaster(Configuration conf) {
+    String[] tables = getTablesOnMaster(conf);
+    return tables != null && tables.length > 0;
+  }
+
   @Override
   public void setConf(Configuration conf) {
     setSlop(conf);


Mime
View raw message