org.apache.oozie
Class WorkflowActionBean

java.lang.Object
  extended by org.apache.oozie.client.rest.JsonWorkflowAction
      extended by org.apache.oozie.WorkflowActionBean
All Implemented Interfaces:
org.apache.hadoop.io.Writable, JsonBean, WorkflowAction

public class WorkflowActionBean
extends JsonWorkflowAction
implements org.apache.hadoop.io.Writable

Bean that contains all the information to start an action for a workflow node.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.oozie.client.WorkflowAction
WorkflowAction.Status
 
Constructor Summary
WorkflowActionBean()
          Default constructor.
 
Method Summary
 Date getEndTime()
          Return the end time of the action action.
 Timestamp getEndTimestamp()
          Return the action last check time
 String getExecutionPath()
          Return the node execution path.
 String getJobId()
          Return the job Id.
 Date getLastCheckTime()
          Return the action last check time
 Timestamp getLastCheckTimestamp()
          Return the action last check time
 String getLogToken()
          Return the job log token.
 boolean getPending()
           
 Date getPendingAge()
          Return the pending age of the action.
 Timestamp getPendingAgeTimestamp()
          Return the action last check time
 String getSignalValue()
          Return the signal value for the action.
 String getSlaXml()
           
 Date getStartTime()
          Return the start time of the action action.
 Timestamp getStartTimestamp()
          Return the action last check time
 WorkflowAction.Status getStatus()
          Return the current status of the action action.
 String getStatusStr()
           
 String getWfId()
          Return the job Id.
 void incRetries()
          Increments the number of retries for the action.
 boolean isComplete()
          Return if the action is complete.
 boolean isExecutionComplete()
          Return if the action execution is complete.
 boolean isPending()
          Return if the action is pending.
 boolean isRetryOrManual()
          Return if the action is START_RETRY or START_MANUAL or END_RETRY or END_MANUAL.
 void readFields(DataInput dataInput)
          Deserialize an action bean from a data input.
 void resetPending()
          Removes the pending flag and pendingAge from the action.
 void resetPendingOnly()
          Removes the pending flag from the action.
 void setEndData(WorkflowAction.Status status, String signalValue)
          Set the completion information for an action end.
 void setEndTime(Date endTime)
           
 void setExecutionData(String externalStatus, Properties actionData)
          Set the completion information for an action start.
 void setExecutionPath(String executionPath)
          Set the node execution path.
 void setJobId(String id)
          Set the job id.
 void setLastCheckTime(Date lastCheckTime)
          Sets the action last check time
 void setLogToken(String logToken)
          Set the job log token.
 void setPending()
          Set the action as pending and the current time as pending.
 void setPendingAge(Date pendingAge)
          Set a time when the action will be pending, normally a time in the future.
 void setPendingOnly()
          Set the action pending flag to true.
 void setSignalValue(String signalValue)
          Set the signal value for the action.
 void setSlaXml(String slaXml)
           
 void setStartData(String externalId, String trackerUri, String consoleUrl)
          Set a tracking information for an action, and set the action status to Action.Status#DONE
 void setStartTime(Date startTime)
           
 void setStatus(WorkflowAction.Status val)
           
 void write(DataOutput dataOutput)
          Serialize the action bean to a data output.
 
Methods inherited from class org.apache.oozie.client.rest.JsonWorkflowAction
fromJSONArray, getConf, getConsoleUrl, getData, getErrorCode, getErrorMessage, getExternalId, getExternalStatus, getId, getName, getRetries, getTrackerUri, getTransition, getType, setConf, setConsoleUrl, setData, setErrorInfo, setExternalId, setExternalStatus, setId, setName, setRetries, setTrackerUri, setTransition, setType, toJSONArray, toJSONObject, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WorkflowActionBean

public WorkflowActionBean()
Default constructor.

Method Detail

write

public void write(DataOutput dataOutput)
           throws IOException
Serialize the action bean to a data output.

Specified by:
write in interface org.apache.hadoop.io.Writable
Parameters:
dataOutput - data output.
Throws:
IOException - thrown if the action bean could not be serialized.

readFields

public void readFields(DataInput dataInput)
                throws IOException
Deserialize an action bean from a data input.

Specified by:
readFields in interface org.apache.hadoop.io.Writable
Parameters:
dataInput - data input.
Throws:
IOException - thrown if the action bean could not be deserialized.

isExecutionComplete

public boolean isExecutionComplete()
Return if the action execution is complete.

Returns:
if the action start is complete.

isRetryOrManual

public boolean isRetryOrManual()
Return if the action is START_RETRY or START_MANUAL or END_RETRY or END_MANUAL.

Returns:
boolean true if status is START_RETRY or START_MANUAL or END_RETRY or END_MANUAL

isComplete

public boolean isComplete()
Return if the action is complete.

