Class BuilderImpl

  • All Implemented Interfaces:
    Builder

    public final class BuilderImpl
    extends Object
    implements Builder
    BuilderImpl implements the Builder interface. The builder keeps track of the all the sources of the computation DAG and builds the Topology by traversing all the computation nodes.
    • Constructor Detail

      • BuilderImpl

        public BuilderImpl()
    • Method Detail

      • newSource

        public <R> Streamlet<R> newSource​(SerializableSupplier<R> supplier)
        Description copied from interface: Builder
        All sources of the computation should register using addSource.
        Specified by:
        newSource in interface Builder
        Parameters:
        supplier - The supplier function that is used to create the streamlet
      • newSource

        public <R> Streamlet<R> newSource​(Source<R> generator)
        Description copied from interface: Builder
        Creates a new Streamlet using the underlying generator
        Specified by:
        newSource in interface Builder
        Parameters:
        generator - The generator that generates the tuples of the streamlet
        Returns:
        the new streamlet
      • newSource

        public <R> Streamlet<R> newSource​(IRichSpout spout)
        Description copied from interface: Builder
        Creates a new Streamlet using the provided spout
        Specified by:
        newSource in interface Builder
        Parameters:
        spout - The spout that emits the tuples of the streamlet
        Returns:
        the new streamlet
      • build

        public TopologyBuilder build()
        We start traversing from all sources and build each node.
        Returns:
        TopologyBuilder class that represents the built topology