Class LocalOutputContext

  • All Implemented Interfaces:
    java.lang.AutoCloseable, OutputContext

    public final class LocalOutputContext
    extends LocalTransferContext
    implements OutputContext
    This class provides a data transfer interface to the sender side when both the sender and the receiver are in the same executor. Since data serialization is unnecessary, the sender sends data without serializing them. A single local output context represents a data transfer between two tasks.
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalOutputContext​(java.lang.String executorId, java.lang.String edgeId, int srcTaskIndex, int dstTaskIndex)
      Creates a new local output context.
    • Constructor Detail

      • LocalOutputContext

        public LocalOutputContext​(java.lang.String executorId,
                                  java.lang.String edgeId,
                                  int srcTaskIndex,
                                  int dstTaskIndex)
        Creates a new local output context.
        Parameters:
        executorId - id of the executor to which this context belong
        edgeId - id of the DAG edge
        srcTaskIndex - source task index
        dstTaskIndex - destination task index
    • Method Detail

      • close

        public void close()
        Closes this local output context.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface OutputContext
      • getQueue

        public java.util.concurrent.LinkedBlockingQueue getQueue()
                                                          throws java.lang.RuntimeException
        Accessor method for the queue in this local output context.
        Returns:
        queue to which the sender writes its data.
        Throws:
        java.lang.RuntimeException - if the context has already been closed.
      • isClosed

        public boolean isClosed()
        Checks whether the context has been closed. It is for testing purpose.
        Returns:
        true if the context has been closed.
      • newOutputStream

        public TransferOutputStream newOutputStream()
        Creates a new output stream to which the sender sends its data.
        Specified by:
        newOutputStream in interface OutputContext
        Returns:
        output stream of this local output context