com.ibm.streams.flow.execute

Interface ExecutableGraph<E extends ExecutableGraph<E>>

  • All Known Subinterfaces:
    JavaTestableGraph


    public interface ExecutableGraph<E extends ExecutableGraph<E>>
    ExecutableGraph represents an executable flow graph of Java primitive operators.
    Since:
    InfoSphere® Streams Version 3.1
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.util.concurrent.Future<E> execute()
      Execute the complete graph.
      E executeToCompletion()
      Execute this graph and wait for the completion of the graph.
      E setTraceLevel(TraceLevel level)
      Set the trace level for the executing graph.
    • Method Detail

      • execute

        java.util.concurrent.Future<E> execute()
        Execute the complete graph. The following tasks are performed for each operator in the graph:
        1. Calls the context check methods
        2. Calls the Operator.initialize(OperatorContext) method
        3. Calls the Operator.allPortsReady() method, which notifies the operator that the ports are ready and the operator can submit tuples.

        The order for the method calls is not defined across the operators. However, the Operator.allPortsReady() method is called for an operator only after Operator.initialize(OperatorContext) method is called for all the operators.

        The graph runs until all the work has been completed by all the operators. A graph is completed when all the operators in the graph have been completed by terminating all the background threads and tasks. A graph is typically completed by source operators that submit final punctuation marks on all the output ports after those ports submit all of the tuples. When all work is completed, the operators are shutdown and the returned Future get() method returns this.
        Some graphs might never complete and therefore run forever. Typically, this occurs for graphs with source operators that read live data sources that never end.
        A call to the returned Future cancel(true) method initiates an asynchronous shutdown of the graph, thereby calling the Operator.shutdown() method for all the operator invocations in the graph. The order for shutdowns is not defined across the operators.

        Returns:
        this
      • executeToCompletion

        E executeToCompletion()
                                                         throws java.lang.Exception
        Execute this graph and wait for the completion of the graph. Once the graph completes it will be shutdown prior to this method returning.
        Returns:
        this
        Throws:
        java.lang.Exception - Exception executing the graph.
      • setTraceLevel

        E setTraceLevel(TraceLevel level)
        Set the trace level for the executing graph. This will cause the trace level change notification to be issued.
        Parameters:
        level - New trace level.
        Returns:
        this