Package eu.stratosphere.nephele.execution

Examples of eu.stratosphere.nephele.execution.ExecutionState


    if (newExecutionState == null) {
      throw new IllegalArgumentException("Argument newExecutionState must not be null");
    }

    final ExecutionState currentExecutionState = this.executionState.get();
    if (currentExecutionState == ExecutionState.CANCELING) {

      // If we are in CANCELING, ignore state changes to FINISHING
      if (newExecutionState == ExecutionState.FINISHING) {
        return currentExecutionState;
      }

      // Rewrite FINISHED to CANCELED if the task has been marked to be canceled
      if (newExecutionState == ExecutionState.FINISHED) {
        LOG.info("Received transition from CANCELING to FINISHED for vertex " + toString()
          + ", converting it to CANCELED");
        newExecutionState = ExecutionState.CANCELED;
      }
    }

    // Check and save the new execution state
    final ExecutionState previousState = this.executionState.getAndSet(newExecutionState);
    if (previousState == newExecutionState) {
      return previousState;
    }

    // Check the transition
View Full Code Here


   *
   * @return the result of the task kill attempt
   */
  public TaskKillResult killTask() {

    final ExecutionState state = this.executionState.get();

    if (state != ExecutionState.RUNNING) {
      final TaskKillResult result = new TaskKillResult(getID(), AbstractTaskResult.ReturnCode.ILLEGAL_STATE);
      result.setDescription("Vertex " + this.toString() + " is in state " + state);
      return result;
View Full Code Here

   */
  public TaskCancelResult cancelTask() {

    while (true) {

      final ExecutionState previousState = this.executionState.get();

      if (previousState == ExecutionState.CANCELED) {
        return new TaskCancelResult(getID(), AbstractTaskResult.ReturnCode.SUCCESS);
      }

View Full Code Here

    final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(this, true);

    while (it.hasNext()) {

      final ExecutionState s = it.next().getExecutionState();
      if (s != ExecutionState.CREATED && s != ExecutionState.SCHEDULED && s != ExecutionState.READY) {
        return false;
      }
    }
View Full Code Here

    final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(this, true);

    while (it.hasNext()) {

      final ExecutionState state = it.next().getExecutionState();

      if (state != ExecutionState.CANCELED && state != ExecutionState.FAILED && state != ExecutionState.FINISHED) {
        return false;
      }
    }
View Full Code Here

    if (vertex == null) {
      LOG.error("Cannot find execution vertex with the ID " + vertexID);
      return;
    }

    final ExecutionState actualExecutionState = vertex.getExecutionState();

    final InternalJobStatus newJobStatus = determineNewJobStatus(this, actualExecutionState);

    if (actualExecutionState == ExecutionState.FINISHED) {
      // It is worth checking if the current stage has complete
View Full Code Here

  public boolean isFinishing() {

    final Iterator<ExecutionVertex> it = this.vertices.iterator();
    while (it.hasNext()) {

      final ExecutionState state = it.next().getExecutionState();
      if (state != ExecutionState.FINISHING && state != ExecutionState.FINISHED) {
        return false;
      }
    }
View Full Code Here

        // LOG.info("Created receiverNotReady for " + connectedVertex + " 1");
        return ConnectionInfoLookupResponse.createReceiverNotReady();
      }

      // Check execution state
      final ExecutionState executionState = connectedVertex.getExecutionState();
      if (executionState == ExecutionState.FINISHED) {
        // that should not happen. if there is data pending, the receiver cannot be ready
        return ConnectionInfoLookupResponse.createReceiverNotFound();
      }

      // running is common, finishing is happens when the lookup is for the close event
      if (executionState != ExecutionState.RUNNING && executionState != ExecutionState.FINISHING) {
        // LOG.info("Created receiverNotReady for " + connectedVertex + " in state " + executionState + " 2");
        return ConnectionInfoLookupResponse.createReceiverNotReady();
      }

      if (assignedInstance.getInstanceConnectionInfo().equals(caller)) {
        // Receiver runs on the same task manager
        return ConnectionInfoLookupResponse.createReceiverFoundAndReady(edge.getOutputChannelID());
      } else {
        // Receiver runs on a different task manager
        final InstanceConnectionInfo ici = assignedInstance.getInstanceConnectionInfo();
        final InetSocketAddress isa = new InetSocketAddress(ici.address(), ici.dataPort());

        return ConnectionInfoLookupResponse.createReceiverFoundAndReady(new RemoteReceiver(isa, edge.getConnectionID()));
      }
    }
    // else, the request is for an output channel
    // Find vertex of connected input channel
    final ExecutionVertex targetVertex = edge.getInputGate().getVertex();

    // Check execution state
    final ExecutionState executionState = targetVertex.getExecutionState();

    // check whether the task needs to be deployed
    if (executionState != ExecutionState.RUNNING && executionState != ExecutionState.FINISHING && executionState != ExecutionState.FINISHED) {

      if (executionState == ExecutionState.ASSIGNED) {
View Full Code Here

    final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(eg, true);
    while (it.hasNext()) {

      final ExecutionVertex vertex = it.next();
      final ExecutionState state = vertex.getExecutionState();
      if (state == ExecutionState.RUNNING || state == ExecutionState.FINISHING) {
        final AbstractInstance instance = vertex.getAllocatedResource().getInstance();

        if (instance instanceof DummyInstance) {
          LOG.error("Found instance of type DummyInstance for vertex " + vertex.getName() + " (state "
View Full Code Here

    boolean resourceCanBeReleased = true;
    final Iterator<ExecutionVertex> it = allocatedResource.assignedVertices();
    while (it.hasNext()) {
      final ExecutionVertex vertex = it.next();
      final ExecutionState state = vertex.getExecutionState();

      if (state != ExecutionState.CREATED && state != ExecutionState.FINISHED
        && state != ExecutionState.FAILED && state != ExecutionState.CANCELED) {

        resourceCanBeReleased = false;
View Full Code Here

TOP

Related Classes of eu.stratosphere.nephele.execution.ExecutionState

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.