ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tbeerbo...@apache.org
Subject git commit: AMBARI-4363 - Support new version of ambari server in Ambari SCOM server
Date Fri, 24 Jan 2014 17:22:21 GMT
Updated Branches:
  refs/heads/branch-1.4.4 226c4a884 -> 8d11c648a


AMBARI-4363 - Support new version of ambari server in Ambari SCOM server


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

Branch: refs/heads/branch-1.4.4
Commit: 8d11c648a4a5917a70810adefd0c3f55381ee4aa
Parents: 226c4a8
Author: tbeerbower <tbeerbower@hortonworks.com>
Authored: Fri Jan 24 12:21:56 2014 -0500
Committer: tbeerbower <tbeerbower@hortonworks.com>
Committed: Fri Jan 24 12:21:56 2014 -0500

----------------------------------------------------------------------
 .../org/apache/ambari/scom/AmbariServer.java    | 21 +++++++++-----------
 .../apache/ambari/scom/SQLProviderModule.java   |  8 ++++----
 .../ambari/scom/SQLPropertyProviderTest.java    | 12 +++++------
 3 files changed, 19 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8d11c648/contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/scom/AmbariServer.java
----------------------------------------------------------------------
diff --git a/contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/scom/AmbariServer.java
b/contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/scom/AmbariServer.java
index 9c0b420..a02c74c 100644
--- a/contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/scom/AmbariServer.java
+++ b/contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/scom/AmbariServer.java
@@ -1,4 +1,3 @@
-
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -385,21 +384,19 @@ public class AmbariServer {
         databaseDriver = configuration.getLocalDatabaseUrl();
         databaseUrl    = Configuration.JDBC_LOCAL_DRIVER;
 
-      } else {
-        databaseDriver = configuration.getDatabaseDriver();
-        databaseUrl    = configuration.getDatabaseUrl();
-
+      }
+      else {
         if (persistenceType == PersistenceType.IN_MEMORY) {
-          if(databaseDriver == null){
-            databaseDriver = Configuration.JDBC_IN_MEMROY_DRIVER;
-          }
-          if (databaseUrl == null) {
-            databaseUrl = Configuration.JDBC_IN_MEMORY_URL;
-          }
+          databaseDriver = Configuration.JDBC_IN_MEMROY_DRIVER;
+          databaseUrl = Configuration.JDBC_IN_MEMORY_URL;
+        }
+        else {
+          databaseDriver = configuration.getDatabaseDriver();
+          databaseUrl    = configuration.getDatabaseUrl();
         }
       }
