|
@@ -57,6 +57,7 @@ import org.apache.hadoop.yarn.server.api.protocolrecords.RegisterNodeManagerResp
|
|
|
import org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryServer;
|
|
|
import org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryStore;
|
|
|
import org.apache.hadoop.yarn.server.applicationhistoryservice.MemoryApplicationHistoryStore;
|
|
|
+import org.apache.hadoop.yarn.server.applicationhistoryservice.webapp.AHSWebApp;
|
|
|
import org.apache.hadoop.yarn.server.nodemanager.Context;
|
|
|
import org.apache.hadoop.yarn.server.nodemanager.NodeHealthCheckerService;
|
|
|
import org.apache.hadoop.yarn.server.nodemanager.NodeManager;
|
|
@@ -119,6 +120,7 @@ public class MiniYARNCluster extends CompositeService {
|
|
|
private int numLocalDirs;
|
|
|
// Number of nm-log-dirs per nodemanager
|
|
|
private int numLogDirs;
|
|
|
+ private boolean enableAHS;
|
|
|
|
|
|
/**
|
|
|
* @param testName name of the test
|
|
@@ -126,13 +128,15 @@ public class MiniYARNCluster extends CompositeService {
|
|
|
* @param numNodeManagers the number of node managers in the cluster
|
|
|
* @param numLocalDirs the number of nm-local-dirs per nodemanager
|
|
|
* @param numLogDirs the number of nm-log-dirs per nodemanager
|
|
|
+ * @param enableAHS enable ApplicationHistoryServer or not
|
|
|
*/
|
|
|
public MiniYARNCluster(
|
|
|
String testName, int numResourceManagers, int numNodeManagers,
|
|
|
- int numLocalDirs, int numLogDirs) {
|
|
|
+ int numLocalDirs, int numLogDirs, boolean enableAHS) {
|
|
|
super(testName.replace("$", ""));
|
|
|
this.numLocalDirs = numLocalDirs;
|
|
|
this.numLogDirs = numLogDirs;
|
|
|
+ this.enableAHS = enableAHS;
|
|
|
String testSubDir = testName.replace("$", "");
|
|
|
File targetWorkDir = new File("target", testSubDir);
|
|
|
try {
|
|
@@ -182,6 +186,20 @@ public class MiniYARNCluster extends CompositeService {
|
|
|
nodeManagers = new NodeManager[numNodeManagers];
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param testName name of the test
|
|
|
+ * @param numResourceManagers the number of resource managers in the cluster
|
|
|
+ * @param numNodeManagers the number of node managers in the cluster
|
|
|
+ * @param numLocalDirs the number of nm-local-dirs per nodemanager
|
|
|
+ * @param numLogDirs the number of nm-log-dirs per nodemanager
|
|
|
+ */
|
|
|
+ public MiniYARNCluster(
|
|
|
+ String testName, int numResourceManagers, int numNodeManagers,
|
|
|
+ int numLocalDirs, int numLogDirs) {
|
|
|
+ this(testName, numResourceManagers, numNodeManagers, numLocalDirs,
|
|
|
+ numLogDirs, false);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param testName name of the test
|
|
|
* @param numNodeManagers the number of node managers in the cluster
|
|
@@ -242,8 +260,8 @@ public class MiniYARNCluster extends CompositeService {
|
|
|
addService(new NodeManagerWrapper(index));
|
|
|
}
|
|
|
|
|
|
- if(conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, false)) {
|
|
|
- addService(new ApplicationHistoryServerWrapper());
|
|
|
+ if (enableAHS) {
|
|
|
+ addService(new ApplicationHistoryServerWrapper());
|
|
|
}
|
|
|
|
|
|
super.serviceInit(
|