scheduler.setClock(clock); resourceManager.start(); preemptionThread = (FairSchedulerWithMockPreemption.MockPreemptionThread)
private void startResourceManager(float utilizationThreshold) { conf.setFloat(FairSchedulerConfiguration.PREEMPTION_THRESHOLD, utilizationThreshold); resourceManager = new MockRM(conf); resourceManager.start(); assertTrue( resourceManager.getResourceScheduler() instanceof StubbedFairScheduler); scheduler = (FairScheduler)resourceManager.getResourceScheduler(); scheduler.setClock(clock); scheduler.updateInterval = 60 * 1000; }
scheduler.setClock(clock);
scheduler.setClock(clock);
conf.set(FairSchedulerConfiguration.ALLOCATION_FILE, ALLOC_FILE); MockClock clock = new MockClock(); scheduler.setClock(clock);
conf.set(FairSchedulerConfiguration.ALLOCATION_FILE, ALLOC_FILE); ControlledClock clock = new ControlledClock(); scheduler.setClock(clock);
conf.set(FairSchedulerConfiguration.ALLOCATION_FILE, ALLOC_FILE); MockClock clock = new MockClock(); scheduler.setClock(clock);
@Before public void setup() { mockClock = new MockClock(); conf = createConfiguration(); resourceManager = new MockRM(conf); resourceManager.start(); scheduler = (FairScheduler) resourceManager.getResourceScheduler(); scheduler.setClock(mockClock); assertTrue(scheduler.isContinuousSchedulingEnabled()); assertEquals( FairSchedulerConfiguration.DEFAULT_CONTINUOUS_SCHEDULING_SLEEP_MS, scheduler.getContinuousSchedulingSleepMs()); assertEquals(mockClock, scheduler.getClock()); }
@SuppressWarnings("deprecation") @Before public void setup() { mockClock = new ControlledClock(); conf = createConfiguration(); resourceManager = new MockRM(conf); resourceManager.start(); scheduler = (FairScheduler) resourceManager.getResourceScheduler(); scheduler.setClock(mockClock); assertTrue(scheduler.isContinuousSchedulingEnabled()); assertEquals( FairSchedulerConfiguration.DEFAULT_CONTINUOUS_SCHEDULING_SLEEP_MS, scheduler.getContinuousSchedulingSleepMs()); assertEquals(mockClock, scheduler.getClock()); }
scheduler.setClock(clock);
scheduler.setClock(clock); scheduler.init(conf); scheduler.start();
scheduler.setClock(clock);
scheduler.setClock(clock);
private void setupCluster() throws IOException { resourceManager = new MockRM(conf); scheduler = (FairScheduler) resourceManager.getResourceScheduler(); // YARN-6249, FSLeafQueue#lastTimeAtMinShare is initialized to the time in // the real world, so we should keep the clock up with it. clock.setTime(SystemClock.getInstance().getTime()); scheduler.setClock(clock); resourceManager.start(); // Create and add two nodes to the cluster, with capacities // disproportional to the container requests. addNode(NODE_CAPACITY_MULTIPLE * GB, 3 * NODE_CAPACITY_MULTIPLE); addNode(NODE_CAPACITY_MULTIPLE * GB, 3 * NODE_CAPACITY_MULTIPLE); // Reinitialize the scheduler so DRF policy picks up cluster capacity // TODO (YARN-6194): One shouldn't need to call this scheduler.reinitialize(conf, resourceManager.getRMContext()); // Verify if child-1 and child-2 are preemptable FSQueue child1 = scheduler.getQueueManager().getQueue("nonpreemptable.child-1"); assertFalse(child1.isPreemptable()); FSQueue child2 = scheduler.getQueueManager().getQueue("nonpreemptable.child-2"); assertFalse(child2.isPreemptable()); }
conf.set(FairSchedulerConfiguration.ALLOCATION_FILE, ALLOC_FILE); MockClock clock = new MockClock(); scheduler.setClock(clock);