|
@@ -245,6 +245,8 @@ public class CapacityScheduler extends
|
|
|
|
|
|
private CSMaxRunningAppsEnforcer maxRunningEnforcer;
|
|
|
|
|
|
+ private boolean activitiesManagerEnabled = true;
|
|
|
+
|
|
|
public CapacityScheduler() {
|
|
|
super(CapacityScheduler.class.getName());
|
|
|
this.maxRunningEnforcer = new CSMaxRunningAppsEnforcer(this);
|
|
@@ -342,7 +344,9 @@ public class CapacityScheduler extends
|
|
|
this.workflowPriorityMappingsMgr = new WorkflowPriorityMappingsManager();
|
|
|
|
|
|
this.activitiesManager = new ActivitiesManager(rmContext);
|
|
|
- activitiesManager.init(conf);
|
|
|
+ if (activitiesManagerEnabled) {
|
|
|
+ activitiesManager.init(conf);
|
|
|
+ }
|
|
|
initializeQueues(this.conf);
|
|
|
this.isLazyPreemptionEnabled = conf.getLazyPreemptionEnabled();
|
|
|
|
|
@@ -400,7 +404,9 @@ public class CapacityScheduler extends
|
|
|
private void startSchedulerThreads() {
|
|
|
writeLock.lock();
|
|
|
try {
|
|
|
- activitiesManager.start();
|
|
|
+ if (activitiesManagerEnabled) {
|
|
|
+ activitiesManager.start();
|
|
|
+ }
|
|
|
if (scheduleAsynchronously) {
|
|
|
Preconditions.checkNotNull(asyncSchedulerThreads,
|
|
|
"asyncSchedulerThreads is null");
|
|
@@ -434,7 +440,9 @@ public class CapacityScheduler extends
|
|
|
public void serviceStop() throws Exception {
|
|
|
writeLock.lock();
|
|
|
try {
|
|
|
- this.activitiesManager.stop();
|
|
|
+ if (activitiesManagerEnabled) {
|
|
|
+ this.activitiesManager.stop();
|
|
|
+ }
|
|
|
if (scheduleAsynchronously && asyncSchedulerThreads != null) {
|
|
|
for (Thread t : asyncSchedulerThreads) {
|
|
|
t.interrupt();
|
|
@@ -3286,6 +3294,7 @@ public class CapacityScheduler extends
|
|
|
this.maxRunningEnforcer = enforcer;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* Returning true as capacity scheduler supports placement constraints.
|
|
|
*/
|
|
@@ -3293,4 +3302,9 @@ public class CapacityScheduler extends
|
|
|
public boolean placementConstraintEnabled() {
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ @VisibleForTesting
|
|
|
+ public void setActivitiesManagerEnabled(boolean enabled) {
|
|
|
+ this.activitiesManagerEnabled = enabled;
|
|
|
+ }
|
|
|
}
|