Package weka.knowledgeflow
Class BaseExecutionEnvironment
java.lang.Object
weka.knowledgeflow.BaseExecutionEnvironment
- All Implemented Interfaces:
ExecutionEnvironment
Base class for execution environments
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Defaults for the base execution environment -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Description of the default execution environment -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets a new instance of the default flow executor suitable for use with this execution environmentGet default settings for the base execution environmentGet a description of this execution environmentGet environment variables for this execution environmentGet the executor that will actually be responsible for running the flow.Get the environment for performing commands at the application-level in a graphical environment.getLog()
Get the log in useGet the logging level in useGet knowledge flow settings for this execution environmentboolean
Get whether this execution environment is headlessvoid
Set environment variables for this execution environmentvoid
setFlowExecutor
(FlowExecutor executor) Set the executor that will actually be responsible for running the flow.void
Set the environment for performing commands at the application-level in a graphical environment.void
setHeadless
(boolean headless) Set whether this execution environment is headlessvoid
Set the log to usevoid
setLoggingLevel
(LoggingLevel level) Set the logging level to usevoid
setSettings
(Settings settings) Set knowledge flow settings for this execution environmentvoid
The main point at which to request stop processing of a flow.<T> Future<ExecutionResult<T>>
submitTask
(StepTask<T> stepTask) Submit a task to be run by the execution environment.
-
Field Details
-
DESCRIPTION
Description of the default execution environment- See Also:
-
-
Constructor Details
-
BaseExecutionEnvironment
public BaseExecutionEnvironment()
-
-
Method Details
-
getDescription
Get a description of this execution environment- Specified by:
getDescription
in interfaceExecutionEnvironment
- Returns:
- a description of this execution environemtn
-
isHeadless
public boolean isHeadless()Get whether this execution environment is headless- Specified by:
isHeadless
in interfaceExecutionEnvironment
- Returns:
- true if this execution environment is headless
-
setHeadless
public void setHeadless(boolean headless) Set whether this execution environment is headless- Specified by:
setHeadless
in interfaceExecutionEnvironment
- Parameters:
headless
- true if the execution environment is headless
-
getGraphicalEnvironmentCommandHandler
Get the environment for performing commands at the application-level in a graphical environment.- Specified by:
getGraphicalEnvironmentCommandHandler
in interfaceExecutionEnvironment
- Returns:
- the graphical environment command handler, or null if running headless
-
setGraphicalEnvironmentCommandHandler
Set the environment for performing commands at the application-level in a graphical environment.- Specified by:
setGraphicalEnvironmentCommandHandler
in interfaceExecutionEnvironment
-
getEnvironmentVariables
Get environment variables for this execution environment- Specified by:
getEnvironmentVariables
in interfaceExecutionEnvironment
- Returns:
- the environment variables for this execution environment
-
setEnvironmentVariables
Set environment variables for this execution environment- Specified by:
setEnvironmentVariables
in interfaceExecutionEnvironment
- Parameters:
env
- the environment variables to use
-
setSettings
Description copied from interface:ExecutionEnvironment
Set knowledge flow settings for this execution environment- Specified by:
setSettings
in interfaceExecutionEnvironment
- Parameters:
settings
- the settings to use
-
getSettings
Description copied from interface:ExecutionEnvironment
Get knowledge flow settings for this execution environment- Specified by:
getSettings
in interfaceExecutionEnvironment
- Returns:
- the settings to use
-
getLog
Get the log in use- Specified by:
getLog
in interfaceExecutionEnvironment
- Returns:
- the log in use
-
setLog
Set the log to use- Specified by:
setLog
in interfaceExecutionEnvironment
- Parameters:
log
- the log to use
-
getLoggingLevel
Get the logging level in use- Specified by:
getLoggingLevel
in interfaceExecutionEnvironment
- Returns:
- the logging level in use
-
setLoggingLevel
Set the logging level to use- Specified by:
setLoggingLevel
in interfaceExecutionEnvironment
- Parameters:
level
- the logging level to use
-
submitTask
Submit a task to be run by the execution environment. The default execution environment uses an ExecutorService to run tasks in parallel. Client steps are free to use this service or to just do their processing locally within their own code.- Specified by:
submitTask
in interfaceExecutionEnvironment
- Parameters:
stepTask
- the StepTask encapsulating the code to be run- Returns:
- the Future holding the status and result when complete
- Throws:
WekaException
- if processing fails in the case of
-
stopProcessing
public void stopProcessing()The main point at which to request stop processing of a flow. This will request the FlowExecutor to stop and then shutdown the executor service- Specified by:
stopProcessing
in interfaceExecutionEnvironment
-
getDefaultFlowExecutor
Gets a new instance of the default flow executor suitable for use with this execution environment- Returns:
- a new instance of the default flow executor suitable for use with this execution environment
-
getFlowExecutor
Get the executor that will actually be responsible for running the flow. This is not guaranteed to be available from this execution environment until the flow is actually running (or at least initialized)- Returns:
- the executor that will be running the flow
-
setFlowExecutor
Set the executor that will actually be responsible for running the flow. This is not guaranteed to be available from this execution environment until the flow is actually running (or at least initialized)- Parameters:
executor
- the executor that will be running the flow
-
getDefaultSettings
Get default settings for the base execution environment- Specified by:
getDefaultSettings
in interfaceExecutionEnvironment
- Returns:
- the default settings
-