Package org.apache.oozie.coord

Examples of org.apache.oozie.coord.SyncCoordDataset


        return !isDatasetContext();
    }

    private static boolean isDatasetContext() {
        ELEvaluator eval = ELEvaluator.getCurrent();
        SyncCoordDataset ds = (SyncCoordDataset) eval.getVariable(CoordELFunctions.DATASET);
        return ds != null;
    }
View Full Code Here


                "hdfs://localhost:8020/clicks/2009/09/02/10/*/US,hdfs://localhost:8020/clicks/2009/09/02/09/*/US";
        Assert.assertEquals(expuris, CoordELFunctions.evalAndWrap(eval, "${dataIn('clicks', '*/US')}"));

        //test optional input
        String inName = "clicks";
        SyncCoordDataset ds = createDataSet("2007-09-30T010:00Z");
        eval.setVariable(inName + ".frequency", String.valueOf(ds.getFrequency()));
        eval.setVariable(inName + ".freq_timeunit", ds.getTimeUnit().name());
        eval.setVariable(inName + ".timezone", ds.getTimeZone().getID());
        eval.setVariable(inName + ".end_of_duration", Timeunit.NONE.name());
        eval.setVariable(inName + ".initial-instance", DateUtils.formatDateOozieTZ(ds.getInitInstance()));
        eval.setVariable(inName + ".done-flag", "notused");
        eval.setVariable(inName + ".uri-template", ds.getUriTemplate());
        eval.setVariable(inName + ".start-instance", "now(-1,0)");
        eval.setVariable(inName + ".end-instance", "now(0,0)");
        // TODO Had to comment this out for this test to PASS else NPE in
        // TODO org.apache.oozie.command.coord.CoordCommandUtils.createEarlyURIs(CoordCommandUtils.java:359)
        // eval.setVariable(".datain.clicks", null);
View Full Code Here

    private void initForCurrentThread() throws Exception {
        initForCurrentThread("2007-09-30T010:00Z", "2009-09-02T11:30Z", "2009-09-02T10:30Z");
    }

    private SyncCoordDataset createDataSet(String initialInstance) throws Exception {
        SyncCoordDataset ds;
        ds = new SyncCoordDataset();
        ds.setFrequency(1);
        ds.setInitInstance(DateUtils.parseDateUTC(initialInstance));
        ds.setTimeUnit(TimeUnit.HOUR);
        ds.setTimeZone(DateUtils.getTimeZone("UTC"));
        ds.setName("test");
        ds.setUriTemplate("hdfs://localhost:8020/clicks/${YEAR}/${MONTH}/${DAY}/${HOUR}");
        ds.setType("SYNC");
        ds.setDoneFlag("");
        return ds;
    }
View Full Code Here

        appInst.setName("mycoordinator-app");
        return appInst;
    }

    private void initForCurrentThread(String initialInstance, String actualTime, String nominalTime) throws Exception {
        SyncCoordDataset ds = createDataSet(initialInstance);
        SyncCoordAction appInst = createCoordAction(actualTime, nominalTime);
        CoordELFunctions.configureEvaluator(instEval, ds, appInst);
        CoordELFunctions.configureEvaluator(createEval, ds, appInst);
    }
View Full Code Here

                "hdfs://localhost:8020/clicks/2009/09/02/10/*/US,hdfs://localhost:8020/clicks/2009/09/02/09/*/US";
        Assert.assertEquals(expuris, CoordELFunctions.evalAndWrap(eval, "${dataIn('clicks', '*/US')}"));

        //test optional input
        String inName = "clicks";
        SyncCoordDataset ds = createDataSet("2007-09-30T010:00Z");
        eval.setVariable(inName + ".frequency", String.valueOf(ds.getFrequency()));
        eval.setVariable(inName + ".freq_timeunit", ds.getTimeUnit().name());
        eval.setVariable(inName + ".timezone", ds.getTimeZone().getID());
        eval.setVariable(inName + ".end_of_duration", Timeunit.NONE.name());
        eval.setVariable(inName + ".initial-instance", OozieELExtensions.formatDateUTC(ds.getInitInstance()));
        eval.setVariable(inName + ".done-flag", "notused");
        eval.setVariable(inName + ".uri-template", ds.getUriTemplate());
        eval.setVariable(inName + ".start-instance", "now(-1,0)");
        eval.setVariable(inName + ".end-instance", "now(0,0)");
        // TODO Had to comment this out for this test to PASS else NPE in
        // TODO org.apache.oozie.command.coord.CoordCommandUtils.createEarlyURIs(CoordCommandUtils.java:359)
        // eval.setVariable(".datain.clicks", null);
