Examples of WorkflowJob


Examples of org.apache.oozie.client.WorkflowJob

        /* (non-Javadoc)
         * @see org.apache.oozie.action.ActionExecutor.Context#getAppFileSystem()
         */
        public FileSystem getAppFileSystem() throws HadoopAccessorException, IOException, URISyntaxException {
            WorkflowJob workflow = getWorkflow();
            URI uri = new URI(getWorkflow().getAppPath());
            HadoopAccessorService has = Services.get().get(HadoopAccessorService.class);
            Configuration fsConf = has.createJobConf(uri.getAuthority());
            return has.createFileSystem(workflow.getUser(), uri, fsConf);

        }
View Full Code Here

Examples of org.apache.oozie.client.WorkflowJob

        try {
            ARGS args = new ARGS();
            setupArgs(arguments, args);

            OozieClient client = new OozieClient(args.oozieUrl);
            WorkflowJob jobInfo;
            try {
                jobInfo = client.getJobInfo(args.subflowId);
            } catch (OozieClientException e) {
                LOG.error("Error getting jobinfo for: " + args.subflowId, e);
                return 0;
            }

            Path path = new Path(args.logDir + "/"
                    + String.format("%03d", Integer.parseInt(args.runId)));
            FileSystem fs = path.getFileSystem(getConf());

            if (args.entityType.equalsIgnoreCase(EntityType.FEED.name())
                    || notUserWorkflowEngineIsOozie(args.userWorkflowEngine)) {
                // if replication wf or PIG Process
                copyOozieLog(client, fs, path, jobInfo.getId());
                copyTTlogs(fs, path, jobInfo.getActions().get(2));
            } else {
                // if process wf with oozie engine
                String subflowId = jobInfo.getExternalId();
                copyOozieLog(client, fs, path, subflowId);
                WorkflowJob subflowInfo = client.getJobInfo(subflowId);
                List<WorkflowAction> actions = subflowInfo.getActions();
                for (WorkflowAction action : actions) {
                    if (action.getType().equals("pig")
                            || action.getType().equals("java")) {
                        copyTTlogs(fs, path, action);
                    } else {
View Full Code Here

Examples of org.apache.oozie.client.WorkflowJob

     */
    @Override
    public void streamLog(String jobId, Writer writer) throws IOException, DagEngineException {
        XLogStreamer.Filter filter = new XLogStreamer.Filter();
        filter.setParameter(DagXLogInfoService.JOB, jobId);
        WorkflowJob job = getJob(jobId);
        Date lastTime = job.getEndTime();
        if (lastTime == null) {
            lastTime = job.getLastModifiedTime();
        }
        Services.get().get(XLogService.class).streamLog(filter, job.getCreatedTime(), lastTime, writer);
    }
View Full Code Here

Examples of org.apache.oozie.client.WorkflowJob

    }

    @SuppressWarnings("unchecked")
    public void testParseWorkflowJob() {
        JSONObject json = createJsonWorkflowJob();
        WorkflowJob wf = JsonToBean.createWorkflowJob(json);

        assertEquals("a", wf.getAppPath());
        assertEquals("b", wf.getAppName());
        assertEquals("c", wf.getId());
        assertEquals("d", wf.getConf());
        assertEquals(WorkflowJob.Status.PREP, wf.getStatus());
        assertEquals(JsonUtils.parseDateRfc822(CREATED_TIME), wf.getCreatedTime());
        assertEquals(JsonUtils.parseDateRfc822(START_TIME), wf.getStartTime());
        assertEquals(JsonUtils.parseDateRfc822(END_TIME), wf.getEndTime());
        assertEquals("e", wf.getUser());
        assertEquals("f", wf.getGroup());
        assertEquals(1, wf.getRun());
        assertEquals("g", wf.getConsoleUrl());
        assertEquals(2, wf.getActions().size());
        assertEquals("a1", wf.getActions().get(0).getId());
        assertEquals("a2", wf.getActions().get(1).getId());
    }
View Full Code Here

Examples of org.apache.oozie.client.WorkflowJob

                subWorkflowId = oozieClient.run(subWorkflowConf.toProperties());
            }
            else {
                subWorkflowId = runningJobId;
            }
            WorkflowJob workflow = oozieClient.getJobInfo(subWorkflowId);
            String consoleUrl = workflow.getConsoleUrl();
            context.setStartData(subWorkflowId, oozieUri, consoleUrl);
            if (runningJobId != null) {
                check(context, action);
            }
        }
View Full Code Here

Examples of org.apache.oozie.client.WorkflowJob

    public void check(Context context, WorkflowAction action) throws ActionExecutorException {
        try {
            String subWorkflowId = action.getExternalId();
            String oozieUri = action.getTrackerUri();
            OozieClient oozieClient = getWorkflowClient(context, oozieUri);
            WorkflowJob subWorkflow = oozieClient.getJobInfo(subWorkflowId);
            WorkflowJob.Status status = subWorkflow.getStatus();
            switch (status) {
                case FAILED:
                case KILLED:
                case SUCCEEDED:
                    context.setExecutionData(status.toString(), null);
View Full Code Here

Examples of org.apache.oozie.client.WorkflowJob

        conf.set("d", "${c}${c}");
        conf.set("f", "${e}${e}");

        final String jobId1 = engine.submitJob(conf, true);

        WorkflowJob wf = engine.getJob(jobId1);
        XConfiguration wfConf = new XConfiguration(new StringReader(wf.getConf()));
        assertEquals("AA", wfConf.get("a"));
        assertEquals("B", wfConf.get("b"));
        assertEquals("C", conf.get("c"));
        assertEquals("CC", conf.get("d"));
        assertEquals("CCCC", conf.get("e"));
View Full Code Here

Examples of org.apache.oozie.client.WorkflowJob

* EL function for fs action executor.
*/
public class FsELFunctions {

    private static FileSystem getFileSystem(URI uri) throws HadoopAccessorException {
        WorkflowJob workflow = DagELFunctions.getWorkflow();
        String user = workflow.getUser();
        String group = workflow.getGroup();
        return Services.get().get(HadoopAccessorService.class).
                createFileSystem(user, group, uri, DagELFunctions.getProtoActionConf());
    }
View Full Code Here

Examples of org.apache.oozie.client.WorkflowJob

        /* (non-Javadoc)
         * @see org.apache.oozie.action.ActionExecutor.Context#getAppFileSystem()
         */
        public FileSystem getAppFileSystem() throws HadoopAccessorException, IOException, URISyntaxException {
            WorkflowJob workflow = getWorkflow();
            XConfiguration jobConf = new XConfiguration(new StringReader(workflow.getConf()));
            Configuration fsConf = new Configuration();
            XConfiguration.copy(jobConf, fsConf);
            return Services.get().get(HadoopAccessorService.class).createFileSystem(workflow.getUser(),
                    workflow.getGroup(), new URI(getWorkflow().getAppPath()), fsConf);

        }
View Full Code Here

Examples of org.apache.oozie.client.WorkflowJob

        subWorkflow.end(new Context(workflow, action), action);

        assertEquals(WorkflowAction.Status.OK, action.getStatus());

        WorkflowJob wf = oozieClient.getJobInfo(action.getExternalId());
        Configuration childConf = new XConfiguration(new StringReader(wf.getConf()));
        assertEquals("xyz", childConf.get("abc"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.