|
@@ -30,7 +30,7 @@ import org.apache.hadoop.metrics2.annotation.Metrics;
|
|
import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
|
|
import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
|
|
import org.apache.hadoop.metrics2.lib.MetricsRegistry;
|
|
import org.apache.hadoop.metrics2.lib.MetricsRegistry;
|
|
import org.apache.hadoop.metrics2.lib.MutableGaugeInt;
|
|
import org.apache.hadoop.metrics2.lib.MutableGaugeInt;
|
|
-import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeEventType;
|
|
|
|
|
|
+import com.google.common.annotations.VisibleForTesting;
|
|
|
|
|
|
@InterfaceAudience.Private
|
|
@InterfaceAudience.Private
|
|
@Metrics(context="yarn")
|
|
@Metrics(context="yarn")
|
|
@@ -71,6 +71,12 @@ public class ClusterMetrics {
|
|
ms.register("ClusterMetrics", "Metrics for the Yarn Cluster", INSTANCE);
|
|
ms.register("ClusterMetrics", "Metrics for the Yarn Cluster", INSTANCE);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @VisibleForTesting
|
|
|
|
+ synchronized static void destroy() {
|
|
|
|
+ isInitialized.set(false);
|
|
|
|
+ INSTANCE = null;
|
|
|
|
+ }
|
|
|
|
|
|
//Active Nodemanagers
|
|
//Active Nodemanagers
|
|
public int getNumActiveNMs() {
|
|
public int getNumActiveNMs() {
|
|
@@ -136,4 +142,5 @@ public class ClusterMetrics {
|
|
public void decrNumActiveNodes() {
|
|
public void decrNumActiveNodes() {
|
|
numActiveNMs.decr();
|
|
numActiveNMs.decr();
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|