Package weka.knowledgeflow
Class FlowRunner
java.lang.Object
weka.knowledgeflow.FlowRunner
- All Implemented Interfaces:
CommandlineRunnable
,FlowExecutor
- Direct Known Subclasses:
StepInjectorFlowRunner
A FlowExecutor that can launch start points in a flow in parallel or
sequentially.
- Version:
- $Revision: $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A simple logging implementation that writes to standard out -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Set a callback to notify when flow execution finishesboolean
flowBusy()
Checks to see if any step(s) are doing workReturn the execution environment object for this flow executorgetFlow()
Get the flow to executeboolean
Get whether to launch start points sequentiallyGet the log to useGet the logging level to useGet the settings in use when executing the Flowstatic void
Main method for executing the FlowRunnervoid
Perform any teardown stuff that might need to happen after execution.void
Perform any setup stuff that might need to happen before execution.void
Remove a callbackvoid
run()
Execute the flowvoid
Run a FlowRunner objectvoid
Run the flow by launching start points in parallelvoid
Run the flow by launching start points sequentially.void
void
Set the execution environment to usevoid
Set the flow to executevoid
setLaunchStartPointsSequentially
(boolean s) Set whether to launch start points sequentiallyvoid
Set the log to usevoid
setLoggingLevel
(LoggingLevel level) Set the logging level to usevoid
setSettings
(Settings settings) Set the settings to use when executing the Flowvoid
Attempt to stop processing in all stepsvoid
Wait until all the steps are no longer busyboolean
Returns true if execution was stopped via the stopProcessing() method
-
Constructor Details
-
FlowRunner
public FlowRunner()Constructor -
FlowRunner
Constructor
-
-
Method Details
-
setSettings
Set the settings to use when executing the Flow- Specified by:
setSettings
in interfaceFlowExecutor
- Parameters:
settings
- the settings to use
-
getSettings
Get the settings in use when executing the Flow- Specified by:
getSettings
in interfaceFlowExecutor
- Returns:
- the settings
-
setEnvironment
-
main
Main method for executing the FlowRunner- Parameters:
args
- command line arguments
-
run
Run a FlowRunner object- Specified by:
run
in interfaceCommandlineRunnable
- Parameters:
toRun
- the FlowRunner object to executeargs
- the command line arguments- Throws:
Exception
- if a problem occurs
-
addExecutionFinishedCallback
Set a callback to notify when flow execution finishes- Specified by:
addExecutionFinishedCallback
in interfaceFlowExecutor
- Parameters:
callback
- the callback to notify
-
removeExecutionFinishedCallback
Remove a callback- Specified by:
removeExecutionFinishedCallback
in interfaceFlowExecutor
- Parameters:
callback
- the callback to remove
-
getFlow
Get the flow to execute- Specified by:
getFlow
in interfaceFlowExecutor
- Returns:
- the flow to execute
-
setFlow
Set the flow to execute- Specified by:
setFlow
in interfaceFlowExecutor
- Parameters:
flow
- the flow to execute
-
getLogger
Get the log to use- Specified by:
getLogger
in interfaceFlowExecutor
- Returns:
- the log to use
-
setLogger
Set the log to use- Specified by:
setLogger
in interfaceFlowExecutor
- Parameters:
logger
- the log to use
-
getLoggingLevel
Get the logging level to use- Specified by:
getLoggingLevel
in interfaceFlowExecutor
- Returns:
- the logging level to use
-
setLoggingLevel
Set the logging level to use- Specified by:
setLoggingLevel
in interfaceFlowExecutor
- Parameters:
level
- the logging level to use
-
getLaunchStartPointsSequentially
public boolean getLaunchStartPointsSequentially()Get whether to launch start points sequentially- Returns:
- true if start points are to be launched sequentially
-
setLaunchStartPointsSequentially
public void setLaunchStartPointsSequentially(boolean s) Set whether to launch start points sequentially- Parameters:
s
- true if start points are to be launched sequentially
-
getExecutionEnvironment
Description copied from interface:FlowExecutor
Return the execution environment object for this flow executor- Specified by:
getExecutionEnvironment
in interfaceFlowExecutor
- Returns:
- the execution environment
-
setExecutionEnvironment
Set the execution environment to use- Specified by:
setExecutionEnvironment
in interfaceFlowExecutor
- Parameters:
env
- the execution environment to use
-
run
Execute the flow- Throws:
WekaException
- if a problem occurs
-
runSequentially
Run the flow by launching start points sequentially.- Specified by:
runSequentially
in interfaceFlowExecutor
- Throws:
WekaException
- if a problem occurs
-
runParallel
Run the flow by launching start points in parallel- Specified by:
runParallel
in interfaceFlowExecutor
- Throws:
WekaException
- if a problem occurs
-
waitUntilFinished
public void waitUntilFinished()Wait until all the steps are no longer busy- Specified by:
waitUntilFinished
in interfaceFlowExecutor
-
flowBusy
public boolean flowBusy()Checks to see if any step(s) are doing work- Returns:
- true if one or more steps in the flow are busy
-
stopProcessing
public void stopProcessing()Attempt to stop processing in all steps- Specified by:
stopProcessing
in interfaceFlowExecutor
-
wasStopped
public boolean wasStopped()Returns true if execution was stopped via the stopProcessing() method- Specified by:
wasStopped
in interfaceFlowExecutor
- Returns:
- true if execution was stopped.
-
preExecution
Description copied from interface:CommandlineRunnable
Perform any setup stuff that might need to happen before execution.- Specified by:
preExecution
in interfaceCommandlineRunnable
- Throws:
Exception
- if a problem occurs during setup
-
postExecution
Description copied from interface:CommandlineRunnable
Perform any teardown stuff that might need to happen after execution.- Specified by:
postExecution
in interfaceCommandlineRunnable
- Throws:
Exception
- if a problem occurs during teardown
-