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:
parent
219b7afd9e
commit
11cbca1a5e
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue