YARN-7045. Remove FSLeafQueue#addAppSchedulable. (Contributed by Sen Zhao via Yufei Gu)
(cherry picked from commit a92ef030a2
)
This commit is contained in:
parent
18e5f2068b
commit
c3c8b0ffab
|
@ -95,16 +95,6 @@ public class FSLeafQueue extends FSQueue {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// for testing
|
|
||||||
void addAppSchedulable(FSAppAttempt appSched) {
|
|
||||||
writeLock.lock();
|
|
||||||
try {
|
|
||||||
runnableApps.add(appSched);
|
|
||||||
} finally {
|
|
||||||
writeLock.unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the given app from this queue.
|
* Removes the given app from this queue.
|
||||||
* @return whether or not the app was runnable
|
* @return whether or not the app was runnable
|
||||||
|
|
|
@ -89,8 +89,8 @@ public class TestFSLeafQueue extends FairSchedulerTestBase {
|
||||||
FSAppAttempt app = mock(FSAppAttempt.class);
|
FSAppAttempt app = mock(FSAppAttempt.class);
|
||||||
Mockito.when(app.getDemand()).thenReturn(maxResource);
|
Mockito.when(app.getDemand()).thenReturn(maxResource);
|
||||||
|
|
||||||
schedulable.addAppSchedulable(app);
|
schedulable.addApp(app, true);
|
||||||
schedulable.addAppSchedulable(app);
|
schedulable.addApp(app, true);
|
||||||
|
|
||||||
schedulable.updateDemand();
|
schedulable.updateDemand();
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ public class TestFSLeafQueue extends FairSchedulerTestBase {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
for (int i=0; i < 500; i++) {
|
for (int i=0; i < 500; i++) {
|
||||||
schedulable.addAppSchedulable(app);
|
schedulable.addApp(app, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -5220,12 +5220,12 @@ public class TestFairScheduler extends FairSchedulerTestBase {
|
||||||
FSLeafQueue aQueue =
|
FSLeafQueue aQueue =
|
||||||
new FSLeafQueue("root.queue1.a", scheduler, queue1);
|
new FSLeafQueue("root.queue1.a", scheduler, queue1);
|
||||||
aQueue.setMaxShare(maxResource);
|
aQueue.setMaxShare(maxResource);
|
||||||
aQueue.addAppSchedulable(app1);
|
aQueue.addApp(app1, true);
|
||||||
|
|
||||||
FSLeafQueue bQueue =
|
FSLeafQueue bQueue =
|
||||||
new FSLeafQueue("root.queue1.b", scheduler, queue1);
|
new FSLeafQueue("root.queue1.b", scheduler, queue1);
|
||||||
bQueue.setMaxShare(maxResource);
|
bQueue.setMaxShare(maxResource);
|
||||||
bQueue.addAppSchedulable(app2);
|
bQueue.addApp(app2, true);
|
||||||
|
|
||||||
queue1.setMaxShare(maxResource);
|
queue1.setMaxShare(maxResource);
|
||||||
queue1.addChildQueue(aQueue);
|
queue1.addChildQueue(aQueue);
|
||||||
|
@ -5269,7 +5269,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
|
||||||
FSAppAttempt app = mock(FSAppAttempt.class);
|
FSAppAttempt app = mock(FSAppAttempt.class);
|
||||||
Mockito.when(app.getDemand()).thenReturn(resource);
|
Mockito.when(app.getDemand()).thenReturn(resource);
|
||||||
Mockito.when(app.getResourceUsage()).thenReturn(resource);
|
Mockito.when(app.getResourceUsage()).thenReturn(resource);
|
||||||
child1.addAppSchedulable(app);
|
child1.addApp(app, true);
|
||||||
child1.updateDemand();
|
child1.updateDemand();
|
||||||
|
|
||||||
String childQueueString = "{Name: root.parent.child1,"
|
String childQueueString = "{Name: root.parent.child1,"
|
||||||
|
|
Loading…
Reference in New Issue