Package eu.stratosphere.runtime.io.network

Examples of eu.stratosphere.runtime.io.network.RemoteReceiver


      } 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


    StringBuilder str = new StringBuilder();

    str.append(String.format("==== %d outgoing connections ===\n", this.outConnections.size()));

    for (Map.Entry<RemoteReceiver, Object> entry : this.outConnections.entrySet()) {
      RemoteReceiver receiver = entry.getKey();

      Object value = entry.getValue();
      if (value instanceof OutboundConnectionQueue) {
        OutboundConnectionQueue queue = (OutboundConnectionQueue) value;
        if (queue.getNumQueuedEnvelopes() > 0) {
View Full Code Here

    // start sender threads
    // --------------------------------------------------------------------
    RemoteReceiver[] receivers = new RemoteReceiver[this.numChannels];

    for (int i = 0; i < this.numChannels; i++) {
      receivers[i] = new RemoteReceiver(new InetSocketAddress(localhost, BIND_PORT + 1), i);
    }

    for (int i = 0; i < this.numSubtasks; i++) {
      RemoteReceiver receiver = receivers[random.nextInt(this.numChannels)];
      new Thread(new SubtaskSenderThread(connManagerToTest, receiver)).start();
    }

    latch.await();
View Full Code Here

TOP

Related Classes of eu.stratosphere.runtime.io.network.RemoteReceiver

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.