use of org.apache.hadoop.yarn.server.resourcemanager.monitor.SchedulingMonitor in project hadoop by apache.
the class CapacitySchedulerPreemptionTestBase method getSchedulingEditPolicy.
SchedulingEditPolicy getSchedulingEditPolicy(MockRM rm) {
ResourceManager.RMActiveServices activeServices = rm.getRMActiveService();
SchedulingMonitor mon = null;
for (Service service : activeServices.getServices()) {
if (service instanceof SchedulingMonitor) {
mon = (SchedulingMonitor) service;
break;
}
}
if (mon != null) {
return mon.getSchedulingEditPolicy();
}
return null;
}
use of org.apache.hadoop.yarn.server.resourcemanager.monitor.SchedulingMonitor in project hadoop by apache.
the class TestProportionalCapacityPreemptionPolicy method testPolicyInitializeAfterSchedulerInitialized.
@Test
public void testPolicyInitializeAfterSchedulerInitialized() {
@SuppressWarnings("resource") MockRM rm = new MockRM(conf);
rm.init(conf);
// after scheduler got initialized
for (Service service : rm.getRMActiveService().getServices()) {
if (service instanceof SchedulingMonitor) {
ProportionalCapacityPreemptionPolicy policy = (ProportionalCapacityPreemptionPolicy) ((SchedulingMonitor) service).getSchedulingEditPolicy();
assertNotNull(policy.getResourceCalculator());
return;
}
}
fail("Failed to find SchedulingMonitor service, please check what happened");
}
Aggregations