org.apache.oozie
Class CoordinatorEngine

java.lang.Object
  extended by org.apache.oozie.BaseEngine
      extended by org.apache.oozie.CoordinatorEngine

public class CoordinatorEngine
extends BaseEngine


Field Summary
 
Fields inherited from class org.apache.oozie.BaseEngine
authToken, USE_XCOMMAND, user
 
Constructor Summary
CoordinatorEngine()
          Create a system Coordinator engine, with no user and no group.
CoordinatorEngine(String user, String authToken)
          Create a Coordinator engine to perform operations on behave of a user.
 
Method Summary
 void change(String jobId, String changeValue)
          Change a coordinator job.
 String dryRunSubmit(org.apache.hadoop.conf.Configuration conf)
          Dry run a job; like {@link BaseEngine#submitJob(org.apache.hadoop.conf.Configuration, boolean) but doesn't actually execute the job.
 CoordinatorActionBean getCoordAction(String actionId)
           
 CoordinatorJobBean getCoordJob(String jobId)
          Return the info about a coord job.
 CoordinatorJobBean getCoordJob(String jobId, String filter, int start, int length)
          Return the info about a coord job with actions subset.
 CoordinatorJobInfo getCoordJobs(String filter, int start, int len)
           
 String getDefinition(String jobId)
          Return the a job definition.
 org.apache.oozie.client.WorkflowJob getJob(String jobId)
          Return the info about a wf job.
 org.apache.oozie.client.WorkflowJob getJob(String jobId, int start, int length)
          Return the info about a wf job with actions subset.
 String getJobIdForExternalId(String externalId)
          Return the workflow Job ID for an external ID.
 void kill(String jobId)
          Kill a job.
 void reRun(String jobId, org.apache.hadoop.conf.Configuration conf)
          Deprecated. 
 CoordinatorActionInfo reRun(String jobId, String rerunType, String scope, boolean refresh, boolean noCleanup)
          Rerun coordinator actions for given rerunType
 void resume(String jobId)
          Resume a job.
 void start(String jobId)
          Deprecated. 
 void streamLog(String jobId, String logRetrievalScope, String logRetrievalType, Writer writer)
          Add list of actions to the filter based on conditions
 void streamLog(String jobId, Writer writer)
          Stream the log of a job.
 String submitJob(org.apache.hadoop.conf.Configuration conf, boolean startJob)
          Submit a job.
 void suspend(String jobId)
          Suspend a job.
 
Methods inherited from class org.apache.oozie.BaseEngine
getAuthToken, getUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoordinatorEngine

public CoordinatorEngine()
Create a system Coordinator engine, with no user and no group.


CoordinatorEngine

public CoordinatorEngine(String user,
                         String authToken)
Create a Coordinator engine to perform operations on behave of a user.

Parameters:
user - user name.
authToken - the authentication token.
Method Detail

getDefinition

public String getDefinition(String jobId)
                     throws BaseEngineException
Description copied from class: BaseEngine
Return the a job definition.

Specified by:
getDefinition in class BaseEngine
Parameters:
jobId - job Id.
Returns:
the job definition.
Throws:
BaseEngineException - thrown if the job definition could no be obtained.

getCoordAction

public CoordinatorActionBean getCoordAction(String actionId)
                                     throws BaseEngineException
Parameters:
actionId -
Returns:
CoordinatorActionBean
Throws:
BaseEngineException

getCoordJob

public CoordinatorJobBean getCoordJob(String jobId)
                               throws BaseEngineException
Description copied from class: BaseEngine
Return the info about a coord job.

Specified by:
getCoordJob in class BaseEngine
Parameters:
jobId - job Id.
Returns:
the coord job info.
Throws:
BaseEngineException - thrown if the job info could not be obtained.

getCoordJob

public CoordinatorJobBean getCoordJob(String jobId,
                                      String filter,
                                      int start,
                                      int length)
                               throws BaseEngineException
Description copied from class: BaseEngine
Return the info about a coord job with actions subset.

Specified by:
getCoordJob in class BaseEngine
Parameters:
jobId - job Id.
filter - the status filter
start - starting from this index in the list of actions belonging to the job
length - number of actions to be returned
Returns:
the coord job info.
Throws:
BaseEngineException - thrown if the job info could not be obtained.

getJobIdForExternalId

public String getJobIdForExternalId(String externalId)
                             throws CoordinatorEngineException
Description copied from class: BaseEngine
Return the workflow Job ID for an external ID.

This is reverse lookup for recovery purposes.

Specified by:
getJobIdForExternalId in class BaseEngine
Parameters:
externalId - external ID provided at job submission time.
Returns:
the associated workflow job ID if any, null if none.
Throws:
CoordinatorEngineException

kill

public void kill(String jobId)
          throws CoordinatorEngineException
Description copied from class: BaseEngine
Kill a job.

Specified by:
kill in class BaseEngine
Parameters:
jobId - job Id.
Throws:
CoordinatorEngineException

change

public void change(String jobId,
                   String changeValue)
            throws CoordinatorEngineException
Description copied from class: BaseEngine
Change a coordinator job.

Specified by:
change in class BaseEngine
Parameters:
jobId - job Id.
changeValue - change value.
Throws:
CoordinatorEngineException

reRun

@Deprecated
public void reRun(String jobId,
                             org.apache.hadoop.conf.Configuration conf)
           throws BaseEngineException
Deprecated. 

Description copied from class: BaseEngine
Rerun a job.

Specified by:
reRun in class BaseEngine
Parameters:
jobId - job Id to rerun.
conf - configuration information for the rerun.
Throws:
BaseEngineException - thrown if the job could not be rerun.

reRun

public CoordinatorActionInfo reRun(String jobId,
                                   String rerunType,
                                   String scope,
                                   boolean refresh,
                                   boolean noCleanup)
                            throws BaseEngineException
Rerun coordinator actions for given rerunType

Parameters:
jobId -
rerunType -
scope -
refresh -
noCleanup -
Throws:
BaseEngineException

resume

public void resume(String jobId)
            throws CoordinatorEngineException
Description copied from class: BaseEngine
Resume a job.

Specified by:
resume in class BaseEngine
Parameters:
jobId - job Id.
Throws:
CoordinatorEngineException

start

@Deprecated
public void start(String jobId)
           throws BaseEngineException
Deprecated. 

Description copied from class: BaseEngine
Start a job.

Specified by:
start in class BaseEngine
Parameters:
jobId - job Id.
Throws:
BaseEngineException - thrown if the job could not be started.

streamLog

public void streamLog(String jobId,
                      Writer writer)
               throws IOException,
                      BaseEngineException
Description copied from class: BaseEngine
Stream the log of a job.

Specified by:
streamLog in class BaseEngine
Parameters:
jobId - job Id.
writer - writer to stream the log to.
Throws:
IOException - thrown if the log cannot be streamed.
BaseEngineException - thrown if there is error in getting the Workflow/Coordinator Job Information for jobId.

streamLog

public void streamLog(String jobId,
                      String logRetrievalScope,
                      String logRetrievalType,
                      Writer writer)
               throws IOException,
                      BaseEngineException,
                      CommandException
Add list of actions to the filter based on conditions

Parameters:
jobId - Job Id
logRetrievalScope - Value for the retrieval type
logRetrievalType - Based on which filter criteria the log is retrieved
writer - writer to stream the log to
Throws:
IOException
BaseEngineException
CommandException

submitJob

public String submitJob(org.apache.hadoop.conf.Configuration conf,
                        boolean startJob)
                 throws CoordinatorEngineException
Description copied from class: BaseEngine
Submit a job.

It validates configuration properties.

Specified by:
submitJob in class BaseEngine
Parameters:
conf - job configuration.
startJob - indicates if the job should be started or not.
Returns:
the job Id.
Throws:
CoordinatorEngineException

dryRunSubmit

public String dryRunSubmit(org.apache.hadoop.conf.Configuration conf)
                    throws CoordinatorEngineException
Description copied from class: BaseEngine
Dry run a job; like {@link BaseEngine#submitJob(org.apache.hadoop.conf.Configuration, boolean) but doesn't actually execute the job.

It validates configuration properties.

Specified by:
dryRunSubmit in class BaseEngine
Parameters:
conf - job configuration.
Returns:
the result of the dryrun
Throws:
CoordinatorEngineException

suspend

public void suspend(String jobId)
             throws CoordinatorEngineException
Description copied from class: BaseEngine
Suspend a job.

Specified by:
suspend in class BaseEngine
Parameters:
jobId - job Id.
Throws:
CoordinatorEngineException

getJob

public org.apache.oozie.client.WorkflowJob getJob(String jobId)
                                           throws BaseEngineException
Description copied from class: BaseEngine
Return the info about a wf job.

Specified by:
getJob in class BaseEngine
Parameters:
jobId - job Id.
Returns:
the workflow job info.
Throws:
DagEngineException - thrown if the job info could not be obtained.
BaseEngineException

getJob

public org.apache.oozie.client.WorkflowJob getJob(String jobId,
                                                  int start,
                                                  int length)
                                           throws BaseEngineException
Description copied from class: BaseEngine
Return the info about a wf job with actions subset.

Specified by:
getJob in class BaseEngine
Parameters:
jobId - job Id
start - starting from this index in the list of actions belonging to the job
length - number of actions to be returned
Returns:
the workflow job info.
Throws:
DagEngineException - thrown if the job info could not be obtained.
BaseEngineException

getCoordJobs

public CoordinatorJobInfo getCoordJobs(String filter,
                                       int start,
                                       int len)
                                throws CoordinatorEngineException
Parameters:
filter -
start -
len -
Returns:
CoordinatorJobInfo
Throws:
CoordinatorEngineException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.