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:34 UTC
[4/8] FALCON-1 Create packaging and scripts to install and try Apache
Falcon. Contributed by Srikanth Sundarrajan
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());
+ }
+ }
+}