Interface Streamlet<I,O>

All Superinterfaces:
StreamletScope<O>
All Known Subinterfaces:
GenericStreamlet<I,O>
All Known Implementing Classes:
AbstractRecordStreamlet, AbstractStreamlet, DownlinkStreamlet, RecordStreamlet

public interface Streamlet<I,O> extends StreamletScope<O>
Stateful node in a dataflow graph that uses the state of its Inlets to compute the state of its Outlets.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bindInput(String key, Outlet<? extends I> input)
    Connects the Inlet of this Streamlet, identified by the given key, to the input from which the Inlet should acquire its state.
    void
    Marks this Streamlet—and all of its outlets—as having inconsistent state.
    void
    Disconnects all Inlets dominated by this Streamlet in the dataflow dependency graph.
    void
    Disconnects all Inletss dominated by this Streamlet in the dataflow graph.
    Returns the Inlet to this Streamlet identified by the given key; returns null if this Streamlet has no such Inlet.
    Returns the Outlet of this Streamlet identified by the given key; returns null if this Streamlet has no such Outlet.
    void
    recohere(int version)
    Updates the state of this Streamlet to make it consistent with the target version.
    void
    Sets the environment in which this Streamlet operates.
    void
    Sets the lexically scoped parent of this Streamlet.
    Returns the environment in which this Streamlet operates.
    StreamletScope<? extends O>
    Returns the lexically scoped parent of this Streamlet.
    void
    Disconnects the Inlet of this Streamlet, identified by the given key, from its input Outlet, if connected.
  • Method Details

    • streamletScope

      StreamletScope<? extends O> streamletScope()
      Returns the lexically scoped parent of this Streamlet. Returns null if this Streamlet has no lexical parent.
      Specified by:
      streamletScope in interface StreamletScope<I>
    • setStreamletScope

      void setStreamletScope(StreamletScope<? extends O> scope)
      Sets the lexically scoped parent of this Streamlet.
    • streamletContext

      StreamletContext streamletContext()
      Returns the environment in which this Streamlet operates.
      Specified by:
      streamletContext in interface StreamletScope<I>
    • setStreamletContext

      void setStreamletContext(StreamletContext context)
      Sets the environment in which this Streamlet operates.
    • inlet

      Inlet<I> inlet(String key)
      Returns the Inlet to this Streamlet identified by the given key; returns null if this Streamlet has no such Inlet.
    • bindInput

      void bindInput(String key, Outlet<? extends I> input)
      Connects the Inlet of this Streamlet, identified by the given key, to the input from which the Inlet should acquire its state. Delegates to Inlet.bindInput(Outlet) on the identified Inlet.
      Throws:
      IllegalArgumentException - if this Streamlet has no Inlet with the given key.
    • unbindInput

      void unbindInput(String key)
      Disconnects the Inlet of this Streamlet, identified by the given key, from its input Outlet, if connected. Delegates to Inlet.unbindInput() on the identified Inlet.
      Throws:
      IllegalArgumentException - if this Streamlet has no Inlet with the given key.
    • outlet

      Outlet<O> outlet(String key)
      Returns the Outlet of this Streamlet identified by the given key; returns null if this Streamlet has no such Outlet.
      Specified by:
      outlet in interface StreamletScope<I>
    • disconnectInputs

      void disconnectInputs()
      Disconnects all Inlets dominated by this Streamlet in the dataflow dependency graph. Used to recursively clean up chains of combinators terminating at this Streamlet.
    • disconnectOutputs

      void disconnectOutputs()
      Disconnects all Inletss dominated by this Streamlet in the dataflow graph. Used to recursively clean up chains of combinators originating from this Streamlet.
    • decohere

      void decohere()
      Marks this Streamlet—and all of its outlets—as having inconsistent state. Decohering a Streamlet will recursively decohere all streamlets that transitively depend on the state of this Streamlet. Decohering a Streamlet does not cause its state to be recomputed. A subsequent recohere(int) call will eventually make the state of the Streamlet coherent again.
    • recohere

      void recohere(int version)
      Updates the state of this Streamlet to make it consistent with the target version. The Streamlet only needs to update if its current version differs from the target version. To update its state, the Streamlet first invokes Inlet.recohereOutput(int) on each of its inlets, to ensure that its input states are coherent. It then recomputes its own state in an implementation defined manner. Finally, it invokes Outlet.recohereInput(int) on its outlets, causing all transitively dependent streamlets to make their own states coherent again.