Interface LogicalGraph

All Superinterfaces:
OperatorComposable, PropertyValued
All Known Subinterfaces:
LogicalSubgraph

public interface LogicalGraph extends OperatorComposable, PropertyValued
Represents a logical graph which is intended to be executed. The logical operators contained by the graph describe its processing. The logical operators that are added to the graph describe "what" we want to do. The framework compiles the underlying graph into one or more "physical" Kahn process network described by the operators.

A LogicalGraph requires an EngineConfig describing the execution environment and options for execution. These settings effect how the graph is executed (distributed vs. pseudo-distributed) and the degree of parallelism.

A LogicalGraph is created using the factory methods found in LogicalGraphFactory.

  • Method Details

    • validate

      Performs validation but does not return an executable graph. When performing validation, MetadataCalculationContext#getCompilationLevel() will be set to CompilationLevel#VALIDATE so that operators can avoid certain expensive operations.
      Returns:
      a read-only graph view
    • validate

      Performs validation but does not return an executable graph. When performing validation, MetadataCalculationContext#getCompilationLevel() will be set to CompilationLevel#VALIDATE so that operators can avoid certain expensive operations.
      Parameters:
      config - the engine config to use when validating the graph. This may be needed for validation in some cases since it may determine user credentials, etc.
      Returns:
      a read-only graph view
    • compile

      Creates an executable instance of the logical graph. The plan is created, but not started. Type and configuration errors which could not be caught earlier while composing the graph will be signaled at this time.
      Returns:
      an executable instance described by this graph
      Throws:
      DROperatorException - if errors occur while compiling the graph.
    • compile

      Creates an executable instance of the logical graph. The plan is created, but not started. Type and configuration errors which could not be caught earlier while composing the graph will be signaled at this time.
      Parameters:
      config - the engine configuration with which to compile and execute the graph
      Returns:
      an executable instance described by this graph
      Throws:
      DROperatorException - if errors occur while compiling the graph.
    • run

      Creates an instance of the logical graph and executes it synchronously. The caller is blocked until the process network terminates.

      Invoking run() is equivalent to calling compile(), then calling run() on the returned LogicalGraphInstance.

      Returns:
      the instance created. The instance will be in a terminated state.
      Throws:
      DROperatorException - if errors occur while running or compiling the graph
    • run

      Creates an instance of the logical graph and executes it synchronously. The caller is blocked until the process network terminates.

      Invoking run() is equivalent to calling compile(), then calling run() on the returned LogicalGraphInstance.

      Parameters:
      config - the engine configuration with which to compile and execute the graph
      Returns:
      the instance created. The instance will be in a terminated state.
      Throws:
      DROperatorException - if errors occur while running or compiling the graph
    • getName

      String getName()
      Returns the name of the graph. Initially set by LogicalGraphFactory.newLogicalGraph(String).
      Returns:
      the name of the graph.
    • setName

      void setName(String name)
      Sets the name of the graph. This method can be used to specify the name of the graph if it was initially created without specifying a name.
      Parameters:
      name - the name of the graph
    • addCompilationListener

      void addCompilationListener(GraphCompilationListener listener)
      Adds a listener to listen for compilation events. All listeners must be registered prior to invoking compile(). Any listeners that were registered at the point in time that the graph way compiled will be registered for the lifetime of the compilation/execution of that graph.
      Parameters:
      listener - the listener
    • removeCompilationListener

      void removeCompilationListener(GraphCompilationListener listener)
      Removes a listener that was added via addCompilationListener(GraphCompilationListener).
      Parameters:
      listener - the listener