@@ -1764,6 +1764,10 @@ private void updateSumOfMillisSecBetweenNexts(long currentTime) {
1764
1764
}
1765
1765
}
1766
1766
1767
+ /**
1768
+ * Server-side metrics.
1769
+ * Only supported for HBase 0.95 and above.
1770
+ */
1767
1771
private static class ServerSideScanMetrics {
1768
1772
1769
1773
public static final String COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME = "ROWS_SCANNED" ;
@@ -1773,18 +1777,24 @@ private static class ServerSideScanMetrics {
1773
1777
protected long count_of_rows_filtered = 0 ;
1774
1778
1775
1779
/**
1776
- * number of rows scanned during scan RPC. Not every row scanned will be returned to the client
1780
+ * Number of rows scanned during scan RPC.
1781
+ * Not every row scanned will be returned to the client
1777
1782
* since rows may be filtered.
1783
+ * Always returns 0 if HBase < 0.95.
1778
1784
*/
1779
1785
public long getCountOfRowsScanned () { return count_of_rows_scanned ; };
1780
1786
1781
1787
/**
1782
- * number of rows filtered during scan RPC
1788
+ * Number of rows filtered during scan RPC.
1789
+ * Always returns 0 if HBase < 0.95.
1783
1790
*/
1784
1791
public long getCountOfRowsFiltered () { return count_of_rows_filtered ; }
1785
1792
1786
1793
}
1787
1794
1795
+ /**
1796
+ * Client-side metrics.
1797
+ */
1788
1798
public static class ScanMetrics extends ServerSideScanMetrics {
1789
1799
1790
1800
public static final String RPC_CALLS_METRIC_NAME = "RPC_CALLS" ;
@@ -1807,42 +1817,31 @@ public static class ScanMetrics extends ServerSideScanMetrics {
1807
1817
*/
1808
1818
private long count_of_regions = 1 ;
1809
1819
1810
- private long count_of_rpc_retries = 0 ;
1811
-
1812
1820
/**
1813
- * number of RPC calls
1821
+ * Number of RPC calls.
1814
1822
*/
1815
1823
public long getCountOfRPCcalls () { return count_of_rpc_calls ; }
1816
1824
1817
1825
/**
1818
- * sum of milliseconds between sequential next calls
1826
+ * Sum of milliseconds between sequential next calls.
1819
1827
*/
1820
1828
public long getSumOfMillisSecBetweenNexts () { return sum_of_millis_sec_between_nexts ; }
1821
1829
1822
1830
/**
1823
- * number of NotServingRegionException caught
1831
+ * Number of NotServingRegionException caught.
1824
1832
*/
1825
1833
public long getCountOfNSRE () { return count_of_nsre ; }
1826
1834
1827
1835
/**
1828
- * number of bytes in Result objects from region servers
1836
+ * Number of bytes in Result objects from region servers.
1829
1837
*/
1830
1838
public long getCountOfBytesInResults () { return count_of_bytes_in_results ; }
1831
1839
1832
1840
/**
1833
- * number of regions
1834
- * Starts with 1 because it is incremented when a scanner switches to a next region.
1841
+ * Number of regions.
1835
1842
*/
1836
1843
public long getCountOfRegions () { return count_of_regions ; };
1837
1844
1838
- /**
1839
- * number of RPC retries
1840
- */
1841
- public long getCountOfRPCRetries () { return count_of_rpc_retries ; }
1842
-
1843
- /**
1844
- * constructor
1845
- */
1846
1845
public ScanMetrics () {
1847
1846
}
1848
1847
@@ -1855,7 +1854,6 @@ public Map<String, Long> getMetricsMap() {
1855
1854
builder .put (NOT_SERVING_REGION_EXCEPTION_METRIC_NAME , count_of_nsre );
1856
1855
builder .put (BYTES_IN_RESULTS_METRIC_NAME , count_of_bytes_in_results );
1857
1856
builder .put (REGIONS_SCANNED_METRIC_NAME , count_of_regions );
1858
- builder .put (RPC_RETRIES_METRIC_NAME , count_of_rpc_retries );
1859
1857
return builder .build ();
1860
1858
}
1861
1859
}
0 commit comments