Skip to content

Commit 6bcce6e

Browse files
committed
delete countOfRPCRetries
1 parent 1dbe27c commit 6bcce6e

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

src/Scanner.java

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,6 +1764,10 @@ private void updateSumOfMillisSecBetweenNexts(long currentTime) {
17641764
}
17651765
}
17661766

1767+
/**
1768+
* Server-side metrics.
1769+
* Only supported for HBase 0.95 and above.
1770+
*/
17671771
private static class ServerSideScanMetrics {
17681772

17691773
public static final String COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME = "ROWS_SCANNED";
@@ -1773,18 +1777,24 @@ private static class ServerSideScanMetrics {
17731777
protected long count_of_rows_filtered = 0;
17741778

17751779
/**
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
17771782
* since rows may be filtered.
1783+
* Always returns 0 if HBase < 0.95.
17781784
*/
17791785
public long getCountOfRowsScanned() { return count_of_rows_scanned; };
17801786

17811787
/**
1782-
* number of rows filtered during scan RPC
1788+
* Number of rows filtered during scan RPC.
1789+
* Always returns 0 if HBase < 0.95.
17831790
*/
17841791
public long getCountOfRowsFiltered() { return count_of_rows_filtered; }
17851792

17861793
}
17871794

1795+
/**
1796+
* Client-side metrics.
1797+
*/
17881798
public static class ScanMetrics extends ServerSideScanMetrics {
17891799

17901800
public static final String RPC_CALLS_METRIC_NAME = "RPC_CALLS";
@@ -1807,42 +1817,31 @@ public static class ScanMetrics extends ServerSideScanMetrics {
18071817
*/
18081818
private long count_of_regions = 1;
18091819

1810-
private long count_of_rpc_retries = 0;
1811-
18121820
/**
1813-
* number of RPC calls
1821+
* Number of RPC calls.
18141822
*/
18151823
public long getCountOfRPCcalls() { return count_of_rpc_calls; }
18161824

18171825
/**
1818-
* sum of milliseconds between sequential next calls
1826+
* Sum of milliseconds between sequential next calls.
18191827
*/
18201828
public long getSumOfMillisSecBetweenNexts() { return sum_of_millis_sec_between_nexts; }
18211829

18221830
/**
1823-
* number of NotServingRegionException caught
1831+
* Number of NotServingRegionException caught.
18241832
*/
18251833
public long getCountOfNSRE() { return count_of_nsre; }
18261834

18271835
/**
1828-
* number of bytes in Result objects from region servers
1836+
* Number of bytes in Result objects from region servers.
18291837
*/
18301838
public long getCountOfBytesInResults() { return count_of_bytes_in_results; }
18311839

18321840
/**
1833-
* number of regions
1834-
* Starts with 1 because it is incremented when a scanner switches to a next region.
1841+
* Number of regions.
18351842
*/
18361843
public long getCountOfRegions() { return count_of_regions; };
18371844

1838-
/**
1839-
* number of RPC retries
1840-
*/
1841-
public long getCountOfRPCRetries() { return count_of_rpc_retries; }
1842-
1843-
/**
1844-
* constructor
1845-
*/
18461845
public ScanMetrics() {
18471846
}
18481847

@@ -1855,7 +1854,6 @@ public Map<String, Long> getMetricsMap() {
18551854
builder.put(NOT_SERVING_REGION_EXCEPTION_METRIC_NAME, count_of_nsre);
18561855
builder.put(BYTES_IN_RESULTS_METRIC_NAME, count_of_bytes_in_results);
18571856
builder.put(REGIONS_SCANNED_METRIC_NAME, count_of_regions);
1858-
builder.put(RPC_RETRIES_METRIC_NAME, count_of_rpc_retries);
18591857
return builder.build();
18601858
}
18611859
}

test/TestIntegration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,6 @@ public void scanMetrics() throws Exception {
22152215
assertEquals("incorrect count of rows scanned", 1, metrics_a1.getCountOfRowsScanned()); // + 1 row scanned
22162216
assertEquals("incorrect count of RPC calls", 1, metrics_a1.getCountOfRPCcalls()); // + 1 open
22172217
assertTrue("incorrect count of bytes in results", metrics_a1.getCountOfBytesInResults() > prevBytesInResult);
2218-
assertEquals("incorrect count of NotServingRegionException", 0, metrics_a1.getCountOfNSRE());
22192218
prevBytesInResult = metrics_a1.getCountOfBytesInResults();
22202219

22212220
ArrayList<ArrayList<KeyValue>> row_a2 = scanner.nextRows(1).join();
@@ -2264,7 +2263,7 @@ public void scanMetrics() throws Exception {
22642263

22652264
/** Scan metrics of filtered rows tests. */
22662265
@Test
2267-
public void scanMetricsFilter() throws Exception {
2266+
public void scanMetricsWithFilter() throws Exception {
22682267
client.setFlushInterval(FAST_FLUSH);
22692268
// Keep only rows with a column qualifier that starts with "qa".
22702269
final PutRequest put1 = new PutRequest(table, "cpf1", family, "qa1", "v1");

0 commit comments

Comments
 (0)