ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rle...@apache.org
Subject ambari git commit: AMBARI-11211. Make Kafka Metrics Reporter agnostic to the metrics names size (Emil Anca via rlevas)
Date Tue, 26 May 2015 10:57:04 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b7f9b041f -> 955a66850


AMBARI-11211. Make Kafka Metrics Reporter agnostic to the metrics names size (Emil Anca via
rlevas)


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

Branch: refs/heads/trunk
Commit: 955a668508fed5746efa8bc0531f556686f0190b
Parents: b7f9b04
Author: Emil Anca <eanca@hortonworks.com>
Authored: Tue May 26 06:56:57 2015 -0400
Committer: Robert Levas <rlevas@hortonworks.com>
Committed: Tue May 26 06:56:57 2015 -0400

----------------------------------------------------------------------
 .../ambari-metrics-kafka-sink/pom.xml           |  2 +-
 .../kafka/KafkaTimelineMetricsReporter.java     | 33 ++++----------------
 2 files changed, 7 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/955a6685/ambari-metrics/ambari-metrics-kafka-sink/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-kafka-sink/pom.xml b/ambari-metrics/ambari-metrics-kafka-sink/pom.xml
index a4361b0..adb655b 100644
--- a/ambari-metrics/ambari-metrics-kafka-sink/pom.xml
+++ b/ambari-metrics/ambari-metrics-kafka-sink/pom.xml
@@ -43,7 +43,7 @@ limitations under the License.
               <goal>copy-dependencies</goal>
             </goals>
             <configuration>
-              <includeArtifactIds>commons-codec,commons-collections,commons-httpclient,commons-lang,commons-logging,guava,jackson-core-asl,jackson-mapper-asl,jackson-xc</includeArtifactIds>
+              <includeArtifactIds>commons-codec,commons-collections,commons-httpclient,commons-lang,commons-logging,jackson-core-asl,jackson-mapper-asl,jackson-xc</includeArtifactIds>
               <outputDirectory>${project.build.directory}/lib</outputDirectory>
             </configuration>
           </execution>

http://git-wip-us.apache.org/repos/asf/ambari/blob/955a6685/ambari-metrics/ambari-metrics-kafka-sink/src/main/java/org/apache/hadoop/metrics2/sink/kafka/KafkaTimelineMetricsReporter.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-kafka-sink/src/main/java/org/apache/hadoop/metrics2/sink/kafka/KafkaTimelineMetricsReporter.java
b/ambari-metrics/ambari-metrics-kafka-sink/src/main/java/org/apache/hadoop/metrics2/sink/kafka/KafkaTimelineMetricsReporter.java
index 00a58ee..a259864 100644
--- a/ambari-metrics/ambari-metrics-kafka-sink/src/main/java/org/apache/hadoop/metrics2/sink/kafka/KafkaTimelineMetricsReporter.java
+++ b/ambari-metrics/ambari-metrics-kafka-sink/src/main/java/org/apache/hadoop/metrics2/sink/kafka/KafkaTimelineMetricsReporter.java
@@ -34,6 +34,7 @@ import kafka.metrics.KafkaMetricsConfig;
 import kafka.metrics.KafkaMetricsReporter;
 import kafka.utils.VerifiableProperties;
 import org.apache.commons.lang.ClassUtils;
+import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.metrics2.sink.timeline.AbstractTimelineMetricsSink;
@@ -260,17 +261,8 @@ public class KafkaTimelineMetricsReporter extends AbstractTimelineMetricsSink
       String[] metricHNames = cacheKafkaSummarizable(currentTimeMillis, sanitizedName, histogram);
       String[] metricSNames = cacheKafkaSnapshot(currentTimeMillis, sanitizedName, snapshot);
 
-      String[] metricNames = new String[] {
-          metricHNames[0],
-          metricHNames[1],
-          metricSNames[0],
-          metricHNames[2],
-          metricSNames[1],
-          metricSNames[2],
-          metricSNames[3],
-          metricSNames[4],
-          metricSNames[5],
-          metricHNames[3] };
+      String[] metricNames = (String[]) ArrayUtils.addAll(metricHNames, metricSNames);
+
       populateMetricsList(context, metricNames);
     }
 
@@ -284,22 +276,9 @@ public class KafkaTimelineMetricsReporter extends AbstractTimelineMetricsSink
       String[] metricTNames = cacheKafkaSummarizable(currentTimeMillis, sanitizedName, timer);
       String[] metricSNames = cacheKafkaSnapshot(currentTimeMillis, sanitizedName, snapshot);
 
-      String[] metricNames = new String[] {
-          metricMNames[0],
-          metricMNames[1],
-          metricMNames[2],
-          metricMNames[3],
-          metricMNames[4],
-          metricTNames[0],
-          metricTNames[1],
-          metricSNames[0],
-          metricTNames[2],
-          metricSNames[1],
-          metricSNames[2],
-          metricSNames[3],
-          metricSNames[4],
-          metricSNames[5],
-          metricTNames[3] };
+      String[] metricNames = (String[]) ArrayUtils.addAll(metricMNames, metricTNames);
+      metricNames = (String[]) ArrayUtils.addAll(metricNames, metricSNames);
+
       populateMetricsList(context, metricNames);
     }
 


Mime
View raw message