ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject [20/51] [abbrv] ambari git commit: AMBARI-19134 : Storm start is failing due to ClassNotFoundException org.apache.hadoop.metrics2.sink.storm.StormTimelineMetricsReporter. (avijayan)
Date Fri, 09 Dec 2016 21:57:12 GMT
AMBARI-19134 : Storm start is failing due to ClassNotFoundException org.apache.hadoop.metrics2.sink.storm.StormTimelineMetricsReporter.
(avijayan)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 82f9401be0feb30ef59e6c02e8715fe4a05f6f9e
Parents: 51c6ef9
Author: Aravindan Vijayan <avijayan@hortonworks.com>
Authored: Thu Dec 8 12:02:41 2016 -0800
Committer: Aravindan Vijayan <avijayan@hortonworks.com>
Committed: Thu Dec 8 12:02:41 2016 -0800

----------------------------------------------------------------------
 .../metrics2/sink/timeline/AbstractTimelineMetricsSink.java     | 5 +++++
 .../sink/timeline/cache/HandleConnectExceptionTest.java         | 4 ++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/82f9401b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
index f92f968..9bc3be5 100644
--- a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
+++ b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
@@ -222,6 +222,11 @@ public abstract class AbstractTimelineMetricsSink {
       collectorHost = findPreferredCollectHost();
     }
 
+    if (collectorHost == null) {
+      LOG.warn("No live collector to send metrics to. Metrics to be sent will be discarded.");
+      return false;
+    }
+
     String connectUrl = getCollectorUri(collectorHost);
     String jsonData = null;
     LOG.debug("EmitMetrics connectUrl = "  + connectUrl);

http://git-wip-us.apache.org/repos/asf/ambari/blob/82f9401b/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/cache/HandleConnectExceptionTest.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/cache/HandleConnectExceptionTest.java
b/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/cache/HandleConnectExceptionTest.java
index 36ec074..32fe32e 100644
--- a/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/cache/HandleConnectExceptionTest.java
+++ b/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/cache/HandleConnectExceptionTest.java
@@ -130,6 +130,10 @@ public class HandleConnectExceptionTest {
       return super.emitMetrics(metrics);
     }
 
+    @Override
+    protected synchronized String findPreferredCollectHost() {
+      return "localhost";
+    }
 
   }
 }


Mime
View raw message