Skip to content

Commit 286d7c9

Browse files
author
Sanjeet Malhotra
committed
Address Viraj's comments
1 parent 4d2fdf8 commit 286d7c9

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ linklint/
2525
**/*.log
2626
tmp
2727
**/.flattened-pom.xml
28+
.vscode/

hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ScanMetrics.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ public class ScanMetrics extends ServerSideScanMetrics {
9595
*/
9696
public final AtomicLong countOfRemoteRPCRetries = createCounter(REMOTE_RPC_RETRIES_METRIC_NAME);
9797

98+
/**
99+
* Constructor
100+
*/
101+
public ScanMetrics() {
102+
}
103+
98104
@Override
99105
public void moveToNextRegion() {
100106
super.moveToNextRegion();

hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ScanMetricsRegionInfo.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.apache.commons.lang3.builder.HashCodeBuilder;
2222
import org.apache.hadoop.hbase.ServerName;
2323
import org.apache.yetus.audience.InterfaceAudience;
24+
import org.apache.yetus.audience.InterfaceStability;
2425

2526
/**
2627
* POJO for capturing region level details when region level scan metrics are enabled. <br>
@@ -33,6 +34,7 @@
3334
* {@link ServerSideScanMetrics#collectMetricsByRegion(boolean)}.
3435
*/
3536
@InterfaceAudience.Public
37+
@InterfaceStability.Evolving
3638
public class ScanMetricsRegionInfo {
3739
/**
3840
* Users should only compare against this constant by reference and should not make any

hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ScanMetricsUtil.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,36 @@ static AtomicLong createCounter(Map<String, AtomicLong> counters, String counter
3838
return c;
3939
}
4040

41-
/** Sets counter with counterName to passed in value, does nothing if counter does not exist. */
41+
/**
42+
* Sets counter with counterName to passed in value, does nothing if counter does not exist.
43+
*/
4244
static void setCounter(Map<String, AtomicLong> counters, String counterName, long value) {
4345
AtomicLong c = counters.get(counterName);
4446
if (c != null) {
4547
c.set(value);
4648
}
4749
}
4850

49-
/** Increments the counter with counterName by delta, does nothing if counter does not exist. */
51+
/**
52+
* Increments the counter with counterName by delta, does nothing if counter does not exist.
53+
*/
5054
static void addToCounter(Map<String, AtomicLong> counters, String counterName, long delta) {
5155
AtomicLong c = counters.get(counterName);
5256
if (c != null) {
5357
c.addAndGet(delta);
5458
}
5559
}
5660

57-
/** Returns true if a counter exists with the counterName */
61+
/**
62+
* Returns true if a counter exists with the counterName.
63+
*/
5864
static boolean hasCounter(Map<String, AtomicLong> counters, String counterName) {
5965
return counters.containsKey(counterName);
6066
}
6167

62-
/** Returns {@link AtomicLong} instance for this counter name, null if counter does not exist. */
68+
/**
69+
* Returns {@link AtomicLong} instance for this counter name, null if counter does not exist.
70+
*/
6371
static AtomicLong getCounter(Map<String, AtomicLong> counters, String counterName) {
6472
return counters.get(counterName);
6573
}

0 commit comments

Comments
 (0)