From d71641ab28c03cd2134babb34557d8d7759532ef Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Wed, 18 Feb 2015 08:08:48 -0800 Subject: [PATCH] HBASE-12102 Duplicate keys in HBase.RegionServer metrics JSON (Ravi Kishore Valeti) --- .../apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java | 3 +-- .../apache/hadoop/hbase/master/MetricsMasterSourceImpl.java | 3 +-- .../hbase/regionserver/MetricsRegionAggregateSourceImpl.java | 3 +-- .../hbase/regionserver/MetricsRegionServerSourceImpl.java | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java index 2f5e5cf289e..04cf9536428 100644 --- a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java +++ b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java @@ -110,8 +110,7 @@ public class MetricsHBaseServerSourceImpl extends BaseSourceImpl @Override public void getMetrics(MetricsCollector metricsCollector, boolean all) { - MetricsRecordBuilder mrb = metricsCollector.addRecord(metricsName) - .setContext(metricsContext); + MetricsRecordBuilder mrb = metricsCollector.addRecord(metricsName); if (wrapper != null) { mrb.addGauge(Interns.info(QUEUE_SIZE_NAME, QUEUE_SIZE_DESC), wrapper.getTotalQueueSize()) diff --git a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceImpl.java b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceImpl.java index d4c90dcb88e..02463f618c5 100644 --- a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceImpl.java +++ b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceImpl.java @@ -68,8 +68,7 @@ public class MetricsMasterSourceImpl @Override public void getMetrics(MetricsCollector metricsCollector, boolean all) { - MetricsRecordBuilder metricsRecordBuilder = metricsCollector.addRecord(metricsName) - .setContext(metricsContext); + MetricsRecordBuilder metricsRecordBuilder = metricsCollector.addRecord(metricsName); // masterWrapper can be null because this function is called inside of init. if (masterWrapper != null) { diff --git a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionAggregateSourceImpl.java b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionAggregateSourceImpl.java index 5cb2cec4141..ab7255e8f03 100644 --- a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionAggregateSourceImpl.java +++ b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionAggregateSourceImpl.java @@ -80,8 +80,7 @@ public class MetricsRegionAggregateSourceImpl extends BaseSourceImpl public void getMetrics(MetricsCollector collector, boolean all) { - MetricsRecordBuilder mrb = collector.addRecord(metricsName) - .setContext(metricsContext); + MetricsRecordBuilder mrb = collector.addRecord(metricsName); if (regionSources != null) { lock.readLock().lock(); diff --git a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceImpl.java b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceImpl.java index 7b55accec21..0eef82d99bd 100644 --- a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceImpl.java +++ b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceImpl.java @@ -176,8 +176,7 @@ public class MetricsRegionServerSourceImpl @Override public void getMetrics(MetricsCollector metricsCollector, boolean all) { - MetricsRecordBuilder mrb = metricsCollector.addRecord(metricsName) - .setContext(metricsContext); + MetricsRecordBuilder mrb = metricsCollector.addRecord(metricsName); // rsWrap can be null because this function is called inside of init. if (rsWrap != null) {