Returns:
if the action is complete.

setPendingOnly

public void setPendingOnly()
Set the action pending flag to true.


setPending

public void setPending()
Set the action as pending and the current time as pending.


setPendingAge

public void setPendingAge(Date pendingAge)
Set a time when the action will be pending, normally a time in the future.

Parameters:
pendingAge - the time when the action will be pending.

getPendingAge

public Date getPendingAge()
Return the pending age of the action.

Returns:
the pending age of the action, null if the action is not pending.

isPending

public boolean isPending()
Return if the action is pending.

Returns:
if the action is pending.

resetPending

public void resetPending()
Removes the pending flag and pendingAge from the action.


resetPendingOnly

public void resetPendingOnly()
Removes the pending flag from the action.


incRetries

public void incRetries()
Increments the number of retries for the action.


setStartData

public void setStartData(String externalId,
                         String trackerUri,
                         String consoleUrl)
Set a tracking information for an action, and set the action status to Action.Status#DONE

Parameters:
externalId - external ID for the action.
trackerUri - tracker URI for the action.
consoleUrl - console URL for the action.

setExecutionData

public void setExecutionData(String externalStatus,
                             Properties actionData)
Set the completion information for an action start. Sets the Action status to Action.Status#DONE

Parameters:
externalStatus - action external end status.
actionData - action output data, null if there is no action output data.

setEndData

public void setEndData(WorkflowAction.Status status,
                       String signalValue)
Set the completion information for an action end.

Parameters:
status - action status, Action.Status#OK or Action.Status#ERROR or Action.Status#KILLED
signalValue - the signal value. In most cases, the value should be OK or ERROR.

getJobId

public String getJobId()
Return the job Id.

Returns:
the job Id.

getWfId

public String getWfId()
Return the job Id.

Returns:
the job Id.

setJobId

public void setJobId(String id)
Set the job id.

Parameters:
id - jobId;

getSlaXml

public String getSlaXml()

setSlaXml

public void setSlaXml(String slaXml)

setStatus

public void setStatus(WorkflowAction.Status val)
Overrides:
setStatus in class JsonWorkflowAction

getStatusStr

public String getStatusStr()

getStatus

public WorkflowAction.Status getStatus()
Description copied from interface: WorkflowAction
Return the current status of the action action.

Specified by:
getStatus in interface WorkflowAction
Overrides:
getStatus in class JsonWorkflowAction
Returns:
the current status of the action action.

getExecutionPath

public String getExecutionPath()
Return the node execution path.

Returns:
the node execution path.

setExecutionPath

public void setExecutionPath(String executionPath)
Set the node execution path.

Parameters:
executionPath - the node execution path.

getSignalValue

public String getSignalValue()
Return the signal value for the action.

For decision nodes it is the choosen transition, for actions it is OK or ERROR.

Returns:
the action signal value.

setSignalValue

public void setSignalValue(String signalValue)
Set the signal value for the action.

For decision nodes it is the choosen transition, for actions it is OK or ERROR.

Parameters:
signalValue - the action signal value.

getLogToken

public String getLogToken()
Return the job log token.

Returns:
the job log token.

setLogToken

public void setLogToken(String logToken)
Set the job log token.

Parameters:
logToken - the job log token.

getLastCheckTime

public Date getLastCheckTime()
Return the action last check time

Returns:
the last check time

getLastCheckTimestamp

public Timestamp getLastCheckTimestamp()
Return the action last check time

Returns:
the last check time

getStartTimestamp

public Timestamp getStartTimestamp()
Return the action last check time

Returns:
the last check time

getEndTimestamp

public Timestamp getEndTimestamp()
Return the action last check time

Returns:
the last check time

getPendingAgeTimestamp

public Timestamp getPendingAgeTimestamp()
Return the action last check time

Returns:
the last check time

setLastCheckTime

public void setLastCheckTime(Date lastCheckTime)
Sets the action last check time

Parameters:
lastCheckTime - the last check time to set.

getPending

public boolean getPending()

getStartTime

public Date getStartTime()
Description copied from interface: WorkflowAction
Return the start time of the action action.

Specified by:
getStartTime in interface WorkflowAction
Overrides:
getStartTime in class JsonWorkflowAction
Returns:
the start time of the action action.

setStartTime

public void setStartTime(Date startTime)
Overrides:
setStartTime in class JsonWorkflowAction

getEndTime

public Date getEndTime()
Description copied from interface: WorkflowAction
Return the end time of the action action.

Specified by:
getEndTime in interface WorkflowAction
Overrides:
getEndTime in class JsonWorkflowAction
Returns:
the end time of the action action.

setEndTime

public void setEndTime(Date endTime)
Overrides:
setEndTime in class JsonWorkflowAction


Copyright © 2011 Yahoo. All Rights Reserved.