public Map<String, Long> getMetricsMap(boolean reset) {
    // Create a builder
    ImmutableMap.Builder<String, Long> builder = ImmutableMap.builder();
    for (Map.Entry<String, AtomicLong> e : this.counters.entrySet()) {
      long value = reset ? e.getValue().getAndSet(0) : e.getValue().get();
      builder.put(e.getKey(), value);
    }
    // Build the immutable map so that people can't mess around with it.
    return builder.build();
  }
Get all of the values. If reset is true, we will reset the all AtomicLongs back to 0.
@param reset whether to reset the AtomicLongs to 0.
@return A Map of String -&gt; Long for metrics
hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ServerSideScanMetrics.java