Class ScanMetricsUtil
java.lang.Object
org.apache.hadoop.hbase.client.metrics.ScanMetricsUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static void
addToCounter
(Map<String, AtomicLong> counters, String counterName, long delta) Increments the counter with counterName by delta, does nothing if counter does not exist.collectMetrics
(Map<String, AtomicLong> counters, boolean reset) Get all the values.(package private) static AtomicLong
createCounter
(Map<String, AtomicLong> counters, String counterName) Creates a new counter with the specified name and stores it in the counters map.(package private) static AtomicLong
getCounter
(Map<String, AtomicLong> counters, String counterName) ReturnsAtomicLong
instance for this counter name, null if counter does not exist.(package private) static boolean
hasCounter
(Map<String, AtomicLong> counters, String counterName) Returns true if a counter exists with the counterName.(package private) static void
setCounter
(Map<String, AtomicLong> counters, String counterName, long value) Sets counter with counterName to passed in value, does nothing if counter does not exist.
-
Constructor Details
-
ScanMetricsUtil
private ScanMetricsUtil()
-
-
Method Details
-
createCounter
Creates a new counter with the specified name and stores it in the counters map.- Returns:
AtomicLong
instance for the counter with counterName
-
setCounter
Sets counter with counterName to passed in value, does nothing if counter does not exist. -
addToCounter
Increments the counter with counterName by delta, does nothing if counter does not exist. -
hasCounter
Returns true if a counter exists with the counterName. -
getCounter
ReturnsAtomicLong
instance for this counter name, null if counter does not exist. -
collectMetrics
Get all the values. If reset is true, we will reset the all AtomicLongs back to 0.- Parameters:
reset
- whether to reset the AtomicLongs to 0.- Returns:
- A Map of String -> Long for metrics
-