bbeaudreault commented on code in PR #5012:
URL: https://github.com/apache/hbase/pull/5012#discussion_r1117088587
##########
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);
Review Comment:
might as well use `histogramsByTable.get(tn, () -> new
TableHistograms(getMetricsRegistry(), tn))`?
--
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]