|
@@ -52,10 +52,11 @@ public class AppSchedulable extends Schedulable {
|
|
private FSSchedulerApp app;
|
|
private FSSchedulerApp app;
|
|
private Resource demand = Resources.createResource(0);
|
|
private Resource demand = Resources.createResource(0);
|
|
private long startTime;
|
|
private long startTime;
|
|
- private static RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null);
|
|
|
|
private static final Log LOG = LogFactory.getLog(AppSchedulable.class);
|
|
private static final Log LOG = LogFactory.getLog(AppSchedulable.class);
|
|
private FSLeafQueue queue;
|
|
private FSLeafQueue queue;
|
|
private RMContainerTokenSecretManager containerTokenSecretManager;
|
|
private RMContainerTokenSecretManager containerTokenSecretManager;
|
|
|
|
+ private Priority priority;
|
|
|
|
+ private ResourceWeights resourceWeights;
|
|
|
|
|
|
public AppSchedulable(FairScheduler scheduler, FSSchedulerApp app, FSLeafQueue queue) {
|
|
public AppSchedulable(FairScheduler scheduler, FSSchedulerApp app, FSLeafQueue queue) {
|
|
this.scheduler = scheduler;
|
|
this.scheduler = scheduler;
|
|
@@ -64,6 +65,8 @@ public class AppSchedulable extends Schedulable {
|
|
this.queue = queue;
|
|
this.queue = queue;
|
|
this.containerTokenSecretManager = scheduler.
|
|
this.containerTokenSecretManager = scheduler.
|
|
getContainerTokenSecretManager();
|
|
getContainerTokenSecretManager();
|
|
|
|
+ this.priority = Priority.newInstance(1);
|
|
|
|
+ this.resourceWeights = new ResourceWeights();
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -75,6 +78,10 @@ public class AppSchedulable extends Schedulable {
|
|
return app;
|
|
return app;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public ResourceWeights getResourceWeights() {
|
|
|
|
+ return resourceWeights;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void updateDemand() {
|
|
public void updateDemand() {
|
|
demand = Resources.createResource(0);
|
|
demand = Resources.createResource(0);
|
|
@@ -134,9 +141,7 @@ public class AppSchedulable extends Schedulable {
|
|
public Priority getPriority() {
|
|
public Priority getPriority() {
|
|
// Right now per-app priorities are not passed to scheduler,
|
|
// Right now per-app priorities are not passed to scheduler,
|
|
// so everyone has the same priority.
|
|
// so everyone has the same priority.
|
|
- Priority p = recordFactory.newRecordInstance(Priority.class);
|
|
|
|
- p.setPriority(1);
|
|
|
|
- return p;
|
|
|
|
|
|
+ return priority;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|