Package eu.stratosphere.runtime.io.channels

Examples of eu.stratosphere.runtime.io.channels.Channel


  public void unregister(ExecutionVertexID vertexId, Task task) {
    final Environment environment = task.getEnvironment();

    // destroy and remove OUTPUT channels from registered channels and cache
    for (ChannelID id : environment.getOutputChannelIDs()) {
      Channel channel = this.channels.remove(id);
      if (channel != null) {
        channel.destroy();
      }

      this.receiverCache.remove(channel);
    }

    // destroy and remove INPUT channels from registered channels and cache
    for (ChannelID id : environment.getInputChannelIDs()) {
      Channel channel = this.channels.remove(id);
      if (channel != null) {
        channel.destroy();
      }

      this.receiverCache.remove(channel);
    }
View Full Code Here


      LOG.warn("Receiver cache already contained entry for " + source);
    }
  }

  private void generateSenderHint(Envelope envelope, RemoteReceiver receiver) throws IOException {
    Channel channel = this.channels.get(envelope.getSource());
    if (channel == null) {
      LOG.error("Cannot find channel for channel ID " + envelope.getSource());
      return;
    }

    // Only generate sender hints for output channels
    if (channel.isInputChannel()) {
      return;
    }

    final ChannelID targetChannelID = channel.getConnectedId();
    final int connectionIndex = receiver.getConnectionIndex();

    final RemoteReceiver ourAddress = new RemoteReceiver(this.ourAddress, connectionIndex);
    final Envelope senderHint = SenderHintEvent.createEnvelopeWithEvent(envelope, targetChannelID, ourAddress);
View Full Code Here

    boolean success = false;
   
    try {
      if (receiverList.hasLocalReceiver()) {
        ChannelID receiver = receiverList.getLocalReceiver();
        Channel channel = this.channels.get(receiver);

        if (channel == null) {
          throw new LocalReceiverCancelledException(receiver);
        }

        if (!channel.isInputChannel()) {
          throw new IOException("Local receiver " + receiver + " is not an input channel.");
        }

        InputChannel<?> inputChannel = (InputChannel<?>) channel;
       
View Full Code Here

   
    EnvelopeReceiverList receiverList = getReceiverListForEnvelope(envelope, true);

    if (receiverList.hasLocalReceiver()) {
      ChannelID receiver = receiverList.getLocalReceiver();
      Channel channel = this.channels.get(receiver);

      if (channel == null) {
        throw new LocalReceiverCancelledException(receiver);
      }

      if (channel.isInputChannel()) {
        throw new IOException("Local receiver " + receiver + " of backward event is not an output channel.");
      }

      OutputChannel outputChannel = (OutputChannel) channel;
      outputChannel.queueEnvelope(envelope);
View Full Code Here

    if (!receiverList.hasLocalReceiver() || receiverList.hasRemoteReceiver()) {
      throw new IOException("Bug in network stack: Envelope dispatched from the incoming network pipe has no local receiver or has a remote receiver");
    }

    ChannelID localReceiver = receiverList.getLocalReceiver();
    Channel channel = this.channels.get(localReceiver);
   
    // if the channel is null, it means that receiver has been cleared already (cancelled or failed).
    // release the buffer immediately
    if (channel == null) {
      releaseEnvelope(envelope);
      if (LOG.isDebugEnabled()) {
        LOG.debug("Dropping envelope for cancelled receiver " + localReceiver);
      }
    }
    else {
      channel.queueEnvelope(envelope);
    }
  }
View Full Code Here

      throw new IOException("The destination to be looked up is not a single local endpoint.");
    }
   

    ChannelID localReceiver = receiverList.getLocalReceiver();
    Channel channel = this.channels.get(localReceiver);
   
    if (channel == null) {
      // receiver is already canceled
      return this.discardBufferPool;
    }

    if (!channel.isInputChannel()) {
      throw new IOException("Channel context for local receiver " + localReceiver + " is not an input channel context");
    }

    return (InputChannel<?>) channel;
  }
View Full Code Here

TOP

Related Classes of eu.stratosphere.runtime.io.channels.Channel

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.