View Full Code Here

    private void initForCurrentThread() throws Exception {
        initForCurrentThread("2007-09-30T010:00Z", "2009-09-02T11:30Z", "2009-09-02T10:30Z");
    }

    private SyncCoordDataset createDataSet(String initialInstance) throws Exception {
        SyncCoordDataset ds;
        ds = new SyncCoordDataset();
        ds.setFrequency(1);
        ds.setInitInstance(DateUtils.parseDateUTC(initialInstance));
        ds.setTimeUnit(TimeUnit.HOUR);
        ds.setTimeZone(OozieELExtensions.UTC);
        ds.setName("test");
        ds.setUriTemplate("hdfs://localhost:8020/clicks/${YEAR}/${MONTH}/${DAY}/${HOUR}");
        ds.setType("SYNC");
        ds.setDoneFlag("");
        return ds;
    }
View Full Code Here

        appInst.setName("mycoordinator-app");
        return appInst;
    }

    private void initForCurrentThread(String initialInstance, String actualTime, String nominalTime) throws Exception {
        SyncCoordDataset ds = createDataSet(initialInstance);
        SyncCoordAction appInst = createCoordAction(actualTime, nominalTime);
        CoordELFunctions.configureEvaluator(instEval, ds, appInst);
        CoordELFunctions.configureEvaluator(createEval, ds, appInst);
    }
View Full Code Here

        return !isDatasetContext();
    }

    private static boolean isDatasetContext() {
        ELEvaluator eval = ELEvaluator.getCurrent();
        SyncCoordDataset ds = (SyncCoordDataset) eval.getVariable(CoordELFunctions.DATASET);
        return ds != null;
    }
View Full Code Here

        return !isDatasetContext();
    }

    private static boolean isDatasetContext() {
        ELEvaluator eval = ELEvaluator.getCurrent();
        SyncCoordDataset ds = (SyncCoordDataset) eval.getVariable(CoordELFunctions.DATASET);
        return ds != null;
    }
View Full Code Here

                "hdfs://localhost:8020/clicks/2009/09/02/10/*/US,hdfs://localhost:8020/clicks/2009/09/02/09/*/US";
        Assert.assertEquals(expuris, CoordELFunctions.evalAndWrap(eval, "${dataIn('clicks', '*/US')}"));

        //test optional input
        String inName = "clicks";
        SyncCoordDataset ds = createDataSet("2007-09-30T010:00Z");
        eval.setVariable(inName + ".frequency", String.valueOf(ds.getFrequency()));
        eval.setVariable(inName + ".freq_timeunit", ds.getTimeUnit().name());
        eval.setVariable(inName + ".timezone", ds.getTimeZone().getID());
        eval.setVariable(inName + ".end_of_duration", Timeunit.NONE.name());
        eval.setVariable(inName + ".initial-instance", DateUtils.formatDateUTC(ds.getInitInstance()));
        eval.setVariable(inName + ".done-flag", "notused");
        eval.setVariable(inName + ".uri-template", ds.getUriTemplate());
        eval.setVariable(inName + ".start-instance", "now(-1,0)");
        eval.setVariable(inName + ".end-instance", "now(0,0)");
        eval.setVariable(".datain.clicks", null);
        Assert.assertEquals(expuris, CoordELFunctions.evalAndWrap(eval, "${dataIn('clicks', '*/US')}"));
    }
View Full Code Here

TOP

Related Classes of org.apache.oozie.coord.SyncCoordDataset

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.