SchedulerUtils { public static boolean isEligibleForFineGrainedScaling(String hostName, SchedulerState state) { for (NodeTask activeNMTask : state.getActiveTasksByType(NodeManagerConfiguration.DEFAULT_NM_TASK_PREFIX)) { if (activeNMTask.getProfile().getCpus() == 0 && activeNMTask.getProfile().getMemory() == 0 && activeNMTask.getHostname().equals(hostName)) { return true; } } return false; }  static boolean isUniqueHostname(Protos.OfferOrBuilder offer, NodeTask taskToLaunch, Collection<NodeTask> tasks); static boolean isEligibleForFineGrainedScaling(String hostName, SchedulerState state);  }
@Test public void testIsEligibleForFineGrainedSchedulingFalse() throws Exception { assertFalse(SchedulerUtils.isEligibleForFineGrainedScaling("localhost", sState)); }
@Test public void testIsEligibleForFineGrainedSchedulingTrue() throws Exception { assertFalse(SchedulerUtils.isEligibleForFineGrainedScaling("server1", sState)); }