You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@falcon.apache.org by sr...@apache.org on 2013/12/10 06:12:24 UTC
[2/3] FALCON-66 Make oozie version change configurable. Contributed
by Shwetha GS
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/build-tools/src/patches/OOZIE-674-v6-3.2.0.patch
----------------------------------------------------------------------
diff --git a/build-tools/src/patches/OOZIE-674-v6-3.2.0.patch b/build-tools/src/patches/OOZIE-674-v6-3.2.0.patch
new file mode 100644
index 0000000..c35437c
--- /dev/null
+++ b/build-tools/src/patches/OOZIE-674-v6-3.2.0.patch
@@ -0,0 +1,370 @@
+Index: core/src/test/java/org/apache/oozie/test/XTestCase.java
+===================================================================
+--- core/src/test/java/org/apache/oozie/test/XTestCase.java (revision 1485571)
++++ core/src/test/java/org/apache/oozie/test/XTestCase.java (working copy)
+@@ -75,7 +75,7 @@
+ * From within testcases, system properties must be changed using the {@link #setSystemProperty} method.
+ */
+ public abstract class XTestCase extends TestCase {
+- private Map<String, String> sysProps;
++ protected Map<String, String> sysProps;
+ private String testCaseDir;
+ private String testCaseConfDir;
+ private String hadoopVersion;
+Index: core/src/test/java/org/apache/oozie/test/XDataTestCase.java
+===================================================================
+--- core/src/test/java/org/apache/oozie/test/XDataTestCase.java (revision 1485571)
++++ core/src/test/java/org/apache/oozie/test/XDataTestCase.java (working copy)
+@@ -121,6 +121,25 @@
+ }
+
+ /**
++ * Inserts the passed coord job
++ * @param coord job bean
++ * @throws Exception
++ */
++ protected void addRecordToCoordJobTable(CoordinatorJobBean coordJob) throws Exception {
++ try {
++ JPAService jpaService = Services.get().get(JPAService.class);
++ assertNotNull(jpaService);
++ CoordJobInsertJPAExecutor coordInsertCmd = new CoordJobInsertJPAExecutor(coordJob);
++ jpaService.execute(coordInsertCmd);
++ }
++ catch (JPAExecutorException je) {
++ je.printStackTrace();
++ fail("Unable to insert the test coord job record to table");
++ throw je;
++ }
++ }
++
++ /**
+ * Insert coord job for testing.
+ *
+ * @param status coord job status
+Index: core/src/test/java/org/apache/oozie/command/coord/CoordELExtensions.java
+===================================================================
+--- core/src/test/java/org/apache/oozie/command/coord/CoordELExtensions.java (revision 0)
++++ core/src/test/java/org/apache/oozie/command/coord/CoordELExtensions.java (revision 0)
+@@ -0,0 +1,77 @@
++/**
++ * Licensed to the Apache Software Foundation (ASF) under one
++ * or more contributor license agreements. See the NOTICE file
++ * distributed with this work for additional information
++ * regarding copyright ownership. The ASF licenses this file
++ * to you under the Apache License, Version 2.0 (the
++ * "License"); you may not use this file except in compliance
++ * with the License. You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++ package org.apache.oozie.command.coord;
++
++import java.util.Calendar;
++
++import org.apache.oozie.coord.CoordELFunctions;
++import org.apache.oozie.util.ELEvaluator;
++
++public class CoordELExtensions {
++ private static final String PREFIX = "coordext:";
++
++ public static String ph1_today_echo(int hr, int min) {
++ ELEvaluator eval = ELEvaluator.getCurrent();
++ eval.setVariable(".wrap", "true");
++ return PREFIX + "today(" + hr + ", " + min + ")"; // Unresolved
++ }
++
++ public static String ph2_today_inst(int hr, int min) throws Exception {
++ Calendar nominalInstanceCal = CoordELFunctions.getEffectiveNominalTime();
++ if (nominalInstanceCal == null) {
++ return "";
++ }
++
++ Calendar dsInstanceCal = Calendar.getInstance(CoordELFunctions.getDatasetTZ());
++ dsInstanceCal.setTime(nominalInstanceCal.getTime());
++ dsInstanceCal.set(Calendar.HOUR_OF_DAY, hr);
++ dsInstanceCal.set(Calendar.MINUTE, min);
++ dsInstanceCal.set(Calendar.SECOND, 0);
++ dsInstanceCal.set(Calendar.MILLISECOND, 0);
++
++ int[] instCnt = new int[1];
++ Calendar compInstCal = CoordELFunctions
++ .getCurrentInstance(dsInstanceCal.getTime(), instCnt);
++ if (compInstCal == null) {
++ return "";
++ }
++ int dsInstanceCnt = instCnt[0];
++
++ compInstCal = CoordELFunctions.getCurrentInstance(nominalInstanceCal.getTime(), instCnt);
++ if (compInstCal == null) {
++ return "";
++ }
++ int nominalInstanceCnt = instCnt[0];
++
++ return "coord:current(" + (dsInstanceCnt - nominalInstanceCnt) + ")";
++ }
++
++ public static String ph2_today(int hr, int min) throws Exception {
++ String inst = ph2_today_inst(hr, min);
++ return evaluateCurrent(inst);
++ }
++
++ private static String evaluateCurrent(String curExpr) throws Exception {
++ if (curExpr.equals("")) {
++ return curExpr;
++ }
++
++ int inst = CoordCommandUtils.parseOneArg(curExpr);
++ return CoordELFunctions.ph2_coord_current(inst);
++ }
++}
+\ No newline at end of file
+Index: core/src/test/resources/oozie-site-coordel.xml
+===================================================================
+--- core/src/test/resources/oozie-site-coordel.xml (revision 0)
++++ core/src/test/resources/oozie-site-coordel.xml (revision 0)
+@@ -0,0 +1,65 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!--
++ Licensed to the Apache Software Foundation (ASF) under one
++ or more contributor license agreements. See the NOTICE file
++ distributed with this work for additional information
++ regarding copyright ownership. The ASF licenses this file
++ to you under the Apache License, Version 2.0 (the
++ "License"); you may not use this file except in compliance
++ with the License. You may obtain a copy of the License at
++
++ http://www.apache.org/licenses/LICENSE-2.0
++
++ Unless required by applicable law or agreed to in writing, software
++ distributed under the License is distributed on an "AS IS" BASIS,
++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ See the License for the specific language governing permissions and
++ limitations under the License.
++-->
++<configuration>
++ <property>
++ <name>oozie.service.ELService.ext.functions.coord-job-submit-instances
++ </name>
++ <value>
++ coordext:today=org.apache.oozie.command.coord.CoordELExtensions#ph1_today_echo
++ </value>
++ <description>
++ EL functions declarations, separated by commas,
++ format is [PREFIX:]NAME=CLASS#METHOD.
++ This property is a
++ convenience property to add extensions to the built in
++ executors without having to
++ include all the built in ones.
++ </description>
++ </property>
++ <property>
++ <name>oozie.service.ELService.ext.functions.coord-action-create-inst
++ </name>
++ <value>
++ coordext:today=org.apache.oozie.command.coord.CoordELExtensions#ph2_today_inst
++ </value>
++ <description>
++ EL functions declarations, separated by commas,
++ format is [PREFIX:]NAME=CLASS#METHOD.
++ This property is a
++ convenience property to add extensions to the built in
++ executors without having to
++ include all the built in ones.
++ </description>
++ </property>
++ <property>
++ <name>oozie.service.ELService.ext.functions.coord-action-create
++ </name>
++ <value>
++ coordext:today=org.apache.oozie.command.coord.CoordELExtensions#ph2_today
++ </value>
++ <description>
++ EL functions declarations, separated by commas,
++ format is [PREFIX:]NAME=CLASS#METHOD.
++ This property is a
++ convenience property to add extensions to the built in
++ executors without having to
++ include all the built in ones.
++ </description>
++ </property>
++</configuration>
+\ No newline at end of file
+Index: core/src/test/resources/coord-job-for-elext.xml
+===================================================================
+--- core/src/test/resources/coord-job-for-elext.xml (revision 0)
++++ core/src/test/resources/coord-job-for-elext.xml (revision 0)
+@@ -0,0 +1,63 @@
++<!--
++ Licensed to the Apache Software Foundation (ASF) under one
++ or more contributor license agreements. See the NOTICE file
++ distributed with this work for additional information
++ regarding copyright ownership. The ASF licenses this file
++ to you under the Apache License, Version 2.0 (the
++ "License"); you may not use this file except in compliance
++ with the License. You may obtain a copy of the License at
++
++ http://www.apache.org/licenses/LICENSE-2.0
++
++ Unless required by applicable law or agreed to in writing, software
++ distributed under the License is distributed on an "AS IS" BASIS,
++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ See the License for the specific language governing permissions and
++ limitations under the License.
++-->
++<coordinator-app xmlns='uri:oozie:coordinator:0.2' name='NAME'
++ frequency="1" start='2009-02-01T01:00Z' end='2009-02-03T23:59Z'
++ timezone='UTC' freq_timeunit='DAY' end_of_duration='NONE'>
++ <controls>
++ <timeout>10</timeout>
++ <concurrency>2</concurrency>
++ <execution>LIFO</execution>
++ </controls>
++ <input-events>
++ <data-in name='A' dataset='a'>
++ <dataset name='a' frequency='1' initial-instance='2009-02-01T00:00Z'
++ timezone='UTC' freq_timeunit='HOUR' end_of_duration='NONE'>
++ <uri-template>file://#testDir/${YEAR}/${MONTH}/${DAY}/${HOUR}
++ </uri-template>
++ </dataset>
++ <start-instance>${coordext:today(-1,0)}</start-instance>
++ <end-instance>${coordext:today(0,0)}</end-instance>
++ </data-in>
++ </input-events>
++ <output-events>
++ <data-out name='LOCAL_A' dataset='local_a'>
++ <dataset name='local_a' frequency='1'
++ initial-instance='2009-02-01T00:00Z' timezone='UTC'
++ freq_timeunit='HOUR' end_of_duration='NONE'>
++ <uri-template>file://#testDir/${YEAR}/${DAY}
++ </uri-template>
++ </dataset>
++ <instance>${coordext:today(0,0)}</instance>
++ </data-out>
++ </output-events>
++ <action>
++ <workflow>
++ <app-path>hdfs:///tmp/workflows/</app-path>
++ <configuration>
++ <property>
++ <name>inputA</name>
++ <value>${coord:dataIn('A')}</value>
++ </property>
++ <property>
++ <name>inputB</name>
++ <value>${coord:dataOut('LOCAL_A')}</value>
++ </property>
++ </configuration>
++ </workflow>
++ </action>
++</coordinator-app>
+\ No newline at end of file
+Index: core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java
+===================================================================
+--- core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java (revision 1485571)
++++ core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java (working copy)
+@@ -63,28 +63,36 @@
+ * <p/>
+ *
+ * @param function
+- * @param event
+- * @param appInst
+- * @param conf
+ * @param restArg
+ * @return int instanceNumber
+ * @throws Exception
+ */
+- public static int getInstanceNumber(String function, Element event, SyncCoordAction appInst, Configuration conf,
+- StringBuilder restArg) throws Exception {
+- ELEvaluator eval = CoordELEvaluator
+- .createInstancesELEvaluator("coord-action-create-inst", event, appInst, conf);
+- String newFunc = CoordELFunctions.evalAndWrap(eval, function);
+- int funcType = getFuncType(newFunc);
++ public static int getInstanceNumber(String function, StringBuilder restArg) throws Exception {
++ int funcType = getFuncType(function);
+ if (funcType == CURRENT || funcType == LATEST) {
+- return parseOneArg(newFunc);
++ return parseOneArg(function);
+ }
+ else {
+- return parseMoreArgs(newFunc, restArg);
++ return parseMoreArgs(function, restArg);
+ }
+ }
+
+- private static int parseOneArg(String funcName) throws Exception {
++ /**
++ * Evaluates function for coord-action-create-inst tag
++ * @param event
++ * @param appInst
++ * @param conf
++ * @param function
++ * @return evaluation result
++ * @throws Exception
++ */
++ private static String evaluateInstanceFunction(Element event, SyncCoordAction appInst, Configuration conf,
++ String function) throws Exception {
++ ELEvaluator eval = CoordELEvaluator.createInstancesELEvaluator("coord-action-create-inst", event, appInst, conf);
++ return CoordELFunctions.evalAndWrap(eval, function);
++ }
++
++ public static int parseOneArg(String funcName) throws Exception {
+ int firstPos = funcName.indexOf("(");
+ int lastPos = funcName.lastIndexOf(")");
+ if (firstPos >= 0 && lastPos > firstPos) {
+@@ -166,15 +174,15 @@
+ Element eStartInst = event.getChild("start-instance", event.getNamespace());
+ Element eEndInst = event.getChild("end-instance", event.getNamespace());
+ if (eStartInst != null && eEndInst != null) {
+- String strStart = eStartInst.getTextTrim();
+- String strEnd = eEndInst.getTextTrim();
++ String strStart = evaluateInstanceFunction(event, appInst, conf, eStartInst.getTextTrim());
++ String strEnd = evaluateInstanceFunction(event, appInst, conf, eEndInst.getTextTrim());
+ checkIfBothSameType(strStart, strEnd);
+ StringBuilder restArg = new StringBuilder(); // To store rest
+ // arguments for
+ // future
+ // function
+- int startIndex = getInstanceNumber(strStart, event, appInst, conf, restArg);
++ int startIndex = getInstanceNumber(strStart, restArg);
+ restArg.delete(0, restArg.length());
+- int endIndex = getInstanceNumber(strEnd, event, appInst, conf, restArg);
++ int endIndex = getInstanceNumber(strEnd, restArg);
+ if (startIndex > endIndex) {
+ throw new CommandException(ErrorCode.E1010,
+Index: core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
+===================================================================
+--- core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java (revision 1485571)
++++ core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java (working copy)
+@@ -952,7 +952,7 @@
+ * @return current instance i.e. current(0) returns null if effectiveTime is earlier than Initial Instance time of
+ * the dataset.
+ */
+- private static Calendar getCurrentInstance(Date effectiveTime, int instanceCount[]) {
++ public static Calendar getCurrentInstance(Date effectiveTime, int instanceCount[]) {
+ Date datasetInitialInstance = getInitialInstance();
+ TimeUnit dsTimeUnit = getDSTimeUnit();
+ TimeZone dsTZ = getDatasetTZ();
+@@ -1294,7 +1294,7 @@
+ return current;
+ }
+
+- private static Calendar getEffectiveNominalTime() {
++ public static Calendar getEffectiveNominalTime() {
+ Date datasetInitialInstance = getInitialInstance();
+ TimeZone dsTZ = getDatasetTZ();
+ // Convert Date to Calendar for corresponding TZ
+@@ -1356,7 +1356,7 @@
+ /**
+ * @return dataset TimeZone
+ */
+- private static TimeZone getDatasetTZ() {
++ public static TimeZone getDatasetTZ() {
+ ELEvaluator eval = ELEvaluator.getCurrent();
+ return getDatasetTZ(eval);
+ }
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/build-tools/src/patches/OOZIE-674-v6.patch
----------------------------------------------------------------------
diff --git a/build-tools/src/patches/OOZIE-674-v6.patch b/build-tools/src/patches/OOZIE-674-v6.patch
new file mode 100644
index 0000000..8f2aa81
--- /dev/null
+++ b/build-tools/src/patches/OOZIE-674-v6.patch
@@ -0,0 +1,481 @@
+Index: core/src/test/java/org/apache/oozie/test/XTestCase.java
+===================================================================
+--- core/src/test/java/org/apache/oozie/test/XTestCase.java (revision 1485571)
++++ core/src/test/java/org/apache/oozie/test/XTestCase.java (working copy)
+@@ -92,13 +92,13 @@
+ * From within testcases, system properties must be changed using the {@link #setSystemProperty} method.
+ */
+ public abstract class XTestCase extends TestCase {
+- private Map<String, String> sysProps;
++ protected Map<String, String> sysProps;
+ private String testCaseDir;
+ private String testCaseConfDir;
+ private String hadoopVersion;
+ protected XLog log = new XLog(LogFactory.getLog(getClass()));
+
+- private static File OOZIE_SRC_DIR = null;
++ protected static File OOZIE_SRC_DIR = null;
+ private static final String OOZIE_TEST_PROPERTIES = "oozie.test.properties";
+
+ public static float WAITFOR_RATIO = Float.parseFloat(System.getProperty("oozie.test.waitfor.ratio", "1"));
+Index: core/src/test/java/org/apache/oozie/test/XDataTestCase.java
+===================================================================
+--- core/src/test/java/org/apache/oozie/test/XDataTestCase.java (revision 1485571)
++++ core/src/test/java/org/apache/oozie/test/XDataTestCase.java (working copy)
+@@ -121,6 +121,25 @@
+ }
+
+ /**
++ * Inserts the passed coord job
++ * @param coord job bean
++ * @throws Exception
++ */
++ protected void addRecordToCoordJobTable(CoordinatorJobBean coordJob) throws Exception {
++ try {
++ JPAService jpaService = Services.get().get(JPAService.class);
++ assertNotNull(jpaService);
++ CoordJobInsertJPAExecutor coordInsertCmd = new CoordJobInsertJPAExecutor(coordJob);
++ jpaService.execute(coordInsertCmd);
++ }
++ catch (JPAExecutorException je) {
++ je.printStackTrace();
++ fail("Unable to insert the test coord job record to table");
++ throw je;
++ }
++ }
++
++ /**
+ * Insert coord job for testing.
+ *
+ * @param status coord job status
+Index: core/src/test/java/org/apache/oozie/command/coord/CoordELExtensions.java
+===================================================================
+--- core/src/test/java/org/apache/oozie/command/coord/CoordELExtensions.java (revision 0)
++++ core/src/test/java/org/apache/oozie/command/coord/CoordELExtensions.java (revision 0)
+@@ -0,0 +1,77 @@
++/**
++ * Licensed to the Apache Software Foundation (ASF) under one
++ * or more contributor license agreements. See the NOTICE file
++ * distributed with this work for additional information
++ * regarding copyright ownership. The ASF licenses this file
++ * to you under the Apache License, Version 2.0 (the
++ * "License"); you may not use this file except in compliance
++ * with the License. You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++ package org.apache.oozie.command.coord;
++
++import java.util.Calendar;
++
++import org.apache.oozie.coord.CoordELFunctions;
++import org.apache.oozie.util.ELEvaluator;
++
++public class CoordELExtensions {
++ private static final String PREFIX = "coordext:";
++
++ public static String ph1_today_echo(int hr, int min) {
++ ELEvaluator eval = ELEvaluator.getCurrent();
++ eval.setVariable(".wrap", "true");
++ return PREFIX + "today(" + hr + ", " + min + ")"; // Unresolved
++ }
++
++ public static String ph2_today_inst(int hr, int min) throws Exception {
++ Calendar nominalInstanceCal = CoordELFunctions.getEffectiveNominalTime();
++ if (nominalInstanceCal == null) {
++ return "";
++ }
++
++ Calendar dsInstanceCal = Calendar.getInstance(CoordELFunctions.getDatasetTZ());
++ dsInstanceCal.setTime(nominalInstanceCal.getTime());
++ dsInstanceCal.set(Calendar.HOUR_OF_DAY, hr);
++ dsInstanceCal.set(Calendar.MINUTE, min);
++ dsInstanceCal.set(Calendar.SECOND, 0);
++ dsInstanceCal.set(Calendar.MILLISECOND, 0);
++
++ int[] instCnt = new int[1];
++ Calendar compInstCal = CoordELFunctions
++ .getCurrentInstance(dsInstanceCal.getTime(), instCnt);
++ if (compInstCal == null) {
++ return "";
++ }
++ int dsInstanceCnt = instCnt[0];
++
++ compInstCal = CoordELFunctions.getCurrentInstance(nominalInstanceCal.getTime(), instCnt);
++ if (compInstCal == null) {
++ return "";
++ }
++ int nominalInstanceCnt = instCnt[0];
++
++ return "coord:current(" + (dsInstanceCnt - nominalInstanceCnt) + ")";
++ }
++
++ public static String ph2_today(int hr, int min) throws Exception {
++ String inst = ph2_today_inst(hr, min);
++ return evaluateCurrent(inst);
++ }
++
++ private static String evaluateCurrent(String curExpr) throws Exception {
++ if (curExpr.equals("")) {
++ return curExpr;
++ }
++
++ int inst = CoordCommandUtils.parseOneArg(curExpr);
++ return CoordELFunctions.ph2_coord_current(inst);
++ }
++}
+\ No newline at end of file
+Index: core/src/test/java/org/apache/oozie/command/coord/TestCoordELExtensions.java
+===================================================================
+--- core/src/test/java/org/apache/oozie/command/coord/TestCoordELExtensions.java (revision 0)
++++ core/src/test/java/org/apache/oozie/command/coord/TestCoordELExtensions.java (revision 0)
+@@ -0,0 +1,82 @@
++/**
++ * Licensed to the Apache Software Foundation (ASF) under one
++ * or more contributor license agreements. See the NOTICE file
++ * distributed with this work for additional information
++ * regarding copyright ownership. The ASF licenses this file
++ * to you under the Apache License, Version 2.0 (the
++ * "License"); you may not use this file except in compliance
++ * with the License. You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++ package org.apache.oozie.command.coord;
++
++import java.io.File;
++import java.util.Date;
++import java.util.HashMap;
++
++import org.apache.oozie.CoordinatorActionBean;
++import org.apache.oozie.CoordinatorJobBean;
++import org.apache.oozie.client.CoordinatorJob;
++import org.apache.oozie.service.Services;
++import org.apache.oozie.store.CoordinatorStore;
++import org.apache.oozie.store.StoreException;
++import org.apache.oozie.test.XDataTestCase;
++import org.apache.oozie.util.DateUtils;
++
++public class TestCoordELExtensions extends XDataTestCase {
++ private Services services;
++ private String[] excludedServices = { "org.apache.oozie.service.StatusTransitService",
++ "org.apache.oozie.service.PauseTransitService",
++ "org.apache.oozie.service.RecoveryService" };
++
++ @Override
++ protected void setUp() throws Exception {
++ sysProps = new HashMap<String, String>();
++ setSystemProperty("oozie.test.config.file", new File(OOZIE_SRC_DIR,
++ "core/src/test/resources/oozie-site-coordel.xml").getAbsolutePath());
++ super.setUp();
++ services = new Services();
++ setClassesToBeExcluded(services.getConf(), excludedServices);
++ services.init();
++ cleanUpDBTables();
++ }
++
++ @Override
++ protected void tearDown() throws Exception {
++ services.destroy();
++ super.tearDown();
++ }
++
++ public void testCoordELActionMater() throws Exception {
++ Date startTime = DateUtils.parseDateUTC("2009-03-06T010:00Z");
++ Date endTime = DateUtils.parseDateUTC("2009-03-07T12:00Z");
++ CoordinatorJobBean job = createCoordJob("coord-job-for-elext.xml",
++ CoordinatorJob.Status.PREMATER, startTime, endTime, false, false, 0);
++ addRecordToCoordJobTable(job);
++
++ new CoordActionMaterializeCommand(job.getId(), startTime, endTime).call();
++ checkCoordAction(job.getId() + "@1");
++ }
++
++ protected CoordinatorActionBean checkCoordAction(String actionId) throws StoreException {
++ CoordinatorStore store = new CoordinatorStore(false);
++ try {
++ CoordinatorActionBean action = store.getCoordinatorAction(actionId, false);
++ assertEquals(
++ "file://#testDir/2009/03/06/00/_SUCCESS#file://#testDir/2009/03/05/23/_SUCCESS",
++ action.getMissingDependencies());
++ return action;
++ } catch (StoreException se) {
++ se.printStackTrace();
++ fail("Action ID " + actionId + " was not stored properly in db");
++ }
++ return null;
++ }
++}
+\ No newline at end of file
+Index: core/src/test/resources/oozie-site-coordel.xml
+===================================================================
+--- core/src/test/resources/oozie-site-coordel.xml (revision 0)
++++ core/src/test/resources/oozie-site-coordel.xml (revision 0)
+@@ -0,0 +1,65 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!--
++ Licensed to the Apache Software Foundation (ASF) under one
++ or more contributor license agreements. See the NOTICE file
++ distributed with this work for additional information
++ regarding copyright ownership. The ASF licenses this file
++ to you under the Apache License, Version 2.0 (the
++ "License"); you may not use this file except in compliance
++ with the License. You may obtain a copy of the License at
++
++ http://www.apache.org/licenses/LICENSE-2.0
++
++ Unless required by applicable law or agreed to in writing, software
++ distributed under the License is distributed on an "AS IS" BASIS,
++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ See the License for the specific language governing permissions and
++ limitations under the License.
++-->
++<configuration>
++ <property>
++ <name>oozie.service.ELService.ext.functions.coord-job-submit-instances
++ </name>
++ <value>
++ coordext:today=org.apache.oozie.command.coord.CoordELExtensions#ph1_today_echo
++ </value>
++ <description>
++ EL functions declarations, separated by commas,
++ format is [PREFIX:]NAME=CLASS#METHOD.
++ This property is a
++ convenience property to add extensions to the built in
++ executors without having to
++ include all the built in ones.
++ </description>
++ </property>
++ <property>
++ <name>oozie.service.ELService.ext.functions.coord-action-create-inst
++ </name>
++ <value>
++ coordext:today=org.apache.oozie.command.coord.CoordELExtensions#ph2_today_inst
++ </value>
++ <description>
++ EL functions declarations, separated by commas,
++ format is [PREFIX:]NAME=CLASS#METHOD.
++ This property is a
++ convenience property to add extensions to the built in
++ executors without having to
++ include all the built in ones.
++ </description>
++ </property>
++ <property>
++ <name>oozie.service.ELService.ext.functions.coord-action-create
++ </name>
++ <value>
++ coordext:today=org.apache.oozie.command.coord.CoordELExtensions#ph2_today
++ </value>
++ <description>
++ EL functions declarations, separated by commas,
++ format is [PREFIX:]NAME=CLASS#METHOD.
++ This property is a
++ convenience property to add extensions to the built in
++ executors without having to
++ include all the built in ones.
++ </description>
++ </property>
++</configuration>
+\ No newline at end of file
+Index: core/src/test/resources/coord-job-for-elext.xml
+===================================================================
+--- core/src/test/resources/coord-job-for-elext.xml (revision 0)
++++ core/src/test/resources/coord-job-for-elext.xml (revision 0)
+@@ -0,0 +1,63 @@
++<!--
++ Licensed to the Apache Software Foundation (ASF) under one
++ or more contributor license agreements. See the NOTICE file
++ distributed with this work for additional information
++ regarding copyright ownership. The ASF licenses this file
++ to you under the Apache License, Version 2.0 (the
++ "License"); you may not use this file except in compliance
++ with the License. You may obtain a copy of the License at
++
++ http://www.apache.org/licenses/LICENSE-2.0
++
++ Unless required by applicable law or agreed to in writing, software
++ distributed under the License is distributed on an "AS IS" BASIS,
++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ See the License for the specific language governing permissions and
++ limitations under the License.
++-->
++<coordinator-app xmlns='uri:oozie:coordinator:0.2' name='NAME'
++ frequency="1" start='2009-02-01T01:00Z' end='2009-02-03T23:59Z'
++ timezone='UTC' freq_timeunit='DAY' end_of_duration='NONE'>
++ <controls>
++ <timeout>10</timeout>
++ <concurrency>2</concurrency>
++ <execution>LIFO</execution>
++ </controls>
++ <input-events>
++ <data-in name='A' dataset='a'>
++ <dataset name='a' frequency='1' initial-instance='2009-02-01T00:00Z'
++ timezone='UTC' freq_timeunit='HOUR' end_of_duration='NONE'>
++ <uri-template>file://#testDir/${YEAR}/${MONTH}/${DAY}/${HOUR}
++ </uri-template>
++ </dataset>
++ <start-instance>${coordext:today(-1,0)}</start-instance>
++ <end-instance>${coordext:today(0,0)}</end-instance>
++ </data-in>
++ </input-events>
++ <output-events>
++ <data-out name='LOCAL_A' dataset='local_a'>
++ <dataset name='local_a' frequency='1'
++ initial-instance='2009-02-01T00:00Z' timezone='UTC'
++ freq_timeunit='HOUR' end_of_duration='NONE'>
++ <uri-template>file://#testDir/${YEAR}/${DAY}
++ </uri-template>
++ </dataset>
++ <instance>${coordext:today(0,0)}</instance>
++ </data-out>
++ </output-events>
++ <action>
++ <workflow>
++ <app-path>hdfs:///tmp/workflows/</app-path>
++ <configuration>
++ <property>
++ <name>inputA</name>
++ <value>${coord:dataIn('A')}</value>
++ </property>
++ <property>
++ <name>inputB</name>
++ <value>${coord:dataOut('LOCAL_A')}</value>
++ </property>
++ </configuration>
++ </workflow>
++ </action>
++</coordinator-app>
+\ No newline at end of file
+Index: core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java
+===================================================================
+--- core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java (revision 1485571)
++++ core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java (working copy)
+@@ -63,28 +63,36 @@
+ * <p/>
+ *
+ * @param function
+- * @param event
+- * @param appInst
+- * @param conf
+ * @param restArg
+ * @return int instanceNumber
+ * @throws Exception
+ */
+- public static int getInstanceNumber(String function, Element event, SyncCoordAction appInst, Configuration conf,
+- StringBuilder restArg) throws Exception {
+- ELEvaluator eval = CoordELEvaluator
+- .createInstancesELEvaluator("coord-action-create-inst", event, appInst, conf);
+- String newFunc = CoordELFunctions.evalAndWrap(eval, function);
+- int funcType = getFuncType(newFunc);
++ public static int getInstanceNumber(String function, StringBuilder restArg) throws Exception {
++ int funcType = getFuncType(function);
+ if (funcType == CURRENT || funcType == LATEST) {
+- return parseOneArg(newFunc);
++ return parseOneArg(function);
+ }
+ else {
+- return parseMoreArgs(newFunc, restArg);
++ return parseMoreArgs(function, restArg);
+ }
+ }
+
+- private static int parseOneArg(String funcName) throws Exception {
++ /**
++ * Evaluates function for coord-action-create-inst tag
++ * @param event
++ * @param appInst
++ * @param conf
++ * @param function
++ * @return evaluation result
++ * @throws Exception
++ */
++ private static String evaluateInstanceFunction(Element event, SyncCoordAction appInst, Configuration conf,
++ String function) throws Exception {
++ ELEvaluator eval = CoordELEvaluator.createInstancesELEvaluator("coord-action-create-inst", event, appInst, conf);
++ return CoordELFunctions.evalAndWrap(eval, function);
++ }
++
++ public static int parseOneArg(String funcName) throws Exception {
+ int firstPos = funcName.indexOf("(");
+ int lastPos = funcName.lastIndexOf(")");
+ if (firstPos >= 0 && lastPos > firstPos) {
+@@ -181,17 +189,17 @@
+ Element eStartInst = event.getChild("start-instance", event.getNamespace());
+ Element eEndInst = event.getChild("end-instance", event.getNamespace());
+ if (eStartInst != null && eEndInst != null) {
+- String strStart = eStartInst.getTextTrim();
+- String strEnd = eEndInst.getTextTrim();
++ String strStart = evaluateInstanceFunction(event, appInst, conf, eStartInst.getTextTrim());
++ String strEnd = evaluateInstanceFunction(event, appInst, conf, eEndInst.getTextTrim());
+ checkIfBothSameType(strStart, strEnd);
+ StringBuilder restArg = new StringBuilder(); // To store rest
+ // arguments for
+ // future
+ // function
+- int startIndex = getInstanceNumber(strStart, event, appInst, conf, restArg);
++ int startIndex = getInstanceNumber(strStart, restArg);
+ String startRestArg = restArg.toString();
+ restArg.delete(0, restArg.length());
+- int endIndex = getInstanceNumber(strEnd, event, appInst, conf, restArg);
++ int endIndex = getInstanceNumber(strEnd, restArg);
+ String endRestArg = restArg.toString();
+ int funcType = getFuncType(strStart);
+ if (funcType == OFFSET) {
+Index: core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
+===================================================================
+--- core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java (revision 1485571)
++++ core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java (working copy)
+@@ -1250,7 +1250,7 @@
+ * @return current instance i.e. current(0) returns null if effectiveTime is earlier than Initial Instance time of
+ * the dataset.
+ */
+- private static Calendar getCurrentInstance(Date effectiveTime, int instanceCount[]) {
++ public static Calendar getCurrentInstance(Date effectiveTime, int instanceCount[]) {
+ ELEvaluator eval = ELEvaluator.getCurrent();
+ return getCurrentInstance(effectiveTime, instanceCount, eval);
+ }
+@@ -1294,7 +1294,7 @@
+ return current;
+ }
+
+- private static Calendar getEffectiveNominalTime() {
++ public static Calendar getEffectiveNominalTime() {
+ Date datasetInitialInstance = getInitialInstance();
+ TimeZone dsTZ = getDatasetTZ();
+ // Convert Date to Calendar for corresponding TZ
+@@ -1356,7 +1356,7 @@
+ /**
+ * @return dataset TimeZone
+ */
+- private static TimeZone getDatasetTZ() {
++ public static TimeZone getDatasetTZ() {
+ ELEvaluator eval = ELEvaluator.getCurrent();
+ return getDatasetTZ(eval);
+ }
+Index: bin/test-patch-05-patch-raw-analysis
+===================================================================
+--- bin/test-patch-05-patch-raw-analysis (revision 1485571)
++++ bin/test-patch-05-patch-raw-analysis (working copy)
+@@ -30,7 +30,8 @@
+ }
+ ###############################################################################
+ printUsage() {
+- echo "Usage: $0 --taskname | (--op=pre|post|report --tempdir=<TEMP DIR> --reportdir=<REPORT DIR> --summaryfile=<SUMMARY FILE>)"
++ echo "Usage: $0 --taskname | (--op=pre|post|report --tempdir=<TEMP DIR> --reportdir=<REPORT DIR> --summaryfile=<SUMMARY FILE> "
++ echo "--patchfile=<PATCH FILE>)"
+ echo
+ }
+ ###############################################################################
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/build-tools/src/patches/OOZIE-882.patch
----------------------------------------------------------------------
diff --git a/build-tools/src/patches/OOZIE-882.patch b/build-tools/src/patches/OOZIE-882.patch
new file mode 100644
index 0000000..edcbf1d
--- /dev/null
+++ b/build-tools/src/patches/OOZIE-882.patch
@@ -0,0 +1,28 @@
+Index: core/src/test/java/org/apache/oozie/coord/TestCoordELEvaluator.java
+===================================================================
+--- core/src/test/java/org/apache/oozie/coord/TestCoordELEvaluator.java (revision 1352500)
++++ core/src/test/java/org/apache/oozie/coord/TestCoordELEvaluator.java (working copy)
+@@ -123,7 +123,8 @@
+ }
+
+ public void testCreateDataEvaluator() throws Exception {
+- String jobXml = "<coordinator-app name=\"mycoordinator-app\" start=\"2009-02-01T01:00GMT\" end=\"2009-02-03T23:59GMT\" frequency=\"720\"";
++ String jobXml = "<coordinator-app name=\"mycoordinator-app\" start=\"2009-02-01T01:00GMT\" end=\"2009-02-03T23:59GMT\" timezone=\"UTC\"";
++ jobXml += " frequency=\"720\" freq_timeunit=\"MINUTE\"";
+ jobXml += " action-nominal-time='2009-09-01T00:00Z' action-actual-time='2010-10-01T00:00Z'>";
+ jobXml += "<input-events><data-in name=\"A\" dataset=\"a\"><uris>file:///tmp/coord/US/2009/1/30|file:///tmp/coord/US/2009/1/31</uris>";
+ jobXml += "<dataset name=\"a\" frequency=\"1440\" initial-instance=\"2009-01-01T00:00Z\">";
+Index: core/src/main/java/org/apache/oozie/coord/CoordELEvaluator.java
+===================================================================
+--- core/src/main/java/org/apache/oozie/coord/CoordELEvaluator.java (revision 1352500)
++++ core/src/main/java/org/apache/oozie/coord/CoordELEvaluator.java (working copy)
+@@ -143,6 +143,9 @@
+ String strNominalTime = eJob.getAttributeValue("action-nominal-time");
+ if (strNominalTime != null) {
+ appInst.setNominalTime(DateUtils.parseDateUTC(strNominalTime));
++ appInst.setTimeZone(DateUtils.getTimeZone(eJob.getAttributeValue("timezone")));
++ appInst.setFrequency(Integer.parseInt(eJob.getAttributeValue("frequency")));
++ appInst.setTimeUnit(TimeUnit.valueOf(eJob.getAttributeValue("freq_timeunit")));
+ appInst.setActionId(actionId);
+ appInst.setName(eJob.getAttributeValue("name"));
+ }
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/build-tools/src/patches/oozie-site.patch
----------------------------------------------------------------------
diff --git a/build-tools/src/patches/oozie-site.patch b/build-tools/src/patches/oozie-site.patch
new file mode 100644
index 0000000..e2cc7b9
--- /dev/null
+++ b/build-tools/src/patches/oozie-site.patch
@@ -0,0 +1,177 @@
+--- ./core/src/main/conf/oozie-site.xml
++++ ./core/src/main/conf/oozie-site.xml
+@@ -375,5 +375,174 @@
+ </property>
+
+ -->
++ <!-- HCatalog Integration Properties -->
++ <property>
++ <name>oozie.service.ActionService.executor.ext.classes</name>
++ <value>
++ org.apache.oozie.action.hadoop.HiveActionExecutor
++ </value>
++ </property>
++
++ <property>
++ <name>oozie.service.SchemaService.wf.ext.schemas</name>
++ <value>hive-action-0.2.xsd</value>
++ </property>
++
++ <property>
++ <name>oozie.service.URIHandlerService.uri.handlers</name>
++ <value>org.apache.oozie.dependency.FSURIHandler,org.apache.oozie.dependency.HCatURIHandler</value>
++ <description>
++ Enlist the different uri handlers supported for data availability checks.
++ </description>
++ </property>
++
++ <property>
++ <name>oozie.services.ext</name>
++ <value>
++ org.apache.oozie.service.JMSAccessorService,
++ org.apache.oozie.service.PartitionDependencyManagerService,
++ org.apache.oozie.service.HCatAccessorService
++ </value>
++ <description>
++ To add/replace services defined in 'oozie.services' with custom implementations.
++ Class names must be separated by commas.
++ </description>
++ </property>
++
++ <property>
++ <name>oozie.service.ELService.ext.functions.coord-job-submit-instances</name>
++ <value>
++ now=org.apache.oozie.extensions.OozieELExtensions#ph1_now_echo,
++ today=org.apache.oozie.extensions.OozieELExtensions#ph1_today_echo,
++ yesterday=org.apache.oozie.extensions.OozieELExtensions#ph1_yesterday_echo,
++ currentMonth=org.apache.oozie.extensions.OozieELExtensions#ph1_currentMonth_echo,
++ lastMonth=org.apache.oozie.extensions.OozieELExtensions#ph1_lastMonth_echo,
++ currentYear=org.apache.oozie.extensions.OozieELExtensions#ph1_currentYear_echo,
++ lastYear=org.apache.oozie.extensions.OozieELExtensions#ph1_lastYear_echo,
++ formatTime=org.apache.oozie.coord.CoordELFunctions#ph1_coord_formatTime_echo
++ </value>
++ <description>
++ EL functions declarations, separated by commas, format is [PREFIX:]NAME=CLASS#METHOD.
++ This property is a convenience property to add extensions to the built in
++ executors without having to
++ include all the built in ones.
++ </description>
++ </property>
++
++ <property>
++ <name>oozie.service.ELService.ext.functions.coord-action-create-inst</name>
++ <value>
++ now=org.apache.oozie.extensions.OozieELExtensions#ph2_now_inst,
++ today=org.apache.oozie.extensions.OozieELExtensions#ph2_today_inst,
++ yesterday=org.apache.oozie.extensions.OozieELExtensions#ph2_yesterday_inst,
++ currentMonth=org.apache.oozie.extensions.OozieELExtensions#ph2_currentMonth_inst,
++ lastMonth=org.apache.oozie.extensions.OozieELExtensions#ph2_lastMonth_inst,
++ currentYear=org.apache.oozie.extensions.OozieELExtensions#ph2_currentYear_inst,
++ lastYear=org.apache.oozie.extensions.OozieELExtensions#ph2_lastYear_inst,
++ latest=org.apache.oozie.coord.CoordELFunctions#ph2_coord_latest_echo,
++ future=org.apache.oozie.coord.CoordELFunctions#ph2_coord_future_echo,
++ formatTime=org.apache.oozie.coord.CoordELFunctions#ph2_coord_formatTime,
++ user=org.apache.oozie.coord.CoordELFunctions#coord_user
++ </value>
++ <description>
++ EL functions declarations, separated by commas, format is [PREFIX:]NAME=CLASS#METHOD.
++ This property is a convenience property to add extensions to the built in
++ executors without having to
++ include all the built in ones.
++ </description>
++ </property>
++
++ <property>
++ <name>oozie.service.ELService.ext.functions.coord-action-create</name>
++ <value>
++ now=org.apache.oozie.extensions.OozieELExtensions#ph2_now,
++ today=org.apache.oozie.extensions.OozieELExtensions#ph2_today,
++ yesterday=org.apache.oozie.extensions.OozieELExtensions#ph2_yesterday,
++ currentMonth=org.apache.oozie.extensions.OozieELExtensions#ph2_currentMonth,
++ lastMonth=org.apache.oozie.extensions.OozieELExtensions#ph2_lastMonth,
++ currentYear=org.apache.oozie.extensions.OozieELExtensions#ph2_currentYear,
++ lastYear=org.apache.oozie.extensions.OozieELExtensions#ph2_lastYear,
++ latest=org.apache.oozie.coord.CoordELFunctions#ph2_coord_latest_echo,
++ future=org.apache.oozie.coord.CoordELFunctions#ph2_coord_future_echo,
++ formatTime=org.apache.oozie.coord.CoordELFunctions#ph2_coord_formatTime,
++ user=org.apache.oozie.coord.CoordELFunctions#coord_user
++ </value>
++ <description>
++ EL functions declarations, separated by commas, format is [PREFIX:]NAME=CLASS#METHOD.
++ This property is a convenience property to add extensions to the built in
++ executors without having to
++ include all the built in ones.
++ </description>
++ </property>
++
++ <property>
++ <name>oozie.service.ELService.ext.functions.coord-job-submit-data</name>
++ <value>
++ now=org.apache.oozie.extensions.OozieELExtensions#ph1_now_echo,
++ today=org.apache.oozie.extensions.OozieELExtensions#ph1_today_echo,
++ yesterday=org.apache.oozie.extensions.OozieELExtensions#ph1_yesterday_echo,
++ currentMonth=org.apache.oozie.extensions.OozieELExtensions#ph1_currentMonth_echo,
++ lastMonth=org.apache.oozie.extensions.OozieELExtensions#ph1_lastMonth_echo,
++ currentYear=org.apache.oozie.extensions.OozieELExtensions#ph1_currentYear_echo,
++ lastYear=org.apache.oozie.extensions.OozieELExtensions#ph1_lastYear_echo,
++ dataIn=org.apache.oozie.extensions.OozieELExtensions#ph1_dataIn_echo,
++ instanceTime=org.apache.oozie.coord.CoordELFunctions#ph1_coord_nominalTime_echo_wrap,
++ formatTime=org.apache.oozie.coord.CoordELFunctions#ph1_coord_formatTime_echo,
++ dateOffset=org.apache.oozie.coord.CoordELFunctions#ph1_coord_dateOffset_echo,
++ user=org.apache.oozie.coord.CoordELFunctions#coord_user
++ </value>
++ <description>
++ EL constant declarations, separated by commas, format is [PREFIX:]NAME=CLASS#CONSTANT.
++ This property is a convenience property to add extensions to the built in
++ executors without having to
++ include all the built in ones.
++ </description>
++ </property>
++
++ <property>
++ <name>oozie.service.ELService.ext.functions.coord-action-start</name>
++ <value>
++ now=org.apache.oozie.extensions.OozieELExtensions#ph2_now,
++ today=org.apache.oozie.extensions.OozieELExtensions#ph2_today,
++ yesterday=org.apache.oozie.extensions.OozieELExtensions#ph2_yesterday,
++ currentMonth=org.apache.oozie.extensions.OozieELExtensions#ph2_currentMonth,
++ lastMonth=org.apache.oozie.extensions.OozieELExtensions#ph2_lastMonth,
++ currentYear=org.apache.oozie.extensions.OozieELExtensions#ph2_currentYear,
++ lastYear=org.apache.oozie.extensions.OozieELExtensions#ph2_lastYear,
++ latest=org.apache.oozie.coord.CoordELFunctions#ph3_coord_latest,
++ future=org.apache.oozie.coord.CoordELFunctions#ph3_coord_future,
++ dataIn=org.apache.oozie.extensions.OozieELExtensions#ph3_dataIn,
++ instanceTime=org.apache.oozie.coord.CoordELFunctions#ph3_coord_nominalTime,
++ dateOffset=org.apache.oozie.coord.CoordELFunctions#ph3_coord_dateOffset,
++ formatTime=org.apache.oozie.coord.CoordELFunctions#ph3_coord_formatTime,
++ user=org.apache.oozie.coord.CoordELFunctions#coord_user
++ </value>
++ <description>
++ EL functions declarations, separated by commas, format is [PREFIX:]NAME=CLASS#METHOD.
++ This property is a convenience property to add extensions to the built in
++ executors without having to
++ include all the built in ones.
++ </description>
++ </property>
++ <property>
++ <name>oozie.service.ELService.ext.functions.coord-sla-submit</name>
++ <value>
++ instanceTime=org.apache.oozie.coord.CoordELFunctions#ph1_coord_nominalTime_echo_fixed,
++ user=org.apache.oozie.coord.CoordELFunctions#coord_user
++ </value>
++ <description>
++ EL functions declarations, separated by commas, format is [PREFIX:]NAME=CLASS#METHOD.
++ </description>
++ </property>
++ <property>
++ <name>oozie.service.ELService.ext.functions.coord-sla-create</name>
++ <value>
++ instanceTime=org.apache.oozie.coord.CoordELFunctions#ph2_coord_nominalTime,
++ user=org.apache.oozie.coord.CoordELFunctions#coord_user
++ </value>
++ <description>
++ EL functions declarations, separated by commas, format is [PREFIX:]NAME=CLASS#METHOD.
++ </description>
++ </property>
+
+ </configuration>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/checkstyle/pom.xml
----------------------------------------------------------------------
diff --git a/checkstyle/pom.xml b/checkstyle/pom.xml
new file mode 100644
index 0000000..2980622
--- /dev/null
+++ b/checkstyle/pom.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.falcon</groupId>
+ <artifactId>checkstyle</artifactId>
+ <version>0.5-incubating-SNAPSHOT</version>
+ <name>Checkstyle</name>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/checkstyle/src/main/resources/falcon/checkstyle-java-header.txt
----------------------------------------------------------------------
diff --git a/checkstyle/src/main/resources/falcon/checkstyle-java-header.txt b/checkstyle/src/main/resources/falcon/checkstyle-java-header.txt
new file mode 100644
index 0000000..5d5f1e3
--- /dev/null
+++ b/checkstyle/src/main/resources/falcon/checkstyle-java-header.txt
@@ -0,0 +1,17 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/checkstyle/src/main/resources/falcon/checkstyle-noframes.xsl
----------------------------------------------------------------------
diff --git a/checkstyle/src/main/resources/falcon/checkstyle-noframes.xsl b/checkstyle/src/main/resources/falcon/checkstyle-noframes.xsl
new file mode 100644
index 0000000..6308ef8
--- /dev/null
+++ b/checkstyle/src/main/resources/falcon/checkstyle-noframes.xsl
@@ -0,0 +1,218 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+ <xsl:output method="html" indent="yes"/>
+ <xsl:decimal-format decimal-separator="." grouping-separator=","/>
+
+ <xsl:key name="files" match="file" use="@name"/>
+
+ <!-- Checkstyle XML Style Sheet by Stephane Bailliez <sb...@apache.org> -->
+ <!-- Part of the Checkstyle distribution found at http://checkstyle.sourceforge.net -->
+ <!-- Usage (generates checkstyle_report.html): -->
+ <!-- <checkstyle failonviolation="false" config="${check.config}"> -->
+ <!-- <fileset dir="${src.dir}" includes="**/*.java"/> -->
+ <!-- <formatter type="xml" toFile="${doc.dir}/checkstyle_report.xml"/> -->
+ <!-- </checkstyle> -->
+ <!-- <style basedir="${doc.dir}" destdir="${doc.dir}" -->
+ <!-- includes="checkstyle_report.xml" -->
+ <!-- style="${doc.dir}/checkstyle-noframes-sorted.xsl"/> -->
+
+ <xsl:template match="checkstyle">
+ <html>
+ <head>
+ <style type="text/css">
+ .bannercell {
+ border: 0px;
+ padding: 0px;
+ }
+ body {
+ margin-left: 10;
+ margin-right: 10;
+ font:normal 80% arial,helvetica,sanserif;
+ background-color:#FFFFFF;
+ color:#000000;
+ }
+ .a td {
+ background: #efefef;
+ }
+ .b td {
+ background: #fff;
+ }
+ th, td {
+ text-align: left;
+ vertical-align: top;
+ }
+ th {
+ font-weight:bold;
+ background: #ccc;
+ color: black;
+ }
+ table, th, td {
+ font-size:100%;
+ border: none
+ }
+ table.log tr td, tr th {
+
+ }
+ h2 {
+ font-weight:bold;
+ font-size:140%;
+ margin-bottom: 5;
+ }
+ h3 {
+ font-size:100%;
+ font-weight:bold;
+ background: #525D76;
+ color: white;
+ text-decoration: none;
+ padding: 5px;
+ margin-right: 2px;
+ margin-left: 2px;
+ margin-bottom: 0;
+ }
+ </style>
+ </head>
+ <body>
+ <a name="top"></a>
+ <!-- jakarta logo -->
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td class="bannercell" rowspan="2">
+ <!--a href="http://jakarta.apache.org/">
+ <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
+ </a-->
+ </td>
+ <td class="text-align:right">
+ <h2>CheckStyle Audit</h2>
+ </td>
+ </tr>
+ <tr>
+ <td class="text-align:right">Designed for use with
+ <a href='http://checkstyle.sourceforge.net/'>CheckStyle</a>
+ and<a href='http://jakarta.apache.org'>Ant</a>.
+ </td>
+ </tr>
+ </table>
+ <hr size="1"/>
+
+ <!-- Summary part -->
+ <xsl:apply-templates select="." mode="summary"/>
+ <hr size="1" width="100%" align="left"/>
+
+ <!-- Package List part -->
+ <xsl:apply-templates select="." mode="filelist"/>
+ <hr size="1" width="100%" align="left"/>
+
+ <!-- For each package create its part -->
+ <xsl:apply-templates select="file[@name and generate-id(.) = generate-id(key('files', @name))]"/>
+
+ <hr size="1" width="100%" align="left"/>
+
+
+ </body>
+ </html>
+ </xsl:template>
+
+
+ <xsl:template match="checkstyle" mode="filelist">
+ <h3>Files</h3>
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+ <tr>
+ <th>Name</th>
+ <th>Errors</th>
+ </tr>
+ <xsl:for-each select="file[@name and generate-id(.) = generate-id(key('files', @name))]">
+ <xsl:sort data-type="number" order="descending" select="count(key('files', @name)/error)"/>
+ <xsl:variable name="errorCount" select="count(error)"/>
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td>
+ <a href="#f-{@name}">
+ <xsl:value-of select="@name"/>
+ </a>
+ </td>
+ <td>
+ <xsl:value-of select="$errorCount"/>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:template>
+
+
+ <xsl:template match="file">
+ <a name="f-{@name}"></a>
+ <h3>File
+ <xsl:value-of select="@name"/>
+ </h3>
+
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+ <tr>
+ <th>Error Description</th>
+ <th>Line</th>
+ </tr>
+ <xsl:for-each select="key('files', @name)/error">
+ <xsl:sort data-type="number" order="ascending" select="@line"/>
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td>
+ <xsl:value-of select="@message"/>
+ </td>
+ <td>
+ <xsl:value-of select="@line"/>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ <a href="#top">Back to top</a>
+ </xsl:template>
+
+
+ <xsl:template match="checkstyle" mode="summary">
+ <h3>Summary</h3>
+ <xsl:variable name="fileCount"
+ select="count(file[@name and generate-id(.) = generate-id(key('files', @name))])"/>
+ <xsl:variable name="errorCount" select="count(file/error)"/>
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+ <tr>
+ <th>Files</th>
+ <th>Errors</th>
+ </tr>
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td>
+ <xsl:value-of select="$fileCount"/>
+ </td>
+ <td>
+ <xsl:value-of select="$errorCount"/>
+ </td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <xsl:template name="alternated-row">
+ <xsl:attribute name="class">
+ <xsl:if test="position() mod 2 = 1">a</xsl:if>
+ <xsl:if test="position() mod 2 = 0">b</xsl:if>
+ </xsl:attribute>
+ </xsl:template>
+</xsl:stylesheet>
+
+
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/checkstyle/src/main/resources/falcon/checkstyle.xml
----------------------------------------------------------------------
diff --git a/checkstyle/src/main/resources/falcon/checkstyle.xml b/checkstyle/src/main/resources/falcon/checkstyle.xml
new file mode 100644
index 0000000..9e18299
--- /dev/null
+++ b/checkstyle/src/main/resources/falcon/checkstyle.xml
@@ -0,0 +1,233 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+ "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+
+<!--
+
+ Checkstyle configuration for Falcon that is based on the sun_checks.xml file
+ that is bundled with Checkstyle and includes checks for:
+
+ - the Java Language Specification at
+ http://java.sun.com/docs/books/jls/second_edition/html/index.html
+
+ - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
+
+ - the Javadoc guidelines at
+ http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
+
+ - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
+
+ - some best practices
+
+ Checkstyle is very configurable. Be sure to read the documentation at
+ http://checkstyle.sf.net (or in your downloaded distribution).
+
+ Most Checks are configurable, be sure to consult the documentation.
+
+ To completely disable a check, just comment it out or delete it from the file.
+
+ Finally, it is worth reading the documentation.
+
+-->
+
+<module name="Checker">
+
+ <!-- Checks that a package.html file exists for each package. -->
+ <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
+ <!-- module name="PackageHtml"/ -->
+
+ <!-- Checks whether files end with a new line. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
+ <module name="NewlineAtEndOfFile"/>
+
+ <!-- Checks for Headers -->
+ <!-- See http://checkstyle.sf.net/config_header.html -->
+ <module name="Header">
+ <property name="headerFile" value="checkstyle/src/main/resources/falcon/checkstyle-java-header.txt"/>
+ </module>
+
+ <module name="FileLength"/>
+ <module name="FileTabCharacter"/>
+
+ <module name="TreeWalker">
+ <!-- Checks for Javadoc comments. -->
+ <!-- See http://checkstyle.sf.net/config_javadoc.html -->
+ <module name="JavadocType">
+ <property name="scope" value="public"/>
+ <property name="allowMissingParamTags" value="true"/>
+ </module>
+ <module name="JavadocStyle"/>
+
+ <module name="SuperClone"/>
+ <module name="SuperFinalize"/>
+
+ <!-- Checks for Naming Conventions. -->
+ <!-- See http://checkstyle.sf.net/config_naming.html -->
+ <module name="ConstantName"/>
+ <module name="ClassTypeParameterName">
+ <property name="format" value="^[A-Z]+$"/>
+ </module>
+ <module name="LocalFinalVariableName">
+ <!--<property name="format" value="^[A-Z][_A-Z0-9]*$"/>-->
+ </module>
+ <module name="LocalVariableName"/>
+ <module name="MemberName"/>
+ <module name="MethodName"/>
+ <module name="MethodTypeParameterName">
+ <property name="format" value="^[A-Z]+$"/>
+ </module>
+ <module name="PackageName"/>
+ <module name="ParameterName"/>
+ <module name="StaticVariableName"/>
+ <module name="TypeName"/>
+
+ <!-- Checks for imports -->
+ <!-- See http://checkstyle.sf.net/config_import.html -->
+ <module name="IllegalImport"/>
+ <!-- defaults to sun.* packages -->
+ <module name="RedundantImport"/>
+ <module name="UnusedImports"/>
+
+
+ <!-- Checks for Size Violations. -->
+ <!-- See http://checkstyle.sf.net/config_sizes.html -->
+ <module name="LineLength">
+ <property name="max" value="120"/>
+ </module>
+ <module name="MethodLength"/>
+ <module name="ParameterNumber"/>
+ <module name="OuterTypeNumber"/>
+
+ <!-- Checks for whitespace -->
+ <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+ <module name="GenericWhitespace"/>
+ <module name="EmptyForIteratorPad"/>
+ <module name="MethodParamPad"/>
+ <module name="WhitespaceAround">
+ <property name="tokens" value="LITERAL_IF"/>
+ </module>
+ <module name="NoWhitespaceAfter">
+ <property name="tokens"
+ value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/>
+ </module>
+ <module name="NoWhitespaceBefore"/>
+ <module name="OperatorWrap"/>
+ <module name="ParenPad"/>
+ <module name="TypecastParenPad"/>
+ <module name="WhitespaceAfter">
+ <property name="tokens" value="COMMA, SEMI"/>
+ </module>
+
+ <module name="Regexp">
+ <property name="format" value="[ \t]+$"/>
+ <property name="illegalPattern" value="true"/>
+ <property name="message" value="Trailing whitespace"/>
+ </module>
+
+ <!-- Modifier Checks -->
+ <!-- See http://checkstyle.sf.net/config_modifiers.html -->
+ <module name="ModifierOrder"/>
+ <module name="RedundantModifier"/>
+
+
+ <!-- Checks for blocks. You know, those {}'s -->
+ <!-- See http://checkstyle.sf.net/config_blocks.html -->
+ <module name="AvoidNestedBlocks"/>
+ <module name="EmptyBlock">
+ <!-- catch blocks need a statement or a comment. -->
+ <property name="option" value="text"/>
+ <property name="tokens" value="LITERAL_CATCH"/>
+ </module>
+ <module name="EmptyBlock">
+ <!-- all other blocks need a real statement. -->
+ <property name="option" value="stmt"/>
+ <property name="tokens" value="LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY,
+ LITERAL_IF, LITERAL_FOR, LITERAL_TRY, LITERAL_WHILE, INSTANCE_INIT,
+ STATIC_INIT"/>
+ </module>
+ <module name="LeftCurly"/>
+ <module name="NeedBraces"/>
+ <module name="RightCurly"/>
+
+
+ <!-- Checks for common coding problems -->
+ <!-- See http://checkstyle.sf.net/config_coding.html -->
+ <!-- module name="AvoidInlineConditionals"/-->
+ <module name="DoubleCheckedLocking"/>
+ <module name="EmptyStatement"/>
+ <module name="EqualsHashCode"/>
+ <module name="StringLiteralEquality"/>
+ <module name="HiddenField">
+ <property name="ignoreConstructorParameter" value="true"/>
+ <property name="ignoreAbstractMethods" value="true"/>
+ <property name="ignoreSetter" value="true"/>
+ </module>
+ <module name="IllegalInstantiation"/>
+ <module name="InnerAssignment"/>
+ <module name="MissingSwitchDefault"/>
+ <module name="RedundantThrows"/>
+ <module name="SimplifyBooleanExpression"/>
+ <module name="SimplifyBooleanReturn"/>
+ <module name="DefaultComesLast"/>
+
+ <!-- Checks for class design -->
+ <!-- See http://checkstyle.sf.net/config_design.html -->
+ <module name="FinalClass"/>
+ <module name="HideUtilityClassConstructor"/>
+ <module name="InterfaceIsType"/>
+ <module name="VisibilityModifier">
+ <property name="protectedAllowed" value="true"/>
+ </module>
+ <module name="MissingOverride"/>
+
+
+ <!-- Miscellaneous other checks. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html -->
+ <module name="ArrayTypeStyle"/>
+ <module name="ArrayTrailingComma"/>
+ <!--
+ This generates too many false-positives on wrapped 'throws' clauses
+ to be really useful. Disabled for now.
+
+ Falcon style is:
+ * Spaces, not tabs.
+ * Indent by four spaces.
+ * Indent by four spaces when wrapping a line.
+ -->
+ <module name="Indentation">
+ <property name="basicOffset" value="4"/>
+ <property name="caseIndent" value="0"/>
+ </module>
+ <module name="TodoComment"/>
+ <module name="UpperEll"/>
+
+ <module name="FileContentsHolder"/>
+ </module>
+
+ <!-- allow warnings to be suppressed -->
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="SUSPEND CHECKSTYLE CHECK ParameterNumberCheck|VisibilityModifierCheck|HiddenFieldCheck|MethodName"/>
+ <property name="onCommentFormat" value="RESUME CHECKSTYLE CHECK ParameterNumberCheck|VisibilityModifierCheck|HiddenFieldCheck|MethodName"/>
+ <property name="checkFormat" value="ParameterNumberCheck|VisibilityModifierCheck|HiddenFieldCheck|MethodName"/>
+ </module>
+
+</module>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/checkstyle/src/main/resources/falcon/findbugs-exclude.xml
----------------------------------------------------------------------
diff --git a/checkstyle/src/main/resources/falcon/findbugs-exclude.xml b/checkstyle/src/main/resources/falcon/findbugs-exclude.xml
new file mode 100644
index 0000000..0a7580d
--- /dev/null
+++ b/checkstyle/src/main/resources/falcon/findbugs-exclude.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<FindBugsFilter>
+ <!-- These are generated by xjc compiler and hence excluded. -->
+ <Match>
+ <Or>
+ <Class name="~org.apache.falcon.entity.v0.feed.Validity" />
+ <Class name="~org.apache.falcon.entity.v0.process.Validity" />
+ </Or>
+ </Match>
+
+ <!--
+ Disable encoding as this might give an impression that Falcon code base is
+ "Internationalization" ready, but we haven't done anything consciously to guarantee that.
+ -->
+ <Match>
+ <Bug pattern="DM_DEFAULT_ENCODING" />
+ </Match>
+</FindBugsFilter>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/docs/src/site/twiki/InstallationSteps.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/InstallationSteps.twiki b/docs/src/site/twiki/InstallationSteps.twiki
index e396747..f2a51b1 100644
--- a/docs/src/site/twiki/InstallationSteps.twiki
+++ b/docs/src/site/twiki/InstallationSteps.twiki
@@ -12,6 +12,7 @@ export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && mvn clean install [For had
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && mvn clean install -Dhadoop.profile=2 [For hadoop 2]
[optionally -Dhadoop.version=<<hadoop.version>> can be appended to build for a specific version of hadoop]
+[optionally -Doozie.version=<<oozie version>> can be appended to build with a specific version of oozie. Oozie versions >= 3.oozie-3.2.0-incubating are supported]
</verbatim>
@@ -216,12 +217,12 @@ bin/falcon-stop
bin/prism-stop
</verbatim>
----+++ Preparing oozie bundle for use with Falcon
+---+++ Preparing Oozie and Falcon packages for deployment
<verbatim>
cd <<project home>>
-mkdir target/package
-src/bin/pacakge.sh <<hadoop-version>>
+src/bin/pacakge.sh <<hadoop-version>> <<oozie-version>>
->> ex. src/bin/pacakge.sh 1.1.2 or src/bin/pacakge.sh 0.20.2-cdh3u5
->> oozie bundle available in target/package/oozie-4.0.0/distro/target/oozie-4.0.0-distro.tar.gz
+>> ex. src/bin/pacakge.sh 1.1.2 3.1.3-incubating or src/bin/pacakge.sh 0.20.2-cdh3u5 4.0.0
+>> Falcon pacakge is available in <<falcon home>>/target/falcon-<<version>>-bin.tar.gz
+>> Oozie pacakge is available in <<falcon home>>/target/oozie-3.3.2-distro.tar.gz
</verbatim>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/hadoop-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-webapp/pom.xml b/hadoop-webapp/pom.xml
index 896b52e..d1d3f9c 100644
--- a/hadoop-webapp/pom.xml
+++ b/hadoop-webapp/pom.xml
@@ -83,6 +83,11 @@
<dependencies>
<dependency>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-core</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.falcon</groupId>
<artifactId>falcon-oozie-el-extension</artifactId>
</dependency>
@@ -145,7 +150,6 @@
<artifactId>oozie-webapp</artifactId>
<type>war</type>
<outputDirectory>${project.build.directory}/oozie</outputDirectory>
- <destFileName>oozie.war</destFileName>
</artifactItem>
</artifactItems>
</configuration>
@@ -165,22 +169,24 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<configuration>
<target>
- <war destfile="target/oozie.war" webxml="target/oozie/WEB-INF/web.xml">
- <lib dir="target/oozie/WEB-INF/lib" />
- <classes dir="target/classes" />
- </war>
+ <jar destfile="target/oozie.war" basedir="target/oozie"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
- <phase>package</phase>
+ <phase>install</phase>
</execution>
</executions>
</plugin>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/hadoop-webapp/src/main/resources/oozie-log4j.properties
----------------------------------------------------------------------
diff --git a/hadoop-webapp/src/main/resources/oozie-log4j.properties b/hadoop-webapp/src/main/resources/oozie-log4j.properties
deleted file mode 100644
index 34e1634..0000000
--- a/hadoop-webapp/src/main/resources/oozie-log4j.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License. See accompanying LICENSE file.
-#
-
-# If the Java System property 'oozie.log.dir' is not defined at Oozie start up time
-# XLogService sets its value to '${oozie.home}/logs'
-
-log4j.appender.oozie=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.oozie.DatePattern='.'yyyy-MM-dd-HH
-
-log4j.appender.oozie.File=${oozie.log.dir}/oozie.log
-log4j.appender.oozie.Append=true
-log4j.appender.oozie.layout=org.apache.log4j.PatternLayout
-log4j.appender.oozie.layout.ConversionPattern=%d{ISO8601} %5p %c{1}:%L - %m%n
-
-log4j.logger.org.apache.oozie=DEBUG, oozie
-log4j.logger.org.apache.hadoop=WARN, oozie
-log4j.logger.org.mortbay=WARN, oozie
-log4j.logger.org.hsqldb=WARN, oozie
-log4j.logger.org.apache.hadoop.security.authentication.server=DEBUG, oozie
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/oozie-el-extensions/src/main/java/org/apache/oozie/extensions/OozieELExtensions.java
----------------------------------------------------------------------
diff --git a/oozie-el-extensions/src/main/java/org/apache/oozie/extensions/OozieELExtensions.java b/oozie-el-extensions/src/main/java/org/apache/oozie/extensions/OozieELExtensions.java
index 7253c1b..d16570b 100644
--- a/oozie-el-extensions/src/main/java/org/apache/oozie/extensions/OozieELExtensions.java
+++ b/oozie-el-extensions/src/main/java/org/apache/oozie/extensions/OozieELExtensions.java
@@ -18,7 +18,11 @@
package org.apache.oozie.extensions;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.conf.Configuration;
@@ -27,7 +31,6 @@ import org.apache.oozie.coord.CoordELEvaluator;
import org.apache.oozie.coord.CoordELFunctions;
import org.apache.oozie.coord.SyncCoordAction;
import org.apache.oozie.coord.SyncCoordDataset;
-import org.apache.oozie.util.DateUtils;
import org.apache.oozie.util.ELEvaluator;
import org.apache.oozie.util.ParamChecker;
import org.apache.oozie.util.XLog;
@@ -42,6 +45,9 @@ import org.jdom.Text;
//SUSPEND CHECKSTYLE CHECK MethodName
public final class OozieELExtensions {
+ public static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm'Z'";
+ public static final TimeZone UTC = TimeZone.getTimeZone("UTC");
+
private enum TruncateBoundary {
NONE, DAY, MONTH, QUARTER, YEAR
}
@@ -226,7 +232,23 @@ public final class OozieELExtensions {
private static String getEffectiveTimeStr(TruncateBoundary trunc, int yr, int mon,
int day, int hr, int min) throws Exception {
Calendar time = getEffectiveTime(trunc, yr, mon, day, hr, min);
- return DateUtils.formatDateOozieTZ(time);
+ return formatDateUTC(time);
+ }
+
+ private static DateFormat getISO8601DateFormat(TimeZone tz) {
+ DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
+ // Stricter parsing to prevent dates such as 2011-12-50T01:00Z (December 50th) from matching
+ dateFormat.setLenient(false);
+ dateFormat.setTimeZone(tz);
+ return dateFormat;
+ }
+
+ public static String formatDateUTC(Date d) throws Exception {
+ return (d != null) ? getISO8601DateFormat(UTC).format(d) : "NULL";
+ }
+
+ public static String formatDateUTC(Calendar c) throws Exception {
+ return (c != null) ? formatDateUTC(c.getTime()) : "NULL";
}
@edu.umd.cs.findbugs.annotations.SuppressWarnings({"SF_SWITCH_FALLTHROUGH"})
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/oozie-el-extensions/src/test/java/org/apache/oozie/extensions/TestOozieELExtensions.java
----------------------------------------------------------------------
diff --git a/oozie-el-extensions/src/test/java/org/apache/oozie/extensions/TestOozieELExtensions.java b/oozie-el-extensions/src/test/java/org/apache/oozie/extensions/TestOozieELExtensions.java
index de53e41..f2f3dbf 100644
--- a/oozie-el-extensions/src/test/java/org/apache/oozie/extensions/TestOozieELExtensions.java
+++ b/oozie-el-extensions/src/test/java/org/apache/oozie/extensions/TestOozieELExtensions.java
@@ -20,6 +20,7 @@ package org.apache.oozie.extensions;
import java.io.File;
+import org.apache.hadoop.conf.Configuration;
import org.apache.oozie.client.CoordinatorJob.Timeunit;
import org.apache.oozie.client.OozieClient;
import org.apache.oozie.coord.CoordELFunctions;
@@ -52,7 +53,17 @@ public class TestOozieELExtensions {
Services.setOozieHome();
Services services = new Services();
- services.getConf().set("oozie.services", "org.apache.oozie.service.ELService");
+ Configuration conf = services.getConf();
+ try {
+ Class.forName("org.apache.oozie.service.URIHandlerService");
+ conf.set("oozie.services", "org.apache.oozie.service.HadoopAccessorService,"
+ + "org.apache.oozie.service.ELService,org.apache.oozie.service.URIHandlerService");
+ } catch (ClassNotFoundException e) {
+ conf.set("oozie.services", "org.apache.oozie.service.HadoopAccessorService,"
+ + "org.apache.oozie.service.ELService");
+ }
+ conf.set("oozie.service.HadoopAccessorService.hadoop.configurations", "*=..");
+ conf.set("oozie.service.HadoopAccessorService.action.configurations", "*=..");
services.init();
instEval = Services.get().get(ELService.class).createEvaluator("coord-action-create-inst");
@@ -119,7 +130,7 @@ public class TestOozieELExtensions {
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 + ".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)");
@@ -245,7 +256,7 @@ public class TestOozieELExtensions {
ds.setFrequency(1);
ds.setInitInstance(DateUtils.parseDateUTC(initialInstance));
ds.setTimeUnit(TimeUnit.HOUR);
- ds.setTimeZone(DateUtils.getTimeZone("UTC"));
+ ds.setTimeZone(OozieELExtensions.UTC);
ds.setName("test");
ds.setUriTemplate("hdfs://localhost:8020/clicks/${YEAR}/${MONTH}/${DAY}/${HOUR}");
ds.setType("SYNC");
@@ -258,7 +269,7 @@ public class TestOozieELExtensions {
appInst = new SyncCoordAction();
appInst.setActualTime(DateUtils.parseDateUTC(actualTime));
appInst.setNominalTime(DateUtils.parseDateUTC(nominalTime));
- appInst.setTimeZone(DateUtils.getTimeZone("UTC"));
+ appInst.setTimeZone(OozieELExtensions.UTC);
appInst.setActionId("00000-oozie-C@1");
appInst.setName("mycoordinator-app");
return appInst;
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/73e54e04/oozie-el-extensions/src/test/resources/oozie-site.xml
----------------------------------------------------------------------
diff --git a/oozie-el-extensions/src/test/resources/oozie-site.xml b/oozie-el-extensions/src/test/resources/oozie-site.xml
index 9e8ba9b..cbcc341 100644
--- a/oozie-el-extensions/src/test/resources/oozie-site.xml
+++ b/oozie-el-extensions/src/test/resources/oozie-site.xml
@@ -11,6 +11,19 @@
<!-- Uncomment to enable additional actions (email). <property> <name>oozie.service.ActionService.executor.ext.classes</name> <value> org.apache.oozie.action.email.EmailActionExecutor
</value> </property> <property> <name>oozie.service.SchemaService.wf.ext.schemas</name> <value>email-action-0.1.xsd</value> </property> -->
+ <!-- HCatalog Integration Properties -->
+ <property>
+ <name>oozie.service.ActionService.executor.ext.classes</name>
+ <value>
+ org.apache.oozie.action.hadoop.HiveActionExecutor
+ </value>
+ </property>
+
+ <property>
+ <name>oozie.service.SchemaService.wf.ext.schemas</name>
+ <value>hive-action-0.2.xsd</value>
+ </property>
+
<property>
<name>oozie.system.id</name>
<value>oozie-${user.name}</value>