@InterfaceAudience.Public public class ServerSideScanMetrics extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BLOCK_BYTES_SCANNED_KEY_METRIC_NAME |
static String |
COUNT_OF_ROWS_FILTERED_KEY
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0
(HBASE-17886). Use
COUNT_OF_ROWS_FILTERED_KEY_METRIC_NAME . |
static String |
COUNT_OF_ROWS_FILTERED_KEY_METRIC_NAME |
static String |
COUNT_OF_ROWS_SCANNED_KEY
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0
(HBASE-17886). Use
COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME . |
static String |
COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME |
AtomicLong |
countOfBlockBytesScanned |
AtomicLong |
countOfRowsFiltered
number of rows filtered during scan RPC
|
AtomicLong |
countOfRowsScanned
number of rows scanned during scan RPC.
|
protected RegionScanMetricsData |
currentRegionScanMetricsData |
static String |
FS_READ_TIME_METRIC_NAME |
AtomicLong |
fsReadTime |
Constructor and Description |
---|
ServerSideScanMetrics() |
Modifier and Type | Method and Description |
---|---|
void |
addToCounter(String counterName,
long delta)
Increments the counter with counterName by delta, does nothing if counter does not exist.
|
Map<ScanMetricsRegionInfo,Map<String,Long>> |
collectMetricsByRegion()
Get values grouped by each region scanned since the last time this was called.
|
Map<ScanMetricsRegionInfo,Map<String,Long>> |
collectMetricsByRegion(boolean reset)
Get values grouped by each region scanned.
|
protected AtomicLong |
createCounter(String counterName)
Create a new counter with the specified name.
|
AtomicLong |
getCounter(String counterName)
Returns
AtomicLong instance for this counter name, null if counter does not exist. |
Map<String,Long> |
getMetricsMap()
Get all the values combined for all the regions since the last time this function was called.
|
Map<String,Long> |
getMetricsMap(boolean reset)
Get all the values combined for all the regions.
|
boolean |
hasCounter(String counterName)
Returns true if a counter exists with the counterName.
|
void |
initScanMetricsRegionInfo(String encodedRegionName,
ServerName serverName)
Call this method after calling
moveToNextRegion() to populate server name and encoded
region name details for the region being scanned and for which metrics are being collected at
the moment. |
void |
moveToNextRegion()
If region level scan metrics are enabled, must call this method to start collecting metrics for
the region before scanning the region.
|
void |
setCounter(String counterName,
long value)
Sets counter with counterName to passed in value, does nothing if counter does not exist.
|
String |
toString() |
protected RegionScanMetricsData currentRegionScanMetricsData
public static final String COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME
public static final String COUNT_OF_ROWS_FILTERED_KEY_METRIC_NAME
public static final String BLOCK_BYTES_SCANNED_KEY_METRIC_NAME
public static final String FS_READ_TIME_METRIC_NAME
@Deprecated public static final String COUNT_OF_ROWS_SCANNED_KEY
COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME
.@Deprecated public static final String COUNT_OF_ROWS_FILTERED_KEY
COUNT_OF_ROWS_FILTERED_KEY_METRIC_NAME
.public final AtomicLong countOfRowsFiltered
public final AtomicLong countOfRowsScanned
public final AtomicLong countOfBlockBytesScanned
public final AtomicLong fsReadTime
public void moveToNextRegion()
protected AtomicLong createCounter(String counterName)
AtomicLong
instance for the counter with counterNamepublic void setCounter(String counterName, long value)
public boolean hasCounter(String counterName)
public AtomicLong getCounter(String counterName)
AtomicLong
instance for this counter name, null if counter does not exist.public void addToCounter(String counterName, long delta)
moveToNextRegion()
.public Map<String,Long> getMetricsMap()
public Map<String,Long> getMetricsMap(boolean reset)
reset
- whether to reset the AtomicLongs to 0.public Map<ScanMetricsRegionInfo,Map<String,Long>> collectMetricsByRegion()
public Map<ScanMetricsRegionInfo,Map<String,Long>> collectMetricsByRegion(boolean reset)
reset
- whether to reset region level scan metric counters to 0.public void initScanMetricsRegionInfo(String encodedRegionName, ServerName serverName)
moveToNextRegion()
to populate server name and encoded
region name details for the region being scanned and for which metrics are being collected at
the moment.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.