Search in sources :

Example 36 with WorkflowAction

use of org.apache.oozie.client.WorkflowAction in project oozie by apache.

the class TestSparkActionExecutor method submitAction.

protected String submitAction(Context context) throws Exception {
    SparkActionExecutor ae = new SparkActionExecutor();
    WorkflowAction action = context.getAction();
    ae.prepareActionDir(getFileSystem(), context);
    ae.submitLauncher(getFileSystem(), context, action);
    String jobId = action.getExternalId();
    String jobTracker = action.getTrackerUri();
    String consoleUrl = action.getConsoleUrl();
    assertNotNull(jobId);
    assertNotNull(jobTracker);
    assertNotNull(consoleUrl);
    return jobId;
}
Also used : WorkflowAction(org.apache.oozie.client.WorkflowAction)

Example 37 with WorkflowAction

use of org.apache.oozie.client.WorkflowAction in project oozie by apache.

the class TestHive2ActionExecutor method submitAction.

private String submitAction(Context context, Namespace ns) throws Exception {
    Hive2ActionExecutor ae = new Hive2ActionExecutor();
    WorkflowAction action = context.getAction();
    ae.prepareActionDir(getFileSystem(), context);
    ae.submitLauncher(getFileSystem(), context, action);
    String jobId = action.getExternalId();
    String jobTracker = action.getTrackerUri();
    String consoleUrl = action.getConsoleUrl();
    assertNotNull(jobId);
    assertNotNull(jobTracker);
    assertNotNull(consoleUrl);
    return jobId;
}
Also used : WorkflowAction(org.apache.oozie.client.WorkflowAction)

Example 38 with WorkflowAction

use of org.apache.oozie.client.WorkflowAction in project oozie by apache.

the class AppInfoCollector method persistWorkflowJobInfo.

private void persistWorkflowJobInfo(int maxChildActions, final File resolvedActionsDir, final WorkflowJob job, final DiagBundleEntryWriter bundleEntryWriter) throws IOException {
    bundleEntryWriter.writeString("WORKFLOW\n").writeString("--------\n").writeStringValue("Workflow Id        : ", job.getId()).writeStringValue("Name               : ", job.getAppName()).writeStringValue("App Path           : ", job.getAppPath()).writeStringValue("User               : ", job.getUser()).writeStringValue("ACL                : ", job.getAcl()).writeStringValue("Status             : ", job.getStatus().toString()).writeStringValue("Console URL        : ", job.getConsoleUrl()).writeStringValue("External Id        : ", job.getExternalId()).writeStringValue("Parent Id          : ", job.getParentId()).writeDateValue("Created Time       : ", job.getCreatedTime()).writeDateValue("End Time           : ", job.getEndTime()).writeDateValue("Last Modified Time : ", job.getLastModifiedTime()).writeDateValue("Start Time         : ", job.getStartTime()).writeIntValue("Run                : ", job.getRun()).writeIntValue("Action Count       : ", job.getActions().size()).writeNewLine().writeString("ACTIONS\n").writeString("------\n").flush();
    final List<WorkflowAction> workflowActions = job.getActions();
    for (int actionCount = 0; actionCount != workflowActions.size() && actionCount < maxChildActions; ++actionCount) {
        final WorkflowAction action = workflowActions.get(actionCount);
        bundleEntryWriter.writeStringValue("Action Id          : ", action.getId()).writeStringValue("Name               : ", action.getName()).writeStringValue("Type               : ", action.getType()).writeStringValue("Status             : ", action.getStatus().toString()).writeStringValue("Transition         : ", action.getTransition()).writeDateValue("Start Time         : ", action.getStartTime()).writeDateValue("End Time           : ", action.getEndTime()).writeStringValue("Error Code         : ", action.getErrorCode()).writeStringValue("Error Message      : ", action.getErrorMessage()).writeStringValue("Console URL        : ", action.getConsoleUrl()).writeStringValue("Tracker URI        : ", action.getTrackerUri()).writeStringValue("External Child Ids : ", action.getExternalChildIDs()).writeStringValue("External Id        : ", action.getExternalId()).writeStringValue("External Status    : ", action.getExternalStatus()).writeStringValue("Data               : ", action.getData()).writeStringValue("Stats              : ", action.getStats()).writeStringValue("Credentials        : ", action.getCred()).writeIntValue("Retries            : ", action.getRetries()).writeIntValue("User Retry Int     : ", action.getUserRetryInterval()).writeIntValue("User Retry Count   : ", action.getUserRetryCount()).writeIntValue("User Retry Max     : ", action.getUserRetryMax()).writeNewLine().flush();
        final String actionType = action.getType();
        persistResolvedActionDefinition(action, resolvedActionsDir);
        if (!isControlNode(actionType)) {
            // skip control nodes
            storeOozieLauncherLog(resolvedActionsDir, action, job.getUser());
        }
    }
}
Also used : WorkflowAction(org.apache.oozie.client.WorkflowAction)

Example 39 with WorkflowAction

use of org.apache.oozie.client.WorkflowAction in project oozie by apache.

the class TestPyspark method submitAction.

protected String submitAction(Context context) throws Exception {
    SparkActionExecutor ae = new SparkActionExecutor();
    WorkflowAction action = context.getAction();
    ae.prepareActionDir(getFileSystem(), context);
    ae.submitLauncher(getFileSystem(), context, action);
    String jobId = action.getExternalId();
    String jobTracker = action.getTrackerUri();
    String consoleUrl = action.getConsoleUrl();
    assertNotNull(jobId);
    assertNotNull(jobTracker);
    assertNotNull(consoleUrl);
    return jobId;
}
Also used : WorkflowAction(org.apache.oozie.client.WorkflowAction)

Example 40 with WorkflowAction

use of org.apache.oozie.client.WorkflowAction in project oozie by apache.

the class TestSqoopActionExecutor method submitAction.

private String submitAction(Context context) throws Exception {
    SqoopActionExecutor ae = new SqoopActionExecutor();
    WorkflowAction action = context.getAction();
    ae.prepareActionDir(getFileSystem(), context);
    ae.submitLauncher(getFileSystem(), context, action);
    String jobId = action.getExternalId();
    String jobTracker = action.getTrackerUri();
    String consoleUrl = action.getConsoleUrl();
    assertNotNull(jobId);
    assertNotNull(jobTracker);
    assertNotNull(consoleUrl);
    return jobId;
}
Also used : WorkflowAction(org.apache.oozie.client.WorkflowAction)

Aggregations

WorkflowAction (org.apache.oozie.client.WorkflowAction)41 FileSystem (org.apache.hadoop.fs.FileSystem)9 Path (org.apache.hadoop.fs.Path)8 IOException (java.io.IOException)6 ActionExecutorException (org.apache.oozie.action.ActionExecutorException)6 WorkflowJob (org.apache.oozie.client.WorkflowJob)6 Writer (java.io.Writer)5 Properties (java.util.Properties)5 OozieClient (org.apache.oozie.client.OozieClient)5 XConfiguration (org.apache.oozie.util.XConfiguration)5 OutputStreamWriter (java.io.OutputStreamWriter)4 Configuration (org.apache.hadoop.conf.Configuration)3 Element (org.jdom.Element)3 File (java.io.File)2 Reader (java.io.Reader)2 StringReader (java.io.StringReader)2 URISyntaxException (java.net.URISyntaxException)2 AccessControlException (org.apache.hadoop.security.AccessControlException)2 WorkflowActionBean (org.apache.oozie.WorkflowActionBean)2 HadoopAccessorException (org.apache.oozie.service.HadoopAccessorException)2