-
- 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 anEngineConfig
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 inLogicalGraphFactory
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addCompilationListener(GraphCompilationListener listener)
Adds a listener to listen for compilation events.LogicalGraphInstance
compile()
Creates an executable instance of the logical graph.LogicalGraphInstance
compile(EngineConfig config)
Creates an executable instance of the logical graph.String
getName()
Returns the name of the graph.void
removeCompilationListener(GraphCompilationListener listener)
Removes a listener that was added viaaddCompilationListener(GraphCompilationListener)
.LogicalGraphInstance
run()
Creates an instance of the logical graph and executes it synchronously.LogicalGraphInstance
run(EngineConfig config)
Creates an instance of the logical graph and executes it synchronously.void
setName(String name)
Sets the name of the graph.LogicalGraphInstanceView
validate()
Performs validation but does not return an executable graph.LogicalGraphInstanceView
validate(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#VALIDATE
so 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#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
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
-
-