-      if (databaseDriver != null && databaseUrl != null) {
 
+      if (databaseDriver != null && databaseUrl != null) {
         properties.setProperty("javax.persistence.jdbc.url",    databaseUrl);
         properties.setProperty("javax.persistence.jdbc.driver", databaseDriver);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8d11c648/contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/scom/SQLProviderModule.java
----------------------------------------------------------------------
diff --git a/contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/scom/SQLProviderModule.java
b/contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/scom/SQLProviderModule.java
index b51f97a..82217c8 100644
--- a/contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/scom/SQLProviderModule.java
+++ b/contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/scom/SQLProviderModule.java
@@ -104,7 +104,7 @@ public class SQLProviderModule extends DefaultProviderModule implements
HostInfo
       case Component:
 
         providers.add(new JMXPropertyProvider(
-            PropertyHelper.getJMXPropertyIds(type, PropertyHelper.MetricsVersion.HDP1),
+            PropertyHelper.getJMXPropertyIds(type),
             urlStreamProvider,
             this,
             PropertyHelper.getPropertyId("ServiceComponentInfo", "cluster_name"),
@@ -114,7 +114,7 @@ public class SQLProviderModule extends DefaultProviderModule implements
HostInfo
             Collections.singleton("STARTED")));
 
         providers.add(new SQLPropertyProvider(
-            PropertyHelper.getGangliaPropertyIds(type, PropertyHelper.MetricsVersion.HDP1),
+            PropertyHelper.getGangliaPropertyIds(type),
             this,
             PropertyHelper.getPropertyId("ServiceComponentInfo", "cluster_name"),
             null,
@@ -124,7 +124,7 @@ public class SQLProviderModule extends DefaultProviderModule implements
HostInfo
       case HostComponent:
 
         providers.add(new JMXPropertyProvider(
-            PropertyHelper.getJMXPropertyIds(type, PropertyHelper.MetricsVersion.HDP1),
+            PropertyHelper.getJMXPropertyIds(type),
             urlStreamProvider,
             this,
             PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
@@ -134,7 +134,7 @@ public class SQLProviderModule extends DefaultProviderModule implements
HostInfo
             Collections.singleton("STARTED")));
 
         providers.add(new SQLPropertyProvider(
-            PropertyHelper.getGangliaPropertyIds(type, PropertyHelper.MetricsVersion.HDP1),
+            PropertyHelper.getGangliaPropertyIds(type),
             this,
             PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
             PropertyHelper.getPropertyId("HostRoles", "host_name"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/8d11c648/contrib/ambari-scom/ambari-scom-server/src/test/java/org/apache/ambari/scom/SQLPropertyProviderTest.java
----------------------------------------------------------------------
diff --git a/contrib/ambari-scom/ambari-scom-server/src/test/java/org/apache/ambari/scom/SQLPropertyProviderTest.java
b/contrib/ambari-scom/ambari-scom-server/src/test/java/org/apache/ambari/scom/SQLPropertyProviderTest.java
index 7b18957..d0298f3 100644
--- a/contrib/ambari-scom/ambari-scom-server/src/test/java/org/apache/ambari/scom/SQLPropertyProviderTest.java
+++ b/contrib/ambari-scom/ambari-scom-server/src/test/java/org/apache/ambari/scom/SQLPropertyProviderTest.java
@@ -85,7 +85,7 @@ public class SQLPropertyProviderTest {
     replay(connectionFactory, connection, statement, resultSet);
 
     SQLPropertyProvider provider = new SQLPropertyProvider(
-        PropertyHelper.getGangliaPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP1),
+        PropertyHelper.getGangliaPropertyIds(Resource.Type.HostComponent),
         new TestHostInfoProvider(),
         CLUSTER_NAME_PROPERTY_ID,
         HOST_NAME_PROPERTY_ID,
@@ -151,7 +151,7 @@ public class SQLPropertyProviderTest {
     TestHostInfoProvider hostProvider = new TestHostInfoProvider();
 
     SQLPropertyProvider provider = new SQLPropertyProvider(
-        PropertyHelper.getGangliaPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP1),
+        PropertyHelper.getGangliaPropertyIds(Resource.Type.HostComponent),
         hostProvider,
         CLUSTER_NAME_PROPERTY_ID,
         HOST_NAME_PROPERTY_ID,
@@ -217,7 +217,7 @@ public class SQLPropertyProviderTest {
     TestHostInfoProvider hostProvider = new TestHostInfoProvider();
 
     SQLPropertyProvider provider = new SQLPropertyProvider(
-        PropertyHelper.getGangliaPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP1),
+        PropertyHelper.getGangliaPropertyIds(Resource.Type.HostComponent),
         hostProvider,
         CLUSTER_NAME_PROPERTY_ID,
         HOST_NAME_PROPERTY_ID,
@@ -278,7 +278,7 @@ public class SQLPropertyProviderTest {
     TestHostInfoProvider hostProvider = new TestHostInfoProvider();
 
     SQLPropertyProvider provider = new SQLPropertyProvider(
-        PropertyHelper.getGangliaPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP1),
+        PropertyHelper.getGangliaPropertyIds(Resource.Type.HostComponent),
         hostProvider,
         CLUSTER_NAME_PROPERTY_ID,
         null,
@@ -336,7 +336,7 @@ public class SQLPropertyProviderTest {
     replay(connectionFactory, connection, statement, resultSet);
 
     SQLPropertyProvider provider = new SQLPropertyProvider(
-        PropertyHelper.getGangliaPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP1),
+        PropertyHelper.getGangliaPropertyIds(Resource.Type.HostComponent),
         new TestHostInfoProvider(),
         CLUSTER_NAME_PROPERTY_ID,
         HOST_NAME_PROPERTY_ID,
@@ -397,7 +397,7 @@ public class SQLPropertyProviderTest {
     replay(connectionFactory, connection, statement, resultSet);
 
     SQLPropertyProvider provider = new SQLPropertyProvider(
-        PropertyHelper.getGangliaPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP1),
+        PropertyHelper.getGangliaPropertyIds(Resource.Type.HostComponent),
         new TestHostInfoProvider(),
         CLUSTER_NAME_PROPERTY_ID,
         HOST_NAME_PROPERTY_ID,


Mime
View raw message