- All Superinterfaces:
OperatorComposable,PropertyValued
- All Known Subinterfaces:
LogicalSubgraph
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 Summary
Modifier and TypeMethodDescriptionvoidAdds a listener to listen for compilation events.compile()Creates an executable instance of the logical graph.compile(EngineConfig config) Creates an executable instance of the logical graph.getName()Returns the name of the graph.voidRemoves a listener that was added viaaddCompilationListener(GraphCompilationListener).run()Creates an instance of the logical graph and executes it synchronously.run(EngineConfig config) Creates an instance of the logical graph and executes it synchronously.voidSets the name of the graph.validate()Performs validation but does not return an executable graph.validate(EngineConfig config) Performs validation but does not return an executable graph.Methods inherited from interface com.pervasive.datarush.operators.OperatorComposable
add, add, add, connectMethods inherited from interface com.pervasive.datarush.graphs.PropertyValued
getProperty, getProperty, setProperty, setProperty
-
Method Details
-
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
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
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
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
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
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
Removes a listener that was added viaaddCompilationListener(GraphCompilationListener).- Parameters:
listener- the listener
-