Package org.apache.hama.bsp

Examples of org.apache.hama.bsp.GroomServerStatus


  private static String getAnyGroomToSchedule(
      Map<String, GroomServerStatus> grooms,
      Map<GroomServerStatus, Integer> tasksInGroomMap) {

    for (String s : grooms.keySet()) {
      GroomServerStatus groom = grooms.get(s);
      if (groom == null)
        continue;
      Integer taskInGroom = tasksInGroomMap.get(groom);
      taskInGroom = (taskInGroom == null) ? 0 : taskInGroom;
      if (taskInGroom < groom.getMaxTasks()) {
        return groom.getGroomHostName();
      }
    }
    return null;
  }
View Full Code Here


  private String getGroomToSchedule(Map<String, GroomServerStatus> grooms,
      Map<GroomServerStatus, Integer> tasksInGroomMap,
      String[] possibleLocations) {

    for (String location : possibleLocations) {
      GroomServerStatus groom = grooms.get(location);
      if (groom == null) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Could not find groom for location " + location);
        }
        continue;
      }
      Integer taskInGroom = tasksInGroomMap.get(groom);
      taskInGroom = (taskInGroom == null) ? 0 : taskInGroom;
      if (LOG.isDebugEnabled()) {
        LOG.debug("taskInGroom = " + taskInGroom + " max tasks = "
            + groom.getMaxTasks() + " location = " + location
            + " groomhostname = " + groom.getGroomHostName());
      }
      if (taskInGroom < groom.getMaxTasks()
          && location.equals(groom.getGroomHostName())) {
        return groom.getGroomHostName();
      }
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("Returning null");
    }
View Full Code Here

TOP

Related Classes of org.apache.hama.bsp.GroomServerStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.