xcangCRM commented on a change in pull request #3018:
URL: https://github.com/apache/hbase/pull/3018#discussion_r594861844
##########
File path:
hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/lib/DynamicMetricsRegistry.java
##########
@@ -452,6 +450,41 @@ public MutableGaugeLong getGauge(String gaugeName, long
potentialStartingValue)
return (MutableGaugeLong) metric;
}
+ /**
+ * Get a MetricMutableGaugeInt from the storage. If it is not there
atomically put it.
+ *
+ * @param gaugeName name of the gauge to create or get.
+ * @param potentialStartingValue value of the new gauge if we have to create
it.
+ */
+ public MutableGaugeInt getGaugeInt(String gaugeName, int
potentialStartingValue) {
+ //Try and get the guage.
+ MutableMetric metric = metricsMap.get(gaugeName);
+
+ //If it's not there then try and put a new one in the storage.
+ if (metric == null) {
+
Review comment:
extra space line
##########
File path:
hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationGlobalSourceSourceImpl.java
##########
@@ -49,6 +50,7 @@
private final MutableFastCounter completedRecoveryQueue;
private final MutableFastCounter failedRecoveryQueue;
private final MutableGaugeLong walReaderBufferUsageBytes;
+ private final MutableGaugeInt sourceInitializing;
Review comment:
never mind, I see you have comments below. :)
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSource.java
##########
@@ -465,6 +465,22 @@ public synchronized UUID getPeerUUID() {
}
+ /**
+ * Bad Endpoint with failing connection to peer on demand.
+ */
+ public static class BadReplicationEndpoint extends
DoNothingReplicationEndpoint {
+ static boolean failing = true;
+
+ @Override
+ public synchronized UUID getPeerUUID() {
+ if (failing) {
Review comment:
nit:
can we say
return failing ? null : super.getPeerUUID();
##########
File path:
hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationGlobalSourceSourceImpl.java
##########
@@ -49,6 +50,7 @@
private final MutableFastCounter completedRecoveryQueue;
private final MutableFastCounter failedRecoveryQueue;
private final MutableGaugeLong walReaderBufferUsageBytes;
+ private final MutableGaugeInt sourceInitializing;
Review comment:
Nit:
so, this is the number of source initializing, right?
mind adding a minor comment for the metrics?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]