HBASE-25135 Convert the internal seperator while emitting the memstore read metrics to # (#2486) (#2489)

Signed-off-by: Anoop Sam John <anoopsamjohn@apache.org>
This commit is contained in:
ramkrish86 2020-10-01 18:18:31 +05:30 committed by GitHub
parent 219b7afd9e
commit 11cbca1a5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -28,7 +28,7 @@ import org.apache.yetus.audience.InterfaceAudience;
*/ */
@InterfaceAudience.Private @InterfaceAudience.Private
public interface MetricsTableWrapperAggregate { public interface MetricsTableWrapperAggregate {
public String UNDERSCORE = "_"; public String HASH = "#";
/** /**
* Get the number of read requests that have been issued against this table * Get the number of read requests that have been issued against this table
*/ */

View File

@ -334,7 +334,7 @@ public class MetricsTableSourceImpl implements MetricsTableSource {
for (Entry<String, Long> entry : metricMap.entrySet()) { for (Entry<String, Long> entry : metricMap.entrySet()) {
// append 'store' and its name to the metric // append 'store' and its name to the metric
mrb.addGauge(Interns.info(this.tableNamePrefixPart1 + _COLUMNFAMILY mrb.addGauge(Interns.info(this.tableNamePrefixPart1 + _COLUMNFAMILY
+ entry.getKey().split(MetricsTableWrapperAggregate.UNDERSCORE)[1] + entry.getKey().split(MetricsTableWrapperAggregate.HASH)[1]
+ this.tableNamePrefixPart2 + metricName, + this.tableNamePrefixPart2 + metricName,
metricDesc), entry.getValue()); metricDesc), entry.getValue());
} }

View File

@ -111,14 +111,14 @@ public class MetricsTableWrapperStub implements MetricsTableWrapperAggregate {
@Override @Override
public Map<String, Long> getMemstoreOnlyRowReadsCount(String table) { public Map<String, Long> getMemstoreOnlyRowReadsCount(String table) {
Map<String, Long> map = new HashMap<String, Long>(); Map<String, Long> map = new HashMap<String, Long>();
map.put("table_info", 3L); map.put("table#info", 3L);
return map; return map;
} }
@Override @Override
public Map<String, Long> getMixedRowReadsCount(String table) { public Map<String, Long> getMixedRowReadsCount(String table) {
Map<String, Long> map = new HashMap<String, Long>(); Map<String, Long> map = new HashMap<String, Long>();
map.put("table_info", 3L); map.put("table#info", 3L);
return map; return map;
} }
} }

View File

@ -94,7 +94,7 @@ public class MetricsTableWrapperAggregateImpl implements MetricsTableWrapperAggr
(long) store.getAvgStoreFileAge().getAsDouble() * store.getStorefilesCount(); (long) store.getAvgStoreFileAge().getAsDouble() * store.getStorefilesCount();
} }
mt.storeCount += 1; mt.storeCount += 1;
tempKey = tbl.getNameAsString() + UNDERSCORE + familyName; tempKey = tbl.getNameAsString() + HASH + familyName;
Long tempVal = mt.perStoreMemstoreOnlyReadCount.get(tempKey); Long tempVal = mt.perStoreMemstoreOnlyReadCount.get(tempKey);
if (tempVal == null) { if (tempVal == null) {
tempVal = 0L; tempVal = 0L;