ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [1/2] ambari git commit: AMBARI-14680. Journal node https results JournalsStatus not available in the API (aonishuk)
Date Fri, 15 Jan 2016 14:41:32 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 9343819ee -> b130a8b4a
  refs/heads/trunk e0957d397 -> b9226d3ea


AMBARI-14680. Journal node https results JournalsStatus not available in the API (aonishuk)


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

Branch: refs/heads/trunk
Commit: b9226d3ea9d75cc37a505fd8730d91324c5659e0
Parents: e0957d3
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Fri Jan 15 16:41:19 2016 +0200
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Fri Jan 15 16:41:19 2016 +0200

----------------------------------------------------------------------
 .../internal/AbstractProviderModule.java        |  9 +++++++-
 .../internal/JMXHostProviderTest.java           | 24 ++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b9226d3e/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
index 001d7de..5fb2cf0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
@@ -115,6 +115,7 @@ public abstract class AbstractProviderModule implements ProviderModule,
 
     componentServiceMap.put("NAMENODE", Service.Type.HDFS);
     componentServiceMap.put("DATANODE", Service.Type.HDFS);
+    componentServiceMap.put("JOURNALNODE", Service.Type.HDFS);
     componentServiceMap.put("JOBTRACKER", Service.Type.MAPREDUCE);
     componentServiceMap.put("TASKTRACKER", Service.Type.MAPREDUCE);
     componentServiceMap.put("HBASE_MASTER", Service.Type.HBASE);
@@ -126,6 +127,8 @@ public abstract class AbstractProviderModule implements ProviderModule,
     initPropMap.put("NAMENODE", new String[]{"dfs.http.address", "dfs.namenode.http-address"});
     initPropMap.put("DATANODE", new String[]{"dfs.datanode.http.address"});
     initPropMap.put("NAMENODE-HTTPS", new String[]{"dfs.namenode.https-address", "dfs.https.port"});
+    initPropMap.put("JOURNALNODE-HTTPS", new String[]{"dfs.journalnode.https-address"});
+    initPropMap.put("JOURNALNODE", new String[]{"dfs.journalnode.http-address"});
     serviceDesiredProperties.put(Service.Type.HDFS, initPropMap);
 
     initPropMap = new HashMap<String, String[]>();
@@ -152,6 +155,10 @@ public abstract class AbstractProviderModule implements ProviderModule,
     jmxDesiredProperties.put("NAMENODE", initPropMap);
 
     initPropMap = new HashMap<String, String[]>();
+    initPropMap.put("JOURNALNODE", new String[]{"dfs.http.policy"});
+    jmxDesiredProperties.put("JOURNALNODE", initPropMap);
+
+    initPropMap = new HashMap<String, String[]>();
     initPropMap.put("RESOURCEMANAGER", new String[]{"yarn.http.policy"});
     jmxDesiredProperties.put("RESOURCEMANAGER", initPropMap);
   }
@@ -1036,7 +1043,7 @@ public abstract class AbstractProviderModule implements ProviderModule,
     String jmxProtocolString = clusterJmxProtocolMap.get(clusterName);
 
     try {
-      if (componentName.equals("NAMENODE") || componentName.equals("RESOURCEMANAGER")) {
+      if (componentName.equals("NAMENODE") || componentName.equals("RESOURCEMANAGER") ||
componentName.equals("JOURNALNODE")) {
         Service.Type service = componentServiceMap.get(componentName);
         String config = serviceConfigTypes.get(service);
         String newSiteConfigVersion = getDesiredConfigVersion(clusterName, config);

http://git-wip-us.apache.org/repos/asf/ambari/blob/b9226d3e/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
index d1bf6f4..37190ee 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
@@ -75,6 +75,8 @@ public class JMXHostProviderTest {
   private static final String RESOURCEMANAGER_HTTPS_PORT = "yarn.resourcemanager.webapp.https.address";
   private static final String YARN_HTTPS_POLICY = "yarn.http.policy";
   private static final String NODEMANAGER_PORT = "yarn.nodemanager.webapp.address";
+  private static final String JOURNALNODE_HTTPS_PORT = "dfs.journalnode.https-address";
+  private static final String HDFS_HTTPS_POLICY = "dfs.http.policy";
 
   @Before
   public void setup() throws Exception {
@@ -227,6 +229,7 @@ public class JMXHostProviderTest {
     String componentName2 = "DATANODE";
     String componentName3 = "HDFS_CLIENT";
     String componentName4 = "RESOURCEMANAGER";
+    String componentName5 = "JOURNALNODE";
 
     createServiceComponent(clusterName, serviceName, componentName1,
       State.INIT);
@@ -236,6 +239,8 @@ public class JMXHostProviderTest {
       State.INIT);
     createServiceComponent(clusterName, serviceName2, componentName4,
       State.INIT);
+    createServiceComponent(clusterName, serviceName, componentName5,
+        State.INIT);
 
     String host1 = "h1";
     clusters.addHost(host1);
@@ -262,6 +267,10 @@ public class JMXHostProviderTest {
       host2, null);
     createServiceComponentHost(clusterName, serviceName, componentName3,
       host1, null);
+    createServiceComponentHost(clusterName, serviceName, componentName5,
+      host1, null);
+    createServiceComponentHost(clusterName, serviceName, componentName5,
+      host2, null);
     createServiceComponentHost(clusterName, serviceName, componentName3,
       host2, null);
     createServiceComponentHost(clusterName, serviceName2, componentName4,
@@ -272,6 +281,8 @@ public class JMXHostProviderTest {
     configs.put(NAMENODE_PORT_V1, "localhost:${ambari.dfs.datanode.http.port}");
     configs.put(DATANODE_PORT, "localhost:70075");
     configs.put("ambari.dfs.datanode.http.port", "70070");
+    configs.put(JOURNALNODE_HTTPS_PORT, "localhost:8481");
+    configs.put(HDFS_HTTPS_POLICY, "HTTPS_ONLY");
 
     Map<String, String> yarnConfigs = new HashMap<String, String>();
     yarnConfigs.put(RESOURCEMANAGER_PORT, "8088");
@@ -405,6 +416,19 @@ public class JMXHostProviderTest {
   }
 
   @Test
+  public void testJMXJournalNodeHttpsPort() throws
+    NoSuchParentResourceException,
+    ResourceAlreadyExistsException, UnsupportedPropertyException,
+    SystemException, AmbariException, NoSuchResourceException {
+    createConfigs();
+    JMXHostProviderModule providerModule = new JMXHostProviderModule();
+    providerModule.registerResourceProvider(Resource.Type.Cluster);
+    providerModule.registerResourceProvider(Resource.Type.Configuration);
+    Assert.assertEquals("https", providerModule.getJMXProtocol("c1", "JOURNALNODE"));
+    Assert.assertEquals("8481", providerModule.getPort("c1", "JOURNALNODE", true));
+  }
+
+  @Test
   public void testJMXPortMapUpdate() throws
     NoSuchParentResourceException,
     ResourceAlreadyExistsException, UnsupportedPropertyException,


Mime
View raw message