Package org.apache.hop.execution.local
Class FileExecutionInfoLocation
- java.lang.Object
-
- org.apache.hop.execution.local.FileExecutionInfoLocation
-
- All Implemented Interfaces:
Cloneable,IExecutionInfoLocation
@GuiPlugin(description="File execution information location GUI elements") @ExecutionInfoLocationPlugin(id="local-folder", name="File location", description="Stores execution information in a folder structure") public class FileExecutionInfoLocation extends Object implements IExecutionInfoLocation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.hop.execution.IExecutionInfoLocation
IExecutionInfoLocation.ExecutionInfoLocationObjectFactory
-
-
Field Summary
Fields Modifier and Type Field Description static StringFILENAME_EXECUTION_JSONstatic StringFILENAME_STATE_JSONstatic StringFILENAME_STATE_LOGstatic intMAX_JSON_LOGGING_TEXT_SIZEprotected StringpluginIdprotected StringpluginNameprotected StringrootFolder
-
Constructor Summary
Constructors Constructor Description FileExecutionInfoLocation()FileExecutionInfoLocation(String rootFolder)FileExecutionInfoLocation(FileExecutionInfoLocation location)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileExecutionInfoLocationclone()voidclose()When you're done with this location you can call this method to clean up any left-over temporary files, memory structures or database connections.booleandeleteExecution(String executionId)Delete the execution with the given ID, its children and the associated information.List<String>findChildIds(ExecutionType parentExecutionType, String parentExecutionId)Find children of an execution.List<Execution>findExecutions(String parentExecutionId)Find all the child executions for a particular execution ID.List<Execution>findExecutions(IExecutionMatcher matcher)Find executions with a matcher.ExecutionfindLastExecution(ExecutionType executionType, String name)Find the last execution of with a given type and nameStringfindParentId(String childId)ExecutionfindPreviousSuccessfulExecution(ExecutionType executionType, String name)Find the previous successful execution of a pipeline or workflow.ExecutiongetExecution(String executionId)Get the execution information for a specific execution ID.ExecutionDatagetExecutionData(String parentExecutionId, String executionId)Get execution data for transforms or an action.List<String>getExecutionIds(boolean includeChildren, int limit)Retrieve a list of execution IDs (log channel IDs) for all pipelines and workflows.ExecutionStategetExecutionState(String executionId)Get the execution state for an execution.ExecutionStategetExecutionState(String executionId, boolean includeLogging)Get the execution state for an executionStringgetExecutionStateLoggingText(String executionId, int sizeLimit)Load the logging text of an execution state separately.protected StringgetExecutionStateLoggingText(ExecutionState executionState, int sizeLimit)StringgetPluginId()StringgetPluginName()StringgetRootFolder()voidinitialize(IVariables variables, IHopMetadataProvider metadataProvider)Initialize a location.voidregisterData(ExecutionData data)register output data for a given transformvoidregisterExecution(Execution execution)Register an execution of a pipeline or workflow at this location * *voidsetPluginId(String pluginId)voidsetPluginName(String pluginName)voidsetRootFolder(String rootFolder)voidupdateExecutionState(ExecutionState executionState)update the execution details of an executor: pipeline, workflow, transform or action
-
-
-
Field Detail
-
FILENAME_EXECUTION_JSON
public static final String FILENAME_EXECUTION_JSON
- See Also:
- Constant Field Values
-
FILENAME_STATE_JSON
public static final String FILENAME_STATE_JSON
- See Also:
- Constant Field Values
-
FILENAME_STATE_LOG
public static final String FILENAME_STATE_LOG
- See Also:
- Constant Field Values
-
MAX_JSON_LOGGING_TEXT_SIZE
public static final int MAX_JSON_LOGGING_TEXT_SIZE
- See Also:
- Constant Field Values
-
pluginId
protected String pluginId
-
pluginName
protected String pluginName
-
-
Constructor Detail
-
FileExecutionInfoLocation
public FileExecutionInfoLocation()
-
FileExecutionInfoLocation
public FileExecutionInfoLocation(String rootFolder)
-
FileExecutionInfoLocation
public FileExecutionInfoLocation(FileExecutionInfoLocation location)
-
-
Method Detail
-
clone
public FileExecutionInfoLocation clone()
- Specified by:
clonein interfaceIExecutionInfoLocation- Overrides:
clonein classObject
-
initialize
public void initialize(IVariables variables, IHopMetadataProvider metadataProvider) throws HopException
Description copied from interface:IExecutionInfoLocationInitialize a location. Load files, open database connections, ...- Specified by:
initializein interfaceIExecutionInfoLocation- Throws:
HopException
-
close
public void close() throws HopExceptionDescription copied from interface:IExecutionInfoLocationWhen you're done with this location you can call this method to clean up any left-over temporary files, memory structures or database connections.- Specified by:
closein interfaceIExecutionInfoLocation- Throws:
HopException
-
registerExecution
public void registerExecution(Execution execution) throws HopException
Description copied from interface:IExecutionInfoLocationRegister an execution of a pipeline or workflow at this location * *- Specified by:
registerExecutionin interfaceIExecutionInfoLocation- Parameters:
execution- The execution information to register- Throws:
HopException- In case there was a problem with the registration
-
deleteExecution
public boolean deleteExecution(String executionId) throws HopException
Description copied from interface:IExecutionInfoLocationDelete the execution with the given ID, its children and the associated information.- Specified by:
deleteExecutionin interfaceIExecutionInfoLocation- Parameters:
executionId- The ID of the execution to delete- Returns:
- true if the execution was found and deleted.
- Throws:
HopException
-
findLastExecution
public Execution findLastExecution(ExecutionType executionType, String name) throws HopException
Description copied from interface:IExecutionInfoLocationFind the last execution of with a given type and name- Specified by:
findLastExecutionin interfaceIExecutionInfoLocation- Parameters:
executionType- The type to look forname- The name to match- Returns:
- The last execution or null if none could be found
- Throws:
HopException
-
updateExecutionState
public void updateExecutionState(ExecutionState executionState) throws HopException
Description copied from interface:IExecutionInfoLocationupdate the execution details of an executor: pipeline, workflow, transform or action- Specified by:
updateExecutionStatein interfaceIExecutionInfoLocation- Parameters:
executionState- The execution state to update- Throws:
HopException- In case there was a problem with the update
-
getExecutionState
public ExecutionState getExecutionState(String executionId) throws HopException
Description copied from interface:IExecutionInfoLocationGet the execution state for an execution. Any large logging text associated with the requested execution state is also loaded.- Specified by:
getExecutionStatein interfaceIExecutionInfoLocation- Parameters:
executionId- The id of the execution- Returns:
- The state of the execution or null if not found
- Throws:
HopException- In case there was a problem reading the state
-
getExecutionState
public ExecutionState getExecutionState(String executionId, boolean includeLogging) throws HopException
Description copied from interface:IExecutionInfoLocationGet the execution state for an execution- Specified by:
getExecutionStatein interfaceIExecutionInfoLocation- Parameters:
executionId- The id of the executionincludeLogging- Set to true if the logging text (can be big) also needs to be loaded.- Returns:
- The state of the execution or null if not found
- Throws:
HopException- In case there was a problem reading the state
-
getExecutionStateLoggingText
public String getExecutionStateLoggingText(String executionId, int sizeLimit) throws HopException
Description copied from interface:IExecutionInfoLocationLoad the logging text of an execution state separately.- Specified by:
getExecutionStateLoggingTextin interfaceIExecutionInfoLocation- Parameters:
executionId- The id of the execution to look for.sizeLimit- The maximum amount of characters to load from the logging text. Set the limit to <=0 if you want to load everything up to a global limit of usually 20MB.- Returns:
- The complete logging text
- Throws:
HopException
-
getExecutionStateLoggingText
protected String getExecutionStateLoggingText(ExecutionState executionState, int sizeLimit) throws HopException
- Throws:
HopException
-
registerData
public void registerData(ExecutionData data) throws HopException
register output data for a given transform- Specified by:
registerDatain interfaceIExecutionInfoLocation- Parameters:
data-- Throws:
HopException
-
getExecutionIds
public List<String> getExecutionIds(boolean includeChildren, int limit) throws HopException
Description copied from interface:IExecutionInfoLocationRetrieve a list of execution IDs (log channel IDs) for all pipelines and workflows. The list is reverse ordered by (start of) execution date.- Specified by:
getExecutionIdsin interfaceIExecutionInfoLocation- Parameters:
includeChildren- set to true if you want to see child executions of workflows and pipelines.limit- the maximum number of IDs to retrieve or a value <=0 to get all IDs.- Returns:
- The list of execution IDs
- Throws:
HopException- in case something went wrong
-
findChildIds
public List<String> findChildIds(ExecutionType parentExecutionType, String parentExecutionId) throws HopException
Description copied from interface:IExecutionInfoLocationFind children of an execution. A workflow can find child actions with this method.- Specified by:
findChildIdsin interfaceIExecutionInfoLocation- Parameters:
parentExecutionType- The parent execution type (Workflow or Pipeline)parentExecutionId- The parent execution ID to look into- Returns:
- A list of IDs or an empty list if nothing could be found.
- Throws:
HopException- in case of a serialization error
-
getExecution
public Execution getExecution(String executionId) throws HopException
Description copied from interface:IExecutionInfoLocationGet the execution information for a specific execution ID. This is the execution information of a workflow or pipeline.- Specified by:
getExecutionin interfaceIExecutionInfoLocation- Parameters:
executionId- The ID of the execution to look for- Returns:
- The Execution or null if nothing was found
- Throws:
HopException- in case something went wrong
-
findExecutions
public List<Execution> findExecutions(String parentExecutionId) throws HopException
Description copied from interface:IExecutionInfoLocationFind all the child executions for a particular execution ID. For example if you want to know the execution of a particular action you can use this method.- Specified by:
findExecutionsin interfaceIExecutionInfoLocation- Parameters:
parentExecutionId- The parent execution ID- Returns:
- A list of executions or an empty list if nothing was found.
- Throws:
HopException- In case of an unexpected error.
-
findExecutions
public List<Execution> findExecutions(IExecutionMatcher matcher) throws HopException
Description copied from interface:IExecutionInfoLocationFind executions with a matcher. This will parse through all executions in the location.- Specified by:
findExecutionsin interfaceIExecutionInfoLocation- Parameters:
matcher- The matcher to allow you to filter any execution from the system.- Returns:
- A list of executions or an empty list if nothing was found.
- Throws:
HopException- In case of an unexpected error.
-
findPreviousSuccessfulExecution
public Execution findPreviousSuccessfulExecution(ExecutionType executionType, String name) throws HopException
Description copied from interface:IExecutionInfoLocationFind the previous successful execution of a pipeline or workflow.- Specified by:
findPreviousSuccessfulExecutionin interfaceIExecutionInfoLocation- Parameters:
executionType- The type of execution to look forname- The name of the executor- Returns:
- The execution or null if no previous successful execution could be found.
- Throws:
HopException
-
findParentId
public String findParentId(String childId) throws HopException
- Specified by:
findParentIdin interfaceIExecutionInfoLocation- Throws:
HopException
-
getExecutionData
public ExecutionData getExecutionData(String parentExecutionId, String executionId) throws HopException
Description copied from interface:IExecutionInfoLocationGet execution data for transforms or an action. The parent ID would typically be a pipeline ID, and you'd get data for all the transforms. You can also get the execution data for specific actions in a workflow (when finished).- Specified by:
getExecutionDatain interfaceIExecutionInfoLocation- Parameters:
parentExecutionId- The ID of the parent (pipeline) execution.executionId- The ID of the transforms (all transforms) or a specific action. Set this parameter to null if you want to collect all the data associated with the parent execution ID. This is for the Beam use case where we don't know up-front how many transforms are running or when they'll pop up.- Returns:
- The ExecutionData
- Throws:
HopException- In case something went wrong
-
getPluginId
public String getPluginId()
- Specified by:
getPluginIdin interfaceIExecutionInfoLocation
-
setPluginId
public void setPluginId(String pluginId)
- Specified by:
setPluginIdin interfaceIExecutionInfoLocation
-
getPluginName
public String getPluginName()
- Specified by:
getPluginNamein interfaceIExecutionInfoLocation
-
setPluginName
public void setPluginName(String pluginName)
- Specified by:
setPluginNamein interfaceIExecutionInfoLocation
-
getRootFolder
public String getRootFolder()
-
setRootFolder
public void setRootFolder(String rootFolder)
-
-