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
Nested ClassesModifier and TypeClassDescriptionstatic classA simple logging implementation that writes to standard out -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSet a callback to notify when flow execution finishesbooleanflowBusy()Checks to see if any step(s) are doing workReturn the execution environment object for this flow executorgetFlow()Get the flow to executebooleanGet whether to launch start points sequentiallyGet the log to useGet the logging level to useGet the settings in use when executing the Flowstatic voidMain method for executing the FlowRunnervoidPerform any teardown stuff that might need to happen after execution.voidPerform any setup stuff that might need to happen before execution.voidRemove a callbackvoidrun()Execute the flowvoidRun a FlowRunner objectvoidRun the flow by launching start points in parallelvoidRun the flow by launching start points sequentially.voidvoidSet the execution environment to usevoidSet the flow to executevoidsetLaunchStartPointsSequentially(boolean s) Set whether to launch start points sequentiallyvoidSet the log to usevoidsetLoggingLevel(LoggingLevel level) Set the logging level to usevoidsetSettings(Settings settings) Set the settings to use when executing the FlowvoidAttempt to stop processing in all stepsvoidWait until all the steps are no longer busybooleanReturns 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:
setSettingsin interfaceFlowExecutor- Parameters:
settings- the settings to use
-
getSettings
Get the settings in use when executing the Flow- Specified by:
getSettingsin interfaceFlowExecutor- Returns:
- the settings
-
setEnvironment
-
main
Main method for executing the FlowRunner- Parameters:
args- command line arguments
-
run
Run a FlowRunner object- Specified by:
runin 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:
addExecutionFinishedCallbackin interfaceFlowExecutor- Parameters:
callback- the callback to notify
-
removeExecutionFinishedCallback
Remove a callback- Specified by:
removeExecutionFinishedCallbackin interfaceFlowExecutor- Parameters:
callback- the callback to remove
-
getFlow
Get the flow to execute- Specified by:
getFlowin interfaceFlowExecutor- Returns:
- the flow to execute
-
setFlow
Set the flow to execute- Specified by:
setFlowin interfaceFlowExecutor- Parameters:
flow- the flow to execute
-
getLogger
Get the log to use- Specified by:
getLoggerin interfaceFlowExecutor- Returns:
- the log to use
-
setLogger
Set the log to use- Specified by:
setLoggerin interfaceFlowExecutor- Parameters:
logger- the log to use
-
getLoggingLevel
Get the logging level to use- Specified by:
getLoggingLevelin interfaceFlowExecutor- Returns:
- the logging level to use
-
setLoggingLevel
Set the logging level to use- Specified by:
setLoggingLevelin 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:FlowExecutorReturn the execution environment object for this flow executor- Specified by:
getExecutionEnvironmentin interfaceFlowExecutor- Returns:
- the execution environment
-
setExecutionEnvironment
Set the execution environment to use- Specified by:
setExecutionEnvironmentin 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:
runSequentiallyin interfaceFlowExecutor- Throws:
WekaException- if a problem occurs
-
runParallel
Run the flow by launching start points in parallel- Specified by:
runParallelin interfaceFlowExecutor- Throws:
WekaException- if a problem occurs
-
waitUntilFinished
public void waitUntilFinished()Wait until all the steps are no longer busy- Specified by:
waitUntilFinishedin 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:
stopProcessingin interfaceFlowExecutor
-
wasStopped
public boolean wasStopped()Returns true if execution was stopped via the stopProcessing() method- Specified by:
wasStoppedin interfaceFlowExecutor- Returns:
- true if execution was stopped.
-
preExecution
Description copied from interface:CommandlineRunnablePerform any setup stuff that might need to happen before execution.- Specified by:
preExecutionin interfaceCommandlineRunnable- Throws:
Exception- if a problem occurs during setup
-
postExecution
Description copied from interface:CommandlineRunnablePerform any teardown stuff that might need to happen after execution.- Specified by:
postExecutionin interfaceCommandlineRunnable- Throws:
Exception- if a problem occurs during teardown
-