-
- 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
LogicalGraphrequires anEngineConfigdescribing 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
LogicalGraphis created using the factory methods found inLogicalGraphFactory.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddCompilationListener(GraphCompilationListener listener)Adds a listener to listen for compilation events.LogicalGraphInstancecompile()Creates an executable instance of the logical graph.LogicalGraphInstancecompile(EngineConfig config)Creates an executable instance of the logical graph.StringgetName()Returns the name of the graph.voidremoveCompilationListener(GraphCompilationListener listener)Removes a listener that was added viaaddCompilationListener(GraphCompilationListener).LogicalGraphInstancerun()Creates an instance of the logical graph and executes it synchronously.LogicalGraphInstancerun(EngineConfig config)Creates an instance of the logical graph and executes it synchronously.voidsetName(String name)Sets the name of the graph.LogicalGraphInstanceViewvalidate()Performs validation but does not return an executable graph.LogicalGraphInstanceViewvalidate(EngineConfig config)Performs validation but does not return an executable graph.-
Methods inherited from interface com.pervasive.datarush.operators.OperatorComposable
add, add, add, connect
-
Methods inherited from interface com.pervasive.datarush.graphs.PropertyValued
getProperty, getProperty, setProperty, setProperty
-
-
-
-
Method Detail
-
validate
LogicalGraphInstanceView validate()
Performs validation but does not return an executable graph. When performing validation,MetadataCalculationContext#getCompilationLevel()will be set toCompilationLevel#VALIDATEso that operators can avoid certain expensive operations.- Returns:
- a read-only graph view
-
validate
LogicalGraphInstanceView validate(EngineConfig config)
Performs validation but does not return an executable graph. When performing validation,MetadataCalculationContext#getCompilationLevel()will be set toCompilationLevel#VALIDATEso 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
LogicalGraphInstance 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
LogicalGraphInstance compile(EngineConfig config)
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
LogicalGraphInstance 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 callingcompile(), then callingrun()on the returnedLogicalGraphInstance.- Returns:
- the instance created. The instance will be in a terminated state.
- Throws:
DROperatorException- if errors occur while running or compiling the graph
-
run
LogicalGraphInstance run(EngineConfig config)
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 callingcompile(), then callingrun()on the returnedLogicalGraphInstance.- 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 byLogicalGraphFactory.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 invokingcompile(). 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 viaaddCompilationListener(GraphCompilationListener).- Parameters:
listener- the listener
-
-