Class Source<O>

All Implemented Interfaces:
FlowOut<O>, Node, Comparable<Node>

public class Source<O>
extends SimpleNode<Extractor<O>>
implements FlowOut<O>
Sources represent an entrypoint node in a DAG. They have no upstream but can propagate their output downstream.
Author:
Pierre Lecerf ([email protected]) Created on 2020/02/28
  • Constructor Details

  • Method Details

    • into

      public <N> Pipe<O,​N> into​(Transformer<O,​N> transformer)
      Description copied from interface: FlowOut
      Binds the current node into a Transformer, resulting in a new Pipe node.
      Specified by:
      into in interface FlowOut<O>
      Type Parameters:
      N - Output type of the pipe node
      Parameters:
      transformer - a Transformer actor
      Returns:
      the resulting Pipe node
    • into

      public Sink<O> into​(Loader<O> loader)
      Description copied from interface: FlowOut
      Binds the current node into a Loader, resulting in a new Sink node.
      Specified by:
      into in interface FlowOut<O>
      Parameters:
      loader - a Loader actor
      Returns:
      the resulting Sink node
    • join

      public <JI,​ JO> Join<O,​JI,​JO> join​(FlowOut<JI> input, BiTransformer<O,​JI,​JO> transformer)
      Description copied from interface: FlowOut
      Joins the current node with another flow using a bi-transformer join function.
      Specified by:
      join in interface FlowOut<O>
      Type Parameters:
      JI - Input type from another flow
      JO - Output type of the joined flow
      Parameters:
      input - Flow with which to join the current flow.
      transformer - A bi-transformer function for performing the join.
      Returns:
      the resulting Join node
    • stream

      public <N> StreamGenerator<O,​N> stream​(Function<O,​Generator<N>> generatorSupplier)
      Description copied from interface: FlowOut
      Initiates a stream from the current node, results in a new StreamGenerator node.
      Specified by:
      stream in interface FlowOut<O>
      Type Parameters:
      N - Output type of the stream generator node
      Parameters:
      generatorSupplier - a Generator creation function
      Returns:
      the resulting StreamGenerator node
    • drift

      public Source<O> drift​(Loader<O> loader)
      Parameters:
      loader -
      Returns:
    • collect

      public Recipient<O> collect​(String name)
      Specified by:
      collect in interface FlowOut<O>
      Returns:
    • sample

      public Source<O> sample​(String name)
      Parameters:
      name -
      Returns:
    • getUpstream

      public List<Node> getUpstream()
      Description copied from interface: Node
      Returns the list of upstream nodes, ie. nodes which output is required in order to execute the current node. For Source nodes, this should be empty. For Pipe and Sink nodes, this should be a list of size 1. For Join nodes, this should be a list of size 2.
      Specified by:
      getUpstream in interface Node
      Overrides:
      getUpstream in class SimpleNode<Extractor<O>>
      Returns:
      the list of upstream nodes