public class WorkflowGridAdaptor extends Object implements IWorkflowAdaptor
The Class WorkflowGridAdaptor constructs an ExecutionPlan that can mediate to submit a job
described through a JDL file using a Grid UI node. After its submission the job is monitored for its
status and once completed the output files are retrieved and stored in the Storage System.
The resources that are provided and need to be moved to the Grid UI are all transfered through the Storage System. They are stored once the plan is constructed and are then retrieved once the execution is started. This does not include the provided user proxy which is transfered as an attachment directly to the remote node to allow secure transfer if the SSL communication option is enabled.
The entire execution process takes place in the Grid UI node. This node is picked from the Information System
and is currently chosen randomly from all the available ones. Currently once the node has been picked, the
execution cannot be moved to a different one even if there is a problem communicating with that node. The execution
that takes place is a sequential series of steps. These steps include
- Contact the remote node
- Retrieval of the data stored in the Storage System and these include the resources marked as one of
AttachedGridResource.ResourceType#Config, AttachedGridResource.ResourceType#InData,
AttachedGridResource.ResourceType#JDL
- Submit the job using the provided JDL file and optionally any configuration additionally provided
using the provided user proxy certificate
- Go into a loop until either the job is completed or a timeout has expired (If a timeout has been set)
- Wait for a defined period
- Retrieve the job status
- Retrieve the job logging info
- Process the results of the above two steps
- Check the reason the loop ended
- If a timeout happened, cancel the job
- If the job terminated successfully retrieve the output files of the job
| Modifier and Type | Field and Description |
|---|---|
long |
RetryOnErrorPeriod |
int |
RetryOnErrorTimes |
long |
Timeout
Timeout period to wait for the job to be completed.
|
long |
WaitPeriod
The period every which the job status and logging info should be polled.
|
| Constructor and Description |
|---|
WorkflowGridAdaptor()
Instantiates a new workflow grid JDL adaptor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
CreatePlan()
Based on the provided resources, a call to this method will do all the needed processing and once completed
a full execution plan will be created
|
gr.uoa.di.madgik.execution.plan.ExecutionPlan |
GetCreatedPlan()
Retrieves the created plan after the successful invocation of the
IWorkflowAdaptor.CreatePlan() |
Set<IOutputResource> |
GetOutput()
Retrieves the set of output resources containing info on the products of the workflow after the plan
is executed.
|
void |
SetAdaptorResources(IAdaptorResources Resources)
Sets the resources that the adaptor needs to construct the plan.
|
void |
SetExecutionId(String executionId)
Sets the execution id which will be associated with the created plan
|
public long Timeout
Long.MIN_VALUE or
Long.MAX_VALUE or a zero value indicates that no timeout should be used.public long WaitPeriod
public long RetryOnErrorPeriod
public int RetryOnErrorTimes
public WorkflowGridAdaptor()
public void SetAdaptorResources(IAdaptorResources Resources) throws WorkflowValidationException
AdaptorGridResources.SetAdaptorResources in interface IWorkflowAdaptorResources - the resources neededWorkflowValidationException - Problem with the validity of one of the provided elementsIWorkflowAdaptor.SetAdaptorResources(gr.uoa.di.madgik.workflow.adaptor.utils.IAdaptorResources)public void SetExecutionId(String executionId)
IWorkflowAdaptorSetExecutionId in interface IWorkflowAdaptorexecutionId - The execution idpublic void CreatePlan()
throws WorkflowValidationException,
WorkflowSerializationException,
WorkflowInternalErrorException,
WorkflowEnvironmentException
IWorkflowAdaptorCreatePlan in interface IWorkflowAdaptorWorkflowValidationException - Problem with the validity of one of the provided elementsWorkflowSerializationException - Problem with the serialization of one of the provided elementsWorkflowInternalErrorException - An internal error has occurredWorkflowEnvironmentException - There was a problem with the environment the Workflow Engine is containedpublic gr.uoa.di.madgik.execution.plan.ExecutionPlan GetCreatedPlan()
IWorkflowAdaptorIWorkflowAdaptor.CreatePlan()GetCreatedPlan in interface IWorkflowAdaptorpublic Set<IOutputResource> GetOutput()
OutputSandboxGridResourceGetOutput in interface IWorkflowAdaptorIWorkflowAdaptor.GetOutput()Copyright © 2014. All Rights Reserved.