Package eu.stratosphere.nephele.executiongraph

Examples of eu.stratosphere.nephele.executiongraph.ExecutionVertex


      this.executionGraph.getIndexOfCurrentExecutionStage());
    while (it.hasNext()) {

      final ExecutionGroupVertex groupVertex = it.next();
      for (int i = 0; i < groupVertex.getCurrentNumberOfGroupMembers(); i++) {
        final ExecutionVertex executionVertex = groupVertex.getGroupMember(i);
        if (instanceProfilingData.getInstanceConnectionInfo().equals(
          executionVertex.getAllocatedResource().getInstance().getInstanceConnectionInfo())) {
          this.collectedInstanceProfilingData.put(instanceProfilingData.getInstanceConnectionInfo(),
            instanceProfilingData);
          return true;
        }
      }
View Full Code Here


      this.executionGraph.getIndexOfCurrentExecutionStage());
    while (it.hasNext()) {

      final ExecutionGroupVertex groupVertex = it.next();
      for (int i = 0; i < groupVertex.getCurrentNumberOfGroupMembers(); i++) {
        final ExecutionVertex executionVertex = groupVertex.getGroupMember(i);
        final AbstractInstance instance = executionVertex.getAllocatedResource().getInstance();
        if(!(instance instanceof DummyInstance)) {
          tempSet.add(instance);
        }
      }
    }
View Full Code Here

      LOG.error("Cannot find execution graph for ID " + executionState.getJobID() + " to change state to "
        + executionState.getExecutionState());
      return;
    }

    final ExecutionVertex vertex = eg.getVertexByID(executionState.getID());
    if (vertex == null) {
      LOG.error("Cannot find vertex with ID " + executionState.getID() + " of job " + eg.getJobID()
        + " to change state to " + executionState.getExecutionState());
      return;
    }

    // Asynchronously update execute state of vertex
    vertex.updateExecutionStateAsynchronously(executionState.getExecutionState(), executionState.getDescription());
  }
View Full Code Here

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

      final ExecutionVertex vertex = it.next();
      final TaskCancelResult result = vertex.cancelTask();
      if (result.getReturnCode() != AbstractTaskResult.ReturnCode.SUCCESS) {
        errorResult = result;
      }
    }

View Full Code Here

      return ConnectionInfoLookupResponse.createReceiverNotFound();
    }

    if (sourceChannelID.equals(edge.getInputChannelID())) {
      // Request was sent from an input channel
      final ExecutionVertex connectedVertex = edge.getOutputGate().getVertex();

      final AbstractInstance assignedInstance = connectedVertex.getAllocatedResource().getInstance();
      if (assignedInstance == null) {
        LOG.error("Cannot resolve lookup: vertex found for channel ID " + edge.getOutputGateIndex()
          + " but no instance assigned");
        // 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) {
        final Runnable command = new Runnable() {
          @Override
          public void run() {
            scheduler.deployAssignedVertices(targetVertex);
          }
        };
        eg.executeCommand(command);
      }

      // LOG.info("Created receiverNotReady for " + targetVertex + " in state " + executionState + " 3");
      return ConnectionInfoLookupResponse.createReceiverNotReady();
    }

    final AbstractInstance assignedInstance = targetVertex.getAllocatedResource().getInstance();
    if (assignedInstance == null) {
      LOG.error("Cannot resolve lookup: vertex found for channel ID " + edge.getInputChannelID() + " but no instance assigned");
      // LOG.info("Created receiverNotReady for " + targetVertex + " in state " + executionState + " 4");
      return ConnectionInfoLookupResponse.createReceiverNotReady();
    }
View Full Code Here

    if (eg == null) {
      LOG.error("Cannot find execution graph for job " + jobID);
      return;
    }

    final ExecutionVertex vertex = eg.getVertexByID(ExecutionVertexID.fromManagementVertexID(id));
    if (vertex == null) {
      LOG.error("Cannot find execution vertex with ID " + id);
      return;
    }

    LOG.info("Killing task " + vertex + " of job " + jobID);

    final Runnable runnable = new Runnable() {

      @Override
      public void run() {

        final TaskKillResult result = vertex.killTask();
        if (result.getReturnCode() != AbstractTaskResult.ReturnCode.SUCCESS) {
          LOG.error(result.getDescription());
        }
      }
    };
View Full Code Here

    final Set<AbstractInstance> allocatedInstance = new HashSet<AbstractInstance>();

    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 "
            + state + ")");
          continue;
        }

        allocatedInstance.add(instance);
View Full Code Here

        }

        int count = 0;
        for (final TaskSubmissionResult tsr : submissionResultList) {

          ExecutionVertex vertex = verticesToBeDeployed.get(count++);
          if (!vertex.getID().equals(tsr.getVertexID())) {
            LOG.error("Expected different order of objects in task result list");
            vertex = null;
            for (final ExecutionVertex candVertex : verticesToBeDeployed) {
              if (tsr.getVertexID().equals(candVertex.getID())) {
                vertex = candVertex;
                break;
              }
            }

            if (vertex == null) {
              LOG.error("Cannot find execution vertex for vertex ID " + tsr.getVertexID());
              continue;
            }
          }

          if (tsr.getReturnCode() != AbstractTaskResult.ReturnCode.SUCCESS) {
            // Change the execution state to failed and let the scheduler deal with the rest
            vertex.updateExecutionStateAsynchronously(ExecutionState.FAILED, tsr.getDescription());
          }
        }
      }
    };
View Full Code Here

    if (graph == null) {
      LOG.error("Cannot find execution graph to job ID " + jobID);
      return null;
    }

    final ExecutionVertex vertex = graph.getVertexByID(vertexID);
    if (vertex == null) {
      LOG.error("Cannot find execution vertex for vertex ID " + vertexID);
      return null;
    }
View Full Code Here

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

    while (it.hasNext()) {

      final ExecutionVertex vertex = it.next();

      // Register the listener object which will pass state changes on to the collector
      vertex.registerExecutionListener(new ExecutionListenerWrapper(this, vertex));

      // Register the listener object which will pass assignment changes on to the collector
      vertex.registerVertexAssignmentListener(new VertexAssignmentListenerWrapper(this, executionGraph.getJobID()));
    }

    // Register one job status listener wrapper for the entire job
    executionGraph.registerJobStatusListener(new JobStatusListenerWrapper(this, executionGraph.getJobName(),
      profilingAvailable, submissionTimestamp));
View Full Code Here

TOP

Related Classes of eu.stratosphere.nephele.executiongraph.ExecutionVertex

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.