ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [1/2] git commit: AMBARI-7777. RestMetricsPropertyProvider spamming messages to ambari-server.log (aonishuk)
Date Wed, 15 Oct 2014 12:36:21 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-1.7.0 9321b1d12 -> 435c1cc62
  refs/heads/trunk d1c082c96 -> ecacc6a06


AMBARI-7777. RestMetricsPropertyProvider spamming messages to ambari-server.log (aonishuk)


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

Branch: refs/heads/trunk
Commit: ecacc6a06b99f15c4a1ae27bc65282050e45c793
Parents: d1c082c
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Wed Oct 15 15:36:12 2014 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Wed Oct 15 15:36:12 2014 +0300

----------------------------------------------------------------------
 .../internal/StackDefinedPropertyProvider.java  | 36 +++++---------------
 .../metrics/RestMetricsPropertyProvider.java    |  2 +-
 2 files changed, 10 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ecacc6a0/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
index db86758..217e216 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
@@ -163,15 +163,15 @@ public class StackDefinedPropertyProvider implements PropertyProvider
{
           } else if (m.getType().equals("jmx")) {
             jmxMap.put(componentName, getPropertyInfo(m));
           } else {
-            PropertyProvider pp = getDelegate(m);
-            if(pp == null) {
-              pp = getDelegate(m,
-                  streamProvider, metricsHostProvider,
-                  clusterNamePropertyId, hostNamePropertyId,
-                  componentNamePropertyId, resourceStatePropertyId,
-                  componentName);
+            PropertyProvider pp = getDelegate(m,
+                streamProvider, metricsHostProvider,
+                clusterNamePropertyId, hostNamePropertyId,
+                componentNamePropertyId, resourceStatePropertyId,
+                componentName);
+            if (pp == null) {
+              pp = getDelegate(m);
             }
-            if(pp != null) {
+            if (pp != null) {
               additional.add(pp);
             }
 
@@ -302,26 +302,8 @@ public class StackDefinedPropertyProvider implements PropertyProvider
{
 
     try {
       Class<?> clz = Class.forName(definition.getType());
-      // singleton/factory
-      try {
-                /*
-         * Interface for singleton/factory method invocation TBD
-         * when implementing the first real use
-         */
-        Method m = clz.getMethod("getInstance", Map.class, Map.class);
-        Object o = m.invoke(
-            definition.getProperties(), componentMetrics,
-            streamProvider, clusterNamePropertyId, hostNamePropertyId,
-            componentNamePropertyId, statePropertyId);
-        return PropertyProvider.class.cast(o);
-      } catch (Exception e) {
-        LOG.info("Could not load singleton or factory method for type '" +
-            definition.getType());
-      }
-
-      // try maps constructor
       try {
-                /*
+         /*
          * Warning: this branch is already used, that's why please adjust
          * all implementations when modifying constructor interface
          */

http://git-wip-us.apache.org/repos/asf/ambari/blob/ecacc6a0/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
index e8b054f..61b576c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
@@ -295,7 +295,7 @@ public class RestMetricsPropertyProvider extends MetricsProvider {
                 "service is misspelled. Trying default port",
             componentName, portConfigType,
             portPropertyName, hostname);
-        LOG.warn(message);
+        LOG.debug(message);
       }
     }
     if (portStr == null && metricsProperties.containsKey(DEFAULT_PORT_PROPERTY))
{


Mime
View raw message