Examples of ExecutionEdge


Examples of eu.stratosphere.nephele.executiongraph.ExecutionEdge

    final InternalJobStatus jobStatus = eg.getJobStatus();
    if (jobStatus == InternalJobStatus.FAILING || jobStatus == InternalJobStatus.CANCELING) {
      return ConnectionInfoLookupResponse.createJobIsAborting();
    }

    final ExecutionEdge edge = eg.getEdgeByID(sourceChannelID);
    if (edge == null) {
      LOG.error("Cannot find execution edge associated with ID " + sourceChannelID);
      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();
    }

    if (assignedInstance.getInstanceConnectionInfo().equals(caller)) {
      // Receiver runs on the same task manager
      return ConnectionInfoLookupResponse.createReceiverFoundAndReady(edge.getInputChannelID());
    } 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()));
    }
  }
View Full Code Here

Examples of eu.stratosphere.nephele.executiongraph.ExecutionEdge

    for (int i = 0; i < numberOfOutputGates; ++i) {

      final ExecutionGate outputGate = vertex.getOutputGate(i);
      for (int j = 0; j < outputGate.getNumberOfEdges(); ++j) {

        final ExecutionEdge outputChannel = outputGate.getEdge(j);

        final ExecutionVertex connectedVertex = outputChannel.getInputGate().getVertex();
        if (connectedVertex == null) {
          LOG.error("Connected vertex is null");
          continue;
        }

        final AbstractInstance instance = connectedVertex.getAllocatedResource().getInstance();
        if (instance instanceof DummyInstance) {
          continue;
        }

        Set<ChannelID> channelIDs = entriesToInvalidate.get(instance);
        if (channelIDs == null) {
          channelIDs = new SerializableHashSet<ChannelID>();
          entriesToInvalidate.put(instance, channelIDs);
        }

        channelIDs.add(outputChannel.getInputChannelID());
      }
    }

    for (int i = 0; i < vertex.getNumberOfInputGates(); ++i) {

      final ExecutionGate inputGate = vertex.getInputGate(i);
      for (int j = 0; j < inputGate.getNumberOfEdges(); ++j) {

        final ExecutionEdge inputChannel = inputGate.getEdge(j);

        final ExecutionVertex connectedVertex = inputChannel.getOutputGate().getVertex();
        if (connectedVertex == null) {
          LOG.error("Connected vertex is null");
          continue;
        }

        final AbstractInstance instance = connectedVertex.getAllocatedResource().getInstance();
        if (instance instanceof DummyInstance) {
          continue;
        }

        Set<ChannelID> channelIDs = entriesToInvalidate.get(instance);
        if (channelIDs == null) {
          channelIDs = new SerializableHashSet<ChannelID>();
          entriesToInvalidate.put(instance, channelIDs);
        }

        channelIDs.add(inputChannel.getOutputChannelID());
      }
    }
  }
View Full Code Here

Examples of eu.stratosphere.nephele.executiongraph.ExecutionEdge

      if (deployTarget) {

        final int numberOfOutputChannels = outputGate.getNumberOfEdges();
        for (int j = 0; j < numberOfOutputChannels; ++j) {
          final ExecutionEdge outputChannel = outputGate.getEdge(j);
          final ExecutionVertex connectedVertex = outputChannel.getInputGate().getVertex();
          findVerticesToBeDeployed(connectedVertex, verticesToBeDeployed, alreadyVisited);
        }
      }
    }
  }
View Full Code Here

Examples of org.openiaml.model.model.operations.ExecutionEdge

    setTo(edge, to);
    return edge;
  }
 
  public ExecutionEdge generatedExecutionEdge(GeneratesElements by, ActivityOperation container) throws InferenceException {
    ExecutionEdge edge = (ExecutionEdge) createElement( container, OperationsPackage.eINSTANCE.getExecutionEdge(), OperationsPackage.eINSTANCE.getActivityOperation_ExecutionEdges() );
    setGeneratedBy(edge, by);
    return edge;
  }
View Full Code Here

Examples of org.openiaml.model.model.operations.ExecutionEdge

    setGeneratedBy(edge, by);
    return edge;
  }

  public ExecutionEdge generatedExecutionEdge(GeneratesElements by, ActivityOperation container, ExecutionEdgesSource from, ExecutionEdgeDestination to) throws InferenceException {
    ExecutionEdge edge = generatedExecutionEdge(by, container);
    setFrom(edge, from);
    setTo(edge, to);
    return edge;
  }
View Full Code Here

Examples of org.openiaml.model.model.operations.ExecutionEdge

    setTo(edge, to);
    return edge;
  }

  public ExecutionEdge generatedExecutionEdge(GeneratesElements by, ActivityPredicate container) throws InferenceException {
    ExecutionEdge edge = (ExecutionEdge) createElement( container, OperationsPackage.eINSTANCE.getExecutionEdge(), OperationsPackage.eINSTANCE.getActivityPredicate_ExecutionEdges() );
    setGeneratedBy(edge, by);
    return edge;
  }
View Full Code Here

Examples of org.openiaml.model.model.operations.ExecutionEdge

    setGeneratedBy(edge, by);
    return edge;
  }

  public ExecutionEdge generatedExecutionEdge(GeneratesElements by, ActivityPredicate container, ExecutionEdgesSource from, ExecutionEdgeDestination to) throws InferenceException {
    ExecutionEdge edge = generatedExecutionEdge(by, container);
    setFrom(edge, from);
    setTo(edge, to);
    return edge;
  }
View Full Code Here

Examples of org.openiaml.model.model.operations.ExecutionEdge

   * the given elements.
   *
   * @return The element found
   */
  public static ExecutionEdge assertHasExecutionEdge(EObject container, ExecutionEdgesSource from, ExecutionEdgeDestination to) throws JaxenException {
    ExecutionEdge result = null;
    for (ExecutionEdge e : from.getOutExecutions()) {
      if (from.equals(e.getFrom()) && to.equals(e.getTo())) {
        if (result != null) {
          fail("Found more than one execution edge from '" + from + "' to '" + to + "'. First = '" + result + ", second = '" + e + "'");
        }
View Full Code Here

Examples of org.openiaml.model.model.operations.ExecutionEdge

   * the given elements, and only with the given name.
   *
   * @return The element found
   */
  public static ExecutionEdge assertHasExecutionEdge(EObject container, ExecutionEdgesSource from, ExecutionEdgeDestination to, String name) throws JaxenException {
    ExecutionEdge result = null;
    for (ExecutionEdge e : from.getOutExecutions()) {
      if (from.equals(e.getFrom()) && to.equals(e.getTo()) && name.equals(e.getName())) {
        if (result != null) {
          fail("Found more than one execution edge from '" + from + "' to '" + to + "' with name '" + name + "'. First = '" + result + ", second = '" + e + "'");
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.