Package org.apache.falcon.oozie.workflow

Examples of org.apache.falcon.oozie.workflow.ACTION


        List<Object> actions = wf.getDecisionOrForkOrJoin();
        for (Object obj : actions) {
            if (!(obj instanceof ACTION)) {
                continue;
            }
            ACTION action = (ACTION) obj;
            List<String> files = null;
            if (action.getJava() != null) {
                files = action.getJava().getFile();
            } else if (action.getPig() != null) {
                files = action.getPig().getFile();
            } else if (action.getMapReduce() != null) {
                files = action.getMapReduce().getFile();
            }
            if (files != null) {
                Assert.assertTrue(files.get(files.size() - 1).endsWith("/projects/falcon/working/libext/FEED/"
                        + lifecycle + "/ext.jar"));
            }
View Full Code Here


        assertWorkflowDefinition(fsReplFeed, workflow);

        List<Object> actions = workflow.getDecisionOrForkOrJoin();
        System.out.println("actions = " + actions);

        ACTION replicationActionNode = (ACTION) actions.get(4);
        Assert.assertEquals(replicationActionNode.getName(), "replication");

        JAVA replication = replicationActionNode.getJava();
        List<String> args = replication.getArg();
        Assert.assertEquals(args.size(), 11);

        HashMap<String, String> props = new HashMap<String, String>();
        for (Property prop : coord.getAction().getWorkflow().getConfiguration().getProperty()) {
View Full Code Here

            if (!(object instanceof ACTION)) {
                continue;
            }

            String storagePath = getStoragePath(getEntity().getWorkflow().getPath());
            ACTION action = (ACTION) object;
            String actionName = action.getName();
            if (engineType == EngineType.OOZIE && actionName.equals("user-oozie-workflow")) {
                action.getSubWorkflow().setAppPath(storagePath);
            } else if (engineType == EngineType.PIG && actionName.equals("user-pig-job")) {
                decoratePIGAction(cluster, process, processWorkflow, storagePath, action.getPig(), wfPath);
            } else if (engineType == EngineType.HIVE && actionName.equals("user-hive-job")) {
                decorateHiveAction(cluster, process, processWorkflow, storagePath, action, wfPath);
            }
        }
View Full Code Here

        WORKFLOWAPP parentWorkflow = initializeProcessMapper(process, "12", "360");
        testParentWorkflow(process, parentWorkflow);

        List<Object> decisionOrForkOrJoin = parentWorkflow.getDecisionOrForkOrJoin();

        ACTION pigActionNode = (ACTION) decisionOrForkOrJoin.get(3);
        Assert.assertEquals("user-pig-job", pigActionNode.getName());

        final PIG pigAction = pigActionNode.getPig();
        Assert.assertEquals("${nameNode}/apps/pig/id.pig", pigAction.getScript());
        Assert.assertNotNull(pigAction.getPrepare());
        Assert.assertEquals(1, pigAction.getPrepare().getDelete().size());
        Assert.assertFalse(pigAction.getParam().isEmpty());
        Assert.assertEquals(5, pigAction.getParam().size());
        Assert.assertEquals(Collections.EMPTY_LIST, pigAction.getArchive());
        Assert.assertTrue(pigAction.getFile().size() > 0);

        ACTION oozieAction = (ACTION) decisionOrForkOrJoin.get(5);
        Assert.assertEquals("user-oozie-workflow", oozieAction.getName());
        Assert.assertEquals("#USER_WF_PATH#", oozieAction.getSubWorkflow().getAppPath());
    }
View Full Code Here

        WORKFLOWAPP parentWorkflow = getParentWorkflow(new Path(wfPath));
        testParentWorkflow(process, parentWorkflow);

        List<Object> decisionOrForkOrJoin = parentWorkflow.getDecisionOrForkOrJoin();

        ACTION hiveNode = (ACTION) decisionOrForkOrJoin.get(4);
        Assert.assertEquals("user-hive-job", hiveNode.getName());

        JAXBElement<org.apache.falcon.oozie.hive.ACTION> actionJaxbElement = mapper.unMarshalHiveAction(hiveNode);
        org.apache.falcon.oozie.hive.ACTION hiveAction = actionJaxbElement.getValue();

        Assert.assertEquals("${nameNode}/apps/hive/script.hql", hiveAction.getScript());
