Class ServerSideScanMetrics
java.lang.Object
org.apache.hadoop.hbase.client.metrics.ServerSideScanMetrics
- Direct Known Subclasses:
ScanMetrics
Provides server side metrics related to scan operations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringfinal AtomicLongstatic final Stringstatic final Stringstatic final Stringfinal AtomicLongfinal AtomicLongfinal AtomicLongstatic final Stringstatic final Stringprivate final Map<String,AtomicLong> Hash to hold the String -> Atomic Long mappings for each metricfinal AtomicLongfinal AtomicLongnumber of rows filtered during scan RPCfinal AtomicLongnumber of rows scanned during scan RPC.protected RegionScanMetricsDatastatic final Stringfinal AtomicLongprivate final List<RegionScanMetricsData>static final Stringstatic final Stringfinal AtomicLongfinal AtomicLong -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToCounter(String counterName, long delta) Increments the counter with counterName by delta, does nothing if counter does not exist.Get values grouped by each region scanned since the last time this was called.collectMetricsByRegion(boolean reset) Get values grouped by each region scanned.protected AtomicLongcreateCounter(String counterName) Create a new counter with the specified name.getCounter(String counterName) ReturnsAtomicLonginstance for this counter name, null if counter does not exist.Get all the values combined for all the regions since the last time this function was called.getMetricsMap(boolean reset) Get all the values combined for all the regions.booleanhasCounter(String counterName) Returns true if a counter exists with the counterName.voidinitScanMetricsRegionInfo(String encodedRegionName, ServerName serverName) Call this method after callingmoveToNextRegion()to populate server name and encoded region name details for the region being scanned and for which metrics are being collected at the moment.voidIf region level scan metrics are enabled, must call this method to start collecting metrics for the region before scanning the region.voidsetCounter(String counterName, long value) Sets counter with counterName to passed in value, does nothing if counter does not exist.toString()
-
Field Details
-
counters
Hash to hold the String -> Atomic Long mappings for each metric -
regionScanMetricsData
-
currentRegionScanMetricsData
-
COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME
- See Also:
-
COUNT_OF_ROWS_FILTERED_KEY_METRIC_NAME
- See Also:
-
BLOCK_BYTES_SCANNED_KEY_METRIC_NAME
- See Also:
-
FS_READ_TIME_METRIC_NAME
- See Also:
-
BYTES_READ_FROM_FS_METRIC_NAME
- See Also:
-
BYTES_READ_FROM_BLOCK_CACHE_METRIC_NAME
- See Also:
-
BYTES_READ_FROM_MEMSTORE_METRIC_NAME
- See Also:
-
BLOCK_READ_OPS_COUNT_METRIC_NAME
- See Also:
-
RPC_SCAN_PROCESSING_TIME_METRIC_NAME
- See Also:
-
RPC_SCAN_QUEUE_WAIT_TIME_METRIC_NAME
- See Also:
-
countOfRowsFiltered
number of rows filtered during scan RPC -
countOfRowsScanned
number of rows scanned during scan RPC. Not every row scanned will be returned to the client since rows may be filtered. -
countOfBlockBytesScanned
-
fsReadTime
-
bytesReadFromFs
-
bytesReadFromBlockCache
-
bytesReadFromMemstore
-
blockReadOpsCount
-
rpcScanProcessingTime
-
rpcScanQueueWaitTime
-
-
Constructor Details
-
ServerSideScanMetrics
public ServerSideScanMetrics()
-
-
Method Details
-
moveToNextRegion
If region level scan metrics are enabled, must call this method to start collecting metrics for the region before scanning the region. -
createCounter
Create a new counter with the specified name.- Returns:
AtomicLonginstance for the counter with counterName
-
setCounter
Sets counter with counterName to passed in value, does nothing if counter does not exist. If region level scan metrics are enabled then sets the value of counter for the current region being scanned. -
hasCounter
Returns true if a counter exists with the counterName. -
getCounter
ReturnsAtomicLonginstance for this counter name, null if counter does not exist. -
addToCounter
Increments the counter with counterName by delta, does nothing if counter does not exist. If region level scan metrics are enabled then increments the counter corresponding to the current region being scanned. Please seemoveToNextRegion(). -
getMetricsMap
Get all the values combined for all the regions since the last time this function was called. Calling this function will reset all AtomicLongs in the instance back to 0.- Returns:
- A Map of String -> Long for metrics
-
getMetricsMap
Get all the values combined for all the regions. If reset is true, we will reset all the AtomicLongs back to 0.- Parameters:
reset- whether to reset the AtomicLongs to 0.- Returns:
- A Map of String -> Long for metrics
-
collectMetricsByRegion
Get values grouped by each region scanned since the last time this was called. Calling this function will reset all region level scan metrics counters back to 0.- Returns:
- A Map of region -> (Map of metric name -> Long) for metrics
-
collectMetricsByRegion
Get values grouped by each region scanned. If reset is true, will reset all the region level scan metrics counters back to 0.- Parameters:
reset- whether to reset region level scan metric counters to 0.- Returns:
- A Map of region -> (Map of metric name -> Long) for metrics
-
toString
-
initScanMetricsRegionInfo
Call this method after callingmoveToNextRegion()to populate server name and encoded region name details for the region being scanned and for which metrics are being collected at the moment.
-