YARN-43. Fix TestResourceTrackerService to not depend on test order and thus pass on JDK7. Contributed by Thomas Graves.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1399066 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
402836479f
commit
ab727f4966
@ -148,6 +148,9 @@ Release 0.23.5 - UNRELEASED
|
||||
YARN-161. Fix multiple compiler warnings for unchecked operations in YARN
|
||||
common. (Chris Nauroth via vinodkv)
|
||||
|
||||
YARN-43. Fix TestResourceTrackerService to not depend on test order and thus
|
||||
pass on JDK7. (Thomas Graves via vinodkv)
|
||||
|
||||
OPTIMIZATIONS
|
||||
|
||||
BUG FIXES
|
||||
|
@ -30,7 +30,7 @@
|
||||
import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
|
||||
import org.apache.hadoop.metrics2.lib.MetricsRegistry;
|
||||
import org.apache.hadoop.metrics2.lib.MutableGaugeInt;
|
||||
import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeEventType;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
@InterfaceAudience.Private
|
||||
@Metrics(context="yarn")
|
||||
@ -71,6 +71,12 @@ private static void registerMetrics() {
|
||||
ms.register("ClusterMetrics", "Metrics for the Yarn Cluster", INSTANCE);
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
synchronized static void destroy() {
|
||||
isInitialized.set(false);
|
||||
INSTANCE = null;
|
||||
}
|
||||
|
||||
//Active Nodemanagers
|
||||
public int getNumActiveNMs() {
|
||||
@ -136,4 +142,5 @@ public void incrNumActiveNodes() {
|
||||
public void decrNumActiveNodes() {
|
||||
numActiveNMs.decr();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -414,6 +414,7 @@ public void tearDown() {
|
||||
if (hostFile != null && hostFile.exists()) {
|
||||
hostFile.delete();
|
||||
}
|
||||
ClusterMetrics.destroy();
|
||||
if (rm != null) {
|
||||
rm.stop();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user