|
@@ -91,6 +91,9 @@ public class FiCaSchedulerApp extends SchedulerApplication {
|
|
|
|
|
|
final Map<Priority, Map<NodeId, RMContainer>> reservedContainers =
|
|
final Map<Priority, Map<NodeId, RMContainer>> reservedContainers =
|
|
new HashMap<Priority, Map<NodeId, RMContainer>>();
|
|
new HashMap<Priority, Map<NodeId, RMContainer>>();
|
|
|
|
+
|
|
|
|
+ private boolean isStopped = false;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* Count how many times the application has been given an opportunity
|
|
* Count how many times the application has been given an opportunity
|
|
@@ -132,7 +135,9 @@ public class FiCaSchedulerApp extends SchedulerApplication {
|
|
|
|
|
|
public synchronized void updateResourceRequests(
|
|
public synchronized void updateResourceRequests(
|
|
List<ResourceRequest> requests) {
|
|
List<ResourceRequest> requests) {
|
|
- this.appSchedulingInfo.updateResourceRequests(requests);
|
|
|
|
|
|
+ if (!isStopped) {
|
|
|
|
+ this.appSchedulingInfo.updateResourceRequests(requests);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public Map<String, ResourceRequest> getResourceRequests(Priority priority) {
|
|
public Map<String, ResourceRequest> getResourceRequests(Priority priority) {
|
|
@@ -168,6 +173,10 @@ public class FiCaSchedulerApp extends SchedulerApplication {
|
|
return this.appSchedulingInfo.isPending();
|
|
return this.appSchedulingInfo.isPending();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public synchronized boolean isStopped() {
|
|
|
|
+ return this.isStopped;
|
|
|
|
+ }
|
|
|
|
+
|
|
public String getQueueName() {
|
|
public String getQueueName() {
|
|
return this.appSchedulingInfo.getQueueName();
|
|
return this.appSchedulingInfo.getQueueName();
|
|
}
|
|
}
|
|
@@ -183,6 +192,7 @@ public class FiCaSchedulerApp extends SchedulerApplication {
|
|
|
|
|
|
public synchronized void stop(RMAppAttemptState rmAppAttemptFinalState) {
|
|
public synchronized void stop(RMAppAttemptState rmAppAttemptFinalState) {
|
|
// Cleanup all scheduling information
|
|
// Cleanup all scheduling information
|
|
|
|
+ this.isStopped = true;
|
|
this.appSchedulingInfo.stop(rmAppAttemptFinalState);
|
|
this.appSchedulingInfo.stop(rmAppAttemptFinalState);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -234,6 +244,10 @@ public class FiCaSchedulerApp extends SchedulerApplication {
|
|
synchronized public RMContainer allocate(NodeType type, FiCaSchedulerNode node,
|
|
synchronized public RMContainer allocate(NodeType type, FiCaSchedulerNode node,
|
|
Priority priority, ResourceRequest request,
|
|
Priority priority, ResourceRequest request,
|
|
Container container) {
|
|
Container container) {
|
|
|
|
+
|
|
|
|
+ if (isStopped) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
|
|
// Required sanity check - AM can call 'allocate' to update resource
|
|
// Required sanity check - AM can call 'allocate' to update resource
|
|
// request without locking the scheduler, hence we need to check
|
|
// request without locking the scheduler, hence we need to check
|