bbeaudreault commented on code in PR #5012:
URL: https://github.com/apache/hbase/pull/5012#discussion_r1117082136
##########
hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsTableLatenciesImpl.java:
##########
@@ -124,16 +148,19 @@ public static String qualifyMetricsName(TableName
tableName, String metric) {
}
public TableHistograms getOrCreateTableHistogram(String tableName) {
- // TODO Java8's ConcurrentHashMap#computeIfAbsent would be stellar instead
final TableName tn = TableName.valueOf(tableName);
- TableHistograms latency = histogramsByTable.get(tn);
+ TableHistograms latency = histogramsByTable.getIfPresent(tn);
if (latency == null) {
latency = new TableHistograms(getMetricsRegistry(), tn);
histogramsByTable.put(tn, latency);
}
return latency;
}
+ public TableHistograms getTableHistogram(TableName tableName) {
Review Comment:
can you make this package protected and comment that it's for tests?
same for your getTicker method, which can you move down here instead of at
top of class?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]