Package org.apache.oozie.client

Examples of org.apache.oozie.client.OozieClient


        finally {
            store.closeTrx();
        }

        try {
            final OozieClient coordClient = LocalOozie.getCoordClient();
            coordClient.reRunCoord(jobId, RestConstants.JOB_COORD_RERUN_ACTION, Integer.toString(actionNum), false,
                    true);
            fail("Exception expected because action is not in terminal state.");
        }
        catch (OozieClientException ex) {
            if (!ex.getErrorCode().equals(ErrorCode.E1018.toString())) {
View Full Code Here


        CoordinatorActionBean action3 = addRecordToCoordActionTable(coordJob.getId(), 3,
                CoordinatorAction.Status.SUCCEEDED, "coord-rerun-action1.xml", 0);

        String rerunScope = Integer.toString(1) + "-" + Integer.toString(2);

        final OozieClient coordClient = LocalOozie.getCoordClient();
        coordClient.reRunCoord(coordJob.getId(), RestConstants.JOB_COORD_RERUN_ACTION, rerunScope, false, true);

        CoordJobGetJPAExecutor coordJobGetCmd = new CoordJobGetJPAExecutor(coordJob.getId());
        coordJob = jpaService.execute(coordJobGetCmd);
        assertEquals(CoordinatorJob.Status.SUCCEEDED, coordJob.getStatus());
View Full Code Here

        CoordinatorActionBean action3 = addRecordToCoordActionTable(coordJob.getId(), 3,
                CoordinatorAction.Status.SUCCEEDED, "coord-rerun-action1.xml", 0);

        String rerunScope = Integer.toString(1) + "-" + Integer.toString(2);

        final OozieClient coordClient = LocalOozie.getCoordClient();
        coordClient.reRunCoord(coordJob.getId(), RestConstants.JOB_COORD_RERUN_ACTION, rerunScope, false, true);

        CoordJobGetJPAExecutor coordJobGetCmd = new CoordJobGetJPAExecutor(coordJob.getId());
        coordJob = jpaService.execute(coordJobGetCmd);
        assertEquals(CoordinatorJob.Status.SUSPENDED, coordJob.getStatus());
View Full Code Here

        CoordinatorActionBean action3 = addRecordToCoordActionTable(coordJob.getId(), 3,
                CoordinatorAction.Status.SUCCEEDED, "coord-rerun-action1.xml", 0);

        String rerunScope = Integer.toString(1) + "-" + Integer.toString(2);

        final OozieClient coordClient = LocalOozie.getCoordClient();
        coordClient.reRunCoord(coordJob.getId(), RestConstants.JOB_COORD_RERUN_ACTION, rerunScope, false, true);

        CoordJobGetJPAExecutor coordJobGetCmd = new CoordJobGetJPAExecutor(coordJob.getId());
        coordJob = jpaService.execute(coordJobGetCmd);
        assertEquals(CoordinatorJob.Status.SUCCEEDED, coordJob.getStatus());
View Full Code Here

        }
    }

    private Properties getCoordProp(Path appPath) throws IOException {
        Path wfAppPath = new Path(getFsTestCaseDir(), "workflow");
        final OozieClient coordClient = LocalOozie.getCoordClient();
        Properties conf = coordClient.createConfiguration();
        conf.setProperty(OozieClient.COORDINATOR_APP_PATH, appPath.toString());
        conf.setProperty("jobTracker", getJobTrackerUri());
        conf.setProperty("nameNode", getNameNodeUri());
        conf.setProperty("wfAppPath", wfAppPath.toString());
        conf.remove("user.name");
View Full Code Here

        try {
            // start local Oozie
            LocalOozie.start();

            // get a OozieClient for local Oozie
            OozieClient wc = LocalOozie.getClient();

            // create a workflow job configuration and set the workflow application path
            Properties conf = wc.createConfiguration();
            conf.setProperty(OozieClient.APP_PATH, appUri + File.separator + "workflow.xml");
            conf.setProperty("mapreduce.jobtracker.kerberos.principal", "mapred/localhost@LOCALHOST");
            conf.setProperty("dfs.namenode.kerberos.principal", "hdfs/localhost@LOCALHOST");
            // load additional workflow job parameters from properties file
            if (propertiesFile != null) {
                conf.load(new FileInputStream(propertiesFile));
            }

            // submit and start the workflow job
            String jobId = wc.run(conf);
            Thread.sleep(1000);
            System.out.println("Workflow job submitted");

            // wait until the workflow job finishes printing the status every 10 seconds
            while (wc.getJobInfo(jobId).getStatus() == WorkflowJob.Status.RUNNING) {
                System.out.println("Workflow job running ...");
                printWorkflowInfo(wc.getJobInfo(jobId));
                Thread.sleep(10 * 1000);
            }

            // print the final status o the workflow job
            System.out.println("Workflow job completed ...");
            printWorkflowInfo(wc.getJobInfo(jobId));

            return (wc.getJobInfo(jobId).getStatus() == WorkflowJob.Status.SUCCEEDED) ? 0 : -1;
        }
        catch (Exception ex) {
            System.out.println();
            System.out.println(ex.getMessage());
            return -1;
View Full Code Here

        CoordinatorActionBean action1 = store1.getCoordinatorAction(actionId, false);
        assertEquals(action1.getStatus(), CoordinatorAction.Status.SUCCEEDED);
        store1.commitTrx();
        store1.closeTrx();

        final OozieClient coordClient = LocalOozie.getCoordClient();
        coordClient.reRunCoord(jobId, RestConstants.JOB_COORD_RERUN_ACTION, Integer.toString(actionNum), false, true);

        CoordinatorStore store2 = Services.get().get(StoreService.class).getStore(CoordinatorStore.class);
        store2.beginTrx();
        CoordinatorActionBean action2 = store2.getCoordinatorAction(actionId, false);
        assertNotSame(action2.getStatus(), CoordinatorAction.Status.SUCCEEDED);
View Full Code Here

            store.closeTrx();
        }

        String rerunScope = Integer.toString(actionNum1) + "-" + Integer.toString(actionNum2);

        final OozieClient coordClient = LocalOozie.getCoordClient();
        coordClient.reRunCoord(jobId, RestConstants.JOB_COORD_RERUN_ACTION, rerunScope, false, true);

        CoordinatorStore store1 = Services.get().get(StoreService.class).getStore(CoordinatorStore.class);
        store1.beginTrx();
        CoordinatorActionBean action1 = store1.getCoordinatorAction(actionId1, false);
        assertNotSame(action1.getStatus(), CoordinatorAction.Status.SUCCEEDED);
View Full Code Here

        finally {
            store.closeTrx();
        }
        String rerunScope = Integer.toString(actionNum1) + "," + Integer.toString(actionNum2);

        final OozieClient coordClient = LocalOozie.getCoordClient();
        coordClient.reRunCoord(jobId, RestConstants.JOB_COORD_RERUN_ACTION, rerunScope, false, true);

        CoordinatorStore store1 = Services.get().get(StoreService.class).getStore(CoordinatorStore.class);
        store1.beginTrx();
        CoordinatorActionBean action1 = store1.getCoordinatorAction(actionId1, false);
        assertNotSame(action1.getStatus(), CoordinatorAction.Status.SUCCEEDED);
View Full Code Here

            store.closeTrx();
        }

        String rerunScope = "1-3";
        try {
            final OozieClient coordClient = LocalOozie.getCoordClient();
            coordClient.reRunCoord(jobId, RestConstants.JOB_COORD_RERUN_ACTION, rerunScope, false, true);
            fail("Exception expected because one action is missing from db.");
        }
        catch (OozieClientException ex) {
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.oozie.client.OozieClient

Copyright © 2018 www.massapicom. 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.