ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [2/2] ambari git commit: AMBARI-14680. Journal node https results JournalsStatus not available in the API (aonishuk)
Date Fri, 15 Jan 2016 14:41:33 GMT
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/b130a8b4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b130a8b4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b130a8b4

Branch: refs/heads/branch-2.2
Commit: b130a8b4a470c7b3b0de93fb3b7ae5ddc2a2a4ca
Parents: 9343819
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Fri Jan 15 16:41:21 2016 +0200
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Fri Jan 15 16:41:21 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/b130a8b4/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/b130a8b4/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 2c6905d..3ea5d7a 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
@@ -73,6 +73,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 {
@@ -221,6 +223,7 @@ public class JMXHostProviderTest {
     String componentName2 = "DATANODE";
     String componentName3 = "HDFS_CLIENT";
     String componentName4 = "RESOURCEMANAGER";
+    String componentName5 = "JOURNALNODE";
 
     createServiceComponent(clusterName, serviceName, componentName1,
       State.INIT);
@@ -230,6 +233,8 @@ public class JMXHostProviderTest {
       State.INIT);
     createServiceComponent(clusterName, serviceName2, componentName4,
       State.INIT);
+    createServiceComponent(clusterName, serviceName, componentName5,
+        State.INIT);
 
     String host1 = "h1";
     clusters.addHost(host1);
@@ -256,6 +261,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,
@@ -266,6 +275,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");
@@ -399,6 +410,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