View Full Code Here

        List<Object> actions = wf.getDecisionOrForkOrJoin();
        for (Object obj : actions) {
            if (!(obj instanceof ACTION)) {
                continue;
            }
            ACTION action = (ACTION) obj;
            List<String> files = null;
            if (action.getJava() != null) {
                files = action.getJava().getFile();
            } else if (action.getPig() != null) {
                files = action.getPig().getFile();
            } else if (action.getMapReduce() != null) {
                files = action.getMapReduce().getFile();
            }
            if (files != null) {
                Assert.assertTrue(files.get(files.size() - 1)
                        .endsWith("/projects/falcon/working/libext/PROCESS/ext.jar"));
            }
View Full Code Here

        WORKFLOWAPP parentWorkflow = initializeProcessMapper(process, "12", "360");
        testParentWorkflow(process, parentWorkflow);

        List<Object> decisionOrForkOrJoin = parentWorkflow.getDecisionOrForkOrJoin();

        ACTION pigActionNode = (ACTION) decisionOrForkOrJoin.get(3);
        Assert.assertEquals("user-pig-job", pigActionNode.getName());

        final PIG pigAction = pigActionNode.getPig();
        Assert.assertEquals(pigAction.getScript(), "${nameNode}/falcon/staging/workflows/pig-process/user/id.pig");
        Assert.assertNotNull(pigAction.getPrepare());
        Assert.assertEquals(1, pigAction.getPrepare().getDelete().size());
        Assert.assertFalse(pigAction.getParam().isEmpty());
        Assert.assertEquals(5, pigAction.getParam().size());
        Assert.assertEquals(Collections.EMPTY_LIST, pigAction.getArchive());
        Assert.assertTrue(pigAction.getFile().size() > 0);

        ACTION oozieAction = (ACTION) decisionOrForkOrJoin.get(5);
        Assert.assertEquals("user-oozie-workflow", oozieAction.getName());
        Assert.assertEquals("#USER_WF_PATH#", oozieAction.getSubWorkflow().getAppPath());
    }
View Full Code Here

        WORKFLOWAPP parentWorkflow = getParentWorkflow(new Path(wfPath));
        testParentWorkflow(process, parentWorkflow);

        List<Object> decisionOrForkOrJoin = parentWorkflow.getDecisionOrForkOrJoin();

        ACTION hiveNode = (ACTION) decisionOrForkOrJoin.get(4);
        Assert.assertEquals("user-hive-job", hiveNode.getName());

        JAXBElement<org.apache.falcon.oozie.hive.ACTION> actionJaxbElement = OozieUtils.unMarshalHiveAction(hiveNode);
        org.apache.falcon.oozie.hive.ACTION hiveAction = actionJaxbElement.getValue();

        Assert.assertEquals(hiveAction.getScript(),
View Full Code Here

        for (Object obj : actions) {
            if (!(obj instanceof ACTION)) {
                continue;
            }

            ACTION action = (ACTION) obj;

            if (!SecurityUtil.isSecurityEnabled()) {
                Assert.assertNull(action.getCred());
                return;
            }

            String actionName = action.getName();
            if ("user-hive-job".equals(actionName) || "user-pig-job".equals(actionName)
                    || "user-oozie-workflow".equals(actionName) || "recordsize".equals(actionName)) {
                Assert.assertNotNull(action.getCred());
                Assert.assertEquals(action.getCred(), "falconHiveAuth");
            }
        }
    }
View Full Code Here

        List<Object> actions = wf.getDecisionOrForkOrJoin();
        for (Object obj : actions) {
            if (!(obj instanceof ACTION)) {
                continue;
            }
            ACTION action = (ACTION) obj;
            List<String> files = null;
            if (action.getJava() != null) {
                files = action.getJava().getFile();
            } else if (action.getPig() != null) {
                files = action.getPig().getFile();
            } else if (action.getMapReduce() != null) {
                files = action.getMapReduce().getFile();
            }
            if (files != null) {
                Assert.assertTrue(files.get(files.size() - 1)
                        .endsWith("/projects/falcon/working/libext/PROCESS/ext.jar"));
            }
View Full Code Here

TOP

Related Classes of org.apache.falcon.oozie.workflow.ACTION

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.