FairScheduler extends
    AbstractYarnScheduler<FSAppAttempt, FSSchedulerNode> { @Override public void serviceInit(Configuration conf) throws Exception { migration = conf.getBoolean(FairSchedulerConfiguration.MIGRATION_MODE, false); noTerminalRuleCheck = migration && conf.getBoolean(FairSchedulerConfiguration.NO_TERMINAL_RULE_CHECK, false); initScheduler(conf); super.serviceInit(conf); if (!migration) { schedulingMonitorManager.initialize(rmContext, conf); } } FairScheduler(); FSContext getContext(); RMContext getRMContext(); boolean isAtLeastReservationThreshold(
      ResourceCalculator resourceCalculator, Resource resource); FairSchedulerConfiguration getConf(); int getNumNodesInRack(String rackName); QueueManager getQueueManager(); @VisibleForTesting @Override void update(); RMContainerTokenSecretManager getContainerTokenSecretManager(); boolean isSizeBasedWeight(); Resource getIncrementResourceCapability(); double getNodeLocalityThreshold(); double getRackLocalityThreshold(); @Deprecated long getNodeLocalityDelayMs(); @Deprecated long getRackLocalityDelayMs(); @Deprecated boolean isContinuousSchedulingEnabled(); @Deprecated int getContinuousSchedulingSleepMs(); @Override Resource getNormalizedResource(Resource requestedResource,
      Resource maxResourceCapability); @Override Resource getMaximumResourceCapability(String queueName); @VisibleForTesting @Override void killContainer(RMContainer container); @Override Allocation allocate(ApplicationAttemptId appAttemptId,
      List<ResourceRequest> ask, List<SchedulingRequest> schedulingRequests,
      List<ContainerId> release, List<String> blacklistAdditions,
      List<String> blacklistRemovals, ContainerUpdates updateRequests); FSAppAttempt getSchedulerApp(ApplicationAttemptId appAttemptId); @Override ResourceCalculator getResourceCalculator(); @Override QueueMetrics getRootQueueMetrics(); @Override void handle(SchedulerEvent event); @Override void recover(RMState state); void setRMContext(RMContext rmContext); @Override void serviceInit(Configuration conf); @Override void serviceStart(); @SuppressWarnings("deprecation") @Override void serviceStop(); @Override void reinitialize(Configuration conf, RMContext rmContext); @Override QueueInfo getQueueInfo(String queueName, boolean includeChildQueues,
      boolean recursive); @Override List<QueueUserACLInfo> getQueueUserAclInfo(); @Override int getNumClusterNodes(); @Override boolean checkAccess(UserGroupInformation callerUGI,
      QueueACL acl, String queueName); AllocationConfiguration getAllocationConfiguration(); @Override List<ApplicationAttemptId> getAppsInQueue(String queueName); @Override String moveApplication(ApplicationId appId,
      String queueName); @Override void preValidateMoveApplication(ApplicationId appId, String newQueue); @Override void updateNodeResource(RMNode nm,
      ResourceOption resourceOption); @Override EnumSet<SchedulerResourceTypes> getSchedulingResourceTypes(); @Override Set<String> getPlanQueues(); @Override void setEntitlement(String queueName,
      QueueEntitlement entitlement); @Override void removeQueue(String queueName); float getReservableNodesRatio(); @Override long checkAndGetApplicationLifetime(String queueName, long lifetime); @Override Priority updateApplicationPriority(Priority newPriority,
      ApplicationId applicationId, SettableFuture<Object> future,
      UserGroupInformation user); boolean isNoTerminalRuleCheck(); static final Resource CONTAINER_RESERVED; }
@Test (timeout = 30000) public void testConfValidation() throws Exception { Configuration conf = new YarnConfiguration(); conf.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 2048); conf.setInt(YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB, 1024); try { scheduler.serviceInit(conf); fail("Exception is expected because the min memory allocation is" + " larger than the max memory allocation."); } catch (YarnRuntimeException e) { assertTrue("The thrown exception is not the expected one.", e.getMessage().startsWith( "Invalid resource scheduler memory")); } conf = new YarnConfiguration(); conf.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_VCORES, 2); conf.setInt(YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES, 1); try { scheduler.serviceInit(conf); fail("Exception is expected because the min vcores allocation is" + " larger than the max vcores allocation."); } catch (YarnRuntimeException e) { assertTrue("The thrown exception is not the expected one.", e.getMessage().startsWith( "Invalid resource scheduler vcores")); } }