Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 e8e45ef8f -> 11816cb7d


HBASE-13564 Master MBeans are not published (Ashish Singhi) + Addendum


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

Branch: refs/heads/branch-1.1
Commit: 11816cb7d49d3da552b163caf4c4a9abfcd742bb
Parents: e8e45ef
Author: stack <[email protected]>
Authored: Wed Apr 29 14:36:08 2015 -0700
Committer: stack <[email protected]>
Committed: Wed Apr 29 22:27:44 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/JMXListener.java   | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/11816cb7/hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java
index 6a115ba..6d22142 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java
@@ -51,7 +51,8 @@ public class JMXListener implements Coprocessor {
   public static final Log LOG = LogFactory.getLog(JMXListener.class);
   public static final String RMI_REGISTRY_PORT_CONF_KEY = ".rmi.registry.port";
   public static final String RMI_CONNECTOR_PORT_CONF_KEY = 
".rmi.connector.port";
-  public static final int defRMIRegistryPort = 10102;
+  public static final int defMasterRMIRegistryPort = 10101;
+  public static final int defRegionserverRMIRegistryPort = 10102;
 
   /**
    * workaround for HBASE-11146
@@ -163,11 +164,17 @@ public class JMXListener implements Coprocessor {
     Configuration conf = env.getConfiguration();
 
     if (env instanceof MasterCoprocessorEnvironment) {
-      LOG.error("JMXListener should not be loaded in Master Environment!");
+      // running on Master
+      rmiRegistryPort =
+          conf.getInt("master" + RMI_REGISTRY_PORT_CONF_KEY, 
defMasterRMIRegistryPort);
+      rmiConnectorPort = conf.getInt("master" + RMI_CONNECTOR_PORT_CONF_KEY, 
rmiRegistryPort);
+      LOG.info("Master rmiRegistryPort:" + rmiRegistryPort + ",Master 
rmiConnectorPort:"
+          + rmiConnectorPort);
     } else if (env instanceof RegionServerCoprocessorEnvironment) {
-      // running on RegionServer --since 0.99 HMaster is also a HRegionServer
+      // running on RegionServer
       rmiRegistryPort =
-        conf.getInt("regionserver" + RMI_REGISTRY_PORT_CONF_KEY, 
defRMIRegistryPort);
+        conf.getInt("regionserver" + RMI_REGISTRY_PORT_CONF_KEY,
+        defRegionserverRMIRegistryPort);
       rmiConnectorPort =
         conf.getInt("regionserver" + RMI_CONNECTOR_PORT_CONF_KEY, 
rmiRegistryPort);
       LOG.info("RegionServer rmiRegistryPort:" + rmiRegistryPort
@@ -175,6 +182,7 @@ public class JMXListener implements Coprocessor {
 
     } else if (env instanceof RegionCoprocessorEnvironment) {
       LOG.error("JMXListener should not be loaded in Region Environment!");
+      return;
     }
 
     synchronized(JMXListener.class) {

Reply via email to