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
public interface MetricsTableWrapperAggregate {
public String UNDERSCORE = "_";
public String HASH = "#";
/**
* 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()) {
// append 'store' and its name to the metric
mrb.addGauge(Interns.info(this.tableNamePrefixPart1 + _COLUMNFAMILY
+ entry.getKey().split(MetricsTableWrapperAggregate.UNDERSCORE)[1]
+ entry.getKey().split(MetricsTableWrapperAggregate.HASH)[1]
+ this.tableNamePrefixPart2 + metricName,
metricDesc), entry.getValue());
}

View File

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

View File

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