Package org.apache.hama.bsp

Examples of org.apache.hama.bsp.GroomServerStatus


    }

    private void restartTask(TaskInProgress tip, long superstep,
        Map<String, GroomServerStatus> groomStatuses,
        Map<GroomServerStatus, List<GroomServerAction>> actionMap) {
      GroomServerStatus serverStatus = tip.getGroomServerStatus();
      Task task = tip.constructTask(serverStatus);
      populateAction(task, superstep, serverStatus, actionMap);

    }
View Full Code Here


              hosts = blocks[0].getHosts();
            } else {
              hosts = new String[groomStatuses.keySet().size()];
              groomStatuses.keySet().toArray(hosts);
            }
            GroomServerStatus serverStatus = this.allocationStrategy
                .getGroomToAllocate(groomStatuses, hosts, taskCountInGroomMap,
                    new BSPResource[0], allTasks[i]);
            Task task = allTasks[i].constructTask(serverStatus);
            populateAction(task, superstep, serverStatus, actionMap);
View Full Code Here

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

    Iterator<String> groomIter = grooms.keySet().iterator();
    while (groomIter.hasNext()) {
      GroomServerStatus groom = grooms.get(groomIter.next());
      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

      Map<GroomServerStatus, Integer> tasksInGroomMap,
      String[] possibleLocations) {

    for (int i = 0; i < possibleLocations.length; ++i) {
      String location = possibleLocations[i];
      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

  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

    }

    private void restartTask(TaskInProgress tip, long superstep,
        Map<String, GroomServerStatus> groomStatuses,
        Map<GroomServerStatus, List<GroomServerAction>> actionMap) {
      GroomServerStatus serverStatus = tip.getGroomServerStatus();
      Task task = tip.constructTask(serverStatus);
      populateAction(task, superstep, serverStatus, actionMap);

    }
View Full Code Here

              hosts = blocks[0].getHosts();
            } else {
              hosts = new String[groomStatuses.keySet().size()];
              groomStatuses.keySet().toArray(hosts);
            }
            GroomServerStatus serverStatus = this.allocationStrategy
                .getGroomToAllocate(groomStatuses, hosts, taskCountInGroomMap,
                    new BSPResource[0], allTask);
            Task task = allTask.constructTask(serverStatus);
            populateAction(task, superstep, serverStatus, actionMap);
View Full Code Here

    }

    private void restartTask(TaskInProgress tip, long superstep,
        Map<String, GroomServerStatus> groomStatuses,
        Map<GroomServerStatus, List<GroomServerAction>> actionMap) {
      GroomServerStatus serverStatus = tip.getGroomServerStatus();
      Task task = tip.constructTask(serverStatus);
      populateAction(task, superstep, serverStatus, actionMap);

    }
View Full Code Here

              hosts = blocks[0].getHosts();
            } else {
              hosts = new String[groomStatuses.keySet().size()];
              groomStatuses.keySet().toArray(hosts);
            }
            GroomServerStatus serverStatus = this.allocationStrategy
                .getGroomToAllocate(groomStatuses, hosts, taskCountInGroomMap,
                    new BSPResource[0], allTask);
            Task task = allTask.constructTask(serverStatus);
            populateAction(task, superstep, serverStatus, actionMap);
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.