Package org.apache.hama.ipc

Examples of org.apache.hama.ipc.WorkerProtocol


      LOG.error("No groom server status.");
      throw new NullPointerException("No groom server status.");
    }
    Throwable e = null;
    try {
      WorkerProtocol wc = (WorkerProtocol) RPC.waitForProxy(
          WorkerProtocol.class, WorkerProtocol.versionID,
          resolveWorkerAddress(status.getRpcServer()), this.conf);
      if (null == wc) {
        LOG.warn("Fail to create Worker client at host " + status.getPeerName());
        return false;
View Full Code Here


  }

  private void updateGroomServersKey(GroomServerStatus old,
      GroomServerStatus newKey) {
    synchronized (groomServers) {
      WorkerProtocol worker = groomServers.remove(old);
      groomServers.put(newKey, worker);
    }
  }
View Full Code Here

          } else if (jip.getStatus().getRunState() == JobStatus.RUNNING) {
            jip.getStatus().setprogress(ts.getSuperstepCount());
          } else if (jip.getStatus().getRunState() == JobStatus.KILLED) {
           
            WorkerProtocol worker = findGroomServer(ustus);
            Directive d1 = new Directive(currentGroomServerPeers(),
                new GroomServerAction[] { new KillTaskAction(ts.getTaskId()) });
           
            worker.dispatch(d1);
           
          }
         
        }
      } else {
View Full Code Here

      // obtain tasks
      Task t = jip.obtainNewTask(this.stus, groomNum);
      // assembly into actions
      // List<Task> tasks = new ArrayList<Task>();
      if (jip.getStatus().getRunState() == JobStatus.RUNNING) {
        WorkerProtocol worker = groomServerManager.findGroomServer(this.stus);
        try {
          // dispatch() to the groom server
          Directive d1 = new Directive(groomServerManager
              .currentGroomServerPeers(),
              new GroomServerAction[] { new LaunchTaskAction(t) });
          worker.dispatch(d1);
        } catch (IOException ioe) {
          LOG.error("Fail to dispatch tasks to GroomServer "
              + this.stus.getGroomName(), ioe);
        }
      } else {
View Full Code Here

      // obtain tasks
      Task t = jip.obtainNewTask(this.stus, groomNum);
      // assembly into actions
      // List<Task> tasks = new ArrayList<Task>();
      if (jip.getStatus().getRunState() == JobStatus.RUNNING) {
        WorkerProtocol worker = groomServerManager.findGroomServer(this.stus);
        try {
          // dispatch() to the groom server
          Directive d1 = new DispatchTasksDirective(groomServerManager
              .currentGroomServerPeers(), new GroomServerAction[] {
              new LaunchTaskAction(t)});
          worker.dispatch(d1);
        } catch (IOException ioe) {
          LOG.error("Fail to dispatch tasks to GroomServer "
              + this.stus.getGroomName(), ioe);
        }
      } else {
View Full Code Here

      LOG.error("No groom server status.");
      throw new NullPointerException("No groom server status.");
    }
    Throwable e = null;
    try {
      WorkerProtocol wc = (WorkerProtocol) RPC.waitForProxy(
          WorkerProtocol.class, WorkerProtocol.versionID,
          resolveWorkerAddress(status.getRpcServer()), this.conf);
      if (null == wc) {
        LOG.warn("Fail to create Worker client at host " + status.getPeerName());
        return false;
View Full Code Here

  }

  private void updateGroomServersKey(GroomServerStatus old,
      GroomServerStatus newKey) {
    synchronized (groomServers) {
      WorkerProtocol worker = groomServers.remove(old);
      groomServers.put(newKey, worker);
    }
  }
View Full Code Here

                }
              }
            } else if (jip.getStatus().getRunState() == JobStatus.RUNNING) {
              jip.getStatus().setprogress(ts.getSuperstepCount());
            } else if (jip.getStatus().getRunState() == JobStatus.KILLED) {
              WorkerProtocol worker = findGroomServer(tmpStatus);
              Directive d1 = new DispatchTasksDirective(
                  currentGroomServerPeers(),
                  new GroomServerAction[] { new KillTaskAction(ts.getTaskId()) });
              try {
                worker.dispatch(d1);
              } catch (IOException ioe) {
                throw new DirectiveException("Error when dispatching kill task"
                    + " action.", ioe);
              }
            }
View Full Code Here

TOP

Related Classes of org.apache.hama.ipc.WorkerProtocol

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.