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, org.apache.oozie.client.WorkflowAction

@Entity
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
org.apache.oozie.client.WorkflowAction.Status
 
Constructor Summary
WorkflowActionBean()
          Default constructor.
 
Method Summary
 Date getEndTime()
           
 Timestamp getEndTimestamp()
          Return the action last check time
 String getExecutionPath()
          Return the node execution path.
 String getExecutionStats()
          Return the action statistics info.
 String getExternalChildIDs()
          Return the external child IDs.
 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()
           
 Timestamp getStartTimestamp()
          Return the action last check time
 org.apache.oozie.client.WorkflowAction.Status getStatus()
           
 String getStatusStr()
           
 String getWfId()
          Return the job Id.
 void incRetries()
          Increments the number of retries for the action.
 boolean inTerminalState()
          Return whether workflow action in terminal state or not
 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.
 boolean isTerminalWithFailure()
          Return if the action is complete with failure.
 boolean isUserRetry()
          Return true if the action is USER_RETRY
 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(org.apache.oozie.client.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 setExecutionStats(String jsonStats)
          Set the action statistics info for the workflow action.
 void setExternalChildIDs(String externalChildIDs)
          Set the external child IDs for the workflow action.
 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(org.apache.oozie.client.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
getConf, getConsoleUrl, getCred, getData, getErrorCode, getErrorMessage, getExternalId, getExternalStatus, getId, getName, getRetries, getStats, getTrackerUri, getTransition, getType, getUserRetryCount, getUserRetryInterval, getUserRetryMax, incrmentUserRetryCount, setConf, setConsoleUrl, setCred, setData, setErrorInfo, setExternalId, setExternalStatus, setId, setName, setRetries, setStats, setTrackerUri, setTransition, setType, setUserRetryCount, setUserRetryInterval, setUserRetryMax, toJSONArray, toJSONObject, 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.

inTerminalState

public boolean inTerminalState()
Return whether workflow action in terminal state or not

Returns:

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

isUserRetry

public boolean isUserRetry()
Return true if the action is USER_RETRY

Returns:
boolean true if status is USER_RETRY

isComplete

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

Returns:
if the action is complete.

isTerminalWithFailure

public boolean isTerminalWithFailure()
Return if the action is complete with failure.

Returns:
if the action is complete with failure.

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.

getExecutionStats

public String getExecutionStats()
Return the action statistics info.

Returns:
Json representation of the stats.

setExecutionStats

public void setExecutionStats(String jsonStats)
Set the action statistics info for the workflow action.

Parameters:
Json - representation of the stats.

getExternalChildIDs

public String getExternalChildIDs()
Return the external child IDs.

Specified by:
getExternalChildIDs in interface org.apache.oozie.client.WorkflowAction
Overrides:
getExternalChildIDs in class JsonWorkflowAction
Returns:
externalChildIDs as a string.

setExternalChildIDs

public void setExternalChildIDs(String externalChildIDs)
Set the external child IDs for the workflow action.

Overrides:
setExternalChildIDs in class JsonWorkflowAction
Parameters:
externalChildIDs - as a string.

setEndData

public void setEndData(org.apache.oozie.client.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(org.apache.oozie.client.WorkflowAction.Status val)
Overrides:
setStatus in class JsonWorkflowAction

getStatusStr

public String getStatusStr()

getStatus

public org.apache.oozie.client.WorkflowAction.Status getStatus()
Specified by:
getStatus in interface org.apache.oozie.client.WorkflowAction
Overrides:
getStatus in class JsonWorkflowAction

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()
Specified by:
getStartTime in interface org.apache.oozie.client.WorkflowAction
Overrides:
getStartTime in class JsonWorkflowAction

setStartTime

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

getEndTime

public Date getEndTime()
Specified by:
getEndTime in interface org.apache.oozie.client.WorkflowAction
Overrides:
getEndTime in class JsonWorkflowAction

setEndTime

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


Copyright © 2013 Apache Software Foundation. All Rights Reserved.