Package org.apache.mesos.Protos

Examples of org.apache.mesos.Protos.TaskState


        + " to " + taskStatus.getState().name()
        + " with message " + taskStatus.getMessage());

    // Remove the TaskTracker if the corresponding Mesos task has reached a
    // terminal state.
    TaskState state = taskStatus.getState();

    if (state == TaskState.TASK_FINISHED || state == TaskState.TASK_FAILED
        || state == TaskState.TASK_KILLED || state == TaskState.TASK_LOST) {

      // Make a copy to iterate over keys and delete values.
View Full Code Here


        }
      }

      @Override
      public void onFailure(Throwable t) {
        TaskState state = TaskState.TASK_LOST;
        String message = String.format("%s while initializing task: %s", t.getClass().getSimpleName(), t.getMessage());

        try {
          if (task.wasKilled()) {
            state = TaskState.TASK_KILLED;
View Full Code Here

    Futures.addCallback(processExitFuture, new FutureCallback<Integer>() {

      // these code blocks must not throw exceptions since they are executed inside an executor. (or must be caught)
      @Override
      public void onSuccess(Integer exitCode) {
        TaskState taskState = null;
        String message = null;

        if (task.wasKilled()) {
          taskState = TaskState.TASK_KILLED;

          if (!task.wasDestroyed()) {
            message = "Task killed. Process exited gracefully with code " + exitCode;
          } else {
            final long millisWaited = task.getExecutorData().getSigKillProcessesAfterMillis().or(configuration.getHardKillAfterMillis());

            message = String.format("Task killed forcibly after waiting at least %s", JavaUtils.durationFromMillis(millisWaited));
          }
        } else if (task.isSuccessExitCode(exitCode)) {
          taskState = TaskState.TASK_FINISHED;

          message = "Process exited normally with code " + exitCode;
        } else {
          taskState = TaskState.TASK_FAILED;

          message = "Process failed with code " + exitCode;
        }

        sendStatusUpdate(task, taskState, message);

        onFinish(task, taskState);
      }

      @Override
      public void onFailure(Throwable t) {
        task.getLog().error("Task {} failed while running process", task, t);

        TaskState taskState = null;
        String message = null;

        if (task.wasKilled()) {
          taskState = TaskState.TASK_KILLED;
          message = String.format("Task killed, caught %s", t.getClass().getSimpleName());
View Full Code Here

  public void frameworkMessage(ExecutorDriver d, byte[] msg) {
    try {
      HadoopFrameworkMessage hfm = new HadoopFrameworkMessage(msg);
      switch (hfm.type) {
        case S2E_SEND_STATUS_UPDATE: {
          TaskState s = TaskState.valueOf(hfm.arg1);
          LOG.info("Sending status update: " + hfm.arg2 + " is " + s);
          d.sendStatusUpdate(org.apache.mesos.Protos.TaskStatus.newBuilder()
                             .setTaskId(TaskID.newBuilder()
                                        .setValue(hfm.arg2).build())
                             .setState(s).build());
View Full Code Here

    }

    // Check whether the task has finished (either successfully or
    // not), and report to Mesos only if it has.
    State state = status.getRunState();
    TaskState mesosState = null;
    if (state == State.SUCCEEDED || state == State.COMMIT_PENDING)
      mesosState = TaskState.TASK_FINISHED;
    else if (state == State.FAILED || state == State.FAILED_UNCLEAN)
      mesosState = TaskState.TASK_FAILED;
    else if (state == State.KILLED || state == State.KILLED_UNCLEAN)
View Full Code Here

    return false;
  }

  @Override
  public void statusUpdate(SchedulerDriver d, org.apache.mesos.Protos.TaskStatus status) {
    TaskState state = status.getState();
    LOG.info("Task " + status.getTaskId().getValue() + " is " + state);
    if (state == TaskState.TASK_FINISHED || state == TaskState.TASK_FAILED ||
        state == TaskState.TASK_KILLED || state == TaskState.TASK_LOST) {
      synchronized (jobTracker) {
        TaskID mesosId = status.getTaskId();
View Full Code Here

TOP

Related Classes of org.apache.mesos.Protos.TaskState

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.