Преглед на файлове

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

Andrew Onishuk преди 11 години
родител
ревизия
ecacc6a06b

+ 9 - 27
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")) {
           } else if (m.getType().equals("jmx")) {
             jmxMap.put(componentName, getPropertyInfo(m));
             jmxMap.put(componentName, getPropertyInfo(m));
           } else {
           } 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);
               additional.add(pp);
             }
             }
 
 
@@ -302,26 +302,8 @@ public class StackDefinedPropertyProvider implements PropertyProvider {
 
 
     try {
     try {
       Class<?> clz = Class.forName(definition.getType());
       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 {
       try {
-                /*
+         /*
          * Warning: this branch is already used, that's why please adjust
          * Warning: this branch is already used, that's why please adjust
          * all implementations when modifying constructor interface
          * all implementations when modifying constructor interface
          */
          */

+ 1 - 1
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",
                 "service is misspelled. Trying default port",
             componentName, portConfigType,
             componentName, portConfigType,
             portPropertyName, hostname);
             portPropertyName, hostname);
-        LOG.warn(message);
+        LOG.debug(message);
       }
       }
     }
     }
     if (portStr == null && metricsProperties.containsKey(DEFAULT_PORT_PROPERTY)) {
     if (portStr == null && metricsProperties.containsKey(DEFAULT_PORT_PROPERTY)) {