You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@falcon.apache.org by ve...@apache.org on 2013/07/10 22:05:31 UTC
[1/8] FALCON-1 Create packaging and scripts to install and try Apache
Falcon. Contributed by Srikanth Sundarrajan
Updated Branches:
refs/heads/master d7e2be9af -> 614173574
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/test/resources/cluster-template.xml
----------------------------------------------------------------------
diff --git a/webapp/src/test/resources/cluster-template.xml b/webapp/src/test/resources/cluster-template.xml
index b3ba11b..c71e08d 100644
--- a/webapp/src/test/resources/cluster-template.xml
+++ b/webapp/src/test/resources/cluster-template.xml
@@ -20,14 +20,14 @@
<cluster colo="gs" description="" name="##cluster##" xmlns="uri:falcon:cluster:0.1"
>
<interfaces>
- <interface type="readonly" endpoint="hftp://localhost:50010"
+ <interface type="readonly" endpoint="hftp://localhost:41110"
version="0.20.2"/>
- <interface type="write" endpoint="hdfs://localhost:8020"
+ <interface type="write" endpoint="hdfs://localhost:41020"
version="0.20.2"/>
- <interface type="execute" endpoint="localhost:8021" version="0.20.2"/>
- <interface type="workflow" endpoint="http://localhost:11000/oozie/"
+ <interface type="execute" endpoint="localhost:41021" version="0.20.2"/>
+ <interface type="workflow" endpoint="http://localhost:41000/oozie/"
version="3.1"/>
- <interface type="messaging" endpoint="tcp://10.14.117.33:61616?daemon=true"
+ <interface type="messaging" endpoint="tcp://localhost:61616?daemon=true"
version="5.1.6"/>
<interface type="registry" endpoint="Hcat" version="1"/>
</interfaces>
[5/8] FALCON-1 Create packaging and scripts to install and try Apache
Falcon. Contributed by Srikanth Sundarrajan
Posted by ve...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.2.5.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.2.5.xsd b/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.2.5.xsd
new file mode 100644
index 0000000..a2e3d70
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.2.5.xsd
@@ -0,0 +1,288 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:workflow="uri:oozie:workflow:0.2.5"
+ elementFormDefault="qualified" targetNamespace="uri:oozie:workflow:0.2.5">
+
+ <xs:element name="workflow-app" type="workflow:WORKFLOW-APP"/>
+
+ <xs:simpleType name="IDENTIFIER">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="([a-zA-Z_]([\-_a-zA-Z0-9])*){1,39}"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="WORKFLOW-APP">
+ <xs:sequence>
+ <xs:element name="credentials" type="workflow:CREDENTIALS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="start" type="workflow:START" minOccurs="1" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="decision" type="workflow:DECISION" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="fork" type="workflow:FORK" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="join" type="workflow:JOIN" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="kill" type="workflow:KILL" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="action" type="workflow:ACTION" minOccurs="1" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="end" type="workflow:END" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="uri:oozie:sla:0.1" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="START">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="END">
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="DECISION">
+ <xs:sequence>
+ <xs:element name="switch" type="workflow:SWITCH" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="switch" type="workflow:SWITCH"/>
+
+ <xs:complexType name="SWITCH">
+ <xs:sequence>
+ <xs:sequence>
+ <xs:element name="case" type="workflow:CASE" minOccurs="1" maxOccurs="unbounded"/>
+ <xs:element name="default" type="workflow:DEFAULT" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CASE">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="DEFAULT">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="FORK_TRANSITION">
+ <xs:attribute name="start" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="FORK">
+ <xs:sequence>
+ <xs:element name="path" type="workflow:FORK_TRANSITION" minOccurs="2" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="JOIN">
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="kill" type="workflow:KILL"/>
+
+ <xs:complexType name="KILL">
+ <xs:sequence>
+ <xs:element name="message" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="ACTION_TRANSITION">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="map-reduce" type="workflow:MAP-REDUCE"/>
+ <xs:element name="pig" type="workflow:PIG"/>
+ <xs:element name="sub-workflow" type="workflow:SUB-WORKFLOW"/>
+ <xs:element name="fs" type="workflow:FS"/>
+ <xs:element name="java" type="workflow:JAVA"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="map-reduce" type="workflow:MAP-REDUCE" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="pig" type="workflow:PIG" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="sub-workflow" type="workflow:SUB-WORKFLOW" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="fs" type="workflow:FS" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="java" type="workflow:JAVA" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="##other" minOccurs="1" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="ok" type="workflow:ACTION_TRANSITION" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="error" type="workflow:ACTION_TRANSITION" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="uri:oozie:sla:0.1" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ <xs:attribute name="cred" type="xs:string"/>
+ </xs:complexType>
+
+ <xs:complexType name="MAP-REDUCE">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:element name="streaming" type="workflow:STREAMING" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="pipes" type="workflow:PIPES" minOccurs="0" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PIG">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="script" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="param" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="argument" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="SUB-WORKFLOW">
+ <xs:sequence>
+ <xs:element name="app-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="propagate-configuration" type="workflow:FLAG" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FS">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="delete" type="workflow:DELETE"/>
+ <xs:element name="mkdir" type="workflow:MKDIR"/>
+ <xs:element name="move" type="workflow:MOVE"/>
+ <xs:element name="chmod" type="workflow:CHMOD"/>
+ </xs:choice>
+ </xs:complexType>
+
+ <xs:complexType name="JAVA">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="main-class" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="java-opts" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="arg" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="capture-output" type="workflow:FLAG" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="STREAMING">
+ <xs:sequence>
+ <xs:element name="mapper" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="reducer" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="record-reader" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="record-reader-mapping" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="env" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PIPES">
+ <xs:sequence>
+ <xs:element name="map" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="reduce" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="inputformat" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="partitioner" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="writer" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="program" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="workflow:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="workflow:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MOVE">
+ <xs:attribute name="source" type="xs:string" use="required"/>
+ <xs:attribute name="target" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="CHMOD">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ <xs:attribute name="permissions" type="xs:string" use="required"/>
+ <xs:attribute name="dir-files" type="xs:string"/>
+ </xs:complexType>
+
+ <xs:complexType name="CREDENTIALS">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="credential" type="workflow:CREDENTIAL"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CREDENTIAL">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded" >
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="type" type="xs:string" use="required"/>
+ </xs:complexType>
+
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.2.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.2.xsd b/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.2.xsd
new file mode 100644
index 0000000..093827a
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.2.xsd
@@ -0,0 +1,263 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:workflow="uri:oozie:workflow:0.2"
+ elementFormDefault="qualified" targetNamespace="uri:oozie:workflow:0.2">
+
+ <xs:element name="workflow-app" type="workflow:WORKFLOW-APP"/>
+
+ <xs:simpleType name="IDENTIFIER">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="([a-zA-Z_]([\-_a-zA-Z0-9])*){1,39}"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="WORKFLOW-APP">
+ <xs:sequence>
+ <xs:element name="start" type="workflow:START" minOccurs="1" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="decision" type="workflow:DECISION" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="fork" type="workflow:FORK" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="join" type="workflow:JOIN" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="kill" type="workflow:KILL" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="action" type="workflow:ACTION" minOccurs="1" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="end" type="workflow:END" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="uri:oozie:sla:0.1" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="START">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="END">
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="DECISION">
+ <xs:sequence>
+ <xs:element name="switch" type="workflow:SWITCH" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="switch" type="workflow:SWITCH"/>
+
+ <xs:complexType name="SWITCH">
+ <xs:sequence>
+ <xs:sequence>
+ <xs:element name="case" type="workflow:CASE" minOccurs="1" maxOccurs="unbounded"/>
+ <xs:element name="default" type="workflow:DEFAULT" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CASE">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="DEFAULT">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="FORK_TRANSITION">
+ <xs:attribute name="start" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="FORK">
+ <xs:sequence>
+ <xs:element name="path" type="workflow:FORK_TRANSITION" minOccurs="2" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="JOIN">
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="kill" type="workflow:KILL"/>
+
+ <xs:complexType name="KILL">
+ <xs:sequence>
+ <xs:element name="message" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="ACTION_TRANSITION">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="map-reduce" type="workflow:MAP-REDUCE"/>
+ <xs:element name="pig" type="workflow:PIG"/>
+ <xs:element name="sub-workflow" type="workflow:SUB-WORKFLOW"/>
+ <xs:element name="fs" type="workflow:FS"/>
+ <xs:element name="java" type="workflow:JAVA"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="map-reduce" type="workflow:MAP-REDUCE" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="pig" type="workflow:PIG" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="sub-workflow" type="workflow:SUB-WORKFLOW" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="fs" type="workflow:FS" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="java" type="workflow:JAVA" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="##other" minOccurs="1" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="ok" type="workflow:ACTION_TRANSITION" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="error" type="workflow:ACTION_TRANSITION" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="uri:oozie:sla:0.1" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MAP-REDUCE">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:element name="streaming" type="workflow:STREAMING" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="pipes" type="workflow:PIPES" minOccurs="0" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PIG">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="script" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="param" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="argument" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="SUB-WORKFLOW">
+ <xs:sequence>
+ <xs:element name="app-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="propagate-configuration" type="workflow:FLAG" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FS">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="delete" type="workflow:DELETE"/>
+ <xs:element name="mkdir" type="workflow:MKDIR"/>
+ <xs:element name="move" type="workflow:MOVE"/>
+ <xs:element name="chmod" type="workflow:CHMOD"/>
+ </xs:choice>
+ </xs:complexType>
+
+ <xs:complexType name="JAVA">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="main-class" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="java-opts" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="arg" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="capture-output" type="workflow:FLAG" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="STREAMING">
+ <xs:sequence>
+ <xs:element name="mapper" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="reducer" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="record-reader" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="record-reader-mapping" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="env" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PIPES">
+ <xs:sequence>
+ <xs:element name="map" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="reduce" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="inputformat" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="partitioner" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="writer" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="program" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="workflow:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="workflow:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MOVE">
+ <xs:attribute name="source" type="xs:string" use="required"/>
+ <xs:attribute name="target" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="CHMOD">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ <xs:attribute name="permissions" type="xs:string" use="required"/>
+ <xs:attribute name="dir-files" type="xs:string"/>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.3.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.3.xsd b/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.3.xsd
new file mode 100644
index 0000000..30b31be
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.3.xsd
@@ -0,0 +1,288 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:workflow="uri:oozie:workflow:0.3"
+ elementFormDefault="qualified" targetNamespace="uri:oozie:workflow:0.3">
+
+ <xs:element name="workflow-app" type="workflow:WORKFLOW-APP"/>
+
+ <xs:simpleType name="IDENTIFIER">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="([a-zA-Z_]([\-_a-zA-Z0-9])*){1,39}"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="WORKFLOW-APP">
+ <xs:sequence>
+ <xs:element name="credentials" type="workflow:CREDENTIALS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="start" type="workflow:START" minOccurs="1" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="decision" type="workflow:DECISION" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="fork" type="workflow:FORK" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="join" type="workflow:JOIN" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="kill" type="workflow:KILL" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="action" type="workflow:ACTION" minOccurs="1" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="end" type="workflow:END" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="uri:oozie:sla:0.1" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="START">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="END">
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="DECISION">
+ <xs:sequence>
+ <xs:element name="switch" type="workflow:SWITCH" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="switch" type="workflow:SWITCH"/>
+
+ <xs:complexType name="SWITCH">
+ <xs:sequence>
+ <xs:sequence>
+ <xs:element name="case" type="workflow:CASE" minOccurs="1" maxOccurs="unbounded"/>
+ <xs:element name="default" type="workflow:DEFAULT" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CASE">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="DEFAULT">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="FORK_TRANSITION">
+ <xs:attribute name="start" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="FORK">
+ <xs:sequence>
+ <xs:element name="path" type="workflow:FORK_TRANSITION" minOccurs="2" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="JOIN">
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="kill" type="workflow:KILL"/>
+
+ <xs:complexType name="KILL">
+ <xs:sequence>
+ <xs:element name="message" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="ACTION_TRANSITION">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="map-reduce" type="workflow:MAP-REDUCE"/>
+ <xs:element name="pig" type="workflow:PIG"/>
+ <xs:element name="sub-workflow" type="workflow:SUB-WORKFLOW"/>
+ <xs:element name="fs" type="workflow:FS"/>
+ <xs:element name="java" type="workflow:JAVA"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="map-reduce" type="workflow:MAP-REDUCE" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="pig" type="workflow:PIG" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="sub-workflow" type="workflow:SUB-WORKFLOW" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="fs" type="workflow:FS" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="java" type="workflow:JAVA" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="##other" minOccurs="1" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="ok" type="workflow:ACTION_TRANSITION" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="error" type="workflow:ACTION_TRANSITION" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="uri:oozie:sla:0.1" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ <xs:attribute name="cred" type="xs:string"/>
+ <xs:attribute name="retry-max" type="xs:string"/>
+ <xs:attribute name="retry-interval" type="xs:string"/>
+ </xs:complexType>
+
+ <xs:complexType name="MAP-REDUCE">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:element name="streaming" type="workflow:STREAMING" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="pipes" type="workflow:PIPES" minOccurs="0" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PIG">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="script" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="param" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="argument" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="SUB-WORKFLOW">
+ <xs:sequence>
+ <xs:element name="app-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="propagate-configuration" type="workflow:FLAG" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FS">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="delete" type="workflow:DELETE"/>
+ <xs:element name="mkdir" type="workflow:MKDIR"/>
+ <xs:element name="move" type="workflow:MOVE"/>
+ <xs:element name="chmod" type="workflow:CHMOD"/>
+ </xs:choice>
+ </xs:complexType>
+
+ <xs:complexType name="JAVA">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="main-class" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="java-opts" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="arg" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="capture-output" type="workflow:FLAG" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="STREAMING">
+ <xs:sequence>
+ <xs:element name="mapper" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="reducer" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="record-reader" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="record-reader-mapping" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="env" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PIPES">
+ <xs:sequence>
+ <xs:element name="map" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="reduce" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="inputformat" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="partitioner" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="writer" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="program" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="workflow:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="workflow:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MOVE">
+ <xs:attribute name="source" type="xs:string" use="required"/>
+ <xs:attribute name="target" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="CHMOD">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ <xs:attribute name="permissions" type="xs:string" use="required"/>
+ <xs:attribute name="dir-files" type="xs:string"/>
+ </xs:complexType>
+
+ <xs:complexType name="CREDENTIALS">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="credential" type="workflow:CREDENTIAL"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CREDENTIAL">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded" >
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="type" type="xs:string" use="required"/>
+ </xs:complexType>
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.4.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.4.xsd b/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.4.xsd
new file mode 100644
index 0000000..5654a02
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.4.xsd
@@ -0,0 +1,329 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:workflow="uri:oozie:workflow:0.4"
+ elementFormDefault="qualified" targetNamespace="uri:oozie:workflow:0.4">
+
+ <xs:element name="workflow-app" type="workflow:WORKFLOW-APP"/>
+
+ <xs:simpleType name="IDENTIFIER">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="([a-zA-Z_]([\-_a-zA-Z0-9])*){1,39}"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="WORKFLOW-APP">
+ <xs:sequence>
+ <xs:element name="parameters" type="workflow:PARAMETERS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="global" type="workflow:GLOBAL" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="credentials" type="workflow:CREDENTIALS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="start" type="workflow:START" minOccurs="1" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="decision" type="workflow:DECISION" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="fork" type="workflow:FORK" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="join" type="workflow:JOIN" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="kill" type="workflow:KILL" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="action" type="workflow:ACTION" minOccurs="1" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="end" type="workflow:END" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="uri:oozie:sla:0.1" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="PARAMETERS">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="GLOBAL">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="START">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="END">
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="DECISION">
+ <xs:sequence>
+ <xs:element name="switch" type="workflow:SWITCH" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="switch" type="workflow:SWITCH"/>
+
+ <xs:complexType name="SWITCH">
+ <xs:sequence>
+ <xs:sequence>
+ <xs:element name="case" type="workflow:CASE" minOccurs="1" maxOccurs="unbounded"/>
+ <xs:element name="default" type="workflow:DEFAULT" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CASE">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="DEFAULT">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="FORK_TRANSITION">
+ <xs:attribute name="start" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="FORK">
+ <xs:sequence>
+ <xs:element name="path" type="workflow:FORK_TRANSITION" minOccurs="2" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="JOIN">
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="kill" type="workflow:KILL"/>
+
+ <xs:complexType name="KILL">
+ <xs:sequence>
+ <xs:element name="message" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="ACTION_TRANSITION">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="map-reduce" type="workflow:MAP-REDUCE"/>
+ <xs:element name="pig" type="workflow:PIG"/>
+ <xs:element name="sub-workflow" type="workflow:SUB-WORKFLOW"/>
+ <xs:element name="fs" type="workflow:FS"/>
+ <xs:element name="java" type="workflow:JAVA"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="map-reduce" type="workflow:MAP-REDUCE" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="pig" type="workflow:PIG" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="sub-workflow" type="workflow:SUB-WORKFLOW" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="fs" type="workflow:FS" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="java" type="workflow:JAVA" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="##other" minOccurs="1" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="ok" type="workflow:ACTION_TRANSITION" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="error" type="workflow:ACTION_TRANSITION" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="uri:oozie:sla:0.1" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ <xs:attribute name="cred" type="xs:string"/>
+ <xs:attribute name="retry-max" type="xs:string"/>
+ <xs:attribute name="retry-interval" type="xs:string"/>
+ </xs:complexType>
+
+ <xs:complexType name="MAP-REDUCE">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:element name="streaming" type="workflow:STREAMING" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="pipes" type="workflow:PIPES" minOccurs="0" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PIG">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="script" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="param" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="argument" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="SUB-WORKFLOW">
+ <xs:sequence>
+ <xs:element name="app-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="propagate-configuration" type="workflow:FLAG" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FS">
+ <xs:sequence>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="delete" type="workflow:DELETE"/>
+ <xs:element name="mkdir" type="workflow:MKDIR"/>
+ <xs:element name="move" type="workflow:MOVE"/>
+ <xs:element name="chmod" type="workflow:CHMOD"/>
+ <xs:element name="touchz" type="workflow:TOUCHZ"/>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="JAVA">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="main-class" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:element name="java-opts" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="java-opt" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:choice>
+ <xs:element name="arg" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="capture-output" type="workflow:FLAG" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="STREAMING">
+ <xs:sequence>
+ <xs:element name="mapper" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="reducer" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="record-reader" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="record-reader-mapping" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="env" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PIPES">
+ <xs:sequence>
+ <xs:element name="map" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="reduce" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="inputformat" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="partitioner" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="writer" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="program" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="workflow:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="workflow:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MOVE">
+ <xs:attribute name="source" type="xs:string" use="required"/>
+ <xs:attribute name="target" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="CHMOD">
+ <xs:sequence>
+ <xs:element name="recursive" type="workflow:FLAG" minOccurs="0" maxOccurs="1"></xs:element>
+ </xs:sequence>
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ <xs:attribute name="permissions" type="xs:string" use="required"/>
+ <xs:attribute name="dir-files" type="xs:string"/>
+ </xs:complexType>
+
+ <xs:complexType name="TOUCHZ">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="CREDENTIALS">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="credential" type="workflow:CREDENTIAL"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CREDENTIAL">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded" >
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="type" type="xs:string" use="required"/>
+ </xs:complexType>
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.5.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.5.xsd b/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.5.xsd
new file mode 100644
index 0000000..6620a4e
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.5.xsd
@@ -0,0 +1,339 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:workflow="uri:oozie:workflow:0.5"
+ elementFormDefault="qualified" targetNamespace="uri:oozie:workflow:0.5">
+
+ <xs:element name="workflow-app" type="workflow:WORKFLOW-APP"/>
+
+ <xs:simpleType name="IDENTIFIER">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="([a-zA-Z_]([\-_a-zA-Z0-9])*){1,39}"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="WORKFLOW-APP">
+ <xs:sequence>
+ <xs:element name="parameters" type="workflow:PARAMETERS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="global" type="workflow:GLOBAL" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="credentials" type="workflow:CREDENTIALS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="start" type="workflow:START" minOccurs="1" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="decision" type="workflow:DECISION" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="fork" type="workflow:FORK" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="join" type="workflow:JOIN" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="kill" type="workflow:KILL" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="action" type="workflow:ACTION" minOccurs="1" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="end" type="workflow:END" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="uri:oozie:sla:0.1 uri:oozie:sla:0.2" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="PARAMETERS">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="GLOBAL">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="START">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="END">
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="DECISION">
+ <xs:sequence>
+ <xs:element name="switch" type="workflow:SWITCH" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="switch" type="workflow:SWITCH"/>
+
+ <xs:complexType name="SWITCH">
+ <xs:sequence>
+ <xs:sequence>
+ <xs:element name="case" type="workflow:CASE" minOccurs="1" maxOccurs="unbounded"/>
+ <xs:element name="default" type="workflow:DEFAULT" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CASE">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="DEFAULT">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="FORK_TRANSITION">
+ <xs:attribute name="start" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="FORK">
+ <xs:sequence>
+ <xs:element name="path" type="workflow:FORK_TRANSITION" minOccurs="2" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="JOIN">
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="kill" type="workflow:KILL"/>
+
+ <xs:complexType name="KILL">
+ <xs:sequence>
+ <xs:element name="message" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="ACTION_TRANSITION">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="map-reduce" type="workflow:MAP-REDUCE"/>
+ <xs:element name="pig" type="workflow:PIG"/>
+ <xs:element name="sub-workflow" type="workflow:SUB-WORKFLOW"/>
+ <xs:element name="fs" type="workflow:FS"/>
+ <xs:element name="java" type="workflow:JAVA"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="map-reduce" type="workflow:MAP-REDUCE" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="pig" type="workflow:PIG" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="sub-workflow" type="workflow:SUB-WORKFLOW" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="fs" type="workflow:FS" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="java" type="workflow:JAVA" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="##other" minOccurs="1" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="ok" type="workflow:ACTION_TRANSITION" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="error" type="workflow:ACTION_TRANSITION" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="uri:oozie:sla:0.1 uri:oozie:sla:0.2" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ <xs:attribute name="cred" type="xs:string"/>
+ <xs:attribute name="retry-max" type="xs:string"/>
+ <xs:attribute name="retry-interval" type="xs:string"/>
+ </xs:complexType>
+
+ <xs:complexType name="MAP-REDUCE">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:element name="streaming" type="workflow:STREAMING" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="pipes" type="workflow:PIPES" minOccurs="0" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PIG">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="script" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="param" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="argument" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="SUB-WORKFLOW">
+ <xs:sequence>
+ <xs:element name="app-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="propagate-configuration" type="workflow:FLAG" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FS">
+ <xs:sequence>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="delete" type="workflow:DELETE"/>
+ <xs:element name="mkdir" type="workflow:MKDIR"/>
+ <xs:element name="move" type="workflow:MOVE"/>
+ <xs:element name="chmod" type="workflow:CHMOD"/>
+ <xs:element name="touchz" type="workflow:TOUCHZ"/>
+ <xs:element name="chgrp" type="workflow:CHGRP"/>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="JAVA">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="main-class" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:element name="java-opts" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="java-opt" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:choice>
+ <xs:element name="arg" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="capture-output" type="workflow:FLAG" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="STREAMING">
+ <xs:sequence>
+ <xs:element name="mapper" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="reducer" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="record-reader" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="record-reader-mapping" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="env" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PIPES">
+ <xs:sequence>
+ <xs:element name="map" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="reduce" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="inputformat" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="partitioner" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="writer" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="program" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="workflow:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="workflow:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MOVE">
+ <xs:attribute name="source" type="xs:string" use="required"/>
+ <xs:attribute name="target" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="CHMOD">
+ <xs:sequence>
+ <xs:element name="recursive" type="workflow:FLAG" minOccurs="0" maxOccurs="1"></xs:element>
+ </xs:sequence>
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ <xs:attribute name="permissions" type="xs:string" use="required"/>
+ <xs:attribute name="dir-files" type="xs:string"/>
+ </xs:complexType>
+
+ <xs:complexType name="TOUCHZ">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="CHGRP">
+ <xs:sequence>
+ <xs:element name="recursive" type="workflow:FLAG" minOccurs="0" maxOccurs="1"></xs:element>
+ </xs:sequence>
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ <xs:attribute name="group" type="xs:string" use="required"/>
+ <xs:attribute name="dir-files" type="xs:string"/>
+ </xs:complexType>
+
+ <xs:complexType name="CREDENTIALS">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="credential" type="workflow:CREDENTIAL"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CREDENTIAL">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded" >
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="type" type="xs:string" use="required"/>
+ </xs:complexType>
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/shell-action-0.1.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/shell-action-0.1.xsd b/webapp/src/conf/oozie/conf/action-conf/shell-action-0.1.xsd
new file mode 100644
index 0000000..4794c0d
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/shell-action-0.1.xsd
@@ -0,0 +1,73 @@
+<?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.
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:shell="uri:oozie:shell-action:0.1" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:shell-action:0.1">
+
+ <xs:element name="shell" type="shell:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="shell:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="shell:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="exec" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="argument" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="env-var" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="capture-output" type="shell:FLAG" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="shell:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="shell:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/shell-action-0.2.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/shell-action-0.2.xsd b/webapp/src/conf/oozie/conf/action-conf/shell-action-0.2.xsd
new file mode 100644
index 0000000..2afee7d
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/shell-action-0.2.xsd
@@ -0,0 +1,73 @@
+<?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.
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:shell="uri:oozie:shell-action:0.2" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:shell-action:0.2">
+
+ <xs:element name="shell" type="shell:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="shell:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="shell:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="exec" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="argument" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="env-var" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="capture-output" type="shell:FLAG" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="shell:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="shell:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+</xs:schema>
[2/8] FALCON-1 Create packaging and scripts to install and try Apache
Falcon. Contributed by Srikanth Sundarrajan
Posted by ve...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyIT.java b/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyIT.java
new file mode 100644
index 0000000..b94cff0
--- /dev/null
+++ b/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyIT.java
@@ -0,0 +1,626 @@
+/**
+ * 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.falcon.resource;
+
+import com.sun.jersey.api.client.ClientResponse;
+import org.apache.falcon.entity.v0.EntityType;
+import org.apache.falcon.entity.v0.feed.Feed;
+import org.apache.falcon.entity.v0.process.Input;
+import org.apache.falcon.entity.v0.process.Process;
+import org.apache.falcon.entity.v0.process.Property;
+import org.apache.falcon.entity.v0.process.Validity;
+import org.apache.falcon.util.BuildProperties;
+import org.apache.falcon.util.DeploymentProperties;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.FsShell;
+import org.apache.hadoop.fs.Path;
+import org.apache.oozie.client.BundleJob;
+import org.apache.oozie.client.Job;
+import org.apache.oozie.client.Job.Status;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import javax.servlet.ServletInputStream;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.xml.bind.JAXBException;
+import java.io.File;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
+
+/**
+ * Test class for Entity REST APIs.
+ *
+ * Tests should be enabled only in local environments as they need running instance of the web server.
+ */
+public class EntityManagerJerseyIT {
+
+ @BeforeClass
+ public void prepare() throws Exception {
+ TestContext.prepare();
+ }
+
+ @Test
+ public void testUpdateCheckUser() throws Exception {
+ TestContext context = newContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+ String tmpFileName = context.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
+ Process process = (Process) EntityType.PROCESS.getUnmarshaller().unmarshal(new File(tmpFileName));
+ Validity processValidity = process.getClusters().getClusters().get(0).getValidity();
+ processValidity.setEnd(new Date(new Date().getTime() + 2 * 24 * 60 * 60 * 1000));
+ File tmpFile = context.getTempFile();
+ EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
+ context.scheduleProcess(tmpFile.getAbsolutePath(), overlay);
+ context.waitForBundleStart(Status.RUNNING);
+
+ List<BundleJob> bundles = context.getBundles();
+ Assert.assertEquals(bundles.size(), 1);
+ Assert.assertEquals(bundles.get(0).getUser(), TestContext.REMOTE_USER);
+
+ ClientResponse response = context.service.path("api/entities/definition/feed/"
+ + context.outputFeedName).header(
+ "Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).get(ClientResponse.class);
+ Feed feed = (Feed) EntityType.FEED.getUnmarshaller()
+ .unmarshal(new StringReader(response.getEntity(String.class)));
+
+ //change output feed path and update feed as another user
+ feed.getLocations().getLocations().get(0).setPath("/falcon/test/output2/${YEAR}/${MONTH}/${DAY}");
+ tmpFile = context.getTempFile();
+ EntityType.FEED.getMarshaller().marshal(feed, tmpFile);
+ response = context.service.path("api/entities/update/feed/"
+ + context.outputFeedName).header("Remote-User",
+ "testuser").accept(MediaType.TEXT_XML)
+ .post(ClientResponse.class, context.getServletInputStream(tmpFile.getAbsolutePath()));
+ context.assertSuccessful(response);
+
+ bundles = context.getBundles();
+ Assert.assertEquals(bundles.size(), 2);
+ Assert.assertEquals(bundles.get(0).getUser(), TestContext.REMOTE_USER);
+ Assert.assertEquals(bundles.get(1).getUser(), TestContext.REMOTE_USER);
+ }
+
+ private ThreadLocal<TestContext> contexts = new ThreadLocal<TestContext>();
+
+ private TestContext newContext() {
+ contexts.set(new TestContext());
+ return contexts.get();
+ }
+
+ @AfterMethod
+ public void cleanup() throws Exception {
+ TestContext testContext = contexts.get();
+ if (testContext != null) {
+ testContext.killOozieJobs();
+ }
+ contexts.remove();
+ }
+
+ @Test(enabled = false)
+ public void testOptionalInput() throws Exception {
+ TestContext context = newContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+ String tmpFileName = context.
+ overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
+ Process process = (Process) EntityType.PROCESS.getUnmarshaller().unmarshal(new File(tmpFileName));
+
+ Input in1 = process.getInputs().getInputs().get(0);
+ Input in2 = new Input();
+ in2.setFeed(in1.getFeed());
+ in2.setName("input2");
+ in2.setOptional(true);
+ in2.setPartition(in1.getPartition());
+ in2.setStart("now(-1,0)");
+ in2.setEnd("now(0,0)");
+ process.getInputs().getInputs().add(in2);
+
+ File tmpFile = context.getTempFile();
+ EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
+ context.scheduleProcess(tmpFile.getAbsolutePath(), overlay);
+ context.waitForWorkflowStart(context.processName);
+ }
+
+ @Test
+ public void testProcessDeleteAndSchedule() throws Exception {
+ //Submit process with invalid property so that coord submit fails and bundle goes to failed state
+ TestContext context = newContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+ String tmpFileName = context.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
+ Process process = (Process) EntityType.PROCESS.getUnmarshaller().unmarshal(new File(tmpFileName));
+ Property prop = new Property();
+ prop.setName("newProp");
+ prop.setValue("${formatTim()}");
+ process.getProperties().getProperties().add(prop);
+ File tmpFile = context.getTempFile();
+ EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
+ context.scheduleProcess(tmpFile.getAbsolutePath(), overlay);
+ context.waitForBundleStart(Status.FAILED);
+
+ //Delete and re-submit the process with correct workflow
+ ClientResponse clientRepsonse = context.service.path("api/entities/delete/process/"
+ + context.processName).header(
+ "Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).delete(ClientResponse.class);
+ context.assertSuccessful(clientRepsonse);
+ process.getWorkflow().setPath("/falcon/test/workflow");
+ tmpFile = context.getTempFile();
+ EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
+ clientRepsonse = context.service.path("api/entities/submitAndSchedule/process").
+ header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
+ .post(ClientResponse.class, context.getServletInputStream(tmpFile.getAbsolutePath()));
+ context.assertSuccessful(clientRepsonse);
+
+ //Assert that new schedule creates new bundle
+ List<BundleJob> bundles = context.getBundles();
+ Assert.assertEquals(bundles.size(), 2);
+ }
+
+ @Test
+ public void testProcessInputUpdate() throws Exception {
+ TestContext context = newContext();
+ context.scheduleProcess();
+ context.waitForBundleStart(Job.Status.RUNNING);
+
+ ClientResponse response = context.service.path("api/entities/definition/process/"
+ + context.processName).header(
+ "Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).get(ClientResponse.class);
+ Process process = (Process) EntityType.PROCESS.getUnmarshaller()
+ .unmarshal(new StringReader(response.getEntity(String.class)));
+
+ String feed3 = "f3" + System.currentTimeMillis();
+ Map<String, String> overlay = new HashMap<String, String>();
+ overlay.put("inputFeedName", feed3);
+ overlay.put("cluster", context.clusterName);
+ response = context.submitToFalcon(TestContext.FEED_TEMPLATE1, overlay, EntityType.FEED);
+ context.assertSuccessful(response);
+
+ Input input = new Input();
+ input.setFeed(feed3);
+ input.setName("inputData2");
+ input.setStart("today(20,0)");
+ input.setEnd("today(20,20)");
+ process.getInputs().getInputs().add(input);
+
+ Validity processValidity = process.getClusters().getClusters().get(0).getValidity();
+ processValidity.setEnd(new Date(new Date().getTime() + 2 * 24 * 60 * 60 * 1000));
+ File tmpFile = context.getTempFile();
+ EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
+ response = context.service.path("api/entities/update/process/"
+ + context.processName).header("Remote-User",
+ TestContext.REMOTE_USER).accept(MediaType.TEXT_XML)
+ .post(ClientResponse.class, context.getServletInputStream(tmpFile.getAbsolutePath()));
+ context.assertSuccessful(response);
+
+ //Assert that update creates new bundle
+ List<BundleJob> bundles = context.getBundles();
+ Assert.assertEquals(bundles.size(), 2);
+ }
+
+ @Test
+ public void testProcessEndtimeUpdate() throws Exception {
+ TestContext context = newContext();
+ context.scheduleProcess();
+ context.waitForBundleStart(Job.Status.RUNNING);
+
+ ClientResponse response = context.service.path("api/entities/definition/process/"
+ + context.processName).header(
+ "Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).get(ClientResponse.class);
+ Process process = (Process) EntityType.PROCESS.getUnmarshaller()
+ .unmarshal(new StringReader(response.getEntity(String.class)));
+
+ Validity processValidity = process.getClusters().getClusters().get(0).getValidity();
+ processValidity.setEnd(new Date(new Date().getTime() + 60 * 60 * 1000));
+ File tmpFile = context.getTempFile();
+ EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
+ response = context.service.path("api/entities/update/process/" + context.processName).header("Remote-User",
+ TestContext.REMOTE_USER).accept(MediaType.TEXT_XML)
+ .post(ClientResponse.class, context.getServletInputStream(tmpFile.getAbsolutePath()));
+ context.assertSuccessful(response);
+
+ //Assert that update does not create new bundle
+ List<BundleJob> bundles = context.getBundles();
+ Assert.assertEquals(bundles.size(), 1);
+ }
+
+ @Test
+ public void testStatus() throws Exception {
+ TestContext context = newContext();
+ ClientResponse response;
+ Map<String, String> overlay = context.getUniqueOverlay();
+
+ response = context.submitToFalcon(context.CLUSTER_TEMPLATE, overlay, EntityType.CLUSTER);
+ context.assertSuccessful(response);
+
+ response = context.submitToFalcon(TestContext.FEED_TEMPLATE1, overlay, EntityType.FEED);
+ context.assertSuccessful(response);
+
+ response = context.service
+ .path("api/entities/status/feed/" + overlay.get("inputFeedName"))
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).get(ClientResponse.class);
+
+ APIResult result = (APIResult) context.unmarshaller.
+ unmarshal(new StringReader(response.getEntity(String.class)));
+ Assert.assertTrue(result.getMessage().contains("SUBMITTED"));
+
+ }
+
+ @Test
+ public void testIdempotentSubmit() throws Exception {
+ TestContext context = newContext();
+ ClientResponse response;
+ Map<String, String> overlay = context.getUniqueOverlay();
+
+ response = context.submitToFalcon(context.CLUSTER_TEMPLATE, overlay, EntityType.CLUSTER);
+ context.assertSuccessful(response);
+
+ response = context.submitToFalcon(context.CLUSTER_TEMPLATE, overlay, EntityType.CLUSTER);
+ context.assertSuccessful(response);
+ }
+
+ @Test
+ public void testNotFoundStatus() {
+ TestContext context = newContext();
+ ClientResponse response;
+ String feed1 = "f1" + System.currentTimeMillis();
+ response = context.service
+ .path("api/entities/status/feed/" + feed1)
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
+ String status = response.getEntity(String.class);
+ Assert.assertEquals(response.getStatus(), Response.Status.BAD_REQUEST.getStatusCode());
+ }
+
+ @Test
+ public void testVersion() {
+ TestContext context = newContext();
+ ClientResponse response;
+ response = context.service
+ .path("api/admin/version")
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
+ String status = response.getEntity(String.class);
+ Assert.assertEquals(status, "{Version:\""
+ + BuildProperties.get().getProperty("build.version") + "\",Mode:\""
+ + DeploymentProperties.get().getProperty("deploy.mode") + "\"}");
+ }
+
+ @Test
+ public void testValidate() {
+ TestContext context = newContext();
+ ServletInputStream stream = context.getServletInputStream(getClass().
+ getResourceAsStream(TestContext.SAMPLE_PROCESS_XML));
+
+ ClientResponse clientRepsonse = context.service
+ .path("api/entities/validate/process")
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
+ .post(ClientResponse.class, stream);
+
+ context.assertFailure(clientRepsonse);
+ }
+
+ @Test
+ public void testClusterValidate() throws Exception {
+ TestContext context = newContext();
+ ClientResponse clientRepsonse;
+ Map<String, String> overlay = context.getUniqueOverlay();
+
+ InputStream stream = context.getServletInputStream(
+ context.overlayParametersOverTemplate(context.CLUSTER_TEMPLATE, overlay));
+
+ clientRepsonse = context.service.path("api/entities/validate/cluster")
+ .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .post(ClientResponse.class, stream);
+ context.assertSuccessful(clientRepsonse);
+ }
+
+ @Test
+ public void testClusterSubmitScheduleSuspendResumeDelete() throws Exception {
+ TestContext context = newContext();
+ ClientResponse clientRepsonse;
+ Map<String, String> overlay = context.getUniqueOverlay();
+
+ clientRepsonse = context.submitToFalcon(context.CLUSTER_TEMPLATE, overlay,
+ EntityType.CLUSTER);
+ context.assertSuccessful(clientRepsonse);
+
+ clientRepsonse = context.service
+ .path("api/entities/schedule/cluster/" + context.clusterName)
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
+ .post(ClientResponse.class);
+ context.assertFailure(clientRepsonse);
+
+ clientRepsonse = context.service
+ .path("api/entities/suspend/cluster/" + context.clusterName)
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
+ .post(ClientResponse.class);
+ context.assertFailure(clientRepsonse);
+
+ clientRepsonse = context.service
+ .path("api/entities/resume/cluster/" + context.clusterName)
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
+ .post(ClientResponse.class);
+ context.assertFailure(clientRepsonse);
+
+ clientRepsonse = context.service
+ .path("api/entities/delete/cluster/" + context.clusterName)
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).delete(ClientResponse.class);
+ context.assertSuccessful(clientRepsonse);
+ }
+
+ @Test
+ public void testSubmit() throws Exception {
+ TestContext context = newContext();
+ ClientResponse response;
+ Map<String, String> overlay = context.getUniqueOverlay();
+
+ response = context.submitToFalcon(context.CLUSTER_TEMPLATE, overlay, EntityType.CLUSTER);
+ context.assertSuccessful(response);
+
+ response = context.submitToFalcon(TestContext.FEED_TEMPLATE1, overlay, EntityType.FEED);
+ context.assertSuccessful(response);
+
+ response = context.submitToFalcon(TestContext.FEED_TEMPLATE2, overlay, EntityType.FEED);
+ context.assertSuccessful(response);
+
+ response = context.submitToFalcon(TestContext.PROCESS_TEMPLATE, overlay, EntityType.PROCESS);
+ context.assertSuccessful(response);
+ }
+
+ @Test
+ public void testGetEntityDefinition() throws Exception {
+ TestContext context = newContext();
+ ClientResponse response;
+ Map<String, String> overlay = context.getUniqueOverlay();
+
+ response = context.submitToFalcon(context.CLUSTER_TEMPLATE, overlay, EntityType.CLUSTER);
+ context.assertSuccessful(response);
+
+ response = context.submitToFalcon(TestContext.FEED_TEMPLATE1, overlay, EntityType.FEED);
+ context.assertSuccessful(response);
+
+ response = context.service
+ .path("api/entities/definition/feed/" + overlay.get("inputFeedName"))
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).get(ClientResponse.class);
+
+ String feedXML = response.getEntity(String.class);
+ try {
+ Feed result = (Feed) context.unmarshaller.
+ unmarshal(new StringReader(feedXML));
+ Assert.assertEquals(result.getName(), overlay.get("inputFeedName"));
+ } catch (JAXBException e) {
+ Assert.fail("Reponse " + feedXML + " is not valid", e);
+ }
+ }
+
+ @Test
+ public void testInvalidGetEntityDefinition() {
+ TestContext context = newContext();
+ ClientResponse clientRepsonse = context.service
+ .path("api/entities/definition/process/sample1")
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).get(ClientResponse.class);
+ context.assertFailure(clientRepsonse);
+ }
+
+ @Test
+ public void testScheduleSuspendResume() throws Exception {
+ TestContext context = newContext();
+ context.scheduleProcess();
+
+ ClientResponse clientRepsonse = context.service
+ .path("api/entities/suspend/process/" + context.processName)
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).post(ClientResponse.class);
+ context.assertSuccessful(clientRepsonse);
+
+ clientRepsonse = context.service
+ .path("api/entities/resume/process/" + context.processName)
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).post(ClientResponse.class);
+ context.assertSuccessful(clientRepsonse);
+ }
+
+ @Test(enabled = true)
+ public void testFeedSchedule() throws Exception {
+ TestContext context = newContext();
+ ClientResponse response;
+ Map<String, String> overlay = context.getUniqueOverlay();
+
+ response = context.submitToFalcon(context.CLUSTER_TEMPLATE, overlay, EntityType.CLUSTER);
+ context.assertSuccessful(response);
+
+ response = context.submitToFalcon(TestContext.FEED_TEMPLATE1, overlay, EntityType.FEED);
+ context.assertSuccessful(response);
+
+ createTestData(context);
+ ClientResponse clientRepsonse = context.service
+ .path("api/entities/schedule/feed/" + overlay.get("inputFeedName"))
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
+ .post(ClientResponse.class);
+ context.assertSuccessful(clientRepsonse);
+ }
+
+ private List<Path> createTestData(TestContext context) throws Exception {
+ List<Path> list = new ArrayList<Path>();
+ FileSystem fs = context.cluster.getFileSystem();
+ fs.mkdirs(new Path("/user/guest"));
+ fs.setOwner(new Path("/user/guest"), TestContext.REMOTE_USER, "users");
+
+ DateFormat formatter = new SimpleDateFormat("yyyy/MM/dd/HH/mm");
+ formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
+ Date date = new Date(System.currentTimeMillis() + 3 * 3600000);
+ Path path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
+ fs.create(path).close();
+ date = new Date(date.getTime() - 3600000);
+ path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
+ fs.create(path).close();
+ date = new Date(date.getTime() - 3600000);
+ path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
+ fs.create(path).close();
+ date = new Date(date.getTime() - 3600000);
+ path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
+ list.add(path);
+ fs.create(path).close();
+ date = new Date(date.getTime() - 3600000);
+ path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
+ list.add(path);
+ fs.create(path).close();
+ date = new Date(date.getTime() - 3600000);
+ path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
+ list.add(path);
+ fs.create(path).close();
+ date = new Date(date.getTime() - 3600000);
+ path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
+ list.add(path);
+ fs.create(path).close();
+ date = new Date(date.getTime() - 3600000);
+ path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
+ list.add(path);
+ fs.create(path).close();
+ date = new Date(date.getTime() - 3600000);
+ path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
+ list.add(path);
+ fs.create(path).close();
+ date = new Date(date.getTime() - 3600000);
+ path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
+ list.add(path);
+ fs.create(path).close();
+ new FsShell(context.cluster.getConf()).
+ run(new String[]{"-chown", "-R", "guest:users", "/examples/input-data/rawLogs"});
+ return list;
+ }
+
+ @Test
+ public void testDeleteDataSet() throws Exception {
+ TestContext context = newContext();
+ ClientResponse response;
+ Map<String, String> overlay = context.getUniqueOverlay();
+
+ response = context.submitToFalcon(context.CLUSTER_TEMPLATE, overlay, EntityType.CLUSTER);
+ context.assertSuccessful(response);
+
+ response = context.submitToFalcon(TestContext.FEED_TEMPLATE1, overlay, EntityType.FEED);
+ context.assertSuccessful(response);
+
+ response = context.service
+ .path("api/entities/delete/feed/" + overlay.get("inputFeedName"))
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).delete(ClientResponse.class);
+ context.assertSuccessful(response);
+ }
+
+ @Test
+ public void testDelete() throws Exception {
+ TestContext context = newContext();
+ ClientResponse response;
+ Map<String, String> overlay = context.getUniqueOverlay();
+
+ response = context.submitToFalcon(context.CLUSTER_TEMPLATE, overlay, EntityType.CLUSTER);
+ context.assertSuccessful(response);
+
+ response = context.submitToFalcon(TestContext.FEED_TEMPLATE1, overlay, EntityType.FEED);
+ context.assertSuccessful(response);
+
+ response = context.service
+ .path("api/entities/delete/cluster/" + context.clusterName)
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).delete(ClientResponse.class);
+ context.assertFailure(response);
+
+ response = context.submitToFalcon(TestContext.FEED_TEMPLATE2, overlay, EntityType.FEED);
+ context.assertSuccessful(response);
+
+ response = context.submitToFalcon(TestContext.PROCESS_TEMPLATE, overlay, EntityType.PROCESS);
+ context.assertSuccessful(response);
+
+ //Delete a referred feed
+ response = context.service
+ .path("api/entities/delete/feed/" + overlay.get("inputFeedName"))
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).delete(ClientResponse.class);
+ context.assertFailure(response);
+
+ //Delete a submitted process
+ response = context.service
+ .path("api/entities/delete/process/" + context.processName)
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).delete(ClientResponse.class);
+ context.assertSuccessful(response);
+
+ response = context.submitToFalcon(TestContext.PROCESS_TEMPLATE, overlay, EntityType.PROCESS);
+ context.assertSuccessful(response);
+
+ ClientResponse clientRepsonse = context.service
+ .path("api/entities/schedule/process/" + context.processName)
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
+ .post(ClientResponse.class);
+ context.assertSuccessful(clientRepsonse);
+
+ //Delete a scheduled process
+ response = context.service
+ .path("api/entities/delete/process/" + context.processName)
+ .header("Remote-User", TestContext.REMOTE_USER)
+ .accept(MediaType.TEXT_XML).delete(ClientResponse.class);
+ context.assertSuccessful(response);
+ }
+
+ @Test
+ public void testGetDependencies() throws Exception {
+ TestContext context = newContext();
+ ClientResponse response;
+ response = context.service
+ .path("api/entities/list/process/")
+ .header("Remote-User", TestContext.REMOTE_USER).type(MediaType.TEXT_XML)
+ .accept(MediaType.TEXT_XML).get(ClientResponse.class);
+ Assert.assertEquals(response.getStatus(), 200);
+
+ Map<String, String> overlay = context.getUniqueOverlay();
+
+ response = context.submitToFalcon(context.CLUSTER_TEMPLATE, overlay, EntityType.CLUSTER);
+ context.assertSuccessful(response);
+
+ response = context.service
+ .path("api/entities/list/cluster/")
+ .header("Remote-User", TestContext.REMOTE_USER).type(MediaType.TEXT_XML)
+ .accept(MediaType.TEXT_XML).get(ClientResponse.class);
+ Assert.assertEquals(response.getStatus(), 200);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyTest.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyTest.java b/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyTest.java
deleted file mode 100644
index b2d234d..0000000
--- a/webapp/src/test/java/org/apache/falcon/resource/EntityManagerJerseyTest.java
+++ /dev/null
@@ -1,573 +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.
- */
-package org.apache.falcon.resource;
-
-import com.sun.jersey.api.client.ClientResponse;
-import org.apache.falcon.entity.v0.EntityType;
-import org.apache.falcon.entity.v0.feed.Feed;
-import org.apache.falcon.entity.v0.process.Input;
-import org.apache.falcon.entity.v0.process.Process;
-import org.apache.falcon.entity.v0.process.Property;
-import org.apache.falcon.entity.v0.process.Validity;
-import org.apache.falcon.util.BuildProperties;
-import org.apache.falcon.util.DeploymentProperties;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.FsShell;
-import org.apache.hadoop.fs.Path;
-import org.apache.oozie.client.BundleJob;
-import org.apache.oozie.client.Job;
-import org.apache.oozie.client.Job.Status;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-import javax.servlet.ServletInputStream;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.xml.bind.JAXBException;
-import java.io.File;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-/**
- * Test class for Entity REST APIs.
- *
- * Tests should be enabled only in local environments as they need running instance of the web server.
- */
-public class EntityManagerJerseyTest extends AbstractTestBase {
-
- @Test
- public void testUpdateCheckUser() throws Exception {
- Map<String, String> overlay = getUniqueOverlay();
- String tmpFileName = overlayParametersOverTemplate(PROCESS_TEMPLATE, overlay);
- Process process = (Process) EntityType.PROCESS.getUnmarshaller().unmarshal(new File(tmpFileName));
- Validity processValidity = process.getClusters().getClusters().get(0).getValidity();
- processValidity.setEnd(new Date(new Date().getTime() + 2 * 24 * 60 * 60 * 1000));
- File tmpFile = getTempFile();
- EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
- scheduleProcess(tmpFile.getAbsolutePath(), overlay);
- waitForBundleStart(Status.RUNNING);
-
- List<BundleJob> bundles = getBundles();
- Assert.assertEquals(bundles.size(), 1);
- Assert.assertEquals(bundles.get(0).getUser(), REMOTE_USER);
-
- ClientResponse response = this.service.path("api/entities/definition/feed/" + outputFeedName).header(
- "Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).get(ClientResponse.class);
- Feed feed = (Feed) EntityType.FEED.getUnmarshaller()
- .unmarshal(new StringReader(response.getEntity(String.class)));
-
- //change output feed path and update feed as another user
- feed.getLocations().getLocations().get(0).setPath("/falcon/test/output2/${YEAR}/${MONTH}/${DAY}");
- tmpFile = getTempFile();
- EntityType.FEED.getMarshaller().marshal(feed, tmpFile);
- response = this.service.path("api/entities/update/feed/" + outputFeedName).header("Remote-User",
- "testuser").accept(MediaType.TEXT_XML)
- .post(ClientResponse.class, getServletInputStream(tmpFile.getAbsolutePath()));
- assertSuccessful(response);
-
- bundles = getBundles();
- Assert.assertEquals(bundles.size(), 2);
- Assert.assertEquals(bundles.get(0).getUser(), REMOTE_USER);
- Assert.assertEquals(bundles.get(1).getUser(), REMOTE_USER);
- }
-
-
- @Test(enabled = false)
- public void testOptionalInput() throws Exception {
- Map<String, String> overlay = getUniqueOverlay();
- String tmpFileName = overlayParametersOverTemplate(PROCESS_TEMPLATE, overlay);
- Process process = (Process) EntityType.PROCESS.getUnmarshaller().unmarshal(new File(tmpFileName));
-
- Input in1 = process.getInputs().getInputs().get(0);
- Input in2 = new Input();
- in2.setFeed(in1.getFeed());
- in2.setName("input2");
- in2.setOptional(true);
- in2.setPartition(in1.getPartition());
- in2.setStart("now(-1,0)");
- in2.setEnd("now(0,0)");
- process.getInputs().getInputs().add(in2);
-
- File tmpFile = getTempFile();
- EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
- scheduleProcess(tmpFile.getAbsolutePath(), overlay);
- waitForWorkflowStart(processName);
- }
-
- @Test
- public void testProcessDeleteAndSchedule() throws Exception {
- //Submit process with invalid property so that coord submit fails and bundle goes to failed state
- Map<String, String> overlay = getUniqueOverlay();
- String tmpFileName = overlayParametersOverTemplate(PROCESS_TEMPLATE, overlay);
- Process process = (Process) EntityType.PROCESS.getUnmarshaller().unmarshal(new File(tmpFileName));
- Property prop = new Property();
- prop.setName("newProp");
- prop.setValue("${formatTim()}");
- process.getProperties().getProperties().add(prop);
- File tmpFile = getTempFile();
- EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
- scheduleProcess(tmpFile.getAbsolutePath(), overlay);
- waitForBundleStart(Status.FAILED);
-
- //Delete and re-submit the process with correct workflow
- ClientResponse clientRepsonse = this.service.path("api/entities/delete/process/" + processName).header(
- "Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).delete(ClientResponse.class);
- assertSuccessful(clientRepsonse);
- process.getWorkflow().setPath("/falcon/test/workflow");
- tmpFile = getTempFile();
- EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
- clientRepsonse = this.service.path("api/entities/submitAndSchedule/process").header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
- .post(ClientResponse.class, getServletInputStream(tmpFile.getAbsolutePath()));
- assertSuccessful(clientRepsonse);
-
- //Assert that new schedule creates new bundle
- List<BundleJob> bundles = getBundles();
- Assert.assertEquals(bundles.size(), 2);
- }
-
- @Test
- public void testProcessInputUpdate() throws Exception {
- scheduleProcess();
- waitForBundleStart(Job.Status.RUNNING);
-
- ClientResponse response = this.service.path("api/entities/definition/process/" + processName).header(
- "Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).get(ClientResponse.class);
- Process process = (Process) EntityType.PROCESS.getUnmarshaller()
- .unmarshal(new StringReader(response.getEntity(String.class)));
-
- String feed3 = "f3" + System.currentTimeMillis();
- Map<String, String> overlay = new HashMap<String, String>();
- overlay.put("inputFeedName", feed3);
- overlay.put("cluster", clusterName);
- response = submitToFalcon(FEED_TEMPLATE1, overlay, EntityType.FEED);
- assertSuccessful(response);
-
- Input input = new Input();
- input.setFeed(feed3);
- input.setName("inputData2");
- input.setStart("today(20,0)");
- input.setEnd("today(20,20)");
- process.getInputs().getInputs().add(input);
-
- Validity processValidity = process.getClusters().getClusters().get(0).getValidity();
- processValidity.setEnd(new Date(new Date().getTime() + 2 * 24 * 60 * 60 * 1000));
- File tmpFile = getTempFile();
- EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
- response = this.service.path("api/entities/update/process/" + processName).header("Remote-User",
- REMOTE_USER).accept(MediaType.TEXT_XML)
- .post(ClientResponse.class, getServletInputStream(tmpFile.getAbsolutePath()));
- assertSuccessful(response);
-
- //Assert that update creates new bundle
- List<BundleJob> bundles = getBundles();
- Assert.assertEquals(bundles.size(), 2);
- }
-
- @Test
- public void testProcessEndtimeUpdate() throws Exception {
- scheduleProcess();
- waitForBundleStart(Job.Status.RUNNING);
-
- ClientResponse response = this.service.path("api/entities/definition/process/" + processName).header(
- "Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).get(ClientResponse.class);
- Process process = (Process) EntityType.PROCESS.getUnmarshaller()
- .unmarshal(new StringReader(response.getEntity(String.class)));
-
- Validity processValidity = process.getClusters().getClusters().get(0).getValidity();
- processValidity.setEnd(new Date(new Date().getTime() + 60 * 60 * 1000));
- File tmpFile = getTempFile();
- EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
- response = this.service.path("api/entities/update/process/" + processName).header("Remote-User",
- REMOTE_USER).accept(MediaType.TEXT_XML)
- .post(ClientResponse.class, getServletInputStream(tmpFile.getAbsolutePath()));
- assertSuccessful(response);
-
- //Assert that update does not create new bundle
- List<BundleJob> bundles = getBundles();
- Assert.assertEquals(bundles.size(), 1);
- }
-
- @Test
- public void testStatus() throws Exception {
- ClientResponse response;
- Map<String, String> overlay = getUniqueOverlay();
-
- response = submitToFalcon(clusterFileTemplate, overlay, EntityType.CLUSTER);
- assertSuccessful(response);
-
- response = submitToFalcon(FEED_TEMPLATE1, overlay, EntityType.FEED);
- assertSuccessful(response);
-
- response = this.service
- .path("api/entities/status/feed/" + overlay.get("inputFeedName"))
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).get(ClientResponse.class);
-
- APIResult result = (APIResult) unmarshaller.
- unmarshal(new StringReader(response.getEntity(String.class)));
- Assert.assertTrue(result.getMessage().contains("SUBMITTED"));
-
- }
-
- @Test
- public void testIdempotentSubmit() throws Exception {
- ClientResponse response;
- Map<String, String> overlay = getUniqueOverlay();
-
- response = submitToFalcon(clusterFileTemplate, overlay, EntityType.CLUSTER);
- assertSuccessful(response);
-
- response = submitToFalcon(clusterFileTemplate, overlay, EntityType.CLUSTER);
- assertSuccessful(response);
- }
-
- @Test
- public void testNotFoundStatus() {
- ClientResponse response;
- String feed1 = "f1" + System.currentTimeMillis();
- response = this.service
- .path("api/entities/status/feed/" + feed1)
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
- String status = response.getEntity(String.class);
- Assert.assertEquals(response.getStatus(), Response.Status.BAD_REQUEST.getStatusCode());
- }
-
- @Test
- public void testVersion() {
- ClientResponse response;
- response = this.service
- .path("api/admin/version")
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
- String status = response.getEntity(String.class);
- Assert.assertEquals(status, "{Version:\""
- + BuildProperties.get().getProperty("build.version") + "\",Mode:\""
- + DeploymentProperties.get().getProperty("deploy.mode") + "\"}");
- }
-
- @Test
- public void testValidate() {
-
- ServletInputStream stream = getServletInputStream(getClass().
- getResourceAsStream(SAMPLE_PROCESS_XML));
-
- ClientResponse clientRepsonse = this.service
- .path("api/entities/validate/process")
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
- .post(ClientResponse.class, stream);
-
- assertFailure(clientRepsonse);
- }
-
- @Test
- public void testClusterValidate() throws Exception {
- ClientResponse clientRepsonse;
- Map<String, String> overlay = getUniqueOverlay();
-
- InputStream stream = getServletInputStream(overlayParametersOverTemplate(
- clusterFileTemplate, overlay));
-
- clientRepsonse = this.service.path("api/entities/validate/cluster")
- .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
- .header("Remote-User", REMOTE_USER)
- .post(ClientResponse.class, stream);
- assertSuccessful(clientRepsonse);
- }
-
- @Test
- public void testClusterSubmitScheduleSuspendResumeDelete() throws Exception {
- ClientResponse clientRepsonse;
- Map<String, String> overlay = getUniqueOverlay();
-
- clientRepsonse = submitToFalcon(clusterFileTemplate, overlay,
- EntityType.CLUSTER);
- assertSuccessful(clientRepsonse);
-
- clientRepsonse = this.service
- .path("api/entities/schedule/cluster/" + clusterName)
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
- .post(ClientResponse.class);
- assertFailure(clientRepsonse);
-
- clientRepsonse = this.service
- .path("api/entities/suspend/cluster/" + clusterName)
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
- .post(ClientResponse.class);
- assertFailure(clientRepsonse);
-
- clientRepsonse = this.service
- .path("api/entities/resume/cluster/" + clusterName)
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
- .post(ClientResponse.class);
- assertFailure(clientRepsonse);
-
- clientRepsonse = this.service
- .path("api/entities/delete/cluster/" + clusterName)
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).delete(ClientResponse.class);
- assertSuccessful(clientRepsonse);
- }
-
- @Test
- public void testSubmit() throws Exception {
-
- ClientResponse response;
- Map<String, String> overlay = getUniqueOverlay();
-
- response = submitToFalcon(clusterFileTemplate, overlay, EntityType.CLUSTER);
- assertSuccessful(response);
-
- response = submitToFalcon(FEED_TEMPLATE1, overlay, EntityType.FEED);
- assertSuccessful(response);
-
- response = submitToFalcon(FEED_TEMPLATE2, overlay, EntityType.FEED);
- assertSuccessful(response);
-
- response = submitToFalcon(PROCESS_TEMPLATE, overlay, EntityType.PROCESS);
- assertSuccessful(response);
- }
-
- @Test
- public void testGetEntityDefinition() throws Exception {
- ClientResponse response;
- Map<String, String> overlay = getUniqueOverlay();
-
- response = submitToFalcon(clusterFileTemplate, overlay, EntityType.CLUSTER);
- assertSuccessful(response);
-
- response = submitToFalcon(FEED_TEMPLATE1, overlay, EntityType.FEED);
- assertSuccessful(response);
-
- response = this.service
- .path("api/entities/definition/feed/" + overlay.get("inputFeedName"))
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).get(ClientResponse.class);
-
- String feedXML = response.getEntity(String.class);
- try {
- Feed result = (Feed) unmarshaller.
- unmarshal(new StringReader(feedXML));
- Assert.assertEquals(result.getName(), overlay.get("inputFeedName"));
- } catch (JAXBException e) {
- Assert.fail("Reponse " + feedXML + " is not valid", e);
- }
- }
-
- @Test
- public void testInvalidGetEntityDefinition() {
- ClientResponse clientRepsonse = this.service
- .path("api/entities/definition/process/sample1")
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).get(ClientResponse.class);
- assertFailure(clientRepsonse);
- }
-
- @Test
- public void testScheduleSuspendResume() throws Exception {
- scheduleProcess();
-
- ClientResponse clientRepsonse = this.service
- .path("api/entities/suspend/process/" + processName)
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).post(ClientResponse.class);
- assertSuccessful(clientRepsonse);
-
- clientRepsonse = this.service
- .path("api/entities/resume/process/" + processName)
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).post(ClientResponse.class);
- assertSuccessful(clientRepsonse);
- }
-
- @Test(enabled = true)
- public void testFeedSchedule() throws Exception {
- ClientResponse response;
- Map<String, String> overlay = getUniqueOverlay();
-
- response = submitToFalcon(clusterFileTemplate, overlay, EntityType.CLUSTER);
- assertSuccessful(response);
-
- response = submitToFalcon(FEED_TEMPLATE1, overlay, EntityType.FEED);
- assertSuccessful(response);
-
- createTestData();
- ClientResponse clientRepsonse = this.service
- .path("api/entities/schedule/feed/" + overlay.get("inputFeedName"))
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
- .post(ClientResponse.class);
- assertSuccessful(clientRepsonse);
- }
-
- private List<Path> createTestData() throws Exception {
- List<Path> list = new ArrayList<Path>();
- FileSystem fs = cluster.getFileSystem();
- fs.mkdirs(new Path("/user/guest"));
- fs.setOwner(new Path("/user/guest"), REMOTE_USER, "users");
-
- DateFormat formatter = new SimpleDateFormat("yyyy/MM/dd/HH/mm");
- formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
- Date date = new Date(System.currentTimeMillis() + 3 * 3600000);
- Path path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
- fs.create(path).close();
- date = new Date(date.getTime() - 3600000);
- path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
- fs.create(path).close();
- date = new Date(date.getTime() - 3600000);
- path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
- fs.create(path).close();
- date = new Date(date.getTime() - 3600000);
- path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
- list.add(path);
- fs.create(path).close();
- date = new Date(date.getTime() - 3600000);
- path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
- list.add(path);
- fs.create(path).close();
- date = new Date(date.getTime() - 3600000);
- path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
- list.add(path);
- fs.create(path).close();
- date = new Date(date.getTime() - 3600000);
- path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
- list.add(path);
- fs.create(path).close();
- date = new Date(date.getTime() - 3600000);
- path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
- list.add(path);
- fs.create(path).close();
- date = new Date(date.getTime() - 3600000);
- path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
- list.add(path);
- fs.create(path).close();
- date = new Date(date.getTime() - 3600000);
- path = new Path("/examples/input-data/rawLogs/" + formatter.format(date) + "/file");
- list.add(path);
- fs.create(path).close();
- new FsShell(cluster.getConf()).run(new String[]{"-chown", "-R", "guest:users", "/examples/input-data/rawLogs"});
- return list;
- }
-
- @Test
- public void testDeleteDataSet() throws Exception {
- ClientResponse response;
- Map<String, String> overlay = getUniqueOverlay();
-
- response = submitToFalcon(clusterFileTemplate, overlay, EntityType.CLUSTER);
- assertSuccessful(response);
-
- response = submitToFalcon(FEED_TEMPLATE1, overlay, EntityType.FEED);
- assertSuccessful(response);
-
- response = this.service
- .path("api/entities/delete/feed/" + overlay.get("inputFeedName"))
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).delete(ClientResponse.class);
- assertSuccessful(response);
- }
-
- @Test
- public void testDelete() throws Exception {
-
- ClientResponse response;
- Map<String, String> overlay = getUniqueOverlay();
-
- response = submitToFalcon(clusterFileTemplate, overlay, EntityType.CLUSTER);
- assertSuccessful(response);
-
- response = submitToFalcon(FEED_TEMPLATE1, overlay, EntityType.FEED);
- assertSuccessful(response);
-
- response = this.service
- .path("api/entities/delete/cluster/" + clusterName)
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).delete(ClientResponse.class);
- assertFailure(response);
-
- response = submitToFalcon(FEED_TEMPLATE2, overlay, EntityType.FEED);
- assertSuccessful(response);
-
- response = submitToFalcon(PROCESS_TEMPLATE, overlay, EntityType.PROCESS);
- assertSuccessful(response);
-
- //Delete a referred feed
- response = this.service
- .path("api/entities/delete/feed/" + overlay.get("inputFeedName"))
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).delete(ClientResponse.class);
- assertFailure(response);
-
- //Delete a submitted process
- response = this.service
- .path("api/entities/delete/process/" + processName)
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).delete(ClientResponse.class);
- assertSuccessful(response);
-
- response = submitToFalcon(PROCESS_TEMPLATE, overlay, EntityType.PROCESS);
- assertSuccessful(response);
-
- ClientResponse clientRepsonse = this.service
- .path("api/entities/schedule/process/" + processName)
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
- .post(ClientResponse.class);
- assertSuccessful(clientRepsonse);
-
- //Delete a scheduled process
- response = this.service
- .path("api/entities/delete/process/" + processName)
- .header("Remote-User", REMOTE_USER)
- .accept(MediaType.TEXT_XML).delete(ClientResponse.class);
- assertSuccessful(response);
- }
-
- @Test
- public void testGetDependencies() throws Exception {
- ClientResponse response;
- response = this.service
- .path("api/entities/list/process/")
- .header("Remote-User", REMOTE_USER).type(MediaType.TEXT_XML)
- .accept(MediaType.TEXT_XML).get(ClientResponse.class);
- Assert.assertEquals(response.getStatus(), 200);
-
- Map<String, String> overlay = getUniqueOverlay();
-
- response = submitToFalcon(clusterFileTemplate, overlay, EntityType.CLUSTER);
- assertSuccessful(response);
-
- response = this.service
- .path("api/entities/list/cluster/")
- .header("Remote-User", REMOTE_USER).type(MediaType.TEXT_XML)
- .accept(MediaType.TEXT_XML).get(ClientResponse.class);
- Assert.assertEquals(response.getStatus(), 200);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/test/java/org/apache/falcon/resource/ProcessInstanceManagerIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/resource/ProcessInstanceManagerIT.java b/webapp/src/test/java/org/apache/falcon/resource/ProcessInstanceManagerIT.java
new file mode 100644
index 0000000..ac15391
--- /dev/null
+++ b/webapp/src/test/java/org/apache/falcon/resource/ProcessInstanceManagerIT.java
@@ -0,0 +1,154 @@
+/**
+ * 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.falcon.resource;
+
+import org.apache.falcon.Tag;
+import org.apache.falcon.entity.EntityUtil;
+import org.apache.falcon.entity.ExternalId;
+import org.apache.falcon.entity.store.ConfigurationStore;
+import org.apache.falcon.entity.v0.EntityType;
+import org.apache.falcon.entity.v0.cluster.Cluster;
+import org.apache.falcon.resource.InstancesResult.Instance;
+import org.apache.falcon.resource.InstancesResult.WorkflowStatus;
+import org.apache.falcon.workflow.engine.OozieClientFactory;
+import org.apache.oozie.client.OozieClient;
+import org.apache.oozie.client.WorkflowJob;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import javax.ws.rs.core.MediaType;
+
+/**
+ * Test class for Process Instance REST API.
+ */
+@Test(enabled = false)
+public class ProcessInstanceManagerIT {
+ private static final String START_INSTANCE = "2012-04-20T00:00Z";
+
+ protected void schedule(TestContext context) throws Exception {
+ context.scheduleProcess();
+ context.waitForProcessWFtoStart();
+ }
+
+ public void testGetRunningInstances() throws Exception {
+ TestContext context = new TestContext();
+ schedule(context);
+ InstancesResult response = context.service.path("api/instance/running/process/" + context.processName)
+ .header("Remote-User", "guest").accept(MediaType.APPLICATION_JSON).get(InstancesResult.class);
+ Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertNotNull(response.getInstances());
+ Assert.assertEquals(1, response.getInstances().length);
+ assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
+ }
+
+ private void assertInstance(Instance processInstance, String instance, WorkflowStatus status) {
+ Assert.assertNotNull(processInstance);
+ Assert.assertNotNull(processInstance.getInstance());
+ Assert.assertTrue(processInstance.getInstance().endsWith(instance));
+ Assert.assertEquals(processInstance.getStatus(), status);
+ }
+
+ public void testGetInstanceStatus() throws Exception {
+ TestContext context = new TestContext();
+ schedule(context);
+ InstancesResult response = context.service.path("api/instance/status/process/" + context.processName)
+ .queryParam("start", START_INSTANCE).header("Remote-User", "guest").accept(MediaType.APPLICATION_JSON)
+ .get(InstancesResult.class);
+ Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertNotNull(response.getInstances());
+ Assert.assertEquals(1, response.getInstances().length);
+ assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
+ }
+
+ public void testReRunInstances() throws Exception {
+ testKillInstances();
+ TestContext context = new TestContext();
+ InstancesResult response = context.service.path("api/instance/rerun/process/" + context.processName)
+ .queryParam("start", START_INSTANCE).header("Remote-User", "guest").accept(MediaType.APPLICATION_JSON)
+ .post(InstancesResult.class);
+
+ Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertNotNull(response.getInstances());
+ Assert.assertEquals(1, response.getInstances().length);
+ assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
+
+ waitForWorkflow(START_INSTANCE, WorkflowJob.Status.RUNNING);
+ }
+
+ public void testKillInstances() throws Exception {
+ TestContext context = new TestContext();
+ schedule(context);
+ InstancesResult response = context.service.path("api/instance/kill/process/" + context.processName)
+ .queryParam("start", START_INSTANCE).header("Remote-User", "guest").accept(MediaType.APPLICATION_JSON)
+ .post(InstancesResult.class);
+ Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertNotNull(response.getInstances());
+ Assert.assertEquals(1, response.getInstances().length);
+ assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.KILLED);
+
+ waitForWorkflow(START_INSTANCE, WorkflowJob.Status.KILLED);
+ }
+
+ public void testSuspendInstances() throws Exception {
+ TestContext context = new TestContext();
+ schedule(context);
+ InstancesResult response = context.service.path("api/instance/suspend/process/" + context.processName)
+ .queryParam("start", START_INSTANCE).header("Remote-User", "guest").accept(MediaType.APPLICATION_JSON)
+ .post(InstancesResult.class);
+ Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertNotNull(response.getInstances());
+ Assert.assertEquals(1, response.getInstances().length);
+ assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.SUSPENDED);
+
+ waitForWorkflow(START_INSTANCE, WorkflowJob.Status.SUSPENDED);
+ }
+
+ public void testResumesInstances() throws Exception {
+ testSuspendInstances();
+
+ TestContext context = new TestContext();
+ InstancesResult response = context.service.path("api/instance/resume/process/" + context.processName)
+ .queryParam("start", START_INSTANCE).header("Remote-User", "guest").accept(MediaType.APPLICATION_JSON)
+ .post(InstancesResult.class);
+ Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
+ Assert.assertNotNull(response.getInstances());
+ Assert.assertEquals(1, response.getInstances().length);
+ assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
+
+ waitForWorkflow(START_INSTANCE, WorkflowJob.Status.RUNNING);
+ }
+
+ private void waitForWorkflow(String instance, WorkflowJob.Status status) throws Exception {
+ TestContext context = new TestContext();
+ ExternalId extId = new ExternalId(context.processName, Tag.DEFAULT, EntityUtil.parseDateUTC(instance));
+ OozieClient ozClient = OozieClientFactory.get(
+ (Cluster) ConfigurationStore.get().get(EntityType.CLUSTER, context.clusterName));
+ String jobId = ozClient.getJobId(extId.getId());
+ WorkflowJob jobInfo = null;
+ for (int i = 0; i < 15; i++) {
+ jobInfo = ozClient.getJobInfo(jobId);
+ if (jobInfo.getStatus() == status) {
+ break;
+ }
+ System.out.println("Waiting for workflow job " + jobId + " status " + status);
+ Thread.sleep((i + 1) * 1000);
+ }
+ Assert.assertEquals(status, jobInfo.getStatus());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/test/java/org/apache/falcon/resource/ProcessInstanceManagerTest.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/resource/ProcessInstanceManagerTest.java b/webapp/src/test/java/org/apache/falcon/resource/ProcessInstanceManagerTest.java
deleted file mode 100644
index c2f6b51..0000000
--- a/webapp/src/test/java/org/apache/falcon/resource/ProcessInstanceManagerTest.java
+++ /dev/null
@@ -1,148 +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.
- */
-
-package org.apache.falcon.resource;
-
-import org.apache.falcon.Tag;
-import org.apache.falcon.entity.EntityUtil;
-import org.apache.falcon.entity.ExternalId;
-import org.apache.falcon.entity.store.ConfigurationStore;
-import org.apache.falcon.entity.v0.EntityType;
-import org.apache.falcon.entity.v0.cluster.Cluster;
-import org.apache.falcon.resource.InstancesResult.Instance;
-import org.apache.falcon.resource.InstancesResult.WorkflowStatus;
-import org.apache.falcon.workflow.engine.OozieClientFactory;
-import org.apache.oozie.client.OozieClient;
-import org.apache.oozie.client.WorkflowJob;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-import javax.ws.rs.core.MediaType;
-
-/**
- * Test class for Process Instance REST API.
- */
-@Test(enabled = false)
-public class ProcessInstanceManagerTest extends AbstractTestBase {
- private static final String START_INSTANCE = "2012-04-20T00:00Z";
-
- protected void schedule() throws Exception {
- scheduleProcess();
- waitForProcessWFtoStart();
- }
-
- public void testGetRunningInstances() throws Exception {
- schedule();
- InstancesResult response = this.service.path("api/instance/running/process/" + processName)
- .header("Remote-User", "guest").accept(MediaType.APPLICATION_JSON).get(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
- Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
- assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
- }
-
- private void assertInstance(Instance processInstance, String instance, WorkflowStatus status) {
- Assert.assertNotNull(processInstance);
- Assert.assertNotNull(processInstance.getInstance());
- Assert.assertTrue(processInstance.getInstance().endsWith(instance));
- Assert.assertEquals(processInstance.getStatus(), status);
- }
-
- public void testGetInstanceStatus() throws Exception {
- schedule();
- InstancesResult response = this.service.path("api/instance/status/process/" + processName)
- .queryParam("start", START_INSTANCE).header("Remote-User", "guest").accept(MediaType.APPLICATION_JSON)
- .get(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
- Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
- assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
- }
-
- public void testReRunInstances() throws Exception {
- testKillInstances();
-
- InstancesResult response = this.service.path("api/instance/rerun/process/" + processName)
- .queryParam("start", START_INSTANCE).header("Remote-User", "guest").accept(MediaType.APPLICATION_JSON)
- .post(InstancesResult.class);
-
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
- Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
- assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
-
- waitForWorkflow(START_INSTANCE, WorkflowJob.Status.RUNNING);
- }
-
- public void testKillInstances() throws Exception {
- schedule();
- InstancesResult response = this.service.path("api/instance/kill/process/" + processName)
- .queryParam("start", START_INSTANCE).header("Remote-User", "guest").accept(MediaType.APPLICATION_JSON)
- .post(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
- Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
- assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.KILLED);
-
- waitForWorkflow(START_INSTANCE, WorkflowJob.Status.KILLED);
- }
-
- public void testSuspendInstances() throws Exception {
- schedule();
- InstancesResult response = this.service.path("api/instance/suspend/process/" + processName)
- .queryParam("start", START_INSTANCE).header("Remote-User", "guest").accept(MediaType.APPLICATION_JSON)
- .post(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
- Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
- assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.SUSPENDED);
-
- waitForWorkflow(START_INSTANCE, WorkflowJob.Status.SUSPENDED);
- }
-
- public void testResumesInstances() throws Exception {
- testSuspendInstances();
-
- InstancesResult response = this.service.path("api/instance/resume/process/" + processName)
- .queryParam("start", START_INSTANCE).header("Remote-User", "guest").accept(MediaType.APPLICATION_JSON)
- .post(InstancesResult.class);
- Assert.assertEquals(APIResult.Status.SUCCEEDED, response.getStatus());
- Assert.assertNotNull(response.getInstances());
- Assert.assertEquals(1, response.getInstances().length);
- assertInstance(response.getInstances()[0], START_INSTANCE, WorkflowStatus.RUNNING);
-
- waitForWorkflow(START_INSTANCE, WorkflowJob.Status.RUNNING);
- }
-
- private void waitForWorkflow(String instance, WorkflowJob.Status status) throws Exception {
- ExternalId extId = new ExternalId(processName, Tag.DEFAULT, EntityUtil.parseDateUTC(instance));
- OozieClient ozClient = OozieClientFactory.get(
- (Cluster) ConfigurationStore.get().get(EntityType.CLUSTER, clusterName));
- String jobId = ozClient.getJobId(extId.getId());
- WorkflowJob jobInfo = null;
- for (int i = 0; i < 15; i++) {
- jobInfo = ozClient.getJobInfo(jobId);
- if (jobInfo.getStatus() == status) {
- break;
- }
- System.out.println("Waiting for workflow job " + jobId + " status " + status);
- Thread.sleep((i + 1) * 1000);
- }
- Assert.assertEquals(status, jobInfo.getStatus());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/test/java/org/apache/falcon/resource/TestContext.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/resource/TestContext.java b/webapp/src/test/java/org/apache/falcon/resource/TestContext.java
new file mode 100644
index 0000000..9f67a80
--- /dev/null
+++ b/webapp/src/test/java/org/apache/falcon/resource/TestContext.java
@@ -0,0 +1,440 @@
+/**
+ * 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.falcon.resource;
+
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.WebResource;
+import com.sun.jersey.api.client.config.ClientConfig;
+import com.sun.jersey.api.client.config.DefaultClientConfig;
+import org.apache.commons.lang.RandomStringUtils;
+import org.apache.falcon.FalconException;
+import org.apache.falcon.cluster.util.EmbeddedCluster;
+import org.apache.falcon.cluster.util.StandAloneCluster;
+import org.apache.falcon.entity.store.ConfigurationStore;
+import org.apache.falcon.entity.v0.EntityType;
+import org.apache.falcon.entity.v0.SchemaHelper;
+import org.apache.falcon.entity.v0.cluster.Cluster;
+import org.apache.falcon.entity.v0.feed.Feed;
+import org.apache.falcon.util.StartupProperties;
+import org.apache.falcon.workflow.engine.OozieClientFactory;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.permission.FsPermission;
+import org.apache.oozie.client.BundleJob;
+import org.apache.oozie.client.CoordinatorJob;
+import org.apache.oozie.client.Job;
+import org.apache.oozie.client.Job.Status;
+import org.apache.oozie.client.OozieClient;
+import org.apache.oozie.client.WorkflowJob;
+import org.testng.Assert;
+
+import javax.servlet.ServletInputStream;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriBuilder;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Base test class for CLI, Entity and Process Instances.
+ */
+public class TestContext {
+ public static final String FEED_TEMPLATE1 = "/feed-template1.xml";
+ public static final String FEED_TEMPLATE2 = "/feed-template2.xml";
+
+ public static final String CLUSTER_TEMPLATE = "/cluster-template.xml";
+
+ public static final String SAMPLE_PROCESS_XML = "/process-version-0.xml";
+ public static final String PROCESS_TEMPLATE = "/process-template.xml";
+
+ public static final String BASE_URL = "http://localhost:41000/falcon-webapp";
+ public static final String REMOTE_USER = System.getProperty("user.name");
+
+ protected Unmarshaller unmarshaller;
+ protected Marshaller marshaller;
+
+ protected EmbeddedCluster cluster;
+ protected WebResource service = null;
+ protected String clusterName;
+ protected String processName;
+ protected String outputFeedName;
+
+ public static final Pattern VAR_PATTERN = Pattern.compile("##[A-Za-z0-9_]*##");
+
+ public Unmarshaller getUnmarshaller() {
+ return unmarshaller;
+ }
+
+ public Marshaller getMarshaller() {
+ return marshaller;
+ }
+
+ public EmbeddedCluster getCluster() {
+ return cluster;
+ }
+
+ public WebResource getService() {
+ return service;
+ }
+
+ public String getClusterName() {
+ return clusterName;
+ }
+
+ public String getProcessName() {
+ return processName;
+ }
+
+ public String getOutputFeedName() {
+ return outputFeedName;
+ }
+
+ public String getClusterFileTemplate() {
+ return CLUSTER_TEMPLATE;
+ }
+
+ public void scheduleProcess(String processTemplate, Map<String, String> overlay) throws Exception {
+ ClientResponse response = submitToFalcon(CLUSTER_TEMPLATE, overlay, EntityType.CLUSTER);
+ assertSuccessful(response);
+
+ response = submitToFalcon(FEED_TEMPLATE1, overlay, EntityType.FEED);
+ assertSuccessful(response);
+
+ response = submitToFalcon(FEED_TEMPLATE2, overlay, EntityType.FEED);
+ assertSuccessful(response);
+
+ response = submitToFalcon(processTemplate, overlay, EntityType.PROCESS);
+ assertSuccessful(response);
+ ClientResponse clientRepsonse = this.service.path("api/entities/schedule/process/" + processName)
+ .header("Remote-User", REMOTE_USER).accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML).post(
+ ClientResponse.class);
+ assertSuccessful(clientRepsonse);
+ }
+
+ public void scheduleProcess() throws Exception {
+ scheduleProcess(PROCESS_TEMPLATE, getUniqueOverlay());
+ }
+
+ private List<WorkflowJob> getRunningJobs(String entityName) throws Exception {
+ OozieClient ozClient = OozieClientFactory.get(cluster.getCluster());
+ StringBuilder builder = new StringBuilder();
+ builder.append(OozieClient.FILTER_STATUS).append('=').append(Job.Status.RUNNING).append(';');
+ builder.append(OozieClient.FILTER_NAME).append('=').append("FALCON_PROCESS_DEFAULT_").append(entityName);
+ return ozClient.getJobsInfo(builder.toString());
+ }
+
+ public void waitForWorkflowStart(String entityName) throws Exception {
+ for (int i = 0; i < 10; i++) {
+ List<WorkflowJob> jobs = getRunningJobs(entityName);
+ if (jobs != null && !jobs.isEmpty()) {
+ return;
+ }
+
+ System.out.println("Waiting for workflow to start");
+ Thread.sleep(i * 1000);
+ }
+ throw new Exception("Workflow for " + entityName + " hasn't started in oozie");
+ }
+
+ public void waitForProcessWFtoStart() throws Exception {
+ waitForWorkflowStart(processName);
+ }
+
+ public void waitForOutputFeedWFtoStart() throws Exception {
+ waitForWorkflowStart(outputFeedName);
+ }
+
+ public void waitForBundleStart(Status status) throws Exception {
+ OozieClient ozClient = OozieClientFactory.get(cluster.getCluster());
+ List<BundleJob> bundles = getBundles();
+ if (bundles.isEmpty()) {
+ return;
+ }
+
+ String bundleId = bundles.get(0).getId();
+ for (int i = 0; i < 15; i++) {
+ Thread.sleep(i * 1000);
+ BundleJob bundle = ozClient.getBundleJobInfo(bundleId);
+ if (bundle.getStatus() == status) {
+ if (status == Status.FAILED) {
+ return;
+ }
+
+ boolean done = false;
+ for (CoordinatorJob coord : bundle.getCoordinators()) {
+ if (coord.getStatus() == status) {
+ done = true;
+ }
+ }
+ if (done) {
+ return;
+ }
+ }
+ System.out.println("Waiting for bundle " + bundleId + " in " + status + " state");
+ }
+ throw new Exception("Bundle " + bundleId + " is not " + status + " in oozie");
+ }
+
+ public TestContext() {
+ try {
+ JAXBContext jaxbContext = JAXBContext.newInstance(APIResult.class, Feed.class, Process.class, Cluster.class,
+ InstancesResult.class);
+ unmarshaller = jaxbContext.createUnmarshaller();
+ marshaller = jaxbContext.createMarshaller();
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ configure();
+ }
+
+ public void configure() {
+ StartupProperties.get().setProperty(
+ "application.services",
+ StartupProperties.get().getProperty("application.services")
+ .replace("org.apache.falcon.service.ProcessSubscriberService", ""));
+ String store = StartupProperties.get().getProperty("config.store.uri");
+ StartupProperties.get().setProperty("config.store.uri", store + System.currentTimeMillis());
+ ClientConfig config = new DefaultClientConfig();
+ Client client = Client.create(config);
+ this.service = client.resource(UriBuilder.fromUri(BASE_URL).build());
+ }
+
+ public void setCluster(String file) throws Exception {
+ cluster = StandAloneCluster.newCluster(file);
+ clusterName = cluster.getCluster().getName();
+ }
+
+ /**
+ * Converts a InputStream into ServletInputStream.
+ *
+ * @param fileName
+ * @return ServletInputStream
+ * @throws java.io.IOException
+ */
+ public ServletInputStream getServletInputStream(String fileName) throws IOException {
+ return getServletInputStream(new FileInputStream(fileName));
+ }
+
+ public ServletInputStream getServletInputStream(final InputStream stream) {
+ return new ServletInputStream() {
+
+ @Override
+ public int read() throws IOException {
+ return stream.read();
+ }
+ };
+ }
+
+ public ClientResponse submitAndSchedule(String template, Map<String, String> overlay, EntityType entityType)
+ throws Exception {
+ String tmpFile = overlayParametersOverTemplate(template, overlay);
+ ServletInputStream rawlogStream = getServletInputStream(tmpFile);
+
+ return this.service.path("api/entities/submitAndSchedule/" + entityType.name().toLowerCase())
+ .header("Remote-User", "testuser").accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
+ .post(ClientResponse.class, rawlogStream);
+ }
+
+ public ClientResponse submitToFalcon(String template, Map<String, String> overlay, EntityType entityType)
+ throws IOException {
+ String tmpFile = overlayParametersOverTemplate(template, overlay);
+ if (entityType == EntityType.CLUSTER) {
+ try {
+ cluster = StandAloneCluster.newCluster(tmpFile);
+ clusterName = cluster.getCluster().getName();
+ } catch (Exception e) {
+ throw new IOException("Unable to setup cluster info", e);
+ }
+ }
+ return submitFileToFalcon(entityType, tmpFile);
+ }
+
+ private ClientResponse submitFileToFalcon(EntityType entityType, String tmpFile) throws IOException {
+
+ ServletInputStream rawlogStream = getServletInputStream(tmpFile);
+
+ return this.service.path("api/entities/submit/" + entityType.name().toLowerCase()).header("Remote-User",
+ "testuser")
+ .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML).post(ClientResponse.class, rawlogStream);
+ }
+
+ public void assertRequestId(ClientResponse clientRepsonse) {
+ String response = clientRepsonse.getEntity(String.class);
+ try {
+ APIResult result = (APIResult) unmarshaller.unmarshal(new StringReader(response));
+ Assert.assertNotNull(result.getRequestId());
+ } catch (JAXBException e) {
+ Assert.fail("Reponse " + response + " is not valid");
+ }
+ }
+
+ public void assertStatus(ClientResponse clientRepsonse, APIResult.Status status) {
+ String response = clientRepsonse.getEntity(String.class);
+ try {
+ APIResult result = (APIResult) unmarshaller.unmarshal(new StringReader(response));
+ Assert.assertEquals(result.getStatus(), status);
+ } catch (JAXBException e) {
+ Assert.fail("Reponse " + response + " is not valid");
+ }
+ }
+
+ public void assertFailure(ClientResponse clientRepsonse) {
+ Assert.assertEquals(clientRepsonse.getStatus(), Response.Status.BAD_REQUEST.getStatusCode());
+ assertStatus(clientRepsonse, APIResult.Status.FAILED);
+ }
+
+ public void assertSuccessful(ClientResponse clientRepsonse) {
+ Assert.assertEquals(clientRepsonse.getStatus(), Response.Status.OK.getStatusCode());
+ assertStatus(clientRepsonse, APIResult.Status.SUCCEEDED);
+ }
+
+ public String overlayParametersOverTemplate(String template, Map<String, String> overlay) throws IOException {
+ File tmpFile = getTempFile();
+ OutputStream out = new FileOutputStream(tmpFile);
+
+ InputStreamReader in;
+ if (getClass().getResourceAsStream(template) == null) {
+ in = new FileReader(template);
+ } else {
+ in = new InputStreamReader(getClass().getResourceAsStream(template));
+ }
+ BufferedReader reader = new BufferedReader(in);
+ String line;
+ while ((line = reader.readLine()) != null) {
+ Matcher matcher = VAR_PATTERN.matcher(line);
+ while (matcher.find()) {
+ String variable = line.substring(matcher.start(), matcher.end());
+ line = line.replace(variable, overlay.get(variable.substring(2, variable.length() - 2)));
+ matcher = VAR_PATTERN.matcher(line);
+ }
+ out.write(line.getBytes());
+ out.write("\n".getBytes());
+ }
+ reader.close();
+ out.close();
+ return tmpFile.getAbsolutePath();
+ }
+
+ public File getTempFile() throws IOException {
+ File target = new File("webapp/target");
+ if (!target.exists()) {
+ target = new File("target");
+ }
+
+ return File.createTempFile("test", ".xml", target);
+ }
+
+ public List<BundleJob> getBundles() throws Exception {
+ List<BundleJob> bundles = new ArrayList<BundleJob>();
+ if (clusterName == null) {
+ return bundles;
+ }
+
+ OozieClient ozClient = OozieClientFactory.get(cluster.getCluster());
+ return ozClient.getBundleJobsInfo("name=FALCON_PROCESS_" + processName, 0, 10);
+ }
+
+ public boolean killOozieJobs() throws Exception {
+ if (cluster == null) {
+ return true;
+ }
+
+ OozieClient ozClient = OozieClientFactory.get(cluster.getCluster());
+ List<BundleJob> bundles = getBundles();
+ if (bundles != null) {
+ for (BundleJob bundle : bundles) {
+ ozClient.kill(bundle.getId());
+ }
+ }
+ return false;
+ }
+
+ public Map<String, String> getUniqueOverlay() throws FalconException {
+ Map<String, String> overlay = new HashMap<String, String>();
+ long time = System.currentTimeMillis();
+ clusterName = "cluster" + time;
+ overlay.put("cluster", clusterName);
+ overlay.put("inputFeedName", "in" + time);
+ //only feeds with future dates can be scheduled
+ Date endDate = new Date(System.currentTimeMillis() + 15 * 60 * 1000);
+ overlay.put("feedEndDate", SchemaHelper.formatDateUTC(endDate));
+ overlay.put("outputFeedName", "out" + time);
+ processName = "p" + time;
+ overlay.put("processName", processName);
+ outputFeedName = "out" + time;
+ return overlay;
+ }
+
+ public static void prepare() throws Exception {
+
+ Map<String, String> overlay = new HashMap<String, String>();
+ overlay.put("cluster", RandomStringUtils.randomAlphabetic(5));
+ TestContext context = new TestContext();
+ String file = context.
+ overlayParametersOverTemplate(context.CLUSTER_TEMPLATE, overlay);
+ EmbeddedCluster cluster = StandAloneCluster.newCluster(file);
+
+ cleanupStore();
+
+ // setup dependent workflow and lipath in hdfs
+ FileSystem fs = FileSystem.get(cluster.getConf());
+ fs.mkdirs(new Path("/falcon"), new FsPermission((short) 511));
+
+ Path wfParent = new Path("/falcon/test");
+ fs.delete(wfParent, true);
+ Path wfPath = new Path(wfParent, "workflow");
+ fs.mkdirs(wfPath);
+ fs.copyFromLocalFile(false, true, new Path(TestContext.class.getResource("/fs-workflow.xml").getPath()),
+ new Path(wfPath,
+ "workflow.xml"));
+ fs.mkdirs(new Path(wfParent, "input/2012/04/20/00"));
+ Path outPath = new Path(wfParent, "output");
+ fs.mkdirs(outPath);
+ fs.setPermission(outPath, new FsPermission((short) 511));
+ }
+
+ public static void cleanupStore() throws Exception {
+ for (EntityType type : EntityType.values()) {
+ for (String name : ConfigurationStore.get().getEntities(type)) {
+ ConfigurationStore.get().remove(type, name);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/test/resources/client.properties
----------------------------------------------------------------------
diff --git a/webapp/src/test/resources/client.properties b/webapp/src/test/resources/client.properties
index 12ae0ac..6ecaa87 100644
--- a/webapp/src/test/resources/client.properties
+++ b/webapp/src/test/resources/client.properties
@@ -16,4 +16,4 @@
# limitations under the License.
#
-falcon.url=http://localhost:15000/
\ No newline at end of file
+falcon.url=http://localhost:41000/
\ No newline at end of file
[4/8] FALCON-1 Create packaging and scripts to install and try Apache
Falcon. Contributed by Srikanth Sundarrajan
Posted by ve...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/shell-action-0.3.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/shell-action-0.3.xsd b/webapp/src/conf/oozie/conf/action-conf/shell-action-0.3.xsd
new file mode 100644
index 0000000..f6269e6
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/shell-action-0.3.xsd
@@ -0,0 +1,73 @@
+<?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.
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:shell="uri:oozie:shell-action:0.3" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:shell-action:0.3">
+
+ <xs:element name="shell" type="shell:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="prepare" type="shell:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="shell:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="exec" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="argument" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="env-var" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="capture-output" type="shell:FLAG" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="shell:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="shell:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/sqoop-action-0.2.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/sqoop-action-0.2.xsd b/webapp/src/conf/oozie/conf/action-conf/sqoop-action-0.2.xsd
new file mode 100644
index 0000000..8e2ebd3
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/sqoop-action-0.2.xsd
@@ -0,0 +1,70 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:sqoop="uri:oozie:sqoop-action:0.2" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:sqoop-action:0.2">
+
+ <xs:element name="sqoop" type="sqoop:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="sqoop:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="sqoop:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:choice>
+ <xs:element name="command" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="arg" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:choice>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="sqoop:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="sqoop:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/sqoop-action-0.3.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/sqoop-action-0.3.xsd b/webapp/src/conf/oozie/conf/action-conf/sqoop-action-0.3.xsd
new file mode 100644
index 0000000..df7a944
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/sqoop-action-0.3.xsd
@@ -0,0 +1,70 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:sqoop="uri:oozie:sqoop-action:0.3" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:sqoop-action:0.3">
+
+ <xs:element name="sqoop" type="sqoop:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="sqoop:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="sqoop:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:choice>
+ <xs:element name="command" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="arg" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:choice>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="sqoop:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="sqoop:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/sqoop-action-0.4.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/sqoop-action-0.4.xsd b/webapp/src/conf/oozie/conf/action-conf/sqoop-action-0.4.xsd
new file mode 100644
index 0000000..a7efc15
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/sqoop-action-0.4.xsd
@@ -0,0 +1,70 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:sqoop="uri:oozie:sqoop-action:0.4" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:sqoop-action:0.4">
+
+ <xs:element name="sqoop" type="sqoop:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="prepare" type="sqoop:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="sqoop:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:choice>
+ <xs:element name="command" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="arg" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:choice>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="sqoop:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="sqoop:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/ssh-action-0.1.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/ssh-action-0.1.xsd b/webapp/src/conf/oozie/conf/action-conf/ssh-action-0.1.xsd
new file mode 100644
index 0000000..e8a6f9e
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/ssh-action-0.1.xsd
@@ -0,0 +1,36 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:ssh="uri:oozie:ssh-action:0.1" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:ssh-action:0.1">
+
+ <xs:element name="ssh" type="ssh:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="host" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="command" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="args" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="capture-output" type="ssh:FLAG" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/ssh-action-0.2.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/ssh-action-0.2.xsd b/webapp/src/conf/oozie/conf/action-conf/ssh-action-0.2.xsd
new file mode 100644
index 0000000..30ff921
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/ssh-action-0.2.xsd
@@ -0,0 +1,39 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:ssh="uri:oozie:ssh-action:0.2" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:ssh-action:0.2">
+
+ <xs:element name="ssh" type="ssh:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="host" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="command" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:choice>
+ <xs:element name="args" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="arg" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:choice>
+ <xs:element name="capture-output" type="ssh:FLAG" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/hadoop-conf/core-site.xml
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/hadoop-conf/core-site.xml b/webapp/src/conf/oozie/conf/hadoop-conf/core-site.xml
new file mode 100644
index 0000000..35078c7
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/hadoop-conf/core-site.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+ 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>mapreduce.jobtracker.kerberos.principal</name>
+ <value>mapred/_HOST@LOCALREALM</value>
+ </property>
+
+ <property>
+ <name>yarn.resourcemanager.principal</name>
+ <value>yarn/_HOST@LOCALREALM</value>
+ </property>
+
+ <property>
+ <name>dfs.namenode.kerberos.principal</name>
+ <value>hdfs/_HOST@LOCALREALM</value>
+ </property>
+
+ <property>
+ <name>mapreduce.framework.name</name>
+ <value>yarn</value>
+ </property>
+
+</configuration>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/oozie-site.xml
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/oozie-site.xml b/webapp/src/conf/oozie/conf/oozie-site.xml
new file mode 100644
index 0000000..84eaa61
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/oozie-site.xml
@@ -0,0 +1,527 @@
+<?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.
+-->
+<configuration>
+
+ <!--
+ Refer to the oozie-default.xml file for the complete list of
+ Oozie configuration properties and their default values.
+ -->
+
+ <property>
+ <name>oozie.service.ActionService.executor.ext.classes</name>
+ <value>
+ org.apache.oozie.action.email.EmailActionExecutor,
+ org.apache.oozie.action.hadoop.HiveActionExecutor,
+ org.apache.oozie.action.hadoop.ShellActionExecutor,
+ org.apache.oozie.action.hadoop.SqoopActionExecutor
+ </value>
+ </property>
+
+ <property>
+ <name>oozie.service.SchemaService.wf.ext.schemas</name>
+ <value>shell-action-0.1.xsd,hive-action-0.2.xsd,sqoop-action-0.2.xsd</value>
+ </property>
+
+ <property>
+ <name>oozie.system.id</name>
+ <value>oozie-${user.name}</value>
+ <description>
+ The Oozie system ID.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.base.url</name>
+ <value>http://localhost:41000/oozie</value>
+ <description>
+ The Oozie system ID.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.systemmode</name>
+ <value>NORMAL</value>
+ <description>
+ System mode for Oozie at startup.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.AuthorizationService.security.enabled</name>
+ <value>false</value>
+ <description>
+ Specifies whether security (user name/admin role) is enabled or not.
+ If disabled any user can manage Oozie system and manage any job.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.PurgeService.older.than</name>
+ <value>30</value>
+ <description>
+ Jobs older than this value, in days, will be purged by the PurgeService.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.PurgeService.purge.interval</name>
+ <value>3600</value>
+ <description>
+ Interval at which the purge service will run, in seconds.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.CallableQueueService.queue.size</name>
+ <value>10000</value>
+ <description>Max callable queue size</description>
+ </property>
+
+ <property>
+ <name>oozie.service.CallableQueueService.threads</name>
+ <value>10</value>
+ <description>Number of threads used for executing callables</description>
+ </property>
+
+ <property>
+ <name>oozie.service.CallableQueueService.callable.concurrency</name>
+ <value>3</value>
+ <description>
+ Maximum concurrency for a given callable type.
+ Each command is a callable type (submit, start, run, signal, job, jobs, suspend,resume, etc).
+ Each action type is a callable type (Map-Reduce, Pig, SSH, FS, sub-workflow, etc).
+ All commands that use action executors (action-start, action-end, action-kill and action-check) use
+ the action type as the callable type.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.coord.normal.default.timeout
+ </name>
+ <value>120</value>
+ <description>Default timeout for a coordinator action input check (in minutes) for normal job.
+ -1 means infinite timeout
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.db.schema.name</name>
+ <value>oozie</value>
+ <description>
+ Oozie DataBase Name
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.JPAService.create.db.schema</name>
+ <value>true</value>
+ <description>
+ Creates Oozie DB.
+
+ If set to true, it creates the DB schema if it does not exist. If the DB schema exists is a NOP.
+ If set to false, it does not create the DB schema. If the DB schema does not exist it fails start up.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.JPAService.jdbc.driver</name>
+ <value>org.apache.derby.jdbc.EmbeddedDriver</value>
+ <description>
+ JDBC driver class.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.JPAService.jdbc.url</name>
+ <value>jdbc:derby:${oozie.data.dir}/${oozie.db.schema.name}-db;create=true</value>
+ <description>
+ JDBC URL.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.JPAService.jdbc.username</name>
+ <value>sa</value>
+ <description>
+ DB user name.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.JPAService.jdbc.password</name>
+ <value></value>
+ <description>
+ DB user password.
+
+ IMPORTANT: if password is emtpy leave a 1 space string, the service trims the value,
+ if empty Configuration assumes it is NULL.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.JPAService.pool.max.active.conn</name>
+ <value>10</value>
+ <description>
+ Max number of connections.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.HadoopAccessorService.kerberos.enabled</name>
+ <value>false</value>
+ <description>
+ Indicates if Oozie is configured to use Kerberos.
+ </description>
+ </property>
+
+ <property>
+ <name>local.realm</name>
+ <value>LOCALHOST</value>
+ <description>
+ Kerberos Realm used by Oozie and Hadoop. Using 'local.realm' to be aligned with Hadoop configuration
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.HadoopAccessorService.keytab.file</name>
+ <value>${user.home}/oozie.keytab</value>
+ <description>
+ Location of the Oozie user keytab file.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.HadoopAccessorService.kerberos.principal</name>
+ <value>${user.name}/localhost@${local.realm}</value>
+ <description>
+ Kerberos principal for Oozie service.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.HadoopAccessorService.jobTracker.whitelist</name>
+ <value></value>
+ <description>
+ Whitelisted job tracker for Oozie service.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.HadoopAccessorService.nameNode.whitelist</name>
+ <value></value>
+ <description>
+ Whitelisted job tracker for Oozie service.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.HadoopAccessorService.hadoop.configurations</name>
+ <value>*=hadoop-conf</value>
+ <description>
+ Comma separated AUTHORITY=HADOOP_CONF_DIR, where AUTHORITY is the HOST:PORT of
+ the Hadoop service (JobTracker, HDFS). The wildcard '*' configuration is
+ used when there is no exact match for an authority. The HADOOP_CONF_DIR contains
+ the relevant Hadoop *-site.xml files. If the path is relative is looked within
+ the Oozie configuration directory; though the path can be absolute (i.e. to point
+ to Hadoop client conf/ directories in the local filesystem.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.WorkflowAppService.system.libpath</name>
+ <value>/user/${user.name}/share/lib</value>
+ <description>
+ System library path to use for workflow applications.
+ This path is added to workflow application if their job properties sets
+ the property 'oozie.use.system.libpath' to true.
+ </description>
+ </property>
+
+ <property>
+ <name>use.system.libpath.for.mapreduce.and.pig.jobs</name>
+ <value>false</value>
+ <description>
+ If set to true, submissions of MapReduce and Pig jobs will include
+ automatically the system library path, thus not requiring users to
+ specify where the Pig JAR files are. Instead, the ones from the system
+ library path are used.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.authentication.type</name>
+ <value>simple</value>
+ <description>
+ Defines authentication used for Oozie HTTP endpoint.
+ Supported values are: simple | kerberos | #AUTHENTICATION_HANDLER_CLASSNAME#
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.authentication.token.validity</name>
+ <value>36000</value>
+ <description>
+ Indicates how long (in seconds) an authentication token is valid before it has
+ to be renewed.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.authentication.signature.secret</name>
+ <value>oozie</value>
+ <description>
+ The signature secret for signing the authentication tokens.
+ If not set a random secret is generated at startup time.
+ In order to authentiation to work correctly across multiple hosts
+ the secret must be the same across al the hosts.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.authentication.cookie.domain</name>
+ <value></value>
+ <description>
+ The domain to use for the HTTP cookie that stores the authentication token.
+ In order to authentiation to work correctly across multiple hosts
+ the domain must be correctly set.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.authentication.simple.anonymous.allowed</name>
+ <value>true</value>
+ <description>
+ Indicates if anonymous requests are allowed.
+ This setting is meaningful only when using 'simple' authentication.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.authentication.kerberos.principal</name>
+ <value>HTTP/localhost@${local.realm}</value>
+ <description>
+ Indicates the Kerberos principal to be used for HTTP endpoint.
+ The principal MUST start with 'HTTP/' as per Kerberos HTTP SPNEGO specification.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.authentication.kerberos.keytab</name>
+ <value>${oozie.service.HadoopAccessorService.keytab.file}</value>
+ <description>
+ Location of the keytab file with the credentials for the principal.
+ Referring to the same keytab file Oozie uses for its Kerberos credentials for Hadoop.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.authentication.kerberos.name.rules</name>
+ <value>DEFAULT</value>
+ <description>
+ The kerberos names rules is to resolve kerberos principal names, refer to Hadoop's
+ KerberosName for more details.
+ </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,
+ latest=org.apache.oozie.coord.CoordELFunctions#ph2_coord_latest_echo,
+ future=org.apache.oozie.coord.CoordELFunctions#ph2_coord_future_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>
+
+ <!-- Proxyuser Configuration -->
+ <property>
+ <name>oozie.service.ProxyUserService.proxyuser.${user.name}.hosts</name>
+ <value>localhost</value>
+ <description></description>
+ </property>
+ <property>
+ <name>oozie.service.ProxyUserService.proxyuser.${user.name}.groups</name>
+ <value>users</value>
+ <description></description>
+ </property>
+
+ <!--
+
+ <property>
+ <name>oozie.service.ProxyUserService.proxyuser.#USER#.hosts</name>
+ <value>*</value>
+ <description>
+ List of hosts the '#USER#' user is allowed to perform 'doAs'
+ operations.
+
+ The '#USER#' must be replaced with the username o the user who is
+ allowed to perform 'doAs' operations.
+
+ The value can be the '*' wildcard or a list of hostnames.
+
+ For multiple users copy this property and replace the user name
+ in the property name.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.ProxyUserService.proxyuser.#USER#.groups</name>
+ <value>*</value>
+ <description>
+ List of groups the '#USER#' user is allowed to impersonate users
+ from to perform 'doAs' operations.
+
+ The '#USER#' must be replaced with the username o the user who is
+ allowed to perform 'doAs' operations.
+
+ The value can be the '*' wildcard or a list of groups.
+
+ For multiple users copy this property and replace the user name
+ in the property name.
+ </description>
+ </property>
+
+ -->
+
+</configuration>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/main/java/org/apache/falcon/Main.java
----------------------------------------------------------------------
diff --git a/webapp/src/main/java/org/apache/falcon/Main.java b/webapp/src/main/java/org/apache/falcon/Main.java
index 438af8f..9a296a0 100644
--- a/webapp/src/main/java/org/apache/falcon/Main.java
+++ b/webapp/src/main/java/org/apache/falcon/Main.java
@@ -36,14 +36,23 @@ public final class Main {
public static void main(String[] args) throws Exception {
String projectVersion = BuildProperties.get().getProperty("project.version");
- EmbeddedServer server = new EmbeddedServer(15000,
- "webapp/target/falcon-webapp-" + projectVersion);
+ String appPath;
+ String dataDir;
+ if (args.length < 1) {
+ appPath = "webapp/target/falcon-webapp-" + projectVersion;
+ dataDir = "target/";
+ } else {
+ appPath = args[0];
+ dataDir = System.getProperty("activemq.base") + "/data";
+ }
+ EmbeddedServer server = new EmbeddedServer(15000, appPath);
server.start();
BrokerService broker = new BrokerService();
broker.setUseJmx(false);
- broker.setDataDirectory("target/");
+ broker.setDataDirectory(dataDir);
broker.addConnector("vm://localhost");
+ broker.addConnector("tcp://localhost:61616");
broker.start();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/webapp/src/main/resources/log4j.xml b/webapp/src/main/resources/log4j.xml
index 189d096..4183181 100644
--- a/webapp/src/main/resources/log4j.xml
+++ b/webapp/src/main/resources/log4j.xml
@@ -28,7 +28,7 @@
</appender>
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="/var/log/falcon/application.log"/>
+ <param name="File" value="${user.dir}/logs/application.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
@@ -37,7 +37,7 @@
</appender>
<appender name="AUDIT" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="/var/log/falcon/audit.log"/>
+ <param name="File" value="${user.dir}/logs/audit.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
@@ -46,7 +46,7 @@
</appender>
<appender name="TRANSACTIONLOG" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="/var/log/falcon/tranlog.log"/>
+ <param name="File" value="${user.dir}/logs/tranlog.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
@@ -55,7 +55,7 @@
</appender>
<appender name="METRIC" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="/var/log/falcon/metric.log"/>
+ <param name="File" value="${user.dir}/logs/metric.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java b/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
new file mode 100644
index 0000000..e87fa06
--- /dev/null
+++ b/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
@@ -0,0 +1,603 @@
+/**
+ * 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.falcon.cli;
+
+import junit.framework.Assert;
+import org.apache.falcon.resource.TestContext;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.util.Map;
+
+/**
+ * Test for Falcon CLI.
+ *
+ * todo: Refactor both the classes to move this methods to helper;
+ */
+public class FalconCLIIT {
+
+ private InMemoryWriter stream = new InMemoryWriter(System.out);
+ // private static final String BROKER_URL =
+ // "tcp://localhost:61616?daemon=true";
+ private static final boolean TEST_ENABLED = true;
+
+ @BeforeClass
+ public void prepare() throws Exception {
+ TestContext.prepare();
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testSubmitEntityValidCommands() throws Exception {
+
+ FalconCLI.OUT.set(stream);
+
+ String filePath;
+ TestContext context = new TestContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+
+ filePath = context.overlayParametersOverTemplate(context.CLUSTER_TEMPLATE, overlay);
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -submit -type cluster -file " + filePath));
+ context.setCluster(filePath);
+ Assert.assertEquals(stream.buffer.toString().trim(),
+ "default/Submit successful (cluster) " + context.getClusterName());
+
+ filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
+ Assert.assertEquals(0,
+ executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(
+ stream.buffer.toString().trim(),
+ "default/Submit successful (feed) "
+ + overlay.get("inputFeedName"));
+
+ filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
+ Assert.assertEquals(0,
+ executeWithURL("entity -submit -type feed -file " + filePath));
+ Assert.assertEquals(
+ stream.buffer.toString().trim(),
+ "default/Submit successful (feed) "
+ + overlay.get("outputFeedName"));
+
+ filePath = context.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -submit -type process -file " + filePath));
+ Assert.assertEquals(
+ stream.buffer.toString().trim(),
+ "default/Submit successful (process) "
+ + overlay.get("processName"));
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testListWithEmptyConfigStore() throws Exception {
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -list -type process "));
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testSubmitAndScheduleEntityValidCommands() throws Exception {
+
+ Thread.sleep(5000);
+ String filePath;
+ TestContext context = new TestContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+
+ filePath = context.overlayParametersOverTemplate(context.getClusterFileTemplate(), overlay);
+ Assert.assertEquals(-1,
+ executeWithURL("entity -submitAndSchedule -type cluster -file "
+ + filePath));
+ context.setCluster(filePath);
+
+ filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
+ Assert.assertEquals(0,
+ executeWithURL("entity -submitAndSchedule -type feed -file "
+ + filePath));
+ filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
+ Assert.assertEquals(0,
+ executeWithURL("entity -submitAndSchedule -type feed -file "
+ + filePath));
+ filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
+ Assert.assertEquals(0,
+ executeWithURL("entity -submit -type feed -file " + filePath));
+
+ filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
+ Assert.assertEquals(0,
+ executeWithURL("entity -submit -type feed -file " + filePath));
+
+ filePath = context.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
+ Assert.assertEquals(0,
+ executeWithURL("entity -submitAndSchedule -type process -file "
+ + filePath));
+
+ Thread.sleep(5000);
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testValidateValidCommands() throws Exception {
+
+ String filePath;
+ TestContext context = new TestContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+
+ filePath = context.overlayParametersOverTemplate(context.getClusterFileTemplate(), overlay);
+ Assert.assertEquals(0,
+ executeWithURL("entity -validate -type cluster -file "
+ + filePath));
+ context.setCluster(filePath);
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -submit -type cluster -file " + filePath));
+ context.setCluster(filePath);
+
+ filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
+ Assert.assertEquals(0,
+ executeWithURL("entity -validate -type feed -file " + filePath));
+ Assert.assertEquals(0,
+ executeWithURL("entity -submit -type feed -file " + filePath));
+
+ filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
+ Assert.assertEquals(0,
+ executeWithURL("entity -validate -type feed -file " + filePath));
+ Assert.assertEquals(0,
+ executeWithURL("entity -submit -type feed -file " + filePath));
+
+ filePath = context.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
+ Assert.assertEquals(0,
+ executeWithURL("entity -validate -type process -file "
+ + filePath));
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -submit -type process -file " + filePath));
+
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testDefinitionEntityValidCommands() throws Exception {
+ TestContext context = new TestContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+ submitTestFiles(context, overlay);
+
+ Assert.assertEquals(0,
+ executeWithURL("entity -definition -type cluster -name "
+ + overlay.get("cluster")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -definition -type feed -name "
+ + overlay.get("inputFeedName")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -definition -type feed -name "
+ + overlay.get("outputFeedName")));
+
+ Assert.assertEquals(0,
+ executeWithURL("entity -definition -type process -name "
+ + overlay.get("processName")));
+
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testScheduleEntityValidCommands() throws Exception {
+
+ TestContext context = new TestContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+ submitTestFiles(context, overlay);
+
+ Assert.assertEquals(-1,
+ executeWithURL("entity -schedule -type cluster -name "
+ + overlay.get("cluster")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -schedule -type feed -name "
+ + overlay.get("outputFeedName")));
+
+ Assert.assertEquals(0,
+ executeWithURL("entity -schedule -type process -name "
+ + overlay.get("processName")));
+
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testSuspendResumeStatusEntityValidCommands() throws Exception {
+
+ Thread.sleep(5000);
+ TestContext context = new TestContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+ submitTestFiles(context, overlay);
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -status -type feed -name "
+ + overlay.get("outputFeedName")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -status -type process -name "
+ + overlay.get("processName")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -schedule -type feed -name "
+ + overlay.get("outputFeedName")));
+
+ Assert.assertEquals(0,
+ executeWithURL("entity -schedule -type process -name "
+ + overlay.get("processName")));
+
+ context.waitForProcessWFtoStart();
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -suspend -type feed -name "
+ + overlay.get("outputFeedName")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -suspend -type process -name "
+ + overlay.get("processName")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -status -type feed -name "
+ + overlay.get("outputFeedName")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -status -type process -name "
+ + overlay.get("processName")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -resume -type feed -name "
+ + overlay.get("outputFeedName")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -resume -type process -name "
+ + overlay.get("processName")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -status -type feed -name "
+ + overlay.get("outputFeedName")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -status -type process -name "
+ + overlay.get("processName")));
+
+ Thread.sleep(5000);
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testSubCommandPresence() throws Exception {
+ Assert.assertEquals(-1, executeWithURL("entity -type cluster "));
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testDeleteEntityValidCommands() throws Exception {
+
+ TestContext context = new TestContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+ submitTestFiles(context, overlay);
+
+ Assert.assertEquals(
+ -1,
+ executeWithURL("entity -delete -type cluster -name "
+ + overlay.get("cluster")));
+
+ Assert.assertEquals(
+ -1,
+ executeWithURL("entity -delete -type feed -name "
+ + overlay.get("inputFeedName")));
+
+ Assert.assertEquals(
+ -1,
+ executeWithURL("entity -delete -type feed -name "
+ + overlay.get("outputFeedName")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -delete -type process -name "
+ + overlay.get("processName")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -delete -type feed -name "
+ + overlay.get("inputFeedName")));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -delete -type feed -name "
+ + overlay.get("outputFeedName")));
+
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testInvalidCLIEntitycommands() throws Exception {
+
+ TestContext context = new TestContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+ context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
+ Assert.assertEquals(-1,
+ executeWithURL("entity -submit -type feed -name " + "name"));
+
+ Assert.assertEquals(-1,
+ executeWithURL("entity -schedule -type feed -file " + "name"));
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testInstanceRunningAndStatusCommands() throws Exception {
+ TestContext context = new TestContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+ submitTestFiles(context, overlay);
+
+ Assert.assertEquals(0,
+ executeWithURL("entity -schedule -type process -name "
+ + overlay.get("processName")));
+
+ Assert.assertEquals(0,
+ executeWithURL("entity -schedule -type feed -name "
+ + overlay.get("outputFeedName")));
+ context.waitForProcessWFtoStart();
+
+ Assert.assertEquals(0,
+ executeWithURL("instance -status -type feed -name "
+ + overlay.get("outputFeedName")
+ + " -start " + START_INSTANCE));
+
+ Assert.assertEquals(0,
+ executeWithURL("instance -running -type process -name "
+ + overlay.get("processName")));
+
+ Assert.assertEquals(0,
+ executeWithURL("instance -status -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE));
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testInstanceSuspendAndResume() throws Exception {
+ Thread.sleep(5000);
+ TestContext context = new TestContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+ submitTestFiles(context, overlay);
+
+ Assert.assertEquals(0,
+ executeWithURL("entity -schedule -type process -name "
+ + overlay.get("processName")));
+
+
+ Assert.assertEquals(0,
+ executeWithURL("instance -suspend -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
+
+ Assert.assertEquals(0,
+ executeWithURL("instance -resume -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
+ Thread.sleep(5000);
+ }
+
+ private static final String START_INSTANCE = "2012-04-20T00:00Z";
+
+ @Test(enabled = TEST_ENABLED)
+ public void testInstanceKillAndRerun() throws Exception {
+ TestContext context = new TestContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+ submitTestFiles(context, overlay);
+
+ Assert.assertEquals(0,
+ executeWithURL("entity -schedule -type process -name "
+ + overlay.get("processName")));
+
+ context.waitForProcessWFtoStart();
+ Assert.assertEquals(
+ 0,
+ executeWithURL("instance -kill -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("instance -rerun -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE + " -file "
+ + createTempJobPropertiesFile()));
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testContinue() throws Exception {
+ TestContext context = new TestContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+ submitTestFiles(context, overlay);
+
+ Assert.assertEquals(0,
+ executeWithURL("entity -schedule -type process -name "
+ + overlay.get("processName")));
+
+ context.waitForProcessWFtoStart();
+ Assert.assertEquals(
+ 0,
+ executeWithURL("instance -kill -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
+
+ Assert.assertEquals(
+ 0,
+ executeWithURL("instance -continue -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE));
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testInvalidCLIInstanceCommands() throws Exception {
+ // no command
+ Assert.assertEquals(-1, executeWithURL(" -kill -type process -name "
+ + "name" + " -start 2010-01-01T01:00Z -end 2010-01-01T03:00Z"));
+
+ Assert.assertEquals(-1, executeWithURL("instance -kill " + "name"
+ + " -start 2010-01-01T01:00Z -end 2010-01-01T01:00Z"));
+
+ Assert.assertEquals(-1,
+ executeWithURL("instance -kill -type process -name " + "name"
+ + " -end 2010-01-01T03:00Z"));
+
+ Assert.assertEquals(-1,
+ executeWithURL("instance -kill -type process -name "
+ + " -start 2010-01-01T01:00Z -end 2010-01-01T03:00Z"));
+
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testFalconURL() throws Exception {
+ Assert.assertEquals(-1, new FalconCLI()
+ .run(("instance -status -type process -name " + "processName"
+ + " -start 2010-01-01T01:00Z -end 2010-01-01T03:00Z")
+ .split("\\s")));
+
+ Assert.assertEquals(-1, new FalconCLI()
+ .run(("instance -status -type process -name "
+ + "processName -url http://unknownhost:1234/"
+ + " -start 2010-01-01T01:00Z -end 2010-01-01T03:00Z")
+ .split("\\s")));
+
+
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testClientProperties() throws Exception {
+ TestContext context = new TestContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+ submitTestFiles(context, overlay);
+
+ Assert.assertEquals(
+ 0,
+ new FalconCLI().run(("entity -schedule -type feed -name "
+ + overlay.get("outputFeedName") + " -url "
+ + TestContext.BASE_URL).split("\\s+")));
+
+ Assert.assertEquals(0,
+ new FalconCLI().run(("entity -schedule -type process -name "
+ + overlay.get("processName")+ " -url "
+ + TestContext.BASE_URL).split("\\s+")));
+
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testGetVersion() throws Exception {
+ Assert.assertEquals(0,
+ new FalconCLI().run("admin -version".split("\\s")));
+
+ Assert.assertEquals(0,
+ new FalconCLI().run("admin -stack".split("\\s")));
+ }
+
+ @Test(enabled = TEST_ENABLED)
+ public void testInstanceGetLogs() throws Exception {
+ TestContext context = new TestContext();
+ Map<String, String> overlay = context.getUniqueOverlay();
+ submitTestFiles(context, overlay);
+
+ Assert.assertEquals(0,
+ executeWithURL("entity -schedule -type process -name "
+ + overlay.get("processName")));
+
+ Assert.assertEquals(0,
+ executeWithURL("instance -logs -type process -name "
+ + overlay.get("processName")
+ + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
+
+ }
+
+
+ private int executeWithURL(String command) throws Exception {
+ return new FalconCLI()
+ .run((command + " -url " + TestContext.BASE_URL).split("\\s+"));
+ }
+
+ private String createTempJobPropertiesFile() throws IOException {
+ File target = new File("webapp/target");
+ if (!target.exists()) {
+ target = new File("target");
+ }
+ File tmpFile = File.createTempFile("job", ".properties", target);
+ OutputStream out = new FileOutputStream(tmpFile);
+ out.write("oozie.wf.rerun.failnodes=true\n".getBytes());
+ out.close();
+ return tmpFile.getAbsolutePath();
+ }
+
+ public void submitTestFiles(TestContext context, Map<String, String> overlay) throws Exception {
+
+ String filePath = context.overlayParametersOverTemplate(context.getClusterFileTemplate(),
+ overlay);
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -submit -type cluster -file " + filePath));
+ context.setCluster(filePath);
+
+ filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
+ Assert.assertEquals(0,
+ executeWithURL("entity -submit -type feed -file " + filePath));
+
+ filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
+ Assert.assertEquals(0,
+ executeWithURL("entity -submit -type feed -file " + filePath));
+
+ filePath = context.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
+ Assert.assertEquals(
+ 0,
+ executeWithURL("entity -submit -type process -file " + filePath));
+ }
+
+ private static class InMemoryWriter extends PrintStream {
+
+ private StringBuffer buffer = new StringBuffer();
+
+ public InMemoryWriter(OutputStream out) {
+ super(out);
+ }
+
+ @Override
+ public void println(String x) {
+ clear();
+ buffer.append(x);
+ super.println(x);
+ }
+
+ public String getBuffer() {
+ return buffer.toString();
+ }
+
+ public void clear() {
+ buffer.delete(0, buffer.length());
+ }
+ }
+}
[7/8] FALCON-1 Create packaging and scripts to install and try Apache
Falcon. Contributed by Srikanth Sundarrajan
Posted by ve...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/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
new file mode 100644
index 0000000..b1e5e4f
--- /dev/null
+++ b/oozie-el-extensions/src/test/java/org/apache/oozie/extensions/TestOozieELExtensions.java
@@ -0,0 +1,278 @@
+/**
+ * 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.extensions;
+
+import java.io.File;
+
+import org.apache.oozie.client.CoordinatorJob.Timeunit;
+import org.apache.oozie.client.OozieClient;
+import org.apache.oozie.coord.CoordELFunctions;
+import org.apache.oozie.coord.SyncCoordAction;
+import org.apache.oozie.coord.SyncCoordDataset;
+import org.apache.oozie.coord.TimeUnit;
+import org.apache.oozie.service.ConfigurationService;
+import org.apache.oozie.service.ELService;
+import org.apache.oozie.service.Services;
+import org.apache.oozie.util.DateUtils;
+import org.apache.oozie.util.ELEvaluator;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * Test class for Falcon - Oozie el extensions.
+ */
+public class TestOozieELExtensions {
+
+ private ELEvaluator instEval;
+ private ELEvaluator createEval;
+
+ @BeforeClass
+ public void setUp() throws Exception {
+ String curPath = new File(".").getAbsolutePath();
+ System.setProperty(Services.OOZIE_HOME_DIR, curPath);
+ String confPath = new File(getClass().getResource("/oozie-site.xml").getFile()).getParent();
+ System.setProperty(ConfigurationService.OOZIE_CONFIG_DIR, confPath);
+ Services.setOozieHome();
+
+ Services services = new Services();
+ services.getConf().set("oozie.services", "org.apache.oozie.service.ELService");
+ services.init();
+
+ instEval = Services.get().get(ELService.class).createEvaluator("coord-action-create-inst");
+ instEval.setVariable(OozieClient.USER_NAME, "test_user");
+ instEval.setVariable(OozieClient.GROUP_NAME, "test_group");
+ createEval = Services.get().get(ELService.class).createEvaluator("coord-action-create");
+ createEval.setVariable(OozieClient.USER_NAME, "test_user");
+ createEval.setVariable(OozieClient.GROUP_NAME, "test_group");
+ }
+
+ @Test
+ public void testActionExpressions() throws Exception {
+ ELEvaluator eval = createActionStartEvaluator();
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${now(0, 0)}"), "2009-09-02T10:00Z");
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${now(1, 0)}"), "2009-09-02T11:00Z");
+
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${today(0, 0)}"), "2009-09-02T00:00Z");
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${today(-1, 0)}"), "2009-09-01T23:00Z");
+
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${yesterday(0, 0)}"), "2009-09-01T00:00Z");
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${yesterday(0, 60)}"), "2009-09-01T01:00Z");
+
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${currentMonth(0, 0, 0)}"), "2009-09-01T00:00Z");
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${currentMonth(-1, 0, 0)}"), "2009-08-31T00:00Z");
+
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${lastMonth(0, 0, 0)}"), "2009-08-01T00:00Z");
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${lastMonth(0, 1, 0)}"), "2009-08-01T01:00Z");
+
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${currentYear(0, 0, 0, 0)}"), "2009-01-01T00:00Z");
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${currentYear(0, -1, 0, 0)}"), "2008-12-31T00:00Z");
+
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${lastYear(0, 0, 0, 0)}"), "2008-01-01T00:00Z");
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${lastYear(1, 0, 0, 0)}"), "2008-02-01T00:00Z");
+
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${instanceTime()}"), "2009-09-02T10:00Z");
+
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${dateOffset(instanceTime(), 1, 'DAY')}"),
+ "2009-09-03T10:00Z");
+
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${formatTime(instanceTime(), 'yyyy-MMM-dd')}"),
+ "2009-Sep-02");
+ }
+
+ @Test
+ public void testUser() throws Exception {
+ ELEvaluator eval = Services.get().get(ELService.class).createEvaluator("coord-action-start");
+ eval.setVariable(OozieClient.USER_NAME, "test");
+ Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${user()}"), "test");
+ }
+
+ @Test
+ public void testDataIn() throws Exception {
+ ELEvaluator eval = createActionStartEvaluator();
+ String uris = "hdfs://localhost:8020/clicks/2009/09/02/10,hdfs://localhost:8020/clicks/2009/09/02/09";
+ eval.setVariable(".datain.clicks", uris);
+ String expuris =
+ "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')}"));
+ }
+
+ @Test
+ public void testCurrentMonth() throws Exception {
+ initForCurrentThread();
+
+ String expr = "${currentMonth(0,0,0)}";
+ String instResult = CoordELFunctions.evalAndWrap(instEval, expr);
+ Assert.assertEquals("2009-09-01T00:00Z", CoordELFunctions.evalAndWrap(createEval, getELExpression(instResult)));
+
+ expr = "${currentMonth(2,-1,0)}";
+ instResult = CoordELFunctions.evalAndWrap(instEval, expr);
+ Assert.assertEquals("2009-09-02T23:00Z", CoordELFunctions.evalAndWrap(createEval, getELExpression(instResult)));
+ }
+
+ private String getELExpression(String expr) {
+ if (expr != null) {
+ return "${" + expr + "}";
+ }
+ return null;
+ }
+
+ @Test
+ public void testToday() throws Exception {
+ initForCurrentThread();
+
+ String expr = "${today(0,0)}";
+ String instResult = CoordELFunctions.evalAndWrap(instEval, expr);
+ Assert.assertEquals("2009-09-02T00:00Z", CoordELFunctions.evalAndWrap(createEval, getELExpression(instResult)));
+
+ expr = "${today(1,-20)}";
+ instResult = CoordELFunctions.evalAndWrap(instEval, expr);
+ Assert.assertEquals("2009-09-02T00:00Z", CoordELFunctions.evalAndWrap(createEval, getELExpression(instResult)));
+ }
+
+ @Test
+ public void testNow() throws Exception {
+ initForCurrentThread();
+
+ String expr = "${now(0,0)}";
+ String instResult = CoordELFunctions.evalAndWrap(instEval, expr);
+ Assert.assertEquals("2009-09-02T10:00Z", CoordELFunctions.evalAndWrap(createEval, getELExpression(instResult)));
+
+ expr = "${now(2,-10)}";
+ instResult = CoordELFunctions.evalAndWrap(instEval, expr);
+ Assert.assertEquals("2009-09-02T12:00Z", CoordELFunctions.evalAndWrap(createEval, getELExpression(instResult)));
+ }
+
+ @Test
+ public void testYesterday() throws Exception {
+ initForCurrentThread();
+
+ String expr = "${yesterday(0,0)}";
+ String instResult = CoordELFunctions.evalAndWrap(instEval, expr);
+ Assert.assertEquals("2009-09-01T00:00Z", CoordELFunctions.evalAndWrap(createEval, getELExpression(instResult)));
+
+ expr = "${yesterday(1,10)}";
+ instResult = CoordELFunctions.evalAndWrap(instEval, expr);
+ Assert.assertEquals("2009-09-01T01:00Z", CoordELFunctions.evalAndWrap(createEval, getELExpression(instResult)));
+ }
+
+ @Test
+ public void testLastMonth() throws Exception {
+ initForCurrentThread();
+
+ String expr = "${lastMonth(0,0,0)}";
+ String instResult = CoordELFunctions.evalAndWrap(instEval, expr);
+ Assert.assertEquals("2009-08-01T00:00Z", CoordELFunctions.evalAndWrap(createEval, getELExpression(instResult)));
+
+ expr = "${lastMonth(1,1,10)}";
+ instResult = CoordELFunctions.evalAndWrap(instEval, expr);
+ Assert.assertEquals("2009-08-02T01:00Z", CoordELFunctions.evalAndWrap(createEval, getELExpression(instResult)));
+ }
+
+ @Test
+ public void testCurrentYear() throws Exception {
+ initForCurrentThread();
+
+ String expr = "${currentYear(0,0,0,0)}";
+ String instResult = CoordELFunctions.evalAndWrap(instEval, expr);
+ Assert.assertEquals("2009-01-01T00:00Z", CoordELFunctions.evalAndWrap(createEval, getELExpression(instResult)));
+
+ expr = "${currentYear(1,0,1,0)}";
+ instResult = CoordELFunctions.evalAndWrap(instEval, expr);
+ Assert.assertEquals("2009-02-01T01:00Z", CoordELFunctions.evalAndWrap(createEval, getELExpression(instResult)));
+ }
+
+ @Test
+ public void testLastYear() throws Exception {
+ initForCurrentThread();
+
+ String expr = "${lastYear(0,0,0,0)}";
+ String instResult = CoordELFunctions.evalAndWrap(instEval, expr);
+ Assert.assertEquals("2008-01-01T00:00Z", CoordELFunctions.evalAndWrap(createEval, getELExpression(instResult)));
+
+ expr = "${lastYear(1,0,1,0)}";
+ instResult = CoordELFunctions.evalAndWrap(instEval, expr);
+ Assert.assertEquals("2008-02-01T01:00Z", CoordELFunctions.evalAndWrap(createEval, getELExpression(instResult)));
+ }
+
+ @Test
+ public void testNominalGreaterThanInitial() throws Exception {
+ initForCurrentThread("2009-08-30T010:00Z", "2009-09-02T11:30Z", "2009-09-02T10:30Z");
+ String expr = "${currentYear(0,0,0,0)}";
+ Assert.assertEquals("", CoordELFunctions.evalAndWrap(instEval, expr));
+ }
+
+ 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;
+ }
+
+ private SyncCoordAction createCoordAction(String actualTime, String nominalTime) throws Exception {
+ SyncCoordAction appInst;
+ appInst = new SyncCoordAction();
+ appInst.setActualTime(DateUtils.parseDateUTC(actualTime));
+ appInst.setNominalTime(DateUtils.parseDateUTC(nominalTime));
+ appInst.setTimeZone(DateUtils.getTimeZone("UTC"));
+ appInst.setActionId("00000-oozie-C@1");
+ 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);
+ }
+
+ private ELEvaluator createActionStartEvaluator() throws Exception {
+ SyncCoordAction appInst = createCoordAction("2009-09-02T11:30Z", "2009-09-02T10:00Z");
+ ELEvaluator eval = Services.get().get(ELService.class).createEvaluator("coord-action-start");
+ CoordELFunctions.configureEvaluator(eval, null, appInst);
+ return eval;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/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
new file mode 100644
index 0000000..9e8ba9b
--- /dev/null
+++ b/oozie-el-extensions/src/test/resources/oozie-site.xml
@@ -0,0 +1,363 @@
+<?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. -->
+<configuration>
+
+ <!-- Refer to the oozie-default.xml file for the complete list of Oozie configuration properties and their default values. -->
+
+ <!-- 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> -->
+
+ <property>
+ <name>oozie.system.id</name>
+ <value>oozie-${user.name}</value>
+ <description>
+ The Oozie system ID.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.systemmode</name>
+ <value>NORMAL</value>
+ <description>
+ System mode for Oozie at startup.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.AuthorizationService.security.enabled</name>
+ <value>false</value>
+ <description>
+ Specifies whether security (user name/admin role) is enabled or not.
+ If disabled any user can manage Oozie system and manage any job.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.PurgeService.older.than</name>
+ <value>30</value>
+ <description>
+ Jobs older than this value, in days, will be purged by the PurgeService.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.PurgeService.purge.interval</name>
+ <value>3600</value>
+ <description>
+ Interval at which the purge service will run, in seconds.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.CallableQueueService.queue.size</name>
+ <value>1000</value>
+ <description>Max callable queue size</description>
+ </property>
+
+ <property>
+ <name>oozie.service.CallableQueueService.threads</name>
+ <value>10</value>
+ <description>Number of threads used for executing callables</description>
+ </property>
+
+ <property>
+ <name>oozie.service.CallableQueueService.callable.concurrency</name>
+ <value>3</value>
+ <description>
+ Maximum concurrency for a given callable type.
+ Each command is a callable type (submit, start, run, signal, job, jobs, suspend,resume, etc).
+ Each action type is
+ a callable type (Map-Reduce, Pig, SSH, FS, sub-workflow, etc).
+ All commands that use action executors (action-start, action-end, action-kill and action-check) use
+ the
+ action type as the callable type.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.coord.normal.default.timeout
+ </name>
+ <value>120</value>
+ <description>Default timeout for a coordinator action input check (in minutes) for normal job.
+ -1 means infinite timeout
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.db.schema.name</name>
+ <value>oozie</value>
+ <description>
+ Oozie DataBase Name
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.StoreService.create.db.schema</name>
+ <value>true</value>
+ <description>
+ Creates Oozie DB.
+
+ If set to true, it creates the DB schema if it does not exist. If the DB schema exists is a NOP.
+ If set to false, it does not create the DB
+ schema. If the DB schema does not exist it fails start up.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.StoreService.jdbc.driver</name>
+ <value>org.apache.derby.jdbc.EmbeddedDriver</value>
+ <description>
+ JDBC driver class.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.StoreService.jdbc.url</name>
+ <value>jdbc:derby:${oozie.data.dir}/${oozie.db.schema.name}-db;create=true</value>
+ <description>
+ JDBC URL.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.StoreService.jdbc.username</name>
+ <value>sa</value>
+ <description>
+ DB user name.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.StoreService.jdbc.password</name>
+ <value>
+ </value>
+ <description>
+ DB user password.
+
+ IMPORTANT: if password is emtpy leave a 1 space string, the service trims the value,
+ if empty Configuration assumes it is NULL.
+
+ IMPORTANT: if
+ the StoreServicePasswordService is active, it will reset this value with the value given in
+ the console.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.StoreService.pool.max.active.conn</name>
+ <value>10</value>
+ <description>
+ Max number of connections.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.HadoopAccessorService.kerberos.enabled</name>
+ <value>false</value>
+ <description>
+ Indicates if Oozie is configured to use Kerberos.
+ </description>
+ </property>
+
+ <property>
+ <name>local.realm</name>
+ <value>LOCALHOST</value>
+ <description>
+ Kerberos Realm used by Oozie and Hadoop. Using 'local.realm' to be aligned with Hadoop configuration
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.HadoopAccessorService.keytab.file</name>
+ <value>${user.home}/oozie.keytab</value>
+ <description>
+ Location of the Oozie user keytab file.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.HadoopAccessorService.kerberos.principal</name>
+ <value>${user.name}/localhost@${local.realm}</value>
+ <description>
+ Kerberos principal for Oozie service.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.HadoopAccessorService.jobTracker.whitelist</name>
+ <value>
+ </value>
+ <description>
+ Whitelisted job tracker for Oozie service.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.HadoopAccessorService.nameNode.whitelist</name>
+ <value>
+ </value>
+ <description>
+ Whitelisted job tracker for Oozie service.
+ </description>
+ </property>
+
+ <property>
+ <name>oozie.service.WorkflowAppService.system.libpath</name>
+ <value>/user/${user.name}/share/lib</value>
+ <description>
+ System library path to use for workflow applications.
+ This path is added to workflow application if their job properties sets
+ the property
+ 'oozie.use.system.libpath' to true.
+ </description>
+ </property>
+
+ <property>
+ <name>use.system.libpath.for.mapreduce.and.pig.jobs</name>
+ <value>false</value>
+ <description>
+ If set to true, submissions of MapReduce and Pig jobs will include
+ automatically the system library path, thus not requiring users to
+ specify where the Pig JAR
+ files are. Instead, the ones from the system
+ library path are used.
+ </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/61417357/oozie/pom.xml
----------------------------------------------------------------------
diff --git a/oozie/pom.xml b/oozie/pom.xml
index f813ff0..0497c8b 100644
--- a/oozie/pom.xml
+++ b/oozie/pom.xml
@@ -34,6 +34,11 @@
<dependencies>
<dependency>
<groupId>org.apache.falcon</groupId>
+ <artifactId>falcon-oozie-el-extension</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.falcon</groupId>
<artifactId>falcon-messaging</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5b59f03..854210b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -100,6 +100,7 @@
<hadoop-distcp.version>0.3</hadoop-distcp.version>
<jetty.version>6.1.26</jetty.version>
<internal.maven.repo>file:///tmp/falcontemprepo</internal.maven.repo>
+ <skipCheck>false</skipCheck>
</properties>
<profiles>
@@ -110,9 +111,11 @@
<module>metrics</module>
<module>common</module>
<module>test-util</module>
+ <module>hadoop-webapp</module>
<module>feed</module>
<module>messaging</module>
<module>process</module>
+ <module>oozie-el-extensions</module>
<module>oozie</module>
<module>acquisition</module>
<module>replication</module>
@@ -131,9 +134,11 @@
<module>client</module>
<module>common</module>
<module>test-util</module>
+ <module>hadoop-webapp</module>
<module>feed</module>
<module>messaging</module>
<module>process</module>
+ <module>oozie-el-extensions</module>
<module>oozie</module>
<module>acquisition</module>
<module>replication</module>
@@ -325,13 +330,13 @@
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
- <version>1.9</version>
+ <version>1.8</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
- <version>1.9</version>
+ <version>1.8</version>
</dependency>
<dependency>
@@ -393,7 +398,7 @@
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
- <version>1.9</version>
+ <version>1.8</version>
</dependency>
<dependency>
@@ -472,6 +477,19 @@
</dependency>
<dependency>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-core</artifactId>
+ <version>${oozie.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-webapp</artifactId>
+ <version>${oozie.version}</version>
+ <type>war</type>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>${hadoop.version}</version>
@@ -532,6 +550,12 @@
<dependency>
<groupId>org.apache.falcon</groupId>
+ <artifactId>falcon-oozie-el-extension</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.falcon</groupId>
<artifactId>falcon-feed</artifactId>
<version>${project.version}</version>
</dependency>
@@ -569,9 +593,16 @@
</dependency>
<dependency>
- <groupId>net.sourceforge.findbugs</groupId>
- <artifactId>annotations</artifactId>
- <version>1.3.2</version>
+ <groupId>org.apache.falcon</groupId>
+ <artifactId>falcon-hadoop-webapp</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.findbugs</groupId>
+ <artifactId>annotations</artifactId>
+ <version>1.3.2</version>
</dependency>
</dependencies>
</dependencyManagement>
@@ -684,10 +715,12 @@
<doUpdate>false</doUpdate>
</configuration>
</plugin>
+
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@@ -696,32 +729,45 @@
<target>1.6</target>
</configuration>
</plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
- <phase>deploy</phase>
+ <phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
- <phase>deploy</phase>
+ <phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assemblies/package.xml</descriptor>
+ </descriptors>
+ <finalName>falcon-${project.version}</finalName>
+ </configuration>
+ </plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@@ -729,6 +775,7 @@
<argLine>-Djava.security.krb5.realm= -Djava.security.krb5.kdc=</argLine>
</configuration>
</plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
@@ -761,6 +808,8 @@
<exclude>**/activemq-data/**</exclude>
<exclude>**/build/**</exclude>
<exclude>*.patch</exclude>
+ <exclude>derby.log</exclude>
+ <exclude>**/logs/**</exclude>
</excludes>
</configuration>
<executions>
@@ -795,6 +844,7 @@
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<configLocation>falcon/checkstyle.xml</configLocation>
<failOnViolation>true</failOnViolation>
+ <skip>${skipCheck}</skip>
</configuration>
</execution>
</executions>
@@ -807,6 +857,7 @@
<xmlOutput>true</xmlOutput>
<excludeFilterFile>${basedir}/../build-tools/src/main/resources/falcon/findbugs-exclude.xml</excludeFilterFile>
<failOnError>true</failOnError>
+ <skip>${skipCheck}</skip>
</configuration>
<executions>
<execution>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/prism/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/prism/src/main/resources/log4j.xml b/prism/src/main/resources/log4j.xml
index ea08108..ef53274 100644
--- a/prism/src/main/resources/log4j.xml
+++ b/prism/src/main/resources/log4j.xml
@@ -28,7 +28,7 @@
</appender>
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="/var/log/falcon/prism.log"/>
+ <param name="File" value="${user.dir}/logs/prism.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
@@ -37,7 +37,7 @@
</appender>
<appender name="AUDIT" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="/var/log/falcon/prism-audit.log"/>
+ <param name="File" value="${user.dir}/logs/prism-audit.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
@@ -46,7 +46,7 @@
</appender>
<appender name="TRANSACTIONLOG" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="/var/log/falcon/prsim-tranlog.log"/>
+ <param name="File" value="${user.dir}/logs/prsim-tranlog.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
@@ -55,7 +55,7 @@
</appender>
<appender name="METRIC" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="/var/log/falcon/prism-metric.log"/>
+ <param name="File" value="${user.dir}/logs/prism-metric.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/process/src/test/java/org/apache/falcon/converter/OozieProcessMapperTest.java
----------------------------------------------------------------------
diff --git a/process/src/test/java/org/apache/falcon/converter/OozieProcessMapperTest.java b/process/src/test/java/org/apache/falcon/converter/OozieProcessMapperTest.java
index 9ed7baf..fe3cc58 100644
--- a/process/src/test/java/org/apache/falcon/converter/OozieProcessMapperTest.java
+++ b/process/src/test/java/org/apache/falcon/converter/OozieProcessMapperTest.java
@@ -41,6 +41,7 @@ import org.apache.falcon.oozie.coordinator.SYNCDATASET;
import org.apache.falcon.oozie.workflow.ACTION;
import org.apache.falcon.oozie.workflow.DECISION;
import org.apache.falcon.oozie.workflow.WORKFLOWAPP;
+import org.apache.falcon.util.StartupProperties;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
@@ -57,6 +58,7 @@ import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
+import java.io.File;
import java.io.InputStreamReader;
import static org.testng.Assert.assertEquals;
@@ -154,6 +156,10 @@ public class OozieProcessMapperTest extends AbstractTestBase {
@Test
public void testBundle() throws Exception {
+ String path = StartupProperties.get().getProperty("system.lib.location");
+ if (!new File(path).exists()) {
+ Assert.assertTrue(new File(path).mkdirs());
+ }
Process process = ConfigurationStore.get().get(EntityType.PROCESS, "clicksummary");
Cluster cluster = ConfigurationStore.get().get(EntityType.CLUSTER, "corp");
OozieProcessMapper mapper = new OozieProcessMapper(process);
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/src/bin/falcon
----------------------------------------------------------------------
diff --git a/src/bin/falcon b/src/bin/falcon
new file mode 100644
index 0000000..7c1bc63
--- /dev/null
+++ b/src/bin/falcon
@@ -0,0 +1,50 @@
+#!/bin/bash
+#
+# Licensed 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. See accompanying LICENSE file.
+#
+
+# resolve links - $0 may be a softlink
+PRG="${0}"
+
+while [ -h "${PRG}" ]; do
+ ls=`ls -ld "${PRG}"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "${PRG}"`/"$link"
+ fi
+done
+
+BASEDIR=`dirname ${PRG}`
+BASEDIR=`cd ${BASEDIR}/..;pwd`
+
+FALCONCPPATH="${BASEDIR}/conf:"
+for i in "${BASEDIR}/client/lib/"*.jar; do
+ FALCONCPPATH="${FALCONCPPATH}:$i"
+done
+
+
+if test -z ${JAVA_HOME}
+then
+ JAVA_BIN=java
+else
+ JAVA_BIN=${JAVA_HOME}/bin/java
+fi
+
+JAVA_PROPERTIES=""
+while [[ ${1} =~ ^\-D ]]; do
+ JAVA_PROPERTIES="${JAVA_PROPERTIES} ${1}"
+ shift
+done
+${JAVA_BIN} ${JAVA_PROPERTIES} -cp ${FALCONCPPATH} org.apache.falcon.cli.FalconCLI "${@}"
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/src/bin/falcon-start
----------------------------------------------------------------------
diff --git a/src/bin/falcon-start b/src/bin/falcon-start
new file mode 100644
index 0000000..df79200
--- /dev/null
+++ b/src/bin/falcon-start
@@ -0,0 +1,55 @@
+#!/bin/bash
+#
+# Licensed 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. See accompanying LICENSE file.
+#
+
+# resolve links - $0 may be a softlink
+PRG="${0}"
+
+while [ -h "${PRG}" ]; do
+ ls=`ls -ld "${PRG}"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "${PRG}"`/"$link"
+ fi
+done
+
+BASEDIR=`dirname ${PRG}`
+BASEDIR=`cd ${BASEDIR}/..;pwd`
+
+FALCONCPPATH="${BASEDIR}/conf:${BASEDIR}/server/webapp/classes:"
+for i in "${BASEDIR}/server/webapp/lib/"*.jar; do
+ FALCONCPPATH="${FALCONCPPATH}:$i"
+done
+
+mkdir -p ${BASEDIR}/logs
+
+if test -z ${JAVA_HOME}
+then
+ JAVA_BIN=java
+else
+ JAVA_BIN=${JAVA_HOME}/bin/java
+fi
+
+pushd ${BASEDIR} > /dev/null
+JAVA_PROPERTIES="-Dactivemq.base=${BASEDIR}/logs"
+while [[ ${1} =~ ^\-D ]]; do
+ JAVA_PROPERTIES="${JAVA_PROPERTIES} ${1}"
+ shift
+done
+TIME=`date +%Y%m%d%H%M%s`
+nohup ${JAVA_BIN} ${JAVA_PROPERTIES} -cp ${FALCONCPPATH} org.apache.falcon.Main ${BASEDIR}/server/webapp/falcon.war 2> ${BASEDIR}/logs/falcon.out.$TIME &
+echo $! > ${BASEDIR}/logs/falcon.pid
+popd > /dev/null
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/src/bin/falcon-stop
----------------------------------------------------------------------
diff --git a/src/bin/falcon-stop b/src/bin/falcon-stop
new file mode 100644
index 0000000..1e6e6b8
--- /dev/null
+++ b/src/bin/falcon-stop
@@ -0,0 +1,37 @@
+#!/bin/bash
+#
+# Licensed 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. See accompanying LICENSE file.
+#
+
+# resolve links - $0 may be a softlink
+PRG="${0}"
+
+while [ -h "${PRG}" ]; do
+ ls=`ls -ld "${PRG}"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "${PRG}"`/"$link"
+ fi
+done
+
+BASEDIR=`dirname ${PRG}`
+BASEDIR=`cd ${BASEDIR}/..;pwd`
+
+if [ -f ${BASEDIR}/logs/falcon.pid ]
+then
+ kill -15 `cat ${BASEDIR}/logs/falcon.pid`
+else
+ echo "pid file ${BASEDIR}/logs/falcon.pid not present"
+fi
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/src/bin/package.sh
----------------------------------------------------------------------
diff --git a/src/bin/package.sh b/src/bin/package.sh
new file mode 100644
index 0000000..caad0af
--- /dev/null
+++ b/src/bin/package.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+# 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.
+
+if [ "${1}"x == "x" ]
+then
+ echo "Usage ${0} <<hadoop-version>>"
+ exit 1
+fi
+
+# resolve links - $0 may be a softlink
+PRG="${0}"
+
+while [ -h "${PRG}" ]; do
+ ls=`ls -ld "${PRG}"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "${PRG}"`/"$link"
+ fi
+done
+
+BASEDIR=`dirname ${PRG}`
+BASEDIR=`cd ${BASEDIR};pwd`
+
+FALCON_SRC=${BASEDIR}/../..
+PACKAGE_HOME=${FALCON_SRC}/target/package
+
+pushd ${FALCON_SRC}
+echo "Building falcon & falcon-oozie-el-extensions ....."
+mvn clean assembly:assembly -Dhadoop.version=${1} -DskipTests -DskipCheck=true > /dev/null
+popd
+
+mkdir -p ${PACKAGE_HOME}
+pushd ${PACKAGE_HOME}
+rm -rf oozie-3.2.0-incubating*
+echo "Getting oozie release tar ball of version 3.2.0-incubating ..."
+curl "http://www.gtlib.gatech.edu/pub/apache/oozie/3.2.0-incubating/oozie-3.2.0-incubating.tar.gz" -o oozie-3.2.0-incubating.tgz
+tar -xzvf oozie-3.2.0-incubating.tgz 2> /dev/null
+rm oozie-3.2.0-incubating.tgz
+cd oozie-3.2.0-incubating
+echo "Patching oozie with falcon extensions and marking version as 3.2.2 (custom) ..."
+patch -p0 < ${FALCON_SRC}/oozie-3.2.0-incubating-el.patch
+patch -p0 < ${FALCON_SRC}/oozie-bundle-el-extension.patch
+echo "Building oozie & creating tar ball ..."
+bin/mkdistro.sh -DskipTests > /dev/null
+
+echo "Falcon pacakge is available in ${FALCON_SRC}/target/falcon-<<version>>/falcon-<<version>>.tar.gz"
+echo "Oozie pacakge is available in ${FALCON_SRC}/target/package/oozie-3.2.0-incubating/distro/target/oozie-3.2.2-distro.tar.gz"
+popd
+
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/src/conf/client.properties
----------------------------------------------------------------------
diff --git a/src/conf/client.properties b/src/conf/client.properties
new file mode 100644
index 0000000..9ff0631
--- /dev/null
+++ b/src/conf/client.properties
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+
+####################################################
+#### This is used for falcon packaging only. ####
+####################################################
+
+falcon.url=http://localhost:15000/
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/src/conf/log4j.xml
----------------------------------------------------------------------
diff --git a/src/conf/log4j.xml b/src/conf/log4j.xml
new file mode 100644
index 0000000..738beb5
--- /dev/null
+++ b/src/conf/log4j.xml
@@ -0,0 +1,89 @@
+<?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.
+ -->
+
+<!--
+ This is used for falcon packaging only.
+ -->
+
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="${user.dir}/logs/application.log"/>
+ <param name="Append" value="true"/>
+ <param name="Threshold" value="debug"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p - [%t:%x] ~ %m (%c{1}:%L)%n"/>
+ </layout>
+ </appender>
+
+ <appender name="AUDIT" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="${user.dir}/logs/audit.log"/>
+ <param name="Append" value="true"/>
+ <param name="Threshold" value="debug"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %x %m%n"/>
+ </layout>
+ </appender>
+
+ <appender name="TRANSACTIONLOG" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="${user.dir}/logs/tranlog.log"/>
+ <param name="Append" value="true"/>
+ <param name="Threshold" value="debug"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %x %m%n"/>
+ </layout>
+ </appender>
+
+ <appender name="METRIC" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="${user.dir}/logs/metric.log"/>
+ <param name="Append" value="true"/>
+ <param name="Threshold" value="debug"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %m%n"/>
+ </layout>
+ </appender>
+
+ <logger name="org.apache.falcon">
+ <level value="debug"/>
+ <appender-ref ref="FILE"/>
+ </logger>
+
+ <logger name="AUDIT">
+ <level value="info"/>
+ <appender-ref ref="AUDIT"/>
+ </logger>
+
+ <logger name="TRANSACTIONLOG">
+ <level value="info"/>
+ <appender-ref ref="TRANSACTIONLOG"/>
+ </logger>
+
+ <logger name="METRIC">
+ <level value="info"/>
+ <appender-ref ref="METRIC"/>
+ </logger>
+
+ <root>
+ <priority value="info"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/src/conf/runtime.properties
----------------------------------------------------------------------
diff --git a/src/conf/runtime.properties b/src/conf/runtime.properties
new file mode 100644
index 0000000..3a1b62e
--- /dev/null
+++ b/src/conf/runtime.properties
@@ -0,0 +1,29 @@
+#
+# 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.
+#
+
+####################################################
+#### This is used for falcon packaging only. ####
+####################################################
+
+*.domain=debug
+
+*.log.cleanup.frequency.minutes.retention =hours(6)
+*.log.cleanup.frequency.hours.retention =minutes(1)
+*.log.cleanup.frequency.days.retention =days(7)
+*.log.cleanup.frequency.months.retention =months(3)
+
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/src/conf/startup.properties
----------------------------------------------------------------------
diff --git a/src/conf/startup.properties b/src/conf/startup.properties
new file mode 100644
index 0000000..a1fdab2
--- /dev/null
+++ b/src/conf/startup.properties
@@ -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.
+#
+
+####################################################
+#### This is used for falcon packaging only. ####
+####################################################
+
+*.domain=debug
+
+######### Implementation classes #########
+## DONT MODIFY UNLESS SURE ABOUT CHANGE ##
+*.workflow.engine.impl=org.apache.falcon.workflow.engine.OozieWorkflowEngine
+*.oozie.process.workflow.builder=org.apache.falcon.workflow.OozieProcessWorkflowBuilder
+*.oozie.feed.workflow.builder=org.apache.falcon.workflow.OozieFeedWorkflowBuilder
+*.journal.impl=org.apache.falcon.transaction.SharedFileSystemJournal
+*.SchedulableEntityManager.impl=org.apache.falcon.resource.SchedulableEntityManager
+*.ConfigSyncService.impl=org.apache.falcon.resource.ConfigSyncService
+*.ProcessInstanceManager.impl=org.apache.falcon.resource.InstanceManager
+*.application.services=org.apache.falcon.entity.store.ConfigurationStore,\
+ org.apache.falcon.service.ProcessSubscriberService,\
+ org.apache.falcon.rerun.service.RetryService,\
+ org.apache.falcon.rerun.service.LateRunService,\
+ org.apache.falcon.service.SLAMonitoringService,\
+ org.apache.falcon.service.LogCleanupService
+*.configstore.listeners=org.apache.falcon.entity.v0.EntityGraph,\
+ org.apache.falcon.entity.ColoClusterRelation,\
+ org.apache.falcon.group.FeedGroupMap,\
+ org.apache.falcon.service.SharedLibraryHostingService
+*.broker.impl.class=org.apache.activemq.ActiveMQConnectionFactory
+*.shared.libs=activemq-core,ant,geronimo-j2ee-management,hadoop-distcp,jms,json-simple,oozie-client,spring-jms,s4fs-0.1.jar
+
+######### Implementation classes #########
+
+debug.config.store.uri=file://${user.dir}/store
+debug.system.lib.location=${user.dir}/server/lib
+debug.broker.url=tcp://localhost:61616
+debug.retry.recorder.path=${user.dir}/logs/retry
+
+*.falcon.cleanup.service.frequency=days(1)
+
+#default time-to-live for a JMS message 3 days (time in minutes)
+*.broker.ttlInMins=4320
+*.entity.topic=FALCON.ENTITY.TOPIC
+*.max.retry.failure.count=1
+*.retry.recorder.path=${user.dir}/logs/retry
+
+######### Properties for configuring iMon client and metric #########
+*.internal.queue.size=1000
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/src/main/assemblies/package.xml
----------------------------------------------------------------------
diff --git a/src/main/assemblies/package.xml b/src/main/assemblies/package.xml
new file mode 100644
index 0000000..fd600f2
--- /dev/null
+++ b/src/main/assemblies/package.xml
@@ -0,0 +1,112 @@
+<?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.
+-->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <formats>
+ <format>dir</format>
+ <format>tar.gz</format>
+ </formats>
+ <fileSets>
+ <fileSet>
+ <directory>src/conf/</directory>
+ <outputDirectory>conf</outputDirectory>
+ </fileSet>
+
+ <fileSet>
+ <directory>client/target/dependency</directory>
+ <outputDirectory>client/lib</outputDirectory>
+ </fileSet>
+
+ <fileSet>
+ <directory>.</directory>
+ <outputDirectory>src</outputDirectory>
+ <includes>
+ <include>**/target/*sources.jar</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>.</directory>
+ <outputDirectory>docs</outputDirectory>
+ <includes>
+ <include>**/target/*javadoc.jar</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>client/target/dependency</directory>
+ <outputDirectory>client/lib</outputDirectory>
+ </fileSet>
+
+ <fileSet>
+ <directory>src/bin</directory>
+ <outputDirectory>bin</outputDirectory>
+ <fileMode>0755</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet>
+
+ <fileSet>
+ <directory>logs</directory>
+ <outputDirectory>logs</outputDirectory>
+ <directoryMode>0777</directoryMode>
+ <excludes>
+ <exclude>*</exclude>
+ <exclude>**/**</exclude>
+ </excludes>
+ </fileSet>
+
+ <fileSet>
+ <directory>./</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>LICENSE.txt</include>
+ <include>CHANGES.txt</include>
+ <include>README</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>webapp/target/falcon-webapp-${project.version}/WEB-INF/classes</directory>
+ <outputDirectory>server/webapp/classes</outputDirectory>
+ <includes>
+ <include>**/*.class</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>webapp/target/falcon-webapp-${project.version}/WEB-INF/lib</directory>
+ <outputDirectory>server/webapp/lib</outputDirectory>
+ </fileSet>
+ </fileSets>
+
+ <files>
+ <file>
+ <source>client/target/falcon-client-${project.version}.jar</source>
+ <outputDirectory>client/lib</outputDirectory>
+ </file>
+
+ <file>
+ <source>webapp/target/falcon-webapp-${project.version}.war</source>
+ <outputDirectory>server/webapp</outputDirectory>
+ <destName>falcon.war</destName>
+ </file>
+ </files>
+</assembly>
+
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/webapp/pom.xml b/webapp/pom.xml
index 0d86a8c..f73470e 100644
--- a/webapp/pom.xml
+++ b/webapp/pom.xml
@@ -133,6 +133,19 @@
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.falcon</groupId>
+ <artifactId>falcon-oozie-el-extension</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.falcon</groupId>
+ <artifactId>falcon-hadoop-webapp</artifactId>
+ <type>war</type>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<build>
@@ -150,6 +163,167 @@
</webResources>
</configuration>
</plugin>
+
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/webapps</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/conf</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.8</version>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.falcon</groupId>
+ <artifactId>falcon-hadoop-webapp</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.build.directory}/webapps</outputDirectory>
+ <destFileName>hadoop.war</destFileName>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.6</version>
+ <executions>
+ <execution>
+ <configuration>
+ <target>
+ <copy file="../hadoop-webapp/target/oozie.war" toDir="target/webapps" />
+ <delete dir="../target/store" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <phase>process-resources</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>2.15</version>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>verify</id>
+ <goals>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>${jetty.version}</version>
+ <configuration>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>41000</port>
+ <maxIdleTime>60000</maxIdleTime>
+ </connector>
+ </connectors>
+ <webApp>${project.build.directory}/falcon-webapp-${project.version}</webApp>
+ <useTestClasspath>true</useTestClasspath>
+ <contextHandlers>
+ <contextHandler implementation="org.mortbay.jetty.webapp.WebAppContext">
+ <war>${project.build.directory}/webapps/oozie.war</war>
+ <contextPath>/oozie</contextPath>
+ </contextHandler>
+ <contextHandler implementation="org.mortbay.jetty.webapp.WebAppContext">
+ <war>${project.build.directory}/webapps/hadoop.war</war>
+ <contextPath>/hadoop</contextPath>
+ </contextHandler>
+ </contextHandlers>
+ <systemProperties>
+ <systemProperty>
+ <name>hadoop.conf.dir</name>
+ <value>${project.build.directory}/webapps/hadoop/conf</value>
+ </systemProperty>
+ <systemProperty>
+ <name>hadoop.tmp.dir</name>
+ <value>${project.build.directory}/tmp-hadoop-${user.name}</value>
+ </systemProperty>
+ <systemProperty>
+ <name>hadoop.log.dir</name>
+ <value>${project.build.directory}/logs</value>
+ </systemProperty>
+ <systemProperty>
+ <name>oozie.home.dir</name>
+ <value>${project.build.directory}/webapps/oozie</value>
+ </systemProperty>
+ <systemProperty>
+ <name>oozie.data.dir</name>
+ <value>${project.build.directory}/webapps/oozie/data</value>
+ </systemProperty>
+ </systemProperties>
+ <stopKey>falcon-stop</stopKey>
+ <stopPort>41001</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <skip>${skipCheck}</skip>
+ <daemon>true</daemon>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
@@ -177,5 +351,4 @@
</profile>
</profiles>
-
</project>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/distcp-action-0.1.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/distcp-action-0.1.xsd b/webapp/src/conf/oozie/conf/action-conf/distcp-action-0.1.xsd
new file mode 100644
index 0000000..b77e039
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/distcp-action-0.1.xsd
@@ -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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:distcp="uri:oozie:distcp-action:0.1" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:distcp-action:0.1">
+
+ <xs:element name="distcp" type="distcp:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="distcp:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="distcp:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="java-opts" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="arg" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="distcp:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="distcp:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/distcp-action-0.2.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/distcp-action-0.2.xsd b/webapp/src/conf/oozie/conf/action-conf/distcp-action-0.2.xsd
new file mode 100644
index 0000000..f478e92
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/distcp-action-0.2.xsd
@@ -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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:distcp="uri:oozie:distcp-action:0.2" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:distcp-action:0.2">
+
+ <xs:element name="distcp" type="distcp:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="prepare" type="distcp:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="distcp:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="java-opts" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="arg" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="distcp:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="distcp:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/email-action-0.1.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/email-action-0.1.xsd b/webapp/src/conf/oozie/conf/action-conf/email-action-0.1.xsd
new file mode 100644
index 0000000..c8b4ca2
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/email-action-0.1.xsd
@@ -0,0 +1,33 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:email="uri:oozie:email-action:0.1" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:email-action:0.1">
+
+ <xs:element name="email" type="email:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="to" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="cc" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="subject" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="body" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/gms-oozie-sla-0.1.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/gms-oozie-sla-0.1.xsd b/webapp/src/conf/oozie/conf/action-conf/gms-oozie-sla-0.1.xsd
new file mode 100644
index 0000000..64cc0ad
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/gms-oozie-sla-0.1.xsd
@@ -0,0 +1,78 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:sla="uri:oozie:sla:0.1" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:sla:0.1">
+
+ <xs:element name="info" type="sla:SLA-INFO"/>
+
+ <xs:complexType name="SLA-INFO">
+ <xs:sequence>
+ <xs:element name="app-name" type="xs:string" minOccurs="1"
+ maxOccurs="1"/>
+
+ <xs:element name="nominal-time" type="xs:string"
+ minOccurs="1" maxOccurs="1"/>
+ <xs:element name="should-start" type="xs:string"
+ minOccurs="1" maxOccurs="1"/>
+ <xs:element name="should-end" type="xs:string" minOccurs="1"
+ maxOccurs="1"/>
+
+ <xs:element name="parent-client-id" type="xs:string"
+ minOccurs="0" maxOccurs="1"/>
+ <xs:element name="parent-sla-id" type="xs:string"
+ minOccurs="0" maxOccurs="1"/>
+
+ <xs:element name="notification-msg" type="xs:string"
+ minOccurs="0" maxOccurs="1"/>
+ <xs:element name="alert-contact" type="xs:string"
+ minOccurs="1" maxOccurs="1"/>
+ <xs:element name="dev-contact" type="xs:string" minOccurs="1"
+ maxOccurs="1"/>
+ <xs:element name="qa-contact" type="xs:string" minOccurs="1"
+ maxOccurs="1"/>
+ <xs:element name="se-contact" type="xs:string" minOccurs="1"
+ maxOccurs="1"/>
+ <xs:element name="alert-frequency" type="sla:alert-frequencyType"
+ minOccurs="0" maxOccurs="1"/>
+ <xs:element name="alert-percentage" type="sla:alert-percentageType"
+ minOccurs="0" maxOccurs="1"/>
+
+ <xs:element name="upstream-apps" type="xs:string"
+ minOccurs="0" maxOccurs="1"/>
+
+ </xs:sequence>
+ </xs:complexType>
+ <xs:simpleType name="alert-percentageType">
+ <xs:restriction base="xs:integer">
+ <xs:minInclusive value="0"/>
+ <xs:maxInclusive value="100"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="alert-frequencyType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="NONE"></xs:enumeration>
+ <xs:enumeration value="LAST_HOUR"></xs:enumeration>
+ <xs:enumeration value="LAST_DAY"></xs:enumeration>
+ <xs:enumeration value="LAST_MONTH"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+
+</xs:schema>
[3/8] FALCON-1 Create packaging and scripts to install and try Apache
Falcon. Contributed by Srikanth Sundarrajan
Posted by ve...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/test/java/org/apache/falcon/cli/FalconCLITest.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/cli/FalconCLITest.java b/webapp/src/test/java/org/apache/falcon/cli/FalconCLITest.java
deleted file mode 100644
index 64f0171..0000000
--- a/webapp/src/test/java/org/apache/falcon/cli/FalconCLITest.java
+++ /dev/null
@@ -1,572 +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.
- */
-
-package org.apache.falcon.cli;
-
-import junit.framework.Assert;
-import org.apache.falcon.resource.AbstractTestBase;
-import org.testng.annotations.Test;
-
-import java.io.*;
-import java.util.Map;
-
-/**
- * Test for Falcon CLI.
- *
- * todo: Refactor both the classes to move this methods to helper;
- */
-public class FalconCLITest extends AbstractTestBase {
-
- private InMemoryWriter stream = new InMemoryWriter(System.out);
- // private static final String BROKER_URL =
- // "tcp://localhost:61616?daemon=true";
- private static final boolean TEST_ENABLED = true;
-
- @Test(enabled = TEST_ENABLED)
- public void testSubmitEntityValidCommands() throws Exception {
-
- FalconCLI.OUT.set(stream);
-
- String filePath;
- Map<String, String> overlay = getUniqueOverlay();
-
- filePath = overlayParametersOverTemplate(clusterFileTemplate, overlay);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -submit -type cluster -file " + filePath));
- Assert.assertEquals(stream.buffer.toString().trim(),
- "default/Submit successful (cluster) " + clusterName);
-
- filePath = overlayParametersOverTemplate(FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
- Assert.assertEquals(
- stream.buffer.toString().trim(),
- "default/Submit successful (feed) "
- + overlay.get("inputFeedName"));
-
- filePath = overlayParametersOverTemplate(FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
- Assert.assertEquals(
- stream.buffer.toString().trim(),
- "default/Submit successful (feed) "
- + overlay.get("outputFeedName"));
-
- filePath = overlayParametersOverTemplate(PROCESS_TEMPLATE, overlay);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -submit -type process -file " + filePath));
- Assert.assertEquals(
- stream.buffer.toString().trim(),
- "default/Submit successful (process) "
- + overlay.get("processName"));
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testListWithEmptyConfigStore() throws Exception {
- Assert.assertEquals(
- 0,
- executeWithURL("entity -list -type process "));
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testSubmitAndScheduleEntityValidCommands() throws Exception {
-
- Thread.sleep(5000);
- String filePath;
- Map<String, String> overlay = getUniqueOverlay();
-
- filePath = overlayParametersOverTemplate(clusterFileTemplate, overlay);
- Assert.assertEquals(-1,
- executeWithURL("entity -submitAndSchedule -type cluster -file "
- + filePath));
-
- filePath = overlayParametersOverTemplate(FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submitAndSchedule -type feed -file "
- + filePath));
- filePath = overlayParametersOverTemplate(FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submitAndSchedule -type feed -file "
- + filePath));
- filePath = overlayParametersOverTemplate(FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
-
- filePath = overlayParametersOverTemplate(FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
-
- filePath = overlayParametersOverTemplate(PROCESS_TEMPLATE, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submitAndSchedule -type process -file "
- + filePath));
-
- Thread.sleep(5000);
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testValidateValidCommands() throws Exception {
-
- String filePath;
- Map<String, String> overlay = getUniqueOverlay();
-
- filePath = overlayParametersOverTemplate(clusterFileTemplate, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -validate -type cluster -file "
- + filePath));
- Assert.assertEquals(
- 0,
- executeWithURL("entity -submit -type cluster -file " + filePath));
-
- filePath = overlayParametersOverTemplate(FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -validate -type feed -file " + filePath));
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
-
- filePath = overlayParametersOverTemplate(FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -validate -type feed -file " + filePath));
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
-
- filePath = overlayParametersOverTemplate(PROCESS_TEMPLATE, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -validate -type process -file "
- + filePath));
- Assert.assertEquals(
- 0,
- executeWithURL("entity -submit -type process -file " + filePath));
-
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testDefinitionEntityValidCommands() throws Exception {
- Map<String, String> overlay = getUniqueOverlay();
- submitTestFiles(overlay);
-
- Assert.assertEquals(0,
- executeWithURL("entity -definition -type cluster -name "
- + overlay.get("cluster")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -definition -type feed -name "
- + overlay.get("inputFeedName")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -definition -type feed -name "
- + overlay.get("outputFeedName")));
-
- Assert.assertEquals(0,
- executeWithURL("entity -definition -type process -name "
- + overlay.get("processName")));
-
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testScheduleEntityValidCommands() throws Exception {
-
- Map<String, String> overlay = getUniqueOverlay();
- submitTestFiles(overlay);
-
- Assert.assertEquals(-1,
- executeWithURL("entity -schedule -type cluster -name "
- + overlay.get("cluster")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -schedule -type feed -name "
- + overlay.get("outputFeedName")));
-
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
-
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testSuspendResumeStatusEntityValidCommands() throws Exception {
-
- Thread.sleep(5000);
- Map<String, String> overlay = getUniqueOverlay();
- submitTestFiles(overlay);
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -status -type feed -name "
- + overlay.get("outputFeedName")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -status -type process -name "
- + overlay.get("processName")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -schedule -type feed -name "
- + overlay.get("outputFeedName")));
-
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
-
- waitForProcessWFtoStart();
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -suspend -type feed -name "
- + overlay.get("outputFeedName")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -suspend -type process -name "
- + overlay.get("processName")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -status -type feed -name "
- + overlay.get("outputFeedName")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -status -type process -name "
- + overlay.get("processName")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -resume -type feed -name "
- + overlay.get("outputFeedName")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -resume -type process -name "
- + overlay.get("processName")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -status -type feed -name "
- + overlay.get("outputFeedName")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -status -type process -name "
- + overlay.get("processName")));
-
- Thread.sleep(5000);
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testSubCommandPresence() throws Exception {
- Assert.assertEquals(-1, executeWithURL("entity -type cluster "));
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testDeleteEntityValidCommands() throws Exception {
-
- Map<String, String> overlay = getUniqueOverlay();
- submitTestFiles(overlay);
-
- Assert.assertEquals(
- -1,
- executeWithURL("entity -delete -type cluster -name "
- + overlay.get("cluster")));
-
- Assert.assertEquals(
- -1,
- executeWithURL("entity -delete -type feed -name "
- + overlay.get("inputFeedName")));
-
- Assert.assertEquals(
- -1,
- executeWithURL("entity -delete -type feed -name "
- + overlay.get("outputFeedName")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -delete -type process -name "
- + overlay.get("processName")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -delete -type feed -name "
- + overlay.get("inputFeedName")));
-
- Assert.assertEquals(
- 0,
- executeWithURL("entity -delete -type feed -name "
- + overlay.get("outputFeedName")));
-
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testInvalidCLIEntitycommands() throws Exception {
-
- Map<String, String> overlay = getUniqueOverlay();
- overlayParametersOverTemplate(FEED_TEMPLATE1, overlay);
- Assert.assertEquals(-1,
- executeWithURL("entity -submit -type feed -name " + "name"));
-
- Assert.assertEquals(-1,
- executeWithURL("entity -schedule -type feed -file " + "name"));
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testInstanceRunningAndStatusCommands() throws Exception {
- Map<String, String> overlay = getUniqueOverlay();
- submitTestFiles(overlay);
-
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
-
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type feed -name "
- + overlay.get("outputFeedName")));
- waitForProcessWFtoStart();
-
- Assert.assertEquals(0,
- executeWithURL("instance -status -type feed -name "
- + overlay.get("outputFeedName")
- + " -start " + START_INSTANCE));
-
- Assert.assertEquals(0,
- executeWithURL("instance -running -type process -name "
- + overlay.get("processName")));
-
- Assert.assertEquals(0,
- executeWithURL("instance -status -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE));
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testInstanceSuspendAndResume() throws Exception {
- Thread.sleep(5000);
- Map<String, String> overlay = getUniqueOverlay();
- submitTestFiles(overlay);
-
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
-
-
- Assert.assertEquals(0,
- executeWithURL("instance -suspend -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
-
- Assert.assertEquals(0,
- executeWithURL("instance -resume -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
- Thread.sleep(5000);
- }
-
- private static final String START_INSTANCE = "2012-04-20T00:00Z";
-
- @Test(enabled = TEST_ENABLED)
- public void testInstanceKillAndRerun() throws Exception {
- Map<String, String> overlay = getUniqueOverlay();
- submitTestFiles(overlay);
-
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
-
- waitForProcessWFtoStart();
- Assert.assertEquals(
- 0,
- executeWithURL("instance -kill -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
-
- Assert.assertEquals(
- 0,
- executeWithURL("instance -rerun -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE + " -file "
- + createTempJobPropertiesFile()));
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testContinue() throws Exception {
- Map<String, String> overlay = getUniqueOverlay();
- submitTestFiles(overlay);
-
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
-
- waitForProcessWFtoStart();
- Assert.assertEquals(
- 0,
- executeWithURL("instance -kill -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
-
- Assert.assertEquals(
- 0,
- executeWithURL("instance -continue -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE));
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testInvalidCLIInstanceCommands() throws Exception {
- // no command
- Assert.assertEquals(-1, executeWithURL(" -kill -type process -name "
- + "name" + " -start 2010-01-01T01:00Z -end 2010-01-01T03:00Z"));
-
- Assert.assertEquals(-1, executeWithURL("instance -kill " + "name"
- + " -start 2010-01-01T01:00Z -end 2010-01-01T01:00Z"));
-
- Assert.assertEquals(-1,
- executeWithURL("instance -kill -type process -name " + "name"
- + " -end 2010-01-01T03:00Z"));
-
- Assert.assertEquals(-1,
- executeWithURL("instance -kill -type process -name "
- + " -start 2010-01-01T01:00Z -end 2010-01-01T03:00Z"));
-
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testFalconURL() throws Exception {
- Assert.assertEquals(-1, new FalconCLI()
- .run(("instance -status -type process -name " + "processName"
- + " -start 2010-01-01T01:00Z -end 2010-01-01T03:00Z")
- .split("\\s")));
-
- Assert.assertEquals(-1, new FalconCLI()
- .run(("instance -status -type process -name "
- + "processName -url http://unknownhost:1234/"
- + " -start 2010-01-01T01:00Z -end 2010-01-01T03:00Z")
- .split("\\s")));
-
-
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testClientProperties() throws Exception {
- Map<String, String> overlay = getUniqueOverlay();
- submitTestFiles(overlay);
-
- Assert.assertEquals(
- 0,
- new FalconCLI().run(("entity -schedule -type feed -name "
- + overlay.get("outputFeedName")).split("\\s")));
-
- Assert.assertEquals(0,
- new FalconCLI().run(("entity -schedule -type process -name "
- + overlay.get("processName")).split("\\s")));
-
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testGetVersion() throws Exception {
- Assert.assertEquals(0,
- new FalconCLI().run("admin -version".split("\\s")));
-
- Assert.assertEquals(0,
- new FalconCLI().run("admin -stack".split("\\s")));
- }
-
- @Test(enabled = TEST_ENABLED)
- public void testInstanceGetLogs() throws Exception {
- Map<String, String> overlay = getUniqueOverlay();
- submitTestFiles(overlay);
-
- Assert.assertEquals(0,
- executeWithURL("entity -schedule -type process -name "
- + overlay.get("processName")));
-
- Assert.assertEquals(0,
- executeWithURL("instance -logs -type process -name "
- + overlay.get("processName")
- + " -start " + START_INSTANCE + " -end " + START_INSTANCE));
-
- }
-
-
- private int executeWithURL(String command) throws Exception {
- return new FalconCLI()
- .run((command + " -url " + BASE_URL).split("\\s+"));
- }
-
- private String createTempJobPropertiesFile() throws IOException {
- File target = new File("webapp/target");
- if (!target.exists()) {
- target = new File("target");
- }
- File tmpFile = File.createTempFile("job", ".properties", target);
- OutputStream out = new FileOutputStream(tmpFile);
- out.write("oozie.wf.rerun.failnodes=true\n".getBytes());
- out.close();
- return tmpFile.getAbsolutePath();
- }
-
- public void submitTestFiles(Map<String, String> overlay) throws Exception {
-
- String filePath = overlayParametersOverTemplate(clusterFileTemplate,
- overlay);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -submit -type cluster -file " + filePath));
-
- filePath = overlayParametersOverTemplate(FEED_TEMPLATE1, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
-
- filePath = overlayParametersOverTemplate(FEED_TEMPLATE2, overlay);
- Assert.assertEquals(0,
- executeWithURL("entity -submit -type feed -file " + filePath));
-
- filePath = overlayParametersOverTemplate(PROCESS_TEMPLATE, overlay);
- Assert.assertEquals(
- 0,
- executeWithURL("entity -submit -type process -file " + filePath));
- }
-
- private static class InMemoryWriter extends PrintStream {
-
- private StringBuffer buffer = new StringBuffer();
-
- public InMemoryWriter(OutputStream out) {
- super(out);
- }
-
- @Override
- public void println(String x) {
- clear();
- buffer.append(x);
- super.println(x);
- }
-
- public String getBuffer() {
- return buffer.toString();
- }
-
- public void clear() {
- buffer.delete(0, buffer.length());
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/test/java/org/apache/falcon/logging/LogMoverIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/logging/LogMoverIT.java b/webapp/src/test/java/org/apache/falcon/logging/LogMoverIT.java
new file mode 100644
index 0000000..ae4b5ad
--- /dev/null
+++ b/webapp/src/test/java/org/apache/falcon/logging/LogMoverIT.java
@@ -0,0 +1,162 @@
+/**
+ * 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.falcon.logging;
+
+import junit.framework.Assert;
+import org.apache.falcon.FalconException;
+import org.apache.falcon.cluster.util.EmbeddedCluster;
+import org.apache.falcon.cluster.util.StandAloneCluster;
+import org.apache.falcon.entity.ClusterHelper;
+import org.apache.falcon.entity.EntityUtil;
+import org.apache.falcon.entity.parser.ProcessEntityParser;
+import org.apache.falcon.entity.store.ConfigurationStore;
+import org.apache.falcon.entity.v0.EntityType;
+import org.apache.falcon.entity.v0.process.Process;
+import org.apache.falcon.resource.TestContext;
+import org.apache.falcon.security.CurrentUser;
+import org.apache.falcon.util.StartupProperties;
+import org.apache.falcon.workflow.engine.OozieWorkflowEngine;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.oozie.client.OozieClient;
+import org.apache.oozie.client.WorkflowJob;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Test for LogMover.
+ * Requires Oozie to be running on localhost.
+ */
+@Test
+public class LogMoverIT {
+
+ private static final ConfigurationStore STORE = ConfigurationStore.get();
+ private static final String PROCESS_NAME = "testProcess" + System.currentTimeMillis();
+ private static EmbeddedCluster testCluster = null;
+ private static Process testProcess = null;
+ private static FileSystem fs;
+
+ @BeforeClass
+ public void setup() throws Exception {
+ Map<String, String> overlay = new HashMap<String, String>();
+ overlay.put("cluster", "testCluster");
+ TestContext context = new TestContext();
+ String file = context.
+ overlayParametersOverTemplate(context.CLUSTER_TEMPLATE, overlay);
+ testCluster = StandAloneCluster.newCluster(file);
+ STORE.publish(EntityType.CLUSTER, testCluster.getCluster());
+/*
+ new File("target/libs").mkdirs();
+ StartupProperties.get().setProperty("system.lib.location", "target/libs");
+ SharedLibraryHostingService listener = new SharedLibraryHostingService();
+ listener.onAdd(testCluster.getCluster());
+*/
+ fs = FileSystem.get(testCluster.getConf());
+ fs.mkdirs(new Path("/workflow/lib"));
+
+ fs.copyFromLocalFile(
+ new Path(LogMoverIT.class.getResource(
+ "/org/apache/falcon/logging/workflow.xml").toURI()),
+ new Path("/workflow"));
+ fs.copyFromLocalFile(
+ new Path(LogMoverIT.class.getResource(
+ "/org/apache/falcon/logging/java-test.jar").toURI()),
+ new Path("/workflow/lib"));
+
+ testProcess = new ProcessEntityParser().parse(LogMoverIT.class
+ .getResourceAsStream("/org/apache/falcon/logging/process.xml"));
+ testProcess.setName(PROCESS_NAME);
+ }
+
+ @AfterClass
+ public void tearDown() {
+ testCluster.shutdown();
+ }
+
+ @Test (enabled = false)
+ public void testLogMover() throws Exception {
+ CurrentUser.authenticate(System.getProperty("user.name"));
+ OozieWorkflowEngine engine = new OozieWorkflowEngine();
+ String path = StartupProperties.get().getProperty("system.lib.location");
+ if (!new File("target/libs").exists()) {
+ Assert.assertTrue(new File("target/libs").mkdirs());
+ }
+ StartupProperties.get().setProperty("system.lib.location", "target/libs");
+ engine.schedule(testProcess);
+ StartupProperties.get().setProperty("system.lib.location", path);
+
+ OozieClient client = new OozieClient(
+ ClusterHelper.getOozieUrl(testCluster.getCluster()));
+ List<WorkflowJob> jobs;
+ while (true) {
+ jobs = client.getJobsInfo(OozieClient.FILTER_NAME + "="
+ + "FALCON_PROCESS_DEFAULT_" + PROCESS_NAME);
+ if (jobs.size() > 0) {
+ break;
+ } else {
+ Thread.sleep(1000);
+ }
+ }
+
+ WorkflowJob job = jobs.get(0);
+ while (true) {
+ if (!(job.getStatus() == WorkflowJob.Status.RUNNING || job
+ .getStatus() == WorkflowJob.Status.PREP)) {
+ break;
+ } else {
+ Thread.sleep(1000);
+ job = client.getJobInfo(job.getId());
+ }
+ }
+
+ Path oozieLogPath = new Path(getLogPath(),
+ "job-2010-01-01-01-00/000/oozie.log");
+ Assert.assertTrue(fs.exists(oozieLogPath));
+
+ testLogMoverWithNextRunId(job.getId());
+
+ }
+
+ private Path getLogPath() throws FalconException {
+ Path stagingPath = new Path(ClusterHelper.getLocation(
+ testCluster.getCluster(), "staging"),
+ EntityUtil.getStagingPath(testProcess) + "/../logs");
+ return new Path(ClusterHelper.getStorageUrl(testCluster
+ .getCluster()), stagingPath);
+ }
+
+ private void testLogMoverWithNextRunId(String jobId) throws Exception {
+ LogMover.main(new String[]{"-workflowEngineUrl",
+ ClusterHelper.getOozieUrl(testCluster.getCluster()),
+ "-subflowId", jobId + "@user-workflow", "-runId", "1",
+ "-logDir", getLogPath().toString() + "/job-2010-01-01-01-00",
+ "-status", "SUCCEEDED", "-entityType", "process", });
+
+ Path oozieLogPath = new Path(getLogPath(),
+ "job-2010-01-01-01-00/001/oozie.log");
+ Assert.assertTrue(fs.exists(oozieLogPath));
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/test/java/org/apache/falcon/logging/LogMoverTest.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/logging/LogMoverTest.java b/webapp/src/test/java/org/apache/falcon/logging/LogMoverTest.java
deleted file mode 100644
index bd6dbe2..0000000
--- a/webapp/src/test/java/org/apache/falcon/logging/LogMoverTest.java
+++ /dev/null
@@ -1,154 +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.
- */
-package org.apache.falcon.logging;
-
-import junit.framework.Assert;
-import org.apache.falcon.FalconException;
-import org.apache.falcon.cluster.util.EmbeddedCluster;
-import org.apache.falcon.entity.ClusterHelper;
-import org.apache.falcon.entity.EntityUtil;
-import org.apache.falcon.entity.parser.ProcessEntityParser;
-import org.apache.falcon.entity.store.ConfigurationStore;
-import org.apache.falcon.entity.v0.EntityType;
-import org.apache.falcon.entity.v0.process.Process;
-import org.apache.falcon.security.CurrentUser;
-import org.apache.falcon.service.SharedLibraryHostingService;
-import org.apache.falcon.workflow.engine.OozieWorkflowEngine;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.apache.oozie.client.OozieClient;
-import org.apache.oozie.client.WorkflowJob;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Test for LogMover.
- * Requires Oozie to be running on localhost.
- */
-public class LogMoverTest {
-
- private static final ConfigurationStore STORE = ConfigurationStore.get();
- private static final String PROCESS_NAME = "testProcess" + System.currentTimeMillis();
- private static EmbeddedCluster testCluster = null;
- private static Process testProcess = null;
- private static FileSystem fs;
-
- @BeforeClass
- public void setup() throws Exception {
- cleanupStore();
- testCluster = EmbeddedCluster.newCluster("testCluster", true);
- STORE.publish(EntityType.CLUSTER, testCluster.getCluster());
- SharedLibraryHostingService listener = new SharedLibraryHostingService();
- listener.onAdd(testCluster.getCluster());
- fs = FileSystem.get(testCluster.getConf());
- fs.mkdirs(new Path("/workflow/lib"));
-
- fs.copyFromLocalFile(
- new Path(LogMoverTest.class.getResource(
- "/org/apache/falcon/logging/workflow.xml").toURI()),
- new Path("/workflow"));
- fs.copyFromLocalFile(
- new Path(LogMoverTest.class.getResource(
- "/org/apache/falcon/logging/java-test.jar").toURI()),
- new Path("/workflow/lib"));
-
- testProcess = new ProcessEntityParser().parse(LogMoverTest.class
- .getResourceAsStream("/org/apache/falcon/logging/process.xml"));
- testProcess.setName(PROCESS_NAME);
- STORE.publish(EntityType.PROCESS, testProcess);
- }
-
- @AfterClass
- public void tearDown() {
- testCluster.shutdown();
- }
-
- private void cleanupStore() throws FalconException {
- for (EntityType type : EntityType.values()) {
- Collection<String> entities = STORE.getEntities(type);
- for (String entity : entities) {
- STORE.remove(type, entity);
- }
- }
- }
-
- @Test
- public void testLogMover() throws Exception {
- CurrentUser.authenticate(System.getProperty("user.name"));
- OozieWorkflowEngine engine = new OozieWorkflowEngine();
- engine.schedule(testProcess);
-
- OozieClient client = new OozieClient(
- ClusterHelper.getOozieUrl(testCluster.getCluster()));
- List<WorkflowJob> jobs;
- while (true) {
- jobs = client.getJobsInfo(OozieClient.FILTER_NAME + "="
- + "FALCON_PROCESS_DEFAULT_" + PROCESS_NAME);
- if (jobs.size() > 0) {
- break;
- } else {
- Thread.sleep(100);
- }
- }
-
- WorkflowJob job = jobs.get(0);
- while (true) {
- if (!(job.getStatus() == WorkflowJob.Status.RUNNING || job
- .getStatus() == WorkflowJob.Status.PREP)) {
- break;
- } else {
- Thread.sleep(100);
- job = client.getJobInfo(job.getId());
- }
- }
-
- Path oozieLogPath = new Path(getLogPath(),
- "job-2010-01-01-01-00/000/oozie.log");
- Assert.assertTrue(fs.exists(oozieLogPath));
-
- testLogMoverWithNextRunId(job.getId());
-
- }
-
- private Path getLogPath() throws FalconException {
- Path stagingPath = new Path(ClusterHelper.getLocation(
- testCluster.getCluster(), "staging"),
- EntityUtil.getStagingPath(testProcess) + "/../logs");
- Path logPath = new Path(ClusterHelper.getStorageUrl(testCluster
- .getCluster()), stagingPath);
- return logPath;
- }
-
- private void testLogMoverWithNextRunId(String jobId) throws Exception {
- LogMover.main(new String[]{"-workflowEngineUrl",
- ClusterHelper.getOozieUrl(testCluster.getCluster()),
- "-subflowId", jobId + "@user-workflow", "-runId", "1",
- "-logDir", getLogPath().toString() + "/job-2010-01-01-01-00",
- "-status", "SUCCEEDED", "-entityType", "process", });
-
- Path oozieLogPath = new Path(getLogPath(),
- "job-2010-01-01-01-00/001/oozie.log");
- Assert.assertTrue(fs.exists(oozieLogPath));
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/test/java/org/apache/falcon/logging/LogProviderIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/logging/LogProviderIT.java b/webapp/src/test/java/org/apache/falcon/logging/LogProviderIT.java
new file mode 100644
index 0000000..25e0979
--- /dev/null
+++ b/webapp/src/test/java/org/apache/falcon/logging/LogProviderIT.java
@@ -0,0 +1,160 @@
+/**
+ * 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.falcon.logging;
+
+import org.apache.falcon.FalconException;
+import org.apache.falcon.cluster.util.EmbeddedCluster;
+import org.apache.falcon.cluster.util.StandAloneCluster;
+import org.apache.falcon.entity.parser.ProcessEntityParser;
+import org.apache.falcon.entity.store.ConfigurationStore;
+import org.apache.falcon.entity.v0.EntityType;
+import org.apache.falcon.entity.v0.process.Process;
+import org.apache.falcon.resource.InstancesResult.Instance;
+import org.apache.falcon.resource.InstancesResult.InstanceAction;
+import org.apache.falcon.resource.InstancesResult.WorkflowStatus;
+import org.apache.falcon.resource.TestContext;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Test for LogProvider.
+ */
+public class LogProviderIT {
+
+ private static final ConfigurationStore STORE = ConfigurationStore.get();
+ private static EmbeddedCluster testCluster = null;
+ private static Process testProcess = null;
+ private static final String PROCESS_NAME = "testProcess";
+ private static FileSystem fs;
+ private Instance instance;
+
+ @BeforeClass
+ public void setup() throws Exception {
+ Map<String, String> overlay = new HashMap<String, String>();
+ overlay.put("cluster", "logProviderTest");
+ TestContext context = new TestContext();
+ String file = context.
+ overlayParametersOverTemplate(context.CLUSTER_TEMPLATE, overlay);
+ testCluster = StandAloneCluster.newCluster(file);
+ cleanupStore();
+ STORE.publish(EntityType.CLUSTER, testCluster.getCluster());
+ fs = FileSystem.get(testCluster.getConf());
+ Path instanceLogPath = new Path(
+ "/projects/falcon/staging/falcon/workflows/process/" + PROCESS_NAME
+ + "/logs/job-2010-01-01-01-00/000");
+ fs.mkdirs(instanceLogPath);
+ fs.createNewFile(new Path(instanceLogPath, "oozie.log"));
+ fs.createNewFile(new Path(instanceLogPath, "pigAction_SUCCEEDED.log"));
+ fs.createNewFile(new Path(instanceLogPath, "mr_Action_FAILED.log"));
+ fs.createNewFile(new Path(instanceLogPath, "mr_Action2_SUCCEEDED.log"));
+
+ fs.mkdirs(new Path("/projects/falcon/staging/falcon/workflows/process/"
+ + PROCESS_NAME + "/logs/job-2010-01-01-01-00/001"));
+ fs.mkdirs(new Path("/projects/falcon/staging/falcon/workflows/process/"
+ + PROCESS_NAME + "/logs/job-2010-01-01-01-00/002"));
+ Path run3 = new Path("/projects/falcon/staging/falcon/workflows/process/"
+ + PROCESS_NAME + "/logs/job-2010-01-01-01-00/003");
+ fs.mkdirs(run3);
+ fs.createNewFile(new Path(run3, "oozie.log"));
+
+ testProcess = new ProcessEntityParser().parse(LogProviderIT.class
+ .getResourceAsStream("/org/apache/falcon/logging/process.xml"));
+ testProcess.setName(PROCESS_NAME);
+ STORE.publish(EntityType.PROCESS, testProcess);
+ }
+
+ @BeforeMethod
+ public void setInstance() {
+ instance = new Instance();
+ instance.status = WorkflowStatus.SUCCEEDED;
+ instance.instance = "2010-01-01T01:00Z";
+ instance.cluster = "logProviderTest";
+ instance.logFile = "http://localhost:41000/oozie/wflog";
+ }
+
+ private void cleanupStore() throws FalconException {
+ for (EntityType type : EntityType.values()) {
+ Collection<String> entities = STORE.getEntities(type);
+ for (String entity : entities) {
+ STORE.remove(type, entity);
+ }
+ }
+ }
+
+ @Test
+ public void testLogProviderWithValidRunId() throws FalconException {
+ LogProvider provider = new LogProvider();
+ Instance instanceWithLog = provider.populateLogUrls(testProcess,
+ instance, "0");
+ Assert.assertEquals(
+ instance.logFile,
+ "http://localhost:50070/data/projects/falcon/staging/falcon/workflows/process/testProcess/logs/"
+ + "job-2010-01-01-01-00/000/oozie.log");
+
+ InstanceAction action = instanceWithLog.actions[0];
+ Assert.assertEquals(action.action, "mr_Action2");
+ Assert.assertEquals(action.status, "SUCCEEDED");
+ Assert.assertEquals(
+ action.logFile,
+ "http://localhost:50070/data/projects/falcon/staging/falcon/workflows/process/testProcess/logs/"
+ + "job-2010-01-01-01-00/000/mr_Action2_SUCCEEDED.log");
+
+ action = instanceWithLog.actions[1];
+ Assert.assertEquals(action.action, "mr_Action");
+ Assert.assertEquals(action.status, "FAILED");
+ Assert.assertEquals(
+ action.logFile,
+ "http://localhost:50070/data/projects/falcon/staging/falcon/workflows/process/testProcess/logs/"
+ + "job-2010-01-01-01-00/000/mr_Action_FAILED.log");
+ }
+
+ @Test
+ public void testLogProviderWithInvalidRunId() throws FalconException {
+ LogProvider provider = new LogProvider();
+ provider.populateLogUrls(testProcess, instance, "x");
+ Assert.assertEquals(instance.logFile,
+ "http://localhost:41000/oozie/wflog");
+ }
+
+ @Test
+ public void testLogProviderWithUnavailableRunId() throws FalconException {
+ LogProvider provider = new LogProvider();
+ instance.logFile = null;
+ provider.populateLogUrls(testProcess, instance, "7");
+ Assert.assertEquals(instance.logFile, "-");
+ }
+
+ @Test
+ public void testLogProviderWithEmptyRunId() throws FalconException {
+ LogProvider provider = new LogProvider();
+ instance.logFile = null;
+ provider.populateLogUrls(testProcess, instance, null);
+ Assert.assertEquals(
+ instance.logFile,
+ "http://localhost:50070/data/projects/falcon/staging/falcon/workflows/process/testProcess/logs/"
+ + "job-2010-01-01-01-00/003/oozie.log");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/test/java/org/apache/falcon/logging/LogProviderTest.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/logging/LogProviderTest.java b/webapp/src/test/java/org/apache/falcon/logging/LogProviderTest.java
deleted file mode 100644
index a3ebaf0..0000000
--- a/webapp/src/test/java/org/apache/falcon/logging/LogProviderTest.java
+++ /dev/null
@@ -1,151 +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.
- */
-package org.apache.falcon.logging;
-
-import org.apache.falcon.FalconException;
-import org.apache.falcon.cluster.util.EmbeddedCluster;
-import org.apache.falcon.entity.parser.ProcessEntityParser;
-import org.apache.falcon.entity.store.ConfigurationStore;
-import org.apache.falcon.entity.v0.EntityType;
-import org.apache.falcon.entity.v0.process.Process;
-import org.apache.falcon.resource.InstancesResult.Instance;
-import org.apache.falcon.resource.InstancesResult.InstanceAction;
-import org.apache.falcon.resource.InstancesResult.WorkflowStatus;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.Collection;
-
-/**
- * Test for LogProvider.
- */
-public class LogProviderTest {
-
- private static final ConfigurationStore STORE = ConfigurationStore.get();
- private static EmbeddedCluster testCluster = null;
- private static Process testProcess = null;
- private static final String PROCESS_NAME = "testProcess";
- private static FileSystem fs;
- private Instance instance;
-
- @BeforeClass
- public void setup() throws Exception {
- testCluster = EmbeddedCluster.newCluster("testCluster", false);
- cleanupStore();
- STORE.publish(EntityType.CLUSTER, testCluster.getCluster());
- fs = FileSystem.get(testCluster.getConf());
- Path instanceLogPath = new Path(
- "/workflow/staging/falcon/workflows/process/" + PROCESS_NAME
- + "/logs/job-2010-01-01-01-00/000");
- fs.mkdirs(instanceLogPath);
- fs.createNewFile(new Path(instanceLogPath, "oozie.log"));
- fs.createNewFile(new Path(instanceLogPath, "pigAction_SUCCEEDED.log"));
- fs.createNewFile(new Path(instanceLogPath, "mr_Action_FAILED.log"));
- fs.createNewFile(new Path(instanceLogPath, "mr_Action2_SUCCEEDED.log"));
-
- fs.mkdirs(new Path("/workflow/staging/falcon/workflows/process/"
- + PROCESS_NAME + "/logs/job-2010-01-01-01-00/001"));
- fs.mkdirs(new Path("/workflow/staging/falcon/workflows/process/"
- + PROCESS_NAME + "/logs/job-2010-01-01-01-00/002"));
- Path run3 = new Path("/workflow/staging/falcon/workflows/process/"
- + PROCESS_NAME + "/logs/job-2010-01-01-01-00/003");
- fs.mkdirs(run3);
- fs.createNewFile(new Path(run3, "oozie.log"));
-
- testProcess = new ProcessEntityParser().parse(LogMoverTest.class
- .getResourceAsStream("/org/apache/falcon/logging/process.xml"));
- testProcess.setName(PROCESS_NAME);
- STORE.publish(EntityType.PROCESS, testProcess);
- }
-
- @BeforeMethod
- public void setInstance() {
- instance = new Instance();
- instance.status = WorkflowStatus.SUCCEEDED;
- instance.instance = "2010-01-01T01:00Z";
- instance.cluster = "testCluster";
- instance.logFile = "http://localhost:15000/oozie/wflog";
- }
-
- private void cleanupStore() throws FalconException {
- for (EntityType type : EntityType.values()) {
- Collection<String> entities = STORE.getEntities(type);
- for (String entity : entities) {
- STORE.remove(type, entity);
- }
- }
- }
-
- @Test
- public void testLogProviderWithValidRunId() throws FalconException {
- LogProvider provider = new LogProvider();
- Instance instanceWithLog = provider.populateLogUrls(testProcess,
- instance, "0");
- Assert.assertEquals(
- instance.logFile,
- "http://localhost:50070/data/workflow/staging/falcon/workflows/process/testProcess/logs/job-2010-01"
- + "-01-01-00/000/oozie.log");
-
- InstanceAction action = instanceWithLog.actions[0];
- Assert.assertEquals(action.action, "mr_Action2");
- Assert.assertEquals(action.status, "SUCCEEDED");
- Assert.assertEquals(
- action.logFile,
- "http://localhost:50070/data/workflow/staging/falcon/workflows/process/testProcess/logs/job-2010-01"
- + "-01-01-00/000/mr_Action2_SUCCEEDED.log");
-
- action = instanceWithLog.actions[1];
- Assert.assertEquals(action.action, "mr_Action");
- Assert.assertEquals(action.status, "FAILED");
- Assert.assertEquals(
- action.logFile,
- "http://localhost:50070/data/workflow/staging/falcon/workflows/process/testProcess/logs/job-2010-01"
- + "-01-01-00/000/mr_Action_FAILED.log");
- }
-
- @Test
- public void testLogProviderWithInvalidRunId() throws FalconException {
- LogProvider provider = new LogProvider();
- provider.populateLogUrls(testProcess, instance, "x");
- Assert.assertEquals(instance.logFile,
- "http://localhost:15000/oozie/wflog");
- }
-
- @Test
- public void testLogProviderWithUnavailableRunId() throws FalconException {
- LogProvider provider = new LogProvider();
- instance.logFile = null;
- provider.populateLogUrls(testProcess, instance, "7");
- Assert.assertEquals(instance.logFile, "-");
- }
-
- @Test
- public void testLogProviderWithEmptyRunId() throws FalconException {
- LogProvider provider = new LogProvider();
- instance.logFile = null;
- provider.populateLogUrls(testProcess, instance, null);
- Assert.assertEquals(
- instance.logFile,
- "http://localhost:50070/data/workflow/staging/falcon/workflows/process/testProcess/logs/"
- + "job-2010-01-01-01-00/003/oozie.log");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/test/java/org/apache/falcon/resource/AbstractTestBase.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/resource/AbstractTestBase.java b/webapp/src/test/java/org/apache/falcon/resource/AbstractTestBase.java
deleted file mode 100644
index 3ddd282..0000000
--- a/webapp/src/test/java/org/apache/falcon/resource/AbstractTestBase.java
+++ /dev/null
@@ -1,410 +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.
- */
-
-package org.apache.falcon.resource;
-
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import org.apache.commons.lang.RandomStringUtils;
-import org.apache.falcon.FalconException;
-import org.apache.falcon.cluster.util.EmbeddedCluster;
-import org.apache.falcon.cluster.util.StandAloneCluster;
-import org.apache.falcon.entity.store.ConfigurationStore;
-import org.apache.falcon.entity.v0.EntityType;
-import org.apache.falcon.entity.v0.SchemaHelper;
-import org.apache.falcon.entity.v0.cluster.Cluster;
-import org.apache.falcon.entity.v0.feed.Feed;
-import org.apache.falcon.util.EmbeddedServer;
-import org.apache.falcon.util.StartupProperties;
-import org.apache.falcon.workflow.engine.OozieClientFactory;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.fs.permission.FsPermission;
-import org.apache.oozie.client.*;
-import org.apache.oozie.client.Job.Status;
-import org.testng.Assert;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeClass;
-
-import javax.servlet.ServletInputStream;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriBuilder;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import java.io.*;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Base test class for CLI, Entity and Process Instances.
- */
-public class AbstractTestBase {
- protected static final String FEED_TEMPLATE1 = "/feed-template1.xml";
- protected static final String FEED_TEMPLATE2 = "/feed-template2.xml";
-
- protected String clusterFileTemplate = "/cluster-template.xml";
-
- protected static final String SAMPLE_PROCESS_XML = "/process-version-0.xml";
- protected static final String PROCESS_TEMPLATE = "/process-template.xml";
-
- protected static final String BASE_URL = "http://localhost:15000/";
- protected static final String REMOTE_USER = System.getProperty("user.name");
-
- protected EmbeddedServer server;
-
- protected Unmarshaller unmarshaller;
- protected Marshaller marshaller;
-
- protected EmbeddedCluster cluster;
- protected WebResource service = null;
- protected String clusterName;
- protected String processName;
- protected String outputFeedName;
-
- private static final Pattern VAR_PATTERN = Pattern.compile("##[A-Za-z0-9_]*##");
-
- protected void scheduleProcess(String processTemplate, Map<String, String> overlay) throws Exception {
- ClientResponse response = submitToFalcon(clusterFileTemplate, overlay, EntityType.CLUSTER);
- assertSuccessful(response);
-
- response = submitToFalcon(FEED_TEMPLATE1, overlay, EntityType.FEED);
- assertSuccessful(response);
-
- response = submitToFalcon(FEED_TEMPLATE2, overlay, EntityType.FEED);
- assertSuccessful(response);
-
- response = submitToFalcon(processTemplate, overlay, EntityType.PROCESS);
- assertSuccessful(response);
- ClientResponse clientRepsonse = this.service.path("api/entities/schedule/process/" + processName)
- .header("Remote-User", REMOTE_USER).accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML).post(
- ClientResponse.class);
- assertSuccessful(clientRepsonse);
- }
-
- protected void scheduleProcess() throws Exception {
- scheduleProcess(PROCESS_TEMPLATE, getUniqueOverlay());
- }
-
- private List<WorkflowJob> getRunningJobs(String entityName) throws Exception {
- OozieClient ozClient = OozieClientFactory.get(
- (Cluster) ConfigurationStore.get().get(EntityType.CLUSTER, clusterName));
- StringBuilder builder = new StringBuilder();
- builder.append(OozieClient.FILTER_STATUS).append('=').append(Job.Status.RUNNING).append(';');
- builder.append(OozieClient.FILTER_NAME).append('=').append("FALCON_PROCESS_DEFAULT_").append(entityName);
- return ozClient.getJobsInfo(builder.toString());
- }
-
- protected void waitForWorkflowStart(String entityName) throws Exception {
- for (int i = 0; i < 10; i++) {
- List<WorkflowJob> jobs = getRunningJobs(entityName);
- if (jobs != null && !jobs.isEmpty()) {
- return;
- }
-
- System.out.println("Waiting for workflow to start");
- Thread.sleep(i * 1000);
- }
- throw new Exception("Workflow for " + entityName + " hasn't started in oozie");
- }
-
- protected void waitForProcessWFtoStart() throws Exception {
- waitForWorkflowStart(processName);
- }
-
- protected void waitForOutputFeedWFtoStart() throws Exception {
- waitForWorkflowStart(outputFeedName);
- }
-
- protected void waitForBundleStart(Status status) throws Exception {
- OozieClient ozClient = OozieClientFactory.get(clusterName);
- List<BundleJob> bundles = getBundles();
- if (bundles.isEmpty()) {
- return;
- }
-
- String bundleId = bundles.get(0).getId();
- for (int i = 0; i < 15; i++) {
- Thread.sleep(i * 1000);
- BundleJob bundle = ozClient.getBundleJobInfo(bundleId);
- if (bundle.getStatus() == status) {
- if (status == Status.FAILED) {
- return;
- }
-
- boolean done = false;
- for (CoordinatorJob coord : bundle.getCoordinators()) {
- if (coord.getStatus() == status) {
- done = true;
- }
- }
- if (done) {
- return;
- }
- }
- System.out.println("Waiting for bundle " + bundleId + " in " + status + " state");
- }
- throw new Exception("Bundle " + bundleId + " is not " + status + " in oozie");
- }
-
- public AbstractTestBase() {
- try {
- JAXBContext jaxbContext = JAXBContext.newInstance(APIResult.class, Feed.class, Process.class, Cluster.class,
- InstancesResult.class);
- unmarshaller = jaxbContext.createUnmarshaller();
- marshaller = jaxbContext.createMarshaller();
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- @BeforeClass
- public void configure() throws Exception {
- StartupProperties.get().setProperty(
- "application.services",
- StartupProperties.get().getProperty("application.services")
- .replace("org.apache.falcon.service.ProcessSubscriberService", ""));
- String store = StartupProperties.get().getProperty("config.store.uri");
- StartupProperties.get().setProperty("config.store.uri", store + System.currentTimeMillis());
- if (new File("webapp/src/main/webapp").exists()) {
- this.server = new EmbeddedServer(15000, "webapp/src/main/webapp");
- } else if (new File("src/main/webapp").exists()) {
- this.server = new EmbeddedServer(15000, "src/main/webapp");
- } else {
- throw new RuntimeException("Cannot run jersey tests");
- }
- ClientConfig config = new DefaultClientConfig();
- Client client = Client.create(config);
- this.service = client.resource(UriBuilder.fromUri(BASE_URL).build());
- this.server.start();
-
- if (System.getProperty("falcon.test.hadoop.embedded", "true").equals("true")) {
- clusterFileTemplate = "target/cluster-template.xml";
- this.cluster = EmbeddedCluster.newCluster("##cluster##", true);
- Cluster clusterEntity = this.cluster.getCluster();
- FileOutputStream out = new FileOutputStream(clusterFileTemplate);
- marshaller.marshal(clusterEntity, out);
- out.close();
- } else {
- Map<String, String> overlay = new HashMap<String, String>();
- overlay.put("cluster", RandomStringUtils.randomAlphabetic(5));
- String file = overlayParametersOverTemplate(clusterFileTemplate, overlay);
- this.cluster = StandAloneCluster.newCluster(file);
- clusterName = cluster.getCluster().getName();
- }
-
- cleanupStore();
-
- // setup dependent workflow and lipath in hdfs
- FileSystem fs = FileSystem.get(this.cluster.getConf());
- fs.mkdirs(new Path("/falcon"), new FsPermission((short) 511));
-
- Path wfParent = new Path("/falcon/test");
- fs.delete(wfParent, true);
- Path wfPath = new Path(wfParent, "workflow");
- fs.mkdirs(wfPath);
- fs.copyFromLocalFile(false, true, new Path(this.getClass().getResource("/fs-workflow.xml").getPath()),
- new Path(wfPath,
- "workflow.xml"));
- fs.mkdirs(new Path(wfParent, "input/2012/04/20/00"));
- Path outPath = new Path(wfParent, "output");
- fs.mkdirs(outPath);
- fs.setPermission(outPath, new FsPermission((short) 511));
- }
-
- /**
- * Converts a InputStream into ServletInputStream.
- *
- * @param fileName
- * @return ServletInputStream
- * @throws java.io.IOException
- */
- protected ServletInputStream getServletInputStream(String fileName) throws IOException {
- return getServletInputStream(new FileInputStream(fileName));
- }
-
- protected ServletInputStream getServletInputStream(final InputStream stream) {
- return new ServletInputStream() {
-
- @Override
- public int read() throws IOException {
- return stream.read();
- }
- };
- }
-
- public void tearDown() throws Exception {
- this.cluster.shutdown();
- server.stop();
- }
-
- public void cleanupStore() throws Exception {
- for (EntityType type : EntityType.values()) {
- for (String name : ConfigurationStore.get().getEntities(type)) {
- ConfigurationStore.get().remove(type, name);
- }
- }
- }
-
- protected ClientResponse submitAndSchedule(String template, Map<String, String> overlay, EntityType entityType)
- throws Exception {
- String tmpFile = overlayParametersOverTemplate(template, overlay);
- ServletInputStream rawlogStream = getServletInputStream(tmpFile);
-
- return this.service.path("api/entities/submitAndSchedule/" + entityType.name().toLowerCase())
- .header("Remote-User", "testuser").accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML)
- .post(ClientResponse.class, rawlogStream);
- }
-
- protected ClientResponse submitToFalcon(String template, Map<String, String> overlay, EntityType entityType)
- throws IOException {
- String tmpFile = overlayParametersOverTemplate(template, overlay);
- return submitFileToFalcon(entityType, tmpFile);
- }
-
- private ClientResponse submitFileToFalcon(EntityType entityType, String tmpFile) throws IOException {
-
- ServletInputStream rawlogStream = getServletInputStream(tmpFile);
-
- return this.service.path("api/entities/submit/" + entityType.name().toLowerCase()).header("Remote-User",
- "testuser")
- .accept(MediaType.TEXT_XML).type(MediaType.TEXT_XML).post(ClientResponse.class, rawlogStream);
- }
-
- protected void assertRequestId(ClientResponse clientRepsonse) {
- String response = clientRepsonse.getEntity(String.class);
- try {
- APIResult result = (APIResult) unmarshaller.unmarshal(new StringReader(response));
- Assert.assertNotNull(result.getRequestId());
- } catch (JAXBException e) {
- Assert.fail("Reponse " + response + " is not valid");
- }
- }
-
- protected void assertStatus(ClientResponse clientRepsonse, APIResult.Status status) {
- String response = clientRepsonse.getEntity(String.class);
- try {
- APIResult result = (APIResult) unmarshaller.unmarshal(new StringReader(response));
- Assert.assertEquals(result.getStatus(), status);
- } catch (JAXBException e) {
- Assert.fail("Reponse " + response + " is not valid");
- }
- }
-
- protected void assertFailure(ClientResponse clientRepsonse) {
- Assert.assertEquals(clientRepsonse.getStatus(), Response.Status.BAD_REQUEST.getStatusCode());
- assertStatus(clientRepsonse, APIResult.Status.FAILED);
- }
-
- protected void assertSuccessful(ClientResponse clientRepsonse) {
- Assert.assertEquals(clientRepsonse.getStatus(), Response.Status.OK.getStatusCode());
- assertStatus(clientRepsonse, APIResult.Status.SUCCEEDED);
- }
-
- protected String overlayParametersOverTemplate(String template, Map<String, String> overlay) throws IOException {
- File tmpFile = getTempFile();
- OutputStream out = new FileOutputStream(tmpFile);
-
- InputStreamReader in;
- if (getClass().getResourceAsStream(template) == null) {
- in = new FileReader(template);
- } else {
- in = new InputStreamReader(getClass().getResourceAsStream(template));
- }
- BufferedReader reader = new BufferedReader(in);
- String line;
- while ((line = reader.readLine()) != null) {
- Matcher matcher = VAR_PATTERN.matcher(line);
- while (matcher.find()) {
- String variable = line.substring(matcher.start(), matcher.end());
- line = line.replace(variable, overlay.get(variable.substring(2, variable.length() - 2)));
- matcher = VAR_PATTERN.matcher(line);
- }
- out.write(line.getBytes());
- out.write("\n".getBytes());
- }
- reader.close();
- out.close();
- return tmpFile.getAbsolutePath();
- }
-
- protected File getTempFile() throws IOException {
- File target = new File("webapp/target");
- if (!target.exists()) {
- target = new File("target");
- }
-
- return File.createTempFile("test", ".xml", target);
- }
-
- protected List<BundleJob> getBundles() throws Exception {
- List<BundleJob> bundles = new ArrayList<BundleJob>();
- if (clusterName == null) {
- return bundles;
- }
-
- OozieClient ozClient = OozieClientFactory.get(cluster.getCluster());
- return ozClient.getBundleJobsInfo("name=FALCON_PROCESS_" + processName, 0, 10);
- }
-
- @AfterClass
- public void cleanup() throws Exception {
- tearDown();
- cleanupStore();
- }
-
- @AfterMethod
- public boolean killOozieJobs() throws Exception {
- if (clusterName == null) {
- return true;
- }
-
- OozieClient ozClient = OozieClientFactory.get(cluster.getCluster());
- List<BundleJob> bundles = getBundles();
- if (bundles != null) {
- for (BundleJob bundle : bundles) {
- ozClient.kill(bundle.getId());
- }
- }
- return false;
- }
-
- protected Map<String, String> getUniqueOverlay() throws FalconException {
- Map<String, String> overlay = new HashMap<String, String>();
- long time = System.currentTimeMillis();
- clusterName = "cluster" + time;
- overlay.put("cluster", clusterName);
- overlay.put("inputFeedName", "in" + time);
- //only feeds with future dates can be scheduled
- Date endDate = new Date(System.currentTimeMillis() + 15 * 60 * 1000);
- overlay.put("feedEndDate", SchemaHelper.formatDateUTC(endDate));
- overlay.put("outputFeedName", "out" + time);
- processName = "p" + time;
- overlay.put("processName", processName);
- outputFeedName = "out" + time;
- return overlay;
- }
-}
[8/8] git commit: FALCON-1 Create packaging and scripts to install
and try Apache Falcon. Contributed by Srikanth Sundarrajan
Posted by ve...@apache.org.
FALCON-1 Create packaging and scripts to install and try Apache Falcon. Contributed by Srikanth Sundarrajan
Project: http://git-wip-us.apache.org/repos/asf/incubator-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-falcon/commit/61417357
Tree: http://git-wip-us.apache.org/repos/asf/incubator-falcon/tree/61417357
Diff: http://git-wip-us.apache.org/repos/asf/incubator-falcon/diff/61417357
Branch: refs/heads/master
Commit: 614173574b0f37a7cb3c068c322ca88326722b47
Parents: d7e2be9
Author: venkatesh <ve...@hortonworks.com>
Authored: Wed Jul 10 13:06:16 2013 -0700
Committer: venkatesh <ve...@hortonworks.com>
Committed: Wed Jul 10 13:06:16 2013 -0700
----------------------------------------------------------------------
.gitignore | 3 +
Installation-steps.txt | 2 +-
build-tools/pom.xml | 22 +
build-tools/src/bin/OOZIE-674.sh | 35 +
.../src/main/resources/falcon/checkstyle.xml | 6 +-
client/bin/falcon | 29 -
client/src/main/resources/falcon.sh | 50 --
common/src/main/resources/log4j.xml | 8 +-
common/src/main/resources/startup.properties | 6 +-
docs/src/site/twiki/FalconDocumentation.twiki | 2 +-
hadoop-webapp/pom.xml | 110 +++
.../falcon/listener/HadoopStartupListener.java | 79 +++
hadoop-webapp/src/main/resources/core-site.xml | 44 ++
hadoop-webapp/src/main/resources/hdfs-site.xml | 64 ++
.../src/main/resources/mapred-site.xml | 68 ++
hadoop-webapp/src/main/webapp/WEB-INF/web.xml | 32 +
messaging/src/main/resources/log4j.xml | 4 +-
oozie-3.2.0-incubating-el.patch | 702 +++++++++++++++++++
oozie-bundle-el-extension.patch | 18 +
oozie-el-extensions/pom.xml | 56 ++
.../oozie/extensions/OozieELExtensions.java | 386 ++++++++++
.../oozie/extensions/TestOozieELExtensions.java | 278 ++++++++
.../src/test/resources/oozie-site.xml | 363 ++++++++++
oozie/pom.xml | 5 +
pom.xml | 67 +-
prism/src/main/resources/log4j.xml | 8 +-
.../converter/OozieProcessMapperTest.java | 6 +
src/bin/falcon | 50 ++
src/bin/falcon-start | 55 ++
src/bin/falcon-stop | 37 +
src/bin/package.sh | 66 ++
src/conf/client.properties | 23 +
src/conf/log4j.xml | 89 +++
src/conf/runtime.properties | 29 +
src/conf/startup.properties | 63 ++
src/main/assemblies/package.xml | 112 +++
webapp/pom.xml | 175 ++++-
.../conf/action-conf/distcp-action-0.1.xsd | 65 ++
.../conf/action-conf/distcp-action-0.2.xsd | 65 ++
.../oozie/conf/action-conf/email-action-0.1.xsd | 33 +
.../conf/action-conf/gms-oozie-sla-0.1.xsd | 78 +++
.../oozie/conf/action-conf/hive-action-0.2.xsd | 68 ++
.../oozie/conf/action-conf/hive-action-0.3.xsd | 68 ++
.../oozie/conf/action-conf/hive-action-0.4.xsd | 68 ++
.../oozie/conf/action-conf/hive-action-0.5.xsd | 69 ++
webapp/src/conf/oozie/conf/action-conf/hive.xml | 35 +
.../conf/action-conf/oozie-buildinfo.properties | 35 +
.../oozie/conf/action-conf/oozie-bundle-0.1.xsd | 61 ++
.../oozie/conf/action-conf/oozie-bundle-0.2.xsd | 75 ++
.../conf/action-conf/oozie-coordinator-0.1.xsd | 132 ++++
.../conf/action-conf/oozie-coordinator-0.2.xsd | 133 ++++
.../conf/action-conf/oozie-coordinator-0.3.xsd | 133 ++++
.../conf/action-conf/oozie-coordinator-0.4.xsd | 147 ++++
.../oozie/conf/action-conf/oozie-sla-0.1.xsd | 63 ++
.../oozie/conf/action-conf/oozie-sla-0.2.xsd | 47 ++
.../conf/action-conf/oozie-workflow-0.1.xsd | 301 ++++++++
.../conf/action-conf/oozie-workflow-0.2.5.xsd | 288 ++++++++
.../conf/action-conf/oozie-workflow-0.2.xsd | 263 +++++++
.../conf/action-conf/oozie-workflow-0.3.xsd | 288 ++++++++
.../conf/action-conf/oozie-workflow-0.4.xsd | 329 +++++++++
.../conf/action-conf/oozie-workflow-0.5.xsd | 339 +++++++++
.../oozie/conf/action-conf/shell-action-0.1.xsd | 73 ++
.../oozie/conf/action-conf/shell-action-0.2.xsd | 73 ++
.../oozie/conf/action-conf/shell-action-0.3.xsd | 73 ++
.../oozie/conf/action-conf/sqoop-action-0.2.xsd | 70 ++
.../oozie/conf/action-conf/sqoop-action-0.3.xsd | 70 ++
.../oozie/conf/action-conf/sqoop-action-0.4.xsd | 70 ++
.../oozie/conf/action-conf/ssh-action-0.1.xsd | 36 +
.../oozie/conf/action-conf/ssh-action-0.2.xsd | 39 ++
.../conf/oozie/conf/hadoop-conf/core-site.xml | 42 ++
webapp/src/conf/oozie/conf/oozie-site.xml | 527 ++++++++++++++
.../src/main/java/org/apache/falcon/Main.java | 15 +-
webapp/src/main/resources/log4j.xml | 8 +-
.../java/org/apache/falcon/cli/FalconCLIIT.java | 603 ++++++++++++++++
.../org/apache/falcon/cli/FalconCLITest.java | 572 ---------------
.../org/apache/falcon/logging/LogMoverIT.java | 162 +++++
.../org/apache/falcon/logging/LogMoverTest.java | 154 ----
.../apache/falcon/logging/LogProviderIT.java | 160 +++++
.../apache/falcon/logging/LogProviderTest.java | 151 ----
.../falcon/resource/AbstractTestBase.java | 410 -----------
.../falcon/resource/EntityManagerJerseyIT.java | 626 +++++++++++++++++
.../resource/EntityManagerJerseyTest.java | 573 ---------------
.../resource/ProcessInstanceManagerIT.java | 154 ++++
.../resource/ProcessInstanceManagerTest.java | 148 ----
.../org/apache/falcon/resource/TestContext.java | 440 ++++++++++++
webapp/src/test/resources/client.properties | 2 +-
webapp/src/test/resources/cluster-template.xml | 10 +-
87 files changed, 9468 insertions(+), 2128 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 2525236..c22e2b3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,3 +31,6 @@ target
#ActiveMQ
activemq-data
build
+
+#log files
+logs
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/Installation-steps.txt
----------------------------------------------------------------------
diff --git a/Installation-steps.txt b/Installation-steps.txt
index a00cfc9..4631dff 100644
--- a/Installation-steps.txt
+++ b/Installation-steps.txt
@@ -69,6 +69,6 @@ qa.config.store.uri=file:///var/lib/tomcat6/target/store
To ensure that Falcon installation on your system uses the qa domain settings, just set the FALCON_DOMAIN value to 'qa' in your environment.
*Falcon logs
-Once deployed, all the Falcon operations are logged in folder /var/log/falcon by default.
+Once deployed, all the Falcon operations are logged in folder ${user.dir}/logs by default.
Application.log contains logs for all the falcon server operations, if Falcon is deployed in distributed mode then prism logs are populated in
Prism.log
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/build-tools/pom.xml
----------------------------------------------------------------------
diff --git a/build-tools/pom.xml b/build-tools/pom.xml
index c7e7c73..a04c807 100644
--- a/build-tools/pom.xml
+++ b/build-tools/pom.xml
@@ -25,4 +25,26 @@
<artifactId>build-tools</artifactId>
<version>0.3-SNAPSHOT</version>
<name>Build Tools</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <id>BUILD-OOZIE</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ <configuration>
+ <executable>src/bin/OOZIE-674.sh</executable>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/build-tools/src/bin/OOZIE-674.sh
----------------------------------------------------------------------
diff --git a/build-tools/src/bin/OOZIE-674.sh b/build-tools/src/bin/OOZIE-674.sh
new file mode 100644
index 0000000..6debd86
--- /dev/null
+++ b/build-tools/src/bin/OOZIE-674.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# 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.
+
+if [ -d `mvn help:effective-settings | grep localRepository | cut -d\> -f2 | cut -d\< -f1`/org/apache/oozie/oozie-core/3.2.2 ]
+then
+ echo "Oozie already setup. skipping";
+ exit 0;
+fi
+
+mkdir -p ../target
+pushd ../target
+rm -rf oozie-3.2.0-incubating*
+curl -v "http://www.gtlib.gatech.edu/pub/apache/oozie/3.2.0-incubating/oozie-3.2.0-incubating.tar.gz" -o oozie-3.2.0-incubating.tgz
+tar -xzvf oozie-3.2.0-incubating.tgz
+cd oozie-3.2.0-incubating
+pwd
+patch -p0 < ../../oozie-3.2.0-incubating-el.patch
+mvn clean install -DskipTests
+rm -rf oozie-3.2.0-incubating*
+popd
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/build-tools/src/main/resources/falcon/checkstyle.xml
----------------------------------------------------------------------
diff --git a/build-tools/src/main/resources/falcon/checkstyle.xml b/build-tools/src/main/resources/falcon/checkstyle.xml
index 0d60e27..6525990 100644
--- a/build-tools/src/main/resources/falcon/checkstyle.xml
+++ b/build-tools/src/main/resources/falcon/checkstyle.xml
@@ -225,9 +225,9 @@
<!-- allow warnings to be suppressed -->
<module name="SuppressionCommentFilter">
- <property name="offCommentFormat" value="SUSPEND CHECKSTYLE CHECK ParameterNumberCheck|VisibilityModifierCheck|HiddenFieldCheck"/>
- <property name="onCommentFormat" value="RESUME CHECKSTYLE CHECK ParameterNumberCheck|VisibilityModifierCheck|HiddenFieldCheck"/>
- <property name="checkFormat" value="ParameterNumberCheck|VisibilityModifierCheck|HiddenFieldCheck"/>
+ <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/61417357/client/bin/falcon
----------------------------------------------------------------------
diff --git a/client/bin/falcon b/client/bin/falcon
deleted file mode 100644
index b0fb0eb..0000000
--- a/client/bin/falcon
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-PRG="${0}"
-BASEDIR=`dirname ${PRG}`
-BASEDIR=`cd ${BASEDIR}/..;pwd`
-
-
-CLASSPATH=${CLASSPATH}:`ls target/falcon-client-*.jar`
-for f in $BASEDIR/target/dependency/*.jar; do
- CLASSPATH=${CLASSPATH}:$f;
-done
-
-exec java -cp $CLASSPATH org.apache.falcon.cli.FalconCLI $@
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/client/src/main/resources/falcon.sh
----------------------------------------------------------------------
diff --git a/client/src/main/resources/falcon.sh b/client/src/main/resources/falcon.sh
deleted file mode 100644
index f45e458..0000000
--- a/client/src/main/resources/falcon.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-#
-# Licensed 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. See accompanying LICENSE file.
-#
-
-# resolve links - $0 may be a softlink
-PRG="${0}"
-
-while [ -h "${PRG}" ]; do
- ls=`ls -ld "${PRG}"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "${PRG}"`/"$link"
- fi
-done
-
-BASEDIR=`dirname ${PRG}`
-BASEDIR=`cd ${BASEDIR}/..;pwd`
-
-FALCONCPPATH=""
-for i in "${BASEDIR}/lib/"*.jar; do
- FALCONCPPATH="${FALCONCPPATH}:$i"
-done
-
-
-if test -z ${JAVA_HOME}
-then
- JAVA_BIN=java
-else
- JAVA_BIN=${JAVA_HOME}/bin/java
-fi
-
-JAVA_PROPERTIES=""
-while [[ ${1} =~ ^\-D ]]; do
- JAVA_PROPERTIES="${JAVA_PROPERTIES} ${1}"
- shift
-done
-${JAVA_BIN} ${JAVA_PROPERTIES} -cp ${FALCONCPPATH} org.apache.falcon.cli.FalconCLI "${@}"
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/common/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/common/src/main/resources/log4j.xml b/common/src/main/resources/log4j.xml
index 189d096..4183181 100644
--- a/common/src/main/resources/log4j.xml
+++ b/common/src/main/resources/log4j.xml
@@ -28,7 +28,7 @@
</appender>
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="/var/log/falcon/application.log"/>
+ <param name="File" value="${user.dir}/logs/application.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
@@ -37,7 +37,7 @@
</appender>
<appender name="AUDIT" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="/var/log/falcon/audit.log"/>
+ <param name="File" value="${user.dir}/logs/audit.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
@@ -46,7 +46,7 @@
</appender>
<appender name="TRANSACTIONLOG" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="/var/log/falcon/tranlog.log"/>
+ <param name="File" value="${user.dir}/logs/tranlog.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
@@ -55,7 +55,7 @@
</appender>
<appender name="METRIC" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="/var/log/falcon/metric.log"/>
+ <param name="File" value="${user.dir}/logs/metric.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/common/src/main/resources/startup.properties
----------------------------------------------------------------------
diff --git a/common/src/main/resources/startup.properties b/common/src/main/resources/startup.properties
index 4accc39..4ff00d7 100644
--- a/common/src/main/resources/startup.properties
+++ b/common/src/main/resources/startup.properties
@@ -44,7 +44,7 @@
*.system.lib.location=${FALCON_HOME}/sharedlibs
-debug.config.store.uri=${user.dir}/target/store
+debug.config.store.uri=file://${user.dir}/target/store
debug.config.oozie.conf.uri=${user.dir}/target/oozie
debug.system.lib.location=${user.dir}/webapp/target/falcon-webapp-${pom.version}/WEB-INF/lib
debug.broker.url=vm://localhost
@@ -57,9 +57,7 @@ debug.retry.recorder.path=${user.dir}/target/retry
*.broker.ttlInMins=4320
*.entity.topic=FALCON.ENTITY.TOPIC
*.max.retry.failure.count=1
-*.retry.recorder.path=/var/log/falcon/retry
+*.retry.recorder.path=${user.dir}/logs/retry
######### Properties for configuring iMon client and metric #########
*.internal.queue.size=1000
-*.imon.inet.address=224.0.0.69
-*.imon.inet.port=9191
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/docs/src/site/twiki/FalconDocumentation.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/FalconDocumentation.twiki b/docs/src/site/twiki/FalconDocumentation.twiki
index fd9e60d..6312627 100644
--- a/docs/src/site/twiki/FalconDocumentation.twiki
+++ b/docs/src/site/twiki/FalconDocumentation.twiki
@@ -460,7 +460,7 @@ Idempotency also by takes care of the condition when request is sent through pri
Falcon provides monitoring of various events by capturing metrics of those events.
The metric numbers can then be used to monitor performance and health of the Falcon system and the entire processing pipelines.
-Users can view the logs of these events in the metric.log file, by default this file is created under /var/log/falcon/ directory.
+Users can view the logs of these events in the metric.log file, by default this file is created under ${user.dir}/logs/ directory.
Users may also extend the Falcon monitoring framework to send events to systems like Mondemand/lwes.
The following events are captured by Falcon for logging the metrics:
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/hadoop-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-webapp/pom.xml b/hadoop-webapp/pom.xml
new file mode 100644
index 0000000..ba5ee02
--- /dev/null
+++ b/hadoop-webapp/pom.xml
@@ -0,0 +1,110 @@
+<?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/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.falcon</groupId>
+ <artifactId>falcon-main</artifactId>
+ <version>0.3-SNAPSHOT</version>
+ </parent>
+ <artifactId>falcon-hadoop-webapp</artifactId>
+ <description>Apache Falcon Embedded Hadoop - Test Cluster</description>
+ <name>Apache Falcon Embedded Hadoop - Test Cluster</name>
+ <packaging>war</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.falcon</groupId>
+ <artifactId>falcon-oozie-el-extension</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.8</version>
+ <executions>
+ <execution>
+ <id>explode-war</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-webapp</artifactId>
+ <type>war</type>
+ <outputDirectory>${project.build.directory}/oozie</outputDirectory>
+ <destFileName>oozie.war</destFileName>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.8</version>
+ <executions>
+ <execution>
+ <id>add-jars</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/oozie/WEB-INF/lib</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </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" />
+ </war>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/hadoop-webapp/src/main/java/org/apache/falcon/listener/HadoopStartupListener.java
----------------------------------------------------------------------
diff --git a/hadoop-webapp/src/main/java/org/apache/falcon/listener/HadoopStartupListener.java b/hadoop-webapp/src/main/java/org/apache/falcon/listener/HadoopStartupListener.java
new file mode 100644
index 0000000..28013f8
--- /dev/null
+++ b/hadoop-webapp/src/main/java/org/apache/falcon/listener/HadoopStartupListener.java
@@ -0,0 +1,79 @@
+/**
+ * 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.falcon.listener;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hdfs.server.datanode.DataNode;
+import org.apache.hadoop.hdfs.server.namenode.NameNode;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.JobTracker;
+import org.apache.hadoop.mapred.TaskTracker;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import java.io.File;
+
+/**
+ * Listener for bootstrapping embedded hadoop cluster for integration tests.
+ */
+public class HadoopStartupListener implements ServletContextListener {
+
+ @Override
+ public void contextInitialized(ServletContextEvent sce) {
+ try {
+ FileUtils.deleteDirectory(new File(System.getProperty("hadoop.tmp.dir")));
+ final Configuration conf = new Configuration();
+
+ NameNode.format(conf);
+ final String[] emptyArgs = {};
+ NameNode.createNameNode(emptyArgs, conf);
+ DataNode.createDataNode(emptyArgs, conf);
+ final JobTracker jobTracker = JobTracker.startTracker(new JobConf(conf));
+ new Thread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ jobTracker.offerService();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }).start();
+ new Thread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ TaskTracker taskTracker = new TaskTracker(new JobConf(conf));
+ taskTracker.run();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }).start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RuntimeException("Unable to start hadoop cluster", e);
+ }
+ }
+
+ @Override
+ public void contextDestroyed(ServletContextEvent sce) {
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/hadoop-webapp/src/main/resources/core-site.xml
----------------------------------------------------------------------
diff --git a/hadoop-webapp/src/main/resources/core-site.xml b/hadoop-webapp/src/main/resources/core-site.xml
new file mode 100644
index 0000000..02c8d42
--- /dev/null
+++ b/hadoop-webapp/src/main/resources/core-site.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+ 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>fs.default.name</name>
+ <value>hdfs://localhost:41020</value>
+ </property>
+
+ <property>
+ <name>hadoop.proxyuser.${user.name}.groups</name>
+ <value>*</value>
+ <description>Allow the superuser oozie to impersonate any members of the group group1 and group2</description>
+ </property>
+
+ <property>
+ <name>hadoop.proxyuser.${user.name}.hosts</name>
+ <value>*</value>
+ <description>The superuser can connect only from host1 and host2 to impersonate a user</description>
+ </property>
+
+ <property>
+ <name>hadoop.tmp.dir</name>
+ <value>${project.build.directory}/tmp-hadoop-${user.name}</value>
+ <description>A base for other temporary directories.</description>
+ </property>
+</configuration>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/hadoop-webapp/src/main/resources/hdfs-site.xml
----------------------------------------------------------------------
diff --git a/hadoop-webapp/src/main/resources/hdfs-site.xml b/hadoop-webapp/src/main/resources/hdfs-site.xml
new file mode 100644
index 0000000..0b929e6
--- /dev/null
+++ b/hadoop-webapp/src/main/resources/hdfs-site.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+ 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.
+-->
+
+<!-- Put site-specific property overrides in this file. -->
+
+<configuration>
+ <property>
+ <name>dfs.replication</name>
+ <value>1</value>
+ </property>
+
+ <property>
+ <name>dfs.datanode.address</name>
+ <value>0.0.0.0:41110</value>
+ <description>
+ The datanode server address and port for data transfer.
+ If the port is 0 then the server will start on a free port.
+ </description>
+ </property>
+
+ <property>
+ <name>dfs.datanode.http.address</name>
+ <value>0.0.0.0:41175</value>
+ <description>
+ The datanode http server address and port.
+ If the port is 0 then the server will start on a free port.
+ </description>
+ </property>
+
+ <property>
+ <name>dfs.datanode.ipc.address</name>
+ <value>0.0.0.0:41120</value>
+ <description>
+ The datanode ipc server address and port.
+ If the port is 0 then the server will start on a free port.
+ </description>
+ </property>
+
+ <property>
+ <name>dfs.http.address</name>
+ <value>0.0.0.0:41170</value>
+ <description>
+ The address and the base port where the dfs namenode web ui will listen on.
+ If the port is 0 then the server will start on a free port.
+ </description>
+ </property>
+</configuration>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/hadoop-webapp/src/main/resources/mapred-site.xml
----------------------------------------------------------------------
diff --git a/hadoop-webapp/src/main/resources/mapred-site.xml b/hadoop-webapp/src/main/resources/mapred-site.xml
new file mode 100644
index 0000000..5328d6b
--- /dev/null
+++ b/hadoop-webapp/src/main/resources/mapred-site.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+ 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.
+-->
+
+<!-- Put site-specific property overrides in this file. -->
+
+<configuration>
+ <property>
+ <name>mapred.job.tracker</name>
+ <value>localhost:41021</value>
+ </property>
+
+ <property>
+ <name>mapred.tasktracker.map.tasks.maximum</name>
+ <value>2</value>
+ <description>The maximum number of map tasks that will be run
+ simultaneously by a task tracker.
+ </description>
+ </property>
+
+ <property>
+ <name>mapred.tasktracker.reduce.tasks.maximum</name>
+ <value>1</value>
+ <description>The maximum number of reduce tasks that will be run
+ simultaneously by a task tracker.
+ </description>
+ </property>
+
+ <property>
+ <name>mapreduce.jobtracker.staging.root.dir</name>
+ <value>/user</value>
+ </property>
+
+ <property>
+ <name>mapred.job.tracker.http.address</name>
+ <value>0.0.0.0:41130</value>
+ <description>
+ The job tracker http server address and port the server will listen on.
+ If the port is 0 then the server will start on a free port.
+ </description>
+ </property>
+
+ <property>
+ <name>mapred.task.tracker.http.address</name>
+ <value>0.0.0.0:41160</value>
+ <description>
+ The task tracker http server address and port.
+ If the port is 0 then the server will start on a free port.
+ </description>
+ </property>
+
+</configuration>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/hadoop-webapp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/hadoop-webapp/src/main/webapp/WEB-INF/web.xml b/hadoop-webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..8b186ad
--- /dev/null
+++ b/hadoop-webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,32 @@
+<?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.
+ -->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+ <display-name>Apache Falcon Embedded Hadoop - Test Cluster</display-name>
+ <description>Apache Falcon Embedded Hadoop - Test Cluster</description>
+
+ <listener>
+ <listener-class>org.apache.falcon.listener.HadoopStartupListener</listener-class>
+ </listener>
+
+</web-app>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/messaging/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/messaging/src/main/resources/log4j.xml b/messaging/src/main/resources/log4j.xml
index 2788c63..50f3cdf 100644
--- a/messaging/src/main/resources/log4j.xml
+++ b/messaging/src/main/resources/log4j.xml
@@ -28,7 +28,7 @@
</appender>
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="/var/log/falcon/application.log"/>
+ <param name="File" value="${user.dir}/logs/application.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
@@ -37,7 +37,7 @@
</appender>
<appender name="AUDIT" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="/var/log/falcon/audit.log"/>
+ <param name="File" value="${user.dir}/logs/audit.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/oozie-3.2.0-incubating-el.patch
----------------------------------------------------------------------
diff --git a/oozie-3.2.0-incubating-el.patch b/oozie-3.2.0-incubating-el.patch
new file mode 100644
index 0000000..87a27bc
--- /dev/null
+++ b/oozie-3.2.0-incubating-el.patch
@@ -0,0 +1,702 @@
+diff --git client/pom.xml client/pom.xml
+index 72da9bc..4e41e28 100644
+--- client/pom.xml
++++ client/pom.xml
+@@ -22,11 +22,11 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-client</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie Client</description>
+ <name>Apache Oozie Client</name>
+ <packaging>jar</packaging>
+diff --git core/pom.xml core/pom.xml
+index 407478d..efbfb47 100644
+--- core/pom.xml
++++ core/pom.xml
+@@ -22,11 +22,11 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-core</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie Core</description>
+ <name>Apache Oozie Core</name>
+ <packaging>jar</packaging>
+diff --git core/src/main/conf/oozie-site.xml core/src/main/conf/oozie-site.xml
+index 63fd7cc..4ee430e 100644
+--- core/src/main/conf/oozie-site.xml
++++ core/src/main/conf/oozie-site.xml
+@@ -121,7 +121,7 @@
+
+ <property>
+ <name>oozie.service.JPAService.create.db.schema</name>
+- <value>false</value>
++ <value>true</value>
+ <description>
+ Creates Oozie DB.
+
+@@ -330,6 +330,141 @@
+ </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,
++ latest=org.apache.oozie.coord.CoordELFunctions#ph2_coord_latest_echo,
++ future=org.apache.oozie.coord.CoordELFunctions#ph2_coord_future_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>
++
+ <!-- Proxyuser Configuration -->
+
+ <!--
+diff --git distro/pom.xml distro/pom.xml
+index a09fd66..c842fa7 100644
+--- distro/pom.xml
++++ distro/pom.xml
+@@ -22,11 +22,11 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-distro</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie Distro</description>
+ <name>Apache Oozie Distro</name>
+ <packaging>jar</packaging>
+diff --git docs/pom.xml docs/pom.xml
+index 9d3ad8a..42060e7 100644
+--- docs/pom.xml
++++ docs/pom.xml
+@@ -22,11 +22,11 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-docs</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie Docs</description>
+ <name>Apache Oozie Docs</name>
+ <packaging>war</packaging>
+diff --git examples/pom.xml examples/pom.xml
+index 7906c8c..4591630 100644
+--- examples/pom.xml
++++ examples/pom.xml
+@@ -22,11 +22,11 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-examples</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie Examples</description>
+ <name>Apache Oozie Examples</name>
+ <packaging>jar</packaging>
+diff --git hadooplibs/hadoop-0_23_1/pom.xml hadooplibs/hadoop-0_23_1/pom.xml
+index fbfaa98..6f4a4ff 100644
+--- hadooplibs/hadoop-0_23_1/pom.xml
++++ hadooplibs/hadoop-0_23_1/pom.xml
+@@ -22,7 +22,7 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+diff --git hadooplibs/hadoop-0_23_2/pom.xml hadooplibs/hadoop-0_23_2/pom.xml
+index fb59c4e..87713c2 100644
+--- hadooplibs/hadoop-0_23_2/pom.xml
++++ hadooplibs/hadoop-0_23_2/pom.xml
+@@ -22,7 +22,7 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+diff --git hadooplibs/hadoop-0_24_0/pom.xml hadooplibs/hadoop-0_24_0/pom.xml
+index 400ff2b..58fa024 100644
+--- hadooplibs/hadoop-0_24_0/pom.xml
++++ hadooplibs/hadoop-0_24_0/pom.xml
+@@ -22,7 +22,7 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+diff --git hadooplibs/hadoop-1_0_1/pom.xml hadooplibs/hadoop-1_0_1/pom.xml
+index 7ab1307..16bd748 100644
+--- hadooplibs/hadoop-1_0_1/pom.xml
++++ hadooplibs/hadoop-1_0_1/pom.xml
+@@ -22,7 +22,7 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+diff --git hadooplibs/hadoop-test-0_23_1/pom.xml hadooplibs/hadoop-test-0_23_1/pom.xml
+index 1125e2d..dc43c93 100644
+--- hadooplibs/hadoop-test-0_23_1/pom.xml
++++ hadooplibs/hadoop-test-0_23_1/pom.xml
+@@ -22,7 +22,7 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+diff --git hadooplibs/hadoop-test-0_23_2/pom.xml hadooplibs/hadoop-test-0_23_2/pom.xml
+index ca27978..b57d288 100644
+--- hadooplibs/hadoop-test-0_23_2/pom.xml
++++ hadooplibs/hadoop-test-0_23_2/pom.xml
+@@ -22,7 +22,7 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+diff --git hadooplibs/hadoop-test-0_24_0/pom.xml hadooplibs/hadoop-test-0_24_0/pom.xml
+index ca45192..aaedde4 100644
+--- hadooplibs/hadoop-test-0_24_0/pom.xml
++++ hadooplibs/hadoop-test-0_24_0/pom.xml
+@@ -22,7 +22,7 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+diff --git hadooplibs/hadoop-test-1_0_1/pom.xml hadooplibs/hadoop-test-1_0_1/pom.xml
+index 42681eb..7f63435 100644
+--- hadooplibs/hadoop-test-1_0_1/pom.xml
++++ hadooplibs/hadoop-test-1_0_1/pom.xml
+@@ -22,7 +22,7 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+diff --git hadooplibs/pom.xml hadooplibs/pom.xml
+index b589ec6..f51aa32 100644
+--- hadooplibs/pom.xml
++++ hadooplibs/pom.xml
+@@ -22,11 +22,11 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-hadooplibs</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie Hadoop Libs</description>
+ <name>Apache Oozie Hadoop Libs</name>
+ <packaging>pom</packaging>
+diff --git minitest/pom.xml minitest/pom.xml
+index 2e30f28..3baa1b1 100644
+--- minitest/pom.xml
++++ minitest/pom.xml
+@@ -21,7 +21,7 @@
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.oozie.test</groupId>
+ <artifactId>oozie-mini</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <repositories>
+ <repository>
+ <id>central</id>
+@@ -66,13 +66,13 @@
+ <dependency>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-core</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-core</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+diff --git pom.xml pom.xml
+index a9ce403..6b044dc 100644
+--- pom.xml
++++ pom.xml
+@@ -21,7 +21,7 @@
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie Main</description>
+ <name>Apache Oozie Main</name>
+ <packaging>pom</packaging>
+diff --git release-log.txt release-log.txt
+index 40aee58..7b37eff 100644
+--- release-log.txt
++++ release-log.txt
+@@ -3,7 +3,7 @@
+ OOZIE-852 remove pipes binaries from the source (tucu)
+ OOZIE-851 demo workflow example does not enable sharelib for pig and streaming (tucu)
+ OOZIE-850 apache-rat report should be a single global report file (tucu)
+-OOZIE-849 set version in branch-3.2 to 3.2.0-incubating (tucu)
++OOZIE-849 set version in branch-3.2 to 3.2.2 (tucu)
+ OOZIE-852 remove pipes binaries from the source (tucu)
+ OOZIE-851 demo workflow example does not enable sharelib for pig and streaming (tucu)
+ OOZIE-850 apache-rat report should be a single global report file (tucu)
+diff --git sharelib/hive/pom.xml sharelib/hive/pom.xml
+index ba22a8f..5ef0cfa 100644
+--- sharelib/hive/pom.xml
++++ sharelib/hive/pom.xml
+@@ -22,12 +22,12 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <relativePath>../..</relativePath>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-sharelib-hive</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie Share Lib Hive</description>
+ <name>Apache Oozie Share Lib Hive</name>
+ <packaging>jar</packaging>
+diff --git sharelib/oozie/pom.xml sharelib/oozie/pom.xml
+index 0d764e8..ee4f21e 100644
+--- sharelib/oozie/pom.xml
++++ sharelib/oozie/pom.xml
+@@ -22,12 +22,12 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <relativePath>../..</relativePath>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-sharelib-oozie</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie Share Lib Oozie</description>
+ <name>Apache Oozie Share Lib Oozie</name>
+ <packaging>jar</packaging>
+diff --git sharelib/pig/pom.xml sharelib/pig/pom.xml
+index 2dd0b57..58f9ac9 100644
+--- sharelib/pig/pom.xml
++++ sharelib/pig/pom.xml
+@@ -22,12 +22,12 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <relativePath>../..</relativePath>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-sharelib-pig</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie Share Lib Pig</description>
+ <name>Apache Oozie Share Lib Pig</name>
+ <packaging>jar</packaging>
+diff --git sharelib/pom.xml sharelib/pom.xml
+index 1bf4743..6ded846 100644
+--- sharelib/pom.xml
++++ sharelib/pom.xml
+@@ -22,11 +22,11 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-sharelib</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie Share Lib</description>
+ <name>Apache Oozie Share Lib</name>
+ <packaging>pom</packaging>
+diff --git sharelib/sqoop/pom.xml sharelib/sqoop/pom.xml
+index 46c936c..0f1a086 100644
+--- sharelib/sqoop/pom.xml
++++ sharelib/sqoop/pom.xml
+@@ -22,12 +22,12 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <relativePath>../..</relativePath>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-sharelib-sqoop</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie Share Lib Sqoop</description>
+ <name>Apache Oozie Share Lib Sqoop</name>
+ <packaging>jar</packaging>
+diff --git sharelib/streaming/pom.xml sharelib/streaming/pom.xml
+index 6524fcd..ca8551a 100644
+--- sharelib/streaming/pom.xml
++++ sharelib/streaming/pom.xml
+@@ -22,12 +22,12 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <relativePath>../..</relativePath>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-sharelib-streaming</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie Share Lib Streaming</description>
+ <name>Apache Oozie Share Lib Streaming</name>
+ <packaging>jar</packaging>
+diff --git tools/pom.xml tools/pom.xml
+index 02f7f66..e3b0e49 100644
+--- tools/pom.xml
++++ tools/pom.xml
+@@ -22,11 +22,11 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-tools</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie Tools</description>
+ <name>Apache Oozie Tools</name>
+ <packaging>jar</packaging>
+diff --git webapp/pom.xml webapp/pom.xml
+index 38ec438..f354e4b 100644
+--- webapp/pom.xml
++++ webapp/pom.xml
+@@ -22,11 +22,11 @@
+ <parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-main</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ </parent>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-webapp</artifactId>
+- <version>3.2.0-incubating</version>
++ <version>3.2.2</version>
+ <description>Apache Oozie WebApp</description>
+ <name>Apache Oozie WebApp</name>
+ <packaging>war</packaging>
+diff --git core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java
+index 33150a6..6b1b33c 100644
+--- core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java
++++ core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java
+@@ -51,28 +51,36 @@ public class CoordCommandUtils {
+ * parse a function like coord:latest(n)/future() and return the 'n'.
+ * <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,16 +174,17 @@ public class CoordCommandUtils {
+ 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,
+ " start-instance should be equal or earlier than the end-instance \n"
+diff --git core/src/main/java/org/apache/oozie/coord/CoordELEvaluator.java core/src/main/java/org/apache/oozie/coord/CoordELEvaluator.java
+index 764ae4b..b22c696 100644
+--- core/src/main/java/org/apache/oozie/coord/CoordELEvaluator.java
++++ core/src/main/java/org/apache/oozie/coord/CoordELEvaluator.java
+@@ -143,6 +143,9 @@ public class CoordELEvaluator {
+ 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"));
+ }
+diff --git core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
+index 5c85adb..61f0e04 100644
+--- core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
++++ core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
+@@ -39,8 +39,8 @@ import org.apache.oozie.service.HadoopAccessorService;
+ */
+
+ public class CoordELFunctions {
+- final private static String DATASET = "oozie.coord.el.dataset.bean";
+- final private static String COORD_ACTION = "oozie.coord.el.app.bean";
++ final public static String DATASET = "oozie.coord.el.dataset.bean";
++ final public static String COORD_ACTION = "oozie.coord.el.app.bean";
+ final public static String CONFIGURATION = "oozie.coord.el.conf";
+ // INSTANCE_SEPARATOR is used to separate multiple directories into one tag.
+ final public static String INSTANCE_SEPARATOR = "#";
+@@ -946,7 +946,7 @@ public class CoordELFunctions {
+ * @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();
+@@ -979,7 +979,7 @@ public class CoordELFunctions {
+ return current;
+ }
+
+- private static Calendar getEffectiveNominalTime() {
++ public static Calendar getEffectiveNominalTime() {
+ Date datasetInitialInstance = getInitialInstance();
+ TimeZone dsTZ = getDatasetTZ();
+ // Convert Date to Calendar for corresponding TZ
+@@ -1027,7 +1027,7 @@ public class CoordELFunctions {
+ /**
+ * @return dataset TimeZone
+ */
+- private static TimeZone getDatasetTZ() {
++ public static TimeZone getDatasetTZ() {
+ ELEvaluator eval = ELEvaluator.getCurrent();
+ SyncCoordDataset ds = (SyncCoordDataset) eval.getVariable(DATASET);
+ if (ds == null) {
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/oozie-bundle-el-extension.patch
----------------------------------------------------------------------
diff --git a/oozie-bundle-el-extension.patch b/oozie-bundle-el-extension.patch
new file mode 100644
index 0000000..0f01fcb
--- /dev/null
+++ b/oozie-bundle-el-extension.patch
@@ -0,0 +1,18 @@
+diff --git webapp/pom.xml webapp/pom.xml
+index 38ec438..c3bc9b8 100644
+--- webapp/pom.xml
++++ webapp/pom.xml
+@@ -33,6 +33,13 @@
+
+ <dependencies>
+ <dependency>
++ <groupId>org.apache.falcon</groupId>
++ <artifactId>falcon-oozie-el-extension</artifactId>
++ <version>0.3-SNAPSHOT</version>
++ <scope>compile</scope>
++ </dependency>
++
++ <dependency>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-core</artifactId>
+ <scope>compile</scope>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/oozie-el-extensions/pom.xml
----------------------------------------------------------------------
diff --git a/oozie-el-extensions/pom.xml b/oozie-el-extensions/pom.xml
new file mode 100644
index 0000000..d06a098
--- /dev/null
+++ b/oozie-el-extensions/pom.xml
@@ -0,0 +1,56 @@
+<?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/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.falcon</groupId>
+ <artifactId>falcon-main</artifactId>
+ <version>0.3-SNAPSHOT</version>
+ </parent>
+ <artifactId>falcon-oozie-el-extension</artifactId>
+ <description>Apache Falcon Oozie EL Extension</description>
+ <name>Apache Falcon Oozie EL Extension</name>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.oozie</groupId>
+ <artifactId>oozie-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.findbugs</groupId>
+ <artifactId>annotations</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/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
new file mode 100644
index 0000000..62b65b2
--- /dev/null
+++ b/oozie-el-extensions/src/main/java/org/apache/oozie/extensions/OozieELExtensions.java
@@ -0,0 +1,386 @@
+/**
+ * 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.extensions;
+
+import java.util.Calendar;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.oozie.command.coord.CoordCommandUtils;
+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;
+import org.jdom.Attribute;
+import org.jdom.Element;
+import org.jdom.Text;
+
+/**
+ * Oozie EL Extensions for falcon.
+ */
+@SuppressWarnings("unchecked")
+//SUSPEND CHECKSTYLE CHECK MethodName
+public final class OozieELExtensions {
+
+ private enum TruncateBoundary {
+ NONE, DAY, MONTH, QUARTER, YEAR
+ }
+
+ public static final String COORD_CURRENT = "coord:current";
+
+ private OozieELExtensions() {
+ }
+
+ public static String ph1_dataIn_echo(String dataInName, String part) {
+ return "dataIn('" + dataInName + "', '" + part + "')";
+ }
+
+ public static String ph3_dataIn(String dataInName, String part) {
+ ELEvaluator eval = ELEvaluator.getCurrent();
+ String uristr = (String) eval.getVariable(".datain." + dataInName);
+
+ //optional input
+ if (uristr == null) {
+ Element dsEle = getDSElement(eval, dataInName);
+ Configuration conf = new Configuration();
+ SyncCoordAction appInst = (SyncCoordAction) eval.getVariable(CoordELFunctions.COORD_ACTION);
+ try {
+ ELEvaluator instEval = CoordELEvaluator.createInstancesELEvaluator(dsEle, appInst, conf);
+ StringBuilder instances = new StringBuilder();
+ CoordCommandUtils.resolveInstanceRange(dsEle, instances , appInst, conf, instEval);
+ uristr = CoordCommandUtils.createEarlyURIs(dsEle, instances.toString(),
+ new StringBuilder(), new StringBuilder());
+ uristr = uristr.replace(CoordELFunctions.INSTANCE_SEPARATOR, ",");
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to resolve instance range for " + dataInName, e);
+ }
+ } else {
+ Boolean unresolved = (Boolean) eval.getVariable(".datain." + dataInName + ".unresolved");
+ if (unresolved != null && unresolved) {
+ throw new RuntimeException("There are unresolved instances in " + uristr);
+ }
+ }
+
+ if (StringUtils.isNotEmpty(uristr) && StringUtils.isNotEmpty(part) && !part.equals("null")) {
+ String[] uris = uristr.split(",");
+ StringBuilder mappedUris = new StringBuilder();
+ for (String uri : uris) {
+ if (uri.trim().length() == 0) {
+ continue;
+ }
+ if (mappedUris.length() > 0) {
+ mappedUris.append(",");
+ }
+ mappedUris.append(uri).append("/").append(part);
+ }
+ return mappedUris.toString();
+ }
+ return uristr;
+ }
+
+ private static Element getDSElement(ELEvaluator eval, String dataInName) {
+ Element ele = new Element("datain");
+ Element dsEle = new Element("dataset");
+ ele.getChildren().add(dsEle);
+
+ String[] attrs = {"initial-instance", "frequency", "freq_timeunit", "timezone", "end_of_duration"};
+ for (String attr : attrs) {
+ dsEle.getAttributes().add(new Attribute(attr, (String) eval.getVariable(dataInName + "." + attr)));
+ }
+
+ String[] children = {"done-flag", "uri-template"};
+ for (String child : children) {
+ Element childEle = new Element(child);
+ childEle.setContent(new Text(((String) eval.getVariable(dataInName + "." + child)).replace('%', '$')));
+ dsEle.getChildren().add(childEle);
+ }
+
+ String[] eleChildren = {"start-instance", "end-instance"};
+ for (String child : eleChildren) {
+ Element childEle = new Element(child);
+ childEle.setContent(new Text("${" + ((String) eval.getVariable(dataInName + "." + child)) + "}"));
+ ele.getChildren().add(childEle);
+ }
+
+ return ele;
+ }
+
+ public static String ph1_now_echo(int hr, int min) {
+ ELEvaluator eval = ELEvaluator.getCurrent();
+ eval.setVariable(".wrap", "true");
+ return "now(" + hr + "," + min + ")"; // Unresolved
+ }
+
+ public static String ph1_today_echo(int hr, int min) {
+ ELEvaluator eval = ELEvaluator.getCurrent();
+ eval.setVariable(".wrap", "true");
+ return "today(" + hr + ", " + min + ")"; // Unresolved
+ }
+
+ public static String ph1_yesterday_echo(int hr, int min) {
+ ELEvaluator eval = ELEvaluator.getCurrent();
+ eval.setVariable(".wrap", "true");
+ return "yesterday(" + hr + ", " + min + ")"; // Unresolved
+ }
+
+ public static String ph1_currentMonth_echo(int day, int hr, int min) {
+ ELEvaluator eval = ELEvaluator.getCurrent();
+ eval.setVariable(".wrap", "true");
+ return "currentMonth(" + day + ", " + hr + ", " + min + ")"; // Unresolved
+ }
+
+ public static String ph1_lastMonth_echo(int day, int hr, int min) {
+ ELEvaluator eval = ELEvaluator.getCurrent();
+ eval.setVariable(".wrap", "true");
+ return "lastMonth(" + day + ", " + hr + ", " + min + ")"; // Unresolved
+ }
+
+ public static String ph1_currentYear_echo(int month, int day, int hr, int min) {
+ ELEvaluator eval = ELEvaluator.getCurrent();
+ eval.setVariable(".wrap", "true");
+ return "currentYear(" + month + ", " + day + ", " + hr + ", " + min + ")"; // Unresolved
+ }
+
+ public static String ph1_lastYear_echo(int month, int day, int hr, int min) {
+ ELEvaluator eval = ELEvaluator.getCurrent();
+ eval.setVariable(".wrap", "true");
+ return "lastYear(" + month + ", " + day + ", " + hr + ", " + min + ")"; // Unresolved
+ }
+
+ public static String ph2_now_inst(int hr, int min) {
+ return mapToCurrentInstance(TruncateBoundary.NONE, 0, 0, 0, hr, min);
+ }
+
+ public static String ph2_today_inst(int hr, int min) {
+ return mapToCurrentInstance(TruncateBoundary.DAY, 0, 0, 0, hr, min);
+ }
+
+ public static String ph2_yesterday_inst(int hr, int min) {
+ return mapToCurrentInstance(TruncateBoundary.DAY, 0, 0, -1, hr, min);
+ }
+
+ public static String ph2_currentMonth_inst(int day, int hr, int min) {
+ return mapToCurrentInstance(TruncateBoundary.MONTH, 0, 0, day, hr, min);
+ }
+
+ public static String ph2_lastMonth_inst(int day, int hr, int min) {
+ return mapToCurrentInstance(TruncateBoundary.MONTH, 0, -1, day, hr, min);
+ }
+
+ public static String ph2_currentYear_inst(int month, int day, int hr, int min) {
+ return mapToCurrentInstance(TruncateBoundary.YEAR, 0, month, day, hr, min);
+ }
+
+ public static String ph2_lastYear_inst(int month, int day, int hr, int min) {
+ return mapToCurrentInstance(TruncateBoundary.YEAR, -1, month, day, hr, min);
+ }
+
+ private static String evaluateCurrent(String curExpr) throws Exception {
+ if (curExpr.equals("")) {
+ return curExpr;
+ }
+
+ int inst = CoordCommandUtils.parseOneArg(curExpr);
+ return CoordELFunctions.ph2_coord_current(inst);
+ }
+
+ public static String ph2_now(int hr, int min) throws Exception {
+ if (isDatasetContext()) {
+ String inst = ph2_now_inst(hr, min);
+ return evaluateCurrent(inst);
+ } else {
+ return getEffectiveTimeStr(TruncateBoundary.NONE, 0, 0, 0, hr, min);
+ }
+ }
+
+ private static boolean isActionContext() {
+ return !isDatasetContext();
+ }
+
+ private static boolean isDatasetContext() {
+ ELEvaluator eval = ELEvaluator.getCurrent();
+ SyncCoordDataset ds = (SyncCoordDataset) eval.getVariable(CoordELFunctions.DATASET);
+ return ds != null;
+ }
+
+ 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.formatDateUTC(time);
+ }
+
+ @edu.umd.cs.findbugs.annotations.SuppressWarnings({"SF_SWITCH_FALLTHROUGH"})
+ private static Calendar getEffectiveTime(TruncateBoundary trunc, int yr, int mon, int day, int hr, int min) {
+ Calendar cal;
+ if (isActionContext()) {
+ ELEvaluator eval = ELEvaluator.getCurrent();
+ SyncCoordAction action = ParamChecker.notNull((SyncCoordAction)
+ eval.getVariable(CoordELFunctions.COORD_ACTION),
+ "Coordinator Action");
+ cal = Calendar.getInstance(action.getTimeZone());
+ cal.setTime(action.getNominalTime());
+ } else {
+ Calendar tmp = CoordELFunctions.getEffectiveNominalTime();
+ if (tmp == null) {
+ return null;
+ }
+ cal = Calendar.getInstance(CoordELFunctions.getDatasetTZ());
+ cal.setTimeInMillis(tmp.getTimeInMillis());
+ }
+
+ // truncate
+ switch (trunc) {
+ case YEAR:
+ cal.set(Calendar.MONTH, 0);
+
+ case MONTH:
+ cal.set(Calendar.DAY_OF_MONTH, 1);
+
+ case DAY:
+ cal.set(Calendar.HOUR_OF_DAY, 0);
+ cal.set(Calendar.MINUTE, 0);
+ cal.set(Calendar.SECOND, 0);
+ cal.set(Calendar.MILLISECOND, 0);
+ break;
+
+ case NONE: // don't truncate
+ break;
+
+ default:
+ throw new IllegalArgumentException("Truncation boundary " + trunc + " is not supported");
+ }
+
+ // add
+ cal.add(Calendar.YEAR, yr);
+ cal.add(Calendar.MONTH, mon);
+ cal.add(Calendar.DAY_OF_MONTH, day);
+ cal.add(Calendar.HOUR_OF_DAY, hr);
+ cal.add(Calendar.MINUTE, min);
+ return cal;
+ }
+
+ public static String ph2_today(int hr, int min) throws Exception {
+ if (isDatasetContext()) {
+ String inst = ph2_today_inst(hr, min);
+ return evaluateCurrent(inst);
+ } else {
+ return getEffectiveTimeStr(TruncateBoundary.DAY, 0, 0, 0, hr, min);
+ }
+ }
+
+ public static String ph2_yesterday(int hr, int min) throws Exception {
+ if (isDatasetContext()) {
+ String inst = ph2_yesterday_inst(hr, min);
+ return evaluateCurrent(inst);
+ } else {
+ return getEffectiveTimeStr(TruncateBoundary.DAY, 0, 0, -1, hr, min);
+ }
+ }
+
+ public static String ph2_currentMonth(int day, int hr, int min) throws Exception {
+ if (isDatasetContext()) {
+ String inst = ph2_currentMonth_inst(day, hr, min);
+ return evaluateCurrent(inst);
+ } else {
+ return getEffectiveTimeStr(TruncateBoundary.MONTH, 0, 0, day, hr, min);
+ }
+ }
+
+ public static String ph2_lastMonth(int day, int hr, int min) throws Exception {
+ if (isDatasetContext()) {
+ String inst = ph2_lastMonth_inst(day, hr, min);
+ return evaluateCurrent(inst);
+ } else {
+ return getEffectiveTimeStr(TruncateBoundary.MONTH, 0, -1, day, hr, min);
+ }
+ }
+
+ public static String ph2_currentYear(int month, int day, int hr, int min) throws Exception {
+ if (isDatasetContext()) {
+ String inst = ph2_currentYear_inst(month, day, hr, min);
+ return evaluateCurrent(inst);
+ } else {
+ return getEffectiveTimeStr(TruncateBoundary.YEAR, 0, month, day, hr, min);
+ }
+ }
+
+ public static String ph2_lastYear(int month, int day, int hr, int min) throws Exception {
+ if (isDatasetContext()) {
+ String inst = ph2_lastYear_inst(month, day, hr, min);
+ return evaluateCurrent(inst);
+ } else {
+ return getEffectiveTimeStr(TruncateBoundary.YEAR, -1, month, day, hr, min);
+ }
+ }
+
+ /**
+ * Maps the dataset time to coord:current(n) with respect to action's
+ * nominal time dataset time = truncate(nominal time) + yr + day + month +
+ * hr + min.
+ *
+ * @param trunc
+ * : Truncate resolution
+ * @param yr
+ * : Year to add (can be -ve)
+ * @param month
+ * : month to add (can be -ve)
+ * @param day
+ * : day to add (can be -ve)
+ * @param hr
+ * : hr to add (can be -ve)
+ * @param min
+ * : min to add (can be -ve)
+ * @return coord:current(n)
+ * @throws Exception
+ * : If encountered an exception while evaluating
+ */
+ private static String mapToCurrentInstance(TruncateBoundary trunc, int yr, int month, int day, int hr, int min) {
+ Calendar nominalInstanceCal = CoordELFunctions.getEffectiveNominalTime();
+ if (nominalInstanceCal == null) {
+ XLog.getLog(OozieELExtensions.class).warn(
+ "If the initial instance of the dataset is later than the nominal time, "
+ + "an empty string is returned. This means that no data is available "
+ + "at the current-instance specified by the user and the user could "
+ + "try modifying his initial-instance to an earlier time.");
+ return "";
+ }
+
+ Calendar dsInstanceCal = getEffectiveTime(trunc, yr, month, day, hr, min);
+
+ 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) + ")";
+ }
+}
+//RESUME CHECKSTYLE CHECK MethodName
[6/8] FALCON-1 Create packaging and scripts to install and try Apache
Falcon. Contributed by Srikanth Sundarrajan
Posted by ve...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/hive-action-0.2.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/hive-action-0.2.xsd b/webapp/src/conf/oozie/conf/action-conf/hive-action-0.2.xsd
new file mode 100644
index 0000000..884bd5f
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/hive-action-0.2.xsd
@@ -0,0 +1,68 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:hive="uri:oozie:hive-action:0.2" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:hive-action:0.2">
+
+ <xs:element name="hive" type="hive:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="hive:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="hive:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="script" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="param" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="hive:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="hive:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/hive-action-0.3.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/hive-action-0.3.xsd b/webapp/src/conf/oozie/conf/action-conf/hive-action-0.3.xsd
new file mode 100644
index 0000000..06619e8
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/hive-action-0.3.xsd
@@ -0,0 +1,68 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:hive="uri:oozie:hive-action:0.3" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:hive-action:0.3">
+
+ <xs:element name="hive" type="hive:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="hive:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="hive:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="script" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="param" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="hive:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="hive:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/hive-action-0.4.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/hive-action-0.4.xsd b/webapp/src/conf/oozie/conf/action-conf/hive-action-0.4.xsd
new file mode 100644
index 0000000..09a3b80
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/hive-action-0.4.xsd
@@ -0,0 +1,68 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:hive="uri:oozie:hive-action:0.4" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:hive-action:0.4">
+
+ <xs:element name="hive" type="hive:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="prepare" type="hive:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="hive:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="script" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="param" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="hive:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="hive:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/hive-action-0.5.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/hive-action-0.5.xsd b/webapp/src/conf/oozie/conf/action-conf/hive-action-0.5.xsd
new file mode 100644
index 0000000..94863e0
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/hive-action-0.5.xsd
@@ -0,0 +1,69 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:hive="uri:oozie:hive-action:0.5" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:hive-action:0.5">
+
+ <xs:element name="hive" type="hive:ACTION"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="prepare" type="hive:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="configuration" type="hive:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="script" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="param" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="argument" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="hive:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="hive:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/hive.xml
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/hive.xml b/webapp/src/conf/oozie/conf/action-conf/hive.xml
new file mode 100644
index 0000000..2076bd4
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/hive.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+ 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>
+ <!-- An example of setting default properties for Hive action.
+ This could be useful with Hadoop versions that have deprecated
+ HADOOP_HOME that Hive still relies on.
+
+ <property>
+ <name>hadoop.bin.path</name>
+ <value>/usr/bin/hadoop</value>
+ </property>
+
+ <property>
+ <name>hadoop.config.dir</name>
+ <value>/etc/hadoop/conf</value>
+ </property>
+ -->
+</configuration>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-buildinfo.properties
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-buildinfo.properties b/webapp/src/conf/oozie/conf/action-conf/oozie-buildinfo.properties
new file mode 100644
index 0000000..d3c1ad1
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-buildinfo.properties
@@ -0,0 +1,35 @@
+#
+# 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.
+
+#
+
+######################
+build.user=${user.name}
+build.time=${build.time}
+build.version=${pom.version}
+vc.revision=${vc.revision}
+vc.url=${vc.url}
+######################
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-bundle-0.1.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-bundle-0.1.xsd b/webapp/src/conf/oozie/conf/action-conf/oozie-bundle-0.1.xsd
new file mode 100644
index 0000000..3bc439f
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-bundle-0.1.xsd
@@ -0,0 +1,61 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:bundle="uri:oozie:bundle:0.1"
+ elementFormDefault="qualified" targetNamespace="uri:oozie:bundle:0.1">
+
+ <xs:element name="bundle-app" type="bundle:BUNDLE-APP"/>
+ <xs:simpleType name="IDENTIFIER">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="([a-zA-Z]([\-_a-zA-Z0-9])*){1,39}"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:complexType name="BUNDLE-APP">
+ <xs:sequence>
+ <xs:element name="controls" type="bundle:CONTROLS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="coordinator" type="bundle:COORDINATOR" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="CONTROLS">
+ <xs:sequence minOccurs="0" maxOccurs="1">
+ <xs:element name="kick-off-time" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="COORDINATOR">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="app-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="configuration" type="bundle:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="bundle:IDENTIFIER" use="required"/>
+ <xs:attribute name="critical" type="xs:string" use="optional"/>
+ </xs:complexType>
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-bundle-0.2.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-bundle-0.2.xsd b/webapp/src/conf/oozie/conf/action-conf/oozie-bundle-0.2.xsd
new file mode 100644
index 0000000..7da8197
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-bundle-0.2.xsd
@@ -0,0 +1,75 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:bundle="uri:oozie:bundle:0.2"
+ elementFormDefault="qualified" targetNamespace="uri:oozie:bundle:0.2">
+
+ <xs:element name="bundle-app" type="bundle:BUNDLE-APP"/>
+ <xs:simpleType name="IDENTIFIER">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="([a-zA-Z]([\-_a-zA-Z0-9])*){1,39}"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:complexType name="BUNDLE-APP">
+ <xs:sequence>
+ <xs:element name="parameters" type="bundle:PARAMETERS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="controls" type="bundle:CONTROLS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="coordinator" type="bundle:COORDINATOR" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="PARAMETERS">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="CONTROLS">
+ <xs:sequence minOccurs="0" maxOccurs="1">
+ <xs:element name="kick-off-time" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="COORDINATOR">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="app-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="configuration" type="bundle:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="bundle:IDENTIFIER" use="required"/>
+ <xs:attribute name="critical" type="xs:string" use="optional"/>
+ </xs:complexType>
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.1.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.1.xsd b/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.1.xsd
new file mode 100644
index 0000000..55817d5
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.1.xsd
@@ -0,0 +1,132 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:coordinator="uri:oozie:coordinator:0.1"
+ elementFormDefault="qualified" targetNamespace="uri:oozie:coordinator:0.1">
+
+ <xs:element name="coordinator-app" type="coordinator:COORDINATOR-APP"/>
+ <xs:element name="datasets" type="coordinator:DATASETS"/>
+ <xs:simpleType name="IDENTIFIER">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="([a-zA-Z]([\-_a-zA-Z0-9])*){1,39}"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:complexType name="COORDINATOR-APP">
+ <xs:sequence>
+ <xs:element name="controls" type="coordinator:CONTROLS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="datasets" type="coordinator:DATASETS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="input-events" type="coordinator:INPUTEVENTS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="output-events" type="coordinator:OUTPUTEVENTS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="action" type="coordinator:ACTION" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="frequency" type="xs:string" use="required"/>
+ <xs:attribute name="start" type="xs:string" use="required"/>
+ <xs:attribute name="end" type="xs:string" use="required"/>
+ <xs:attribute name="timezone" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="CONTROLS">
+ <xs:sequence minOccurs="0" maxOccurs="1">
+ <xs:element name="timeout" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="concurrency" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="execution" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="DATASETS">
+ <xs:sequence minOccurs="0" maxOccurs="1">
+ <xs:element name="include" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="dataset" type="coordinator:SYNCDATASET" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="async-dataset" type="coordinator:ASYNCDATASET" minOccurs="0" maxOccurs="1"/>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="SYNCDATASET">
+ <xs:sequence>
+ <xs:element name="uri-template" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="done-flag" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="frequency" type="xs:string" use="required"/>
+ <xs:attribute name="initial-instance" type="xs:string" use="required"/>
+ <xs:attribute name="timezone" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="ASYNCDATASET">
+ <xs:sequence>
+ <xs:element name="uri-template" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="sequence-type" type="xs:string" use="required"/>
+ <xs:attribute name="initial-version" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="INPUTEVENTS">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="data-in" type="coordinator:DATAIN" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="DATAIN">
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="instance" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="start-instance" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="end-instance" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:choice>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="dataset" type="coordinator:IDENTIFIER" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="OUTPUTEVENTS">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="data-out" type="coordinator:DATAOUT" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="DATAOUT">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="instance" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="dataset" type="coordinator:IDENTIFIER" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="ACTION">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="workflow" type="coordinator:WORKFLOW" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="uri:oozie:sla:0.1" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="WORKFLOW">
+ <xs:sequence>
+ <xs:element name="app-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="configuration" type="coordinator:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.2.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.2.xsd b/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.2.xsd
new file mode 100644
index 0000000..649e100
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.2.xsd
@@ -0,0 +1,133 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:coordinator="uri:oozie:coordinator:0.2"
+ elementFormDefault="qualified" targetNamespace="uri:oozie:coordinator:0.2">
+
+ <xs:element name="coordinator-app" type="coordinator:COORDINATOR-APP"/>
+ <xs:element name="datasets" type="coordinator:DATASETS"/>
+ <xs:simpleType name="IDENTIFIER">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="([a-zA-Z]([\-_a-zA-Z0-9])*){1,39}"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:complexType name="COORDINATOR-APP">
+ <xs:sequence>
+ <xs:element name="controls" type="coordinator:CONTROLS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="datasets" type="coordinator:DATASETS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="input-events" type="coordinator:INPUTEVENTS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="output-events" type="coordinator:OUTPUTEVENTS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="action" type="coordinator:ACTION" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="frequency" type="xs:string" use="required"/>
+ <xs:attribute name="start" type="xs:string" use="required"/>
+ <xs:attribute name="end" type="xs:string" use="required"/>
+ <xs:attribute name="timezone" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="CONTROLS">
+ <xs:sequence minOccurs="0" maxOccurs="1">
+ <xs:element name="timeout" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="concurrency" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="execution" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="throttle" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="DATASETS">
+ <xs:sequence minOccurs="0" maxOccurs="1">
+ <xs:element name="include" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="dataset" type="coordinator:SYNCDATASET" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="async-dataset" type="coordinator:ASYNCDATASET" minOccurs="0" maxOccurs="1"/>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="SYNCDATASET">
+ <xs:sequence>
+ <xs:element name="uri-template" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="done-flag" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="frequency" type="xs:string" use="required"/>
+ <xs:attribute name="initial-instance" type="xs:string" use="required"/>
+ <xs:attribute name="timezone" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="ASYNCDATASET">
+ <xs:sequence>
+ <xs:element name="uri-template" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="sequence-type" type="xs:string" use="required"/>
+ <xs:attribute name="initial-version" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="INPUTEVENTS">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="data-in" type="coordinator:DATAIN" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="DATAIN">
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="instance" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="start-instance" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="end-instance" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:choice>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="dataset" type="coordinator:IDENTIFIER" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="OUTPUTEVENTS">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="data-out" type="coordinator:DATAOUT" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="DATAOUT">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="instance" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="dataset" type="coordinator:IDENTIFIER" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="ACTION">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="workflow" type="coordinator:WORKFLOW" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="uri:oozie:sla:0.1" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="WORKFLOW">
+ <xs:sequence>
+ <xs:element name="app-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="configuration" type="coordinator:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.3.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.3.xsd b/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.3.xsd
new file mode 100644
index 0000000..90917fa
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.3.xsd
@@ -0,0 +1,133 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:coordinator="uri:oozie:coordinator:0.3"
+ elementFormDefault="qualified" targetNamespace="uri:oozie:coordinator:0.3">
+
+ <xs:element name="coordinator-app" type="coordinator:COORDINATOR-APP"/>
+ <xs:element name="datasets" type="coordinator:DATASETS"/>
+ <xs:simpleType name="IDENTIFIER">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="([a-zA-Z]([\-_a-zA-Z0-9])*){1,39}"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:complexType name="COORDINATOR-APP">
+ <xs:sequence>
+ <xs:element name="controls" type="coordinator:CONTROLS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="datasets" type="coordinator:DATASETS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="input-events" type="coordinator:INPUTEVENTS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="output-events" type="coordinator:OUTPUTEVENTS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="action" type="coordinator:ACTION" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="frequency" type="xs:string" use="required"/>
+ <xs:attribute name="start" type="xs:string" use="required"/>
+ <xs:attribute name="end" type="xs:string" use="required"/>
+ <xs:attribute name="timezone" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="CONTROLS">
+ <xs:sequence minOccurs="0" maxOccurs="1">
+ <xs:element name="timeout" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="concurrency" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="execution" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="throttle" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="DATASETS">
+ <xs:sequence minOccurs="0" maxOccurs="1">
+ <xs:element name="include" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="dataset" type="coordinator:SYNCDATASET" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="async-dataset" type="coordinator:ASYNCDATASET" minOccurs="0" maxOccurs="1"/>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="SYNCDATASET">
+ <xs:sequence>
+ <xs:element name="uri-template" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="done-flag" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="frequency" type="xs:string" use="required"/>
+ <xs:attribute name="initial-instance" type="xs:string" use="required"/>
+ <xs:attribute name="timezone" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="ASYNCDATASET">
+ <xs:sequence>
+ <xs:element name="uri-template" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="sequence-type" type="xs:string" use="required"/>
+ <xs:attribute name="initial-version" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="INPUTEVENTS">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="data-in" type="coordinator:DATAIN" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="DATAIN">
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="instance" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="start-instance" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="end-instance" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:choice>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="dataset" type="coordinator:IDENTIFIER" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="OUTPUTEVENTS">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="data-out" type="coordinator:DATAOUT" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="DATAOUT">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="instance" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="dataset" type="coordinator:IDENTIFIER" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="ACTION">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="workflow" type="coordinator:WORKFLOW" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="uri:oozie:sla:0.1" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="WORKFLOW">
+ <xs:sequence>
+ <xs:element name="app-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="configuration" type="coordinator:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.4.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.4.xsd b/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.4.xsd
new file mode 100644
index 0000000..cc34e4d
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-coordinator-0.4.xsd
@@ -0,0 +1,147 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:coordinator="uri:oozie:coordinator:0.4"
+ elementFormDefault="qualified" targetNamespace="uri:oozie:coordinator:0.4">
+
+ <xs:element name="coordinator-app" type="coordinator:COORDINATOR-APP"/>
+ <xs:element name="datasets" type="coordinator:DATASETS"/>
+ <xs:simpleType name="IDENTIFIER">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="([a-zA-Z]([\-_a-zA-Z0-9])*){1,39}"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:complexType name="COORDINATOR-APP">
+ <xs:sequence>
+ <xs:element name="parameters" type="coordinator:PARAMETERS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="controls" type="coordinator:CONTROLS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="datasets" type="coordinator:DATASETS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="input-events" type="coordinator:INPUTEVENTS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="output-events" type="coordinator:OUTPUTEVENTS" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="action" type="coordinator:ACTION" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="frequency" type="xs:string" use="required"/>
+ <xs:attribute name="start" type="xs:string" use="required"/>
+ <xs:attribute name="end" type="xs:string" use="required"/>
+ <xs:attribute name="timezone" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="PARAMETERS">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="CONTROLS">
+ <xs:sequence minOccurs="0" maxOccurs="1">
+ <xs:element name="timeout" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="concurrency" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="execution" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="throttle" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="DATASETS">
+ <xs:sequence minOccurs="0" maxOccurs="1">
+ <xs:element name="include" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="dataset" type="coordinator:SYNCDATASET" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="async-dataset" type="coordinator:ASYNCDATASET" minOccurs="0" maxOccurs="1"/>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="SYNCDATASET">
+ <xs:sequence>
+ <xs:element name="uri-template" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="done-flag" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="frequency" type="xs:string" use="required"/>
+ <xs:attribute name="initial-instance" type="xs:string" use="required"/>
+ <xs:attribute name="timezone" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="ASYNCDATASET">
+ <xs:sequence>
+ <xs:element name="uri-template" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="sequence-type" type="xs:string" use="required"/>
+ <xs:attribute name="initial-version" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="INPUTEVENTS">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="data-in" type="coordinator:DATAIN" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="DATAIN">
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="instance" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="start-instance" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="end-instance" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:choice>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="dataset" type="coordinator:IDENTIFIER" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="OUTPUTEVENTS">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="data-out" type="coordinator:DATAOUT" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="DATAOUT">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="instance" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="coordinator:IDENTIFIER" use="required"/>
+ <xs:attribute name="dataset" type="coordinator:IDENTIFIER" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="ACTION">
+ <xs:sequence minOccurs="1" maxOccurs="1">
+ <xs:element name="workflow" type="coordinator:WORKFLOW" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="uri:oozie:sla:0.1 uri:oozie:sla:0.2" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="WORKFLOW">
+ <xs:sequence>
+ <xs:element name="app-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="configuration" type="coordinator:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-sla-0.1.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-sla-0.1.xsd b/webapp/src/conf/oozie/conf/action-conf/oozie-sla-0.1.xsd
new file mode 100644
index 0000000..2cf3f87
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-sla-0.1.xsd
@@ -0,0 +1,63 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:sla="uri:oozie:sla:0.1" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:sla:0.1">
+
+ <xs:element name="info" type="sla:SLA-INFO"/>
+
+ <xs:complexType name="SLA-INFO">
+ <xs:sequence>
+ <xs:element name="app-name" type="xs:string" minOccurs="1"
+ maxOccurs="1"/>
+
+ <xs:element name="nominal-time" type="xs:string"
+ minOccurs="1" maxOccurs="1"/>
+ <xs:element name="should-start" type="xs:string"
+ minOccurs="1" maxOccurs="1"/>
+ <xs:element name="should-end" type="xs:string" minOccurs="1"
+ maxOccurs="1"/>
+
+ <xs:element name="parent-client-id" type="xs:string"
+ minOccurs="0" maxOccurs="1"/>
+ <xs:element name="parent-sla-id" type="xs:string"
+ minOccurs="0" maxOccurs="1"/>
+
+ <xs:element name="notification-msg" type="xs:string"
+ minOccurs="0" maxOccurs="1"/>
+ <xs:element name="alert-contact" type="xs:string"
+ minOccurs="1" maxOccurs="1"/>
+ <xs:element name="dev-contact" type="xs:string" minOccurs="1"
+ maxOccurs="1"/>
+ <xs:element name="qa-contact" type="xs:string" minOccurs="1"
+ maxOccurs="1"/>
+ <xs:element name="se-contact" type="xs:string" minOccurs="1"
+ maxOccurs="1"/>
+ <xs:element name="alert-frequency" type="xs:string"
+ minOccurs="0" maxOccurs="1"/>
+ <xs:element name="alert-percentage" type="xs:string"
+ minOccurs="0" maxOccurs="1"/>
+
+ <xs:element name="upstream-apps" type="xs:string"
+ minOccurs="0" maxOccurs="1"/>
+
+ </xs:sequence>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-sla-0.2.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-sla-0.2.xsd b/webapp/src/conf/oozie/conf/action-conf/oozie-sla-0.2.xsd
new file mode 100644
index 0000000..1071e7d
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-sla-0.2.xsd
@@ -0,0 +1,47 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:sla="uri:oozie:sla:0.2" elementFormDefault="qualified"
+ targetNamespace="uri:oozie:sla:0.2">
+
+ <xs:element name="info" type="sla:SLA-INFO"/>
+
+ <xs:complexType name="SLA-INFO">
+ <xs:sequence>
+ <xs:element name="nominal-time" type="xs:string" minOccurs="1"
+ maxOccurs="1"/>
+ <xs:element name="should-start" type="xs:string" minOccurs="0"
+ maxOccurs="1"/>
+ <xs:element name="should-end" type="xs:string" minOccurs="1"
+ maxOccurs="1"/>
+ <xs:element name="max-duration" type="xs:string" minOccurs="0"
+ maxOccurs="1"/>
+
+ <xs:element name="alert-events" type="xs:string" minOccurs="0"
+ maxOccurs="1"/>
+ <xs:element name="alert-contact" type="xs:string" minOccurs="0"
+ maxOccurs="1"/>
+ <xs:element name="notification-msg" type="xs:string" minOccurs="0"
+ maxOccurs="1"/>
+ <xs:element name="upstream-apps" type="xs:string" minOccurs="0"
+ maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/61417357/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.1.xsd
----------------------------------------------------------------------
diff --git a/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.1.xsd b/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.1.xsd
new file mode 100644
index 0000000..8af8ecf
--- /dev/null
+++ b/webapp/src/conf/oozie/conf/action-conf/oozie-workflow-0.1.xsd
@@ -0,0 +1,301 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:workflow="uri:oozie:workflow:0.1"
+ elementFormDefault="qualified" targetNamespace="uri:oozie:workflow:0.1">
+
+ <xs:element name="workflow-app" type="workflow:WORKFLOW-APP"/>
+
+ <xs:simpleType name="IDENTIFIER">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="([a-zA-Z_]([\-_a-zA-Z0-9])*){1,39}"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="WORKFLOW-APP">
+ <xs:sequence>
+ <xs:element name="start" type="workflow:START" minOccurs="1" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="decision" type="workflow:DECISION" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="fork" type="workflow:FORK" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="join" type="workflow:JOIN" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="kill" type="workflow:KILL" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="action" type="workflow:ACTION" minOccurs="1" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="end" type="workflow:END" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="START">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="END">
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="DECISION">
+ <xs:sequence>
+ <xs:element name="switch" type="workflow:SWITCH" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="switch" type="workflow:SWITCH"/>
+
+ <xs:complexType name="SWITCH">
+ <xs:sequence>
+ <xs:sequence>
+ <xs:element name="case" type="workflow:CASE" minOccurs="1" maxOccurs="unbounded"/>
+ <xs:element name="default" type="workflow:DEFAULT" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CASE">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="DEFAULT">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="FORK_TRANSITION">
+ <xs:attribute name="start" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="FORK">
+ <xs:sequence>
+ <xs:element name="path" type="workflow:FORK_TRANSITION" minOccurs="2" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="JOIN">
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="kill" type="workflow:KILL"/>
+
+ <xs:complexType name="KILL">
+ <xs:sequence>
+ <xs:element name="message" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="ACTION_TRANSITION">
+ <xs:attribute name="to" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:element name="map-reduce" type="workflow:MAP-REDUCE"/>
+ <xs:element name="pig" type="workflow:PIG"/>
+ <xs:element name="ssh" type="workflow:SSH"/>
+ <xs:element name="sub-workflow" type="workflow:SUB-WORKFLOW"/>
+ <xs:element name="fs" type="workflow:FS"/>
+ <xs:element name="java" type="workflow:JAVA"/>
+
+ <xs:complexType name="ACTION">
+ <xs:sequence>
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="map-reduce" type="workflow:MAP-REDUCE" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="pig" type="workflow:PIG" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="ssh" type="workflow:SSH" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="sub-workflow" type="workflow:SUB-WORKFLOW" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="fs" type="workflow:FS" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="http" type="workflow:HTTP" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="email" type="workflow:EMAIL" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="java" type="workflow:JAVA" minOccurs="1" maxOccurs="1"/>
+ <xs:any namespace="##other" minOccurs="1" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="ok" type="workflow:ACTION_TRANSITION" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="error" type="workflow:ACTION_TRANSITION" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="workflow:IDENTIFIER" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MAP-REDUCE">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:element name="streaming" type="workflow:STREAMING" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="pipes" type="workflow:PIPES" minOccurs="0" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PIG">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="script" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="param" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="SSH">
+ <xs:sequence>
+ <xs:element name="host" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="command" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="args" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="capture-output" type="workflow:FLAG" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="SUB-WORKFLOW">
+ <xs:sequence>
+ <xs:element name="app-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="propagate-configuration" type="workflow:FLAG" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FS">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="delete" type="workflow:DELETE"/>
+ <xs:element name="mkdir" type="workflow:MKDIR"/>
+ <xs:element name="move" type="workflow:MOVE"/>
+ <xs:element name="chmod" type="workflow:CHMOD"/>
+ </xs:choice>
+ </xs:complexType>
+
+ <xs:complexType name="HTTP">
+ <xs:sequence>
+ <xs:element name="http-url" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="post" type="workflow:HTTP-POST" minOccurs="0" maxOccurs="1"/>
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="wait" type="workflow:FLAG" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="continue" type="workflow:FLAG" minOccurs="1" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="capture-output" type="workflow:FLAG"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="EMAIL">
+ <xs:sequence>
+ <xs:element name="to" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="subject" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="message" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="HTTP-POST">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="content-type" type="xs:string" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="JAVA">
+ <xs:sequence>
+ <xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="prepare" type="workflow:PREPARE" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="main-class" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="java-opts" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="arg" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="capture-output" type="workflow:FLAG" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="FLAG"/>
+
+ <xs:complexType name="CONFIGURATION">
+ <xs:sequence>
+ <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+ <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="STREAMING">
+ <xs:sequence>
+ <xs:element name="mapper" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="reducer" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="record-reader" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="record-reader-mapping" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="env" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PIPES">
+ <xs:sequence>
+ <xs:element name="map" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="reduce" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="inputformat" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="partitioner" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="writer" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="program" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PREPARE">
+ <xs:sequence>
+ <xs:element name="delete" type="workflow:DELETE" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="mkdir" type="workflow:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DELETE">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MKDIR">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="MOVE">
+ <xs:attribute name="source" type="xs:string" use="required"/>
+ <xs:attribute name="target" type="xs:string" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="CHMOD">
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ <xs:attribute name="permissions" type="xs:string" use="required"/>
+ <xs:attribute name="dir-files" type="xs:string"/>
+ </xs:complexType>
+
+</xs:schema>