├── examples └── src │ ├── main │ ├── data │ │ ├── _SUCCESS │ │ ├── log01.txt │ │ ├── log02.txt │ │ ├── log03.txt │ │ ├── log04.txt │ │ ├── log05.txt │ │ ├── log06.txt │ │ └── data.txt │ ├── apps │ │ ├── demo │ │ │ ├── id.pig │ │ │ └── job.properties │ │ ├── pig │ │ │ ├── id.pig │ │ │ └── job.properties │ │ ├── custom-main │ │ │ ├── id.pig │ │ │ └── job.properties │ │ ├── no-op │ │ │ ├── job.properties │ │ │ └── workflow.xml │ │ ├── subwf │ │ │ └── job.properties │ │ ├── map-reduce │ │ │ └── job.properties │ │ ├── hadoop-el │ │ │ └── job.properties │ │ ├── java-main │ │ │ ├── job.properties │ │ │ └── workflow.xml │ │ ├── streaming │ │ │ └── job.properties │ │ ├── aggregator │ │ │ └── job.properties │ │ ├── bundle │ │ │ ├── job.properties │ │ │ └── bundle.xml │ │ ├── cron │ │ │ ├── job.properties │ │ │ ├── workflow.xml │ │ │ └── coordinator.xml │ │ └── datelist-java-main │ │ │ └── job.properties │ └── java │ │ └── org │ │ └── apache │ │ └── oozie │ │ └── example │ │ ├── DemoPigMain.java │ │ ├── DemoMapReduceMain.java │ │ ├── DemoJavaMain.java │ │ ├── TimeUnit.java │ │ ├── SampleMapper.java │ │ ├── SampleReducer.java │ │ └── DemoReducer.java │ └── test │ └── resources │ ├── localoozieexample-end.properties │ ├── localoozieexample-kill.properties │ └── localoozieexample-wf.xml ├── webapp └── src │ └── main │ ├── resources │ └── .gitignore │ └── webapp │ ├── oozie_50x.png │ └── META-INF │ └── context.xml ├── core └── src │ ├── test │ ├── resources │ │ ├── test-ioutils.txt │ │ ├── PigMain.txt │ │ ├── wordcount-simple_Linux-i386-32_h20 │ │ ├── wordcount-simple_Linux-amd64-64_h20 │ │ ├── wordcount-simple_Mac_OS_X-x86_64-64_h20 │ │ ├── adminusers.txt │ │ ├── oozie-site1.xml │ │ ├── wf-schema-invalid.xml │ │ ├── hadoop-site.xml │ │ ├── test-oozie-default.xml │ │ ├── auth-disabled-oozie-site.xml │ │ ├── oozie-site-with-security.xml │ │ ├── wf-schema-action-name-too-long.xml │ │ ├── oozie-site2.xml │ │ ├── oozie-sitealternate.xml │ │ ├── oozie-site-instrumentation.xml │ │ ├── wf-loop2-invalid.xml │ │ ├── wf-unsupported-action.xml │ │ ├── failover-fs-wf.xml │ │ ├── coord-matLookup-trigger.xml │ │ ├── wf-ext-schema-invalid.xml │ │ ├── wf-loop1-invalid.xml │ │ ├── wf-transition-invalid.xml │ │ ├── rerun-el-wf.xml │ │ ├── rerun-elerr-wf.xml │ │ ├── test-custom-log4j.properties │ │ ├── test-oozie-log4j.properties │ │ ├── wf-ext-schema-valid.xml │ │ ├── wf-ext-schema-valid-user-retry.xml │ │ ├── wf-test-kill-node-message.xml │ │ ├── rerun-wf.xml │ │ ├── coord-matd-job.xml │ │ ├── wf-ext-schema.xsd │ │ ├── postgresql-oozie-site.xml │ │ └── mysql-oozie-site.xml │ └── java │ │ └── org │ │ └── apache │ │ └── oozie │ │ ├── action │ │ └── hadoop │ │ │ ├── LauncherMainTester2.java │ │ │ └── MainTestCase.java │ │ ├── util │ │ ├── TestClassUtils.java │ │ └── TestXmlUtils.java │ │ ├── service │ │ ├── TestMemoryLocksService.java │ │ ├── TestInstrumentationService.java │ │ ├── ForTestAuthorizationService.java │ │ ├── TestStoreService.java │ │ ├── TestActionService.java │ │ ├── TestDagXLogInfoService.java │ │ └── TestLiteWorkflowStoreService.java │ │ ├── command │ │ ├── SkipCommitFaultInjection.java │ │ └── coord │ │ │ └── CoordXTestCase.java │ │ ├── test │ │ └── TestXFsTestCase.java │ │ └── executor │ │ └── jpa │ │ └── TestCoordJobDeleteJPAExecutor.java │ └── main │ ├── resources │ ├── META-INF │ │ ├── oozie-oracle-orm.xml │ │ ├── oozie-derby-orm.xml │ │ ├── oozie-hsqldb-orm.xml │ │ ├── oozie-postgresql-orm.xml │ │ └── oozie-mysql-orm.xml │ └── ssh-base.sh │ ├── conf │ ├── adminusers.txt │ └── oozie-env.sh │ └── java │ └── org │ └── apache │ └── oozie │ ├── command │ ├── PreconditionException.java │ ├── wf │ │ ├── StartCommand.java │ │ ├── StartXCommand.java │ │ ├── ExternalIdCommand.java │ │ ├── WorkflowActionInfoCommand.java │ │ ├── DefinitionCommand.java │ │ ├── PurgeCommand.java │ │ └── WorkflowXCommand.java │ ├── coord │ │ ├── CoordinatorXCommand.java │ │ ├── CoordActionInfoCommand.java │ │ └── CoordPurgeCommand.java │ ├── CommandException.java │ ├── bundle │ │ └── BundleJobException.java │ └── StatusUpdateXCommand.java │ ├── util │ ├── db │ │ └── ValidateConnectionBean.java │ ├── Instrumentable.java │ └── ELEvaluationException.java │ ├── client │ └── rest │ │ └── JsonBean.java │ ├── service │ ├── AuthorizationException.java │ ├── HadoopAccessorException.java │ └── ServiceException.java │ ├── workflow │ ├── lite │ │ ├── DecisionNodeDef.java │ │ ├── EndNodeDef.java │ │ ├── KillNodeDef.java │ │ └── DecisionNodeHandler.java │ ├── WorkflowApp.java │ └── WorkflowException.java │ ├── coord │ ├── TimeUnit.java │ ├── CoordELConstants.java │ └── CoordinatorJobException.java │ ├── executor │ └── jpa │ │ ├── CoordActionsActiveCountJPAExecutor.java │ │ ├── BundleActionsCountForJobGetJPAExecutor.java │ │ ├── CoordActionsPendingFalseCountGetJPAExecutor.java │ │ ├── CoordJobUpdateJPAExecutor.java │ │ ├── CoordActionsPendingFalseStatusCountGetJPAExecutor.java │ │ ├── JPAExecutorException.java │ │ ├── CoordActionUpdateJPAExecutor.java │ │ ├── BundleActionsGetWaitingOlderJPAExecutor.java │ │ ├── WorkflowActionUpdateJPAExecutor.java │ │ ├── SLAEventInsertJPAExecutor.java │ │ ├── WorkflowJobInsertJPAExecutor.java │ │ └── CoordJobInsertJPAExecutor.java │ ├── CoordinatorActionInfo.java │ ├── BaseEngineException.java │ ├── DagEngineException.java │ ├── BundleEngineException.java │ ├── CoordinatorEngineException.java │ ├── store │ └── StoreException.java │ ├── action │ └── hadoop │ │ ├── KerberosAuthHelper.java │ │ ├── CredentialException.java │ │ ├── KerberosDoAs.java │ │ └── Credentials.java │ └── servlet │ └── ServicesLoader.java ├── distro └── src │ └── main │ ├── tomcat │ └── ROOT │ │ ├── favicon.ico │ │ ├── index.html │ │ └── WEB-INF │ │ └── web.xml │ └── bin │ ├── oozie-run.sh │ ├── oozie-start.sh │ └── oozie-stop.sh ├── docs └── src │ ├── site │ ├── resources │ │ └── DG_Overview.png │ ├── web.xml │ ├── site.xml │ └── twiki │ │ ├── DG_WorkflowReRun.twiki │ │ └── DG_UsingHadoopKerberos.twiki │ └── main │ ├── java │ └── Dummy.java │ └── webapp │ ├── WEB-INF │ └── web.xml │ └── docs │ └── configuration.xsl ├── utils └── dbutils │ └── updatescripts │ ├── updatescripts-3.x-to-3.1.0.sql │ ├── updatescripts-3.0.0-to-3.0.1.sql │ ├── readme.txt │ └── upgradescript-2.x-to-3.0.0.sql ├── .gitignore ├── src └── main │ └── assemblies │ ├── empty.xml │ ├── docs.xml │ └── sharelib.xml ├── client └── src │ ├── test │ ├── resources │ │ ├── valid.xml │ │ └── invalid.xml │ └── java │ │ └── org │ │ └── apache │ │ └── oozie │ │ ├── cli │ │ └── TestValidation.java │ │ └── client │ │ └── rest │ │ └── TestJsonUtils.java │ └── main │ ├── resources │ ├── oozie-buildinfo.properties │ └── email-action-0.1.xsd │ ├── java │ └── org │ │ └── apache │ │ └── oozie │ │ └── cli │ │ └── OozieCLIException.java │ └── bin │ └── oozie ├── NOTICE.txt ├── sharelib └── src │ └── main │ └── resources │ └── sharelib.properties ├── readme.txt └── bin └── mkdistro.sh /examples/src/main/data/_SUCCESS: -------------------------------------------------------------------------------- 1 | . 2 | -------------------------------------------------------------------------------- /webapp/src/main/resources/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /core/src/test/resources/test-ioutils.txt: -------------------------------------------------------------------------------- 1 | abcde -------------------------------------------------------------------------------- /examples/src/main/data/log01.txt: -------------------------------------------------------------------------------- 1 | [01] LOG!!!!!! 2 | -------------------------------------------------------------------------------- /examples/src/main/data/log02.txt: -------------------------------------------------------------------------------- 1 | [02] LOG!!!!!! 2 | -------------------------------------------------------------------------------- /examples/src/main/data/log03.txt: -------------------------------------------------------------------------------- 1 | [03] LOG!!!!!! 2 | -------------------------------------------------------------------------------- /examples/src/main/data/log04.txt: -------------------------------------------------------------------------------- 1 | [04] LOG!!!!!! 2 | -------------------------------------------------------------------------------- /examples/src/main/data/log05.txt: -------------------------------------------------------------------------------- 1 | [05] LOG!!!!!! 2 | -------------------------------------------------------------------------------- /examples/src/main/data/log06.txt: -------------------------------------------------------------------------------- 1 | [06] LOG!!!!!! 2 | -------------------------------------------------------------------------------- /core/src/test/resources/PigMain.txt: -------------------------------------------------------------------------------- 1 | Dummy file to find a directory in the classpath -------------------------------------------------------------------------------- /webapp/src/main/webapp/oozie_50x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hc/oozie/master/webapp/src/main/webapp/oozie_50x.png -------------------------------------------------------------------------------- /distro/src/main/tomcat/ROOT/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hc/oozie/master/distro/src/main/tomcat/ROOT/favicon.ico -------------------------------------------------------------------------------- /docs/src/site/resources/DG_Overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hc/oozie/master/docs/src/site/resources/DG_Overview.png -------------------------------------------------------------------------------- /core/src/test/resources/wordcount-simple_Linux-i386-32_h20: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hc/oozie/master/core/src/test/resources/wordcount-simple_Linux-i386-32_h20 -------------------------------------------------------------------------------- /examples/src/main/apps/demo/id.pig: -------------------------------------------------------------------------------- 1 | A = load '$INPUT' using PigStorage(':'); 2 | B = foreach A generate $0 as id; 3 | store B into '$OUTPUT' USING PigStorage(); 4 | -------------------------------------------------------------------------------- /examples/src/main/apps/pig/id.pig: -------------------------------------------------------------------------------- 1 | A = load '$INPUT' using PigStorage(':'); 2 | B = foreach A generate $0 as id; 3 | store B into '$OUTPUT' USING PigStorage(); 4 | -------------------------------------------------------------------------------- /core/src/test/resources/wordcount-simple_Linux-amd64-64_h20: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hc/oozie/master/core/src/test/resources/wordcount-simple_Linux-amd64-64_h20 -------------------------------------------------------------------------------- /core/src/test/resources/wordcount-simple_Mac_OS_X-x86_64-64_h20: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hc/oozie/master/core/src/test/resources/wordcount-simple_Mac_OS_X-x86_64-64_h20 -------------------------------------------------------------------------------- /examples/src/main/apps/custom-main/id.pig: -------------------------------------------------------------------------------- 1 | A = load '$INPUT' using PigStorage(':'); 2 | B = foreach A generate $0 as id; 3 | store B into '$OUTPUT' USING PigStorage(); 4 | -------------------------------------------------------------------------------- /distro/src/main/tomcat/ROOT/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Oozie Console 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/src/main/apps/no-op/job.properties: -------------------------------------------------------------------------------- 1 | nameNode=hdfs://localhost:8020 2 | jobTracker=localhost:8021 3 | queueName=default 4 | examplesRoot=examples 5 | 6 | oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/no-op 7 | -------------------------------------------------------------------------------- /examples/src/main/apps/subwf/job.properties: -------------------------------------------------------------------------------- 1 | nameNode=hdfs://localhost:8020 2 | jobTracker=localhost:8021 3 | queueName=default 4 | examplesRoot=examples 5 | 6 | oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/subwf 7 | 8 | -------------------------------------------------------------------------------- /utils/dbutils/updatescripts/updatescripts-3.x-to-3.1.0.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE WF_ACTIONS ADD USER_RETRY_COUNT NUMBER DEFAULT 0; 2 | ALTER TABLE WF_ACTIONS ADD USER_RETRY_MAX NUMBER DEFAULT 0; 3 | ALTER TABLE WF_ACTIONS ADD USER_RETRY_INTERVAL NUMBER DEFAULT 0; -------------------------------------------------------------------------------- /examples/src/main/apps/map-reduce/job.properties: -------------------------------------------------------------------------------- 1 | nameNode=hdfs://localhost:8020 2 | jobTracker=localhost:8021 3 | queueName=default 4 | examplesRoot=examples 5 | 6 | oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/map-reduce 7 | outputDir=map-reduce 8 | -------------------------------------------------------------------------------- /examples/src/main/apps/pig/job.properties: -------------------------------------------------------------------------------- 1 | nameNode=hdfs://localhost:8020 2 | jobTracker=localhost:8021 3 | queueName=default 4 | examplesRoot=examples 5 | 6 | oozie.libpath=/user/${user.name}/${examplesRoot}/apps/examples-lib 7 | 8 | oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/pig 9 | -------------------------------------------------------------------------------- /examples/src/main/apps/hadoop-el/job.properties: -------------------------------------------------------------------------------- 1 | nameNode=hdfs://localhost:8020 2 | jobTracker=localhost:8021 3 | queueName=default 4 | examplesRoot=examples 5 | 6 | oozie.libpath=/user/${user.name}/${examplesRoot}/apps/examples-lib 7 | 8 | oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/hadoop-el 9 | -------------------------------------------------------------------------------- /examples/src/main/apps/java-main/job.properties: -------------------------------------------------------------------------------- 1 | nameNode=hdfs://localhost:8020 2 | jobTracker=localhost:8021 3 | queueName=default 4 | examplesRoot=examples 5 | 6 | oozie.libpath=/user/${user.name}/${examplesRoot}/apps/examples-lib 7 | 8 | oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/java-main 9 | -------------------------------------------------------------------------------- /examples/src/main/apps/streaming/job.properties: -------------------------------------------------------------------------------- 1 | nameNode=hdfs://localhost:8020 2 | jobTracker=localhost:8021 3 | queueName=default 4 | examplesRoot=examples 5 | 6 | oozie.libpath=/user/${user.name}/${examplesRoot}/apps/examples-lib 7 | 8 | oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/streaming 9 | -------------------------------------------------------------------------------- /examples/src/main/apps/aggregator/job.properties: -------------------------------------------------------------------------------- 1 | nameNode=hdfs://localhost:8020 2 | jobTracker=localhost:8021 3 | queueName=default 4 | examplesRoot=examples 5 | 6 | oozie.coord.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/aggregator 7 | start=2010-01-01T01:00Z 8 | end=2010-01-01T03:00Z 9 | 10 | 11 | -------------------------------------------------------------------------------- /utils/dbutils/updatescripts/updatescripts-3.0.0-to-3.0.1.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE WF_JOBS DROP PARENTID; 2 | ALTER TABLE WF_JOBS ADD PARENT_ID VARCHAR2(255); 3 | ALTER TABLE WF_ACTIONS MODIFY EXECUTION_PATH VARCHAR2(1024); 4 | ALTER TABLE COORD_JOBS ADD DONE_MATERIALIZATION NUMBER DEFAULT 0; 5 | ALTER TABLE COORD_JOBS ADD APP_NAMESPACE VARCHAR2(255); -------------------------------------------------------------------------------- /examples/src/main/apps/bundle/job.properties: -------------------------------------------------------------------------------- 1 | oozie.bundle.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/bundle 2 | nameNode=hdfs://localhost:8020 3 | jobTracker=localhost:8021 4 | queueName=default 5 | outputDir=bundle 6 | examplesRoot=examples 7 | start=2010-01-01T01:00Z 8 | end=2010-01-01T03:00Z 9 | userName=${user.name} -------------------------------------------------------------------------------- /examples/src/main/apps/custom-main/job.properties: -------------------------------------------------------------------------------- 1 | nameNode=hdfs://localhost:8020 2 | jobTracker=localhost:8021 3 | queueName=default 4 | examplesRoot=examples 5 | 6 | oozie.libpath=/user/${user.name}/${examplesRoot}/apps/examples-lib 7 | 8 | oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/custom-main 9 | 10 | -------------------------------------------------------------------------------- /examples/src/main/apps/demo/job.properties: -------------------------------------------------------------------------------- 1 | nameNode=hdfs://localhost:8020 2 | jobTracker=localhost:8021 3 | queueName=default 4 | examplesRoot=examples 5 | 6 | oozie.libpath=/user/${user.name}/${examplesRoot}/apps/examples-lib 7 | 8 | oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/demo 9 | sshAction=rename 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Maven 2 | target 3 | 4 | # IntelliJ 5 | *.iml 6 | *.ipr 7 | *.iws 8 | 9 | # Structure101 10 | *.hsp 11 | 12 | # Eclipse 13 | .classpath 14 | .project 15 | .settings 16 | 17 | # Oozie build 18 | core/pig* 19 | build 20 | mem 21 | core/build 22 | core/mem 23 | examples/oozietests 24 | mkdistro-*.out 25 | distro/downloads 26 | SecurityAuth.audit 27 | 28 | -------------------------------------------------------------------------------- /examples/src/main/apps/cron/job.properties: -------------------------------------------------------------------------------- 1 | nameNode=hdfs://localhost:8020 2 | jobTracker=localhost:8021 3 | queueName=default 4 | examplesRoot=examples 5 | 6 | oozie.coord.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/cron 7 | start=2010-01-01T00:00Z 8 | end=2010-01-01T01:00Z 9 | workflowAppUri=${nameNode}/user/${user.name}/${examplesRoot}/apps/cron 10 | 11 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/oozie-oracle-orm.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /examples/src/main/apps/datelist-java-main/job.properties: -------------------------------------------------------------------------------- 1 | oozie.wf.application.path=hdfs://localhost:9000/user/${user.name}/examples/apps/java-main 2 | jobTracker=localhost:9001 3 | nameNode=hdfs://localhost:9000 4 | queueName=default 5 | START=2009-02-01T01:00Z 6 | END=2009-02-01T02:00Z 7 | FREQUENCY=15 8 | TIMEUNIT=MINUTES 9 | TIMEZONE=UTC 10 | EXPECTED_DATE_RANGE=2009-02-01T01:00Z,2009-02-01T01:15Z,2009-02-01T01:30Z,2009-02-01T01:45Z 11 | -------------------------------------------------------------------------------- /utils/dbutils/updatescripts/readme.txt: -------------------------------------------------------------------------------- 1 | dbscripts-3.0.0.sql will be used to create all the tables if we have new schema. 2 | 3 | updatescripts-2.x-to-3.0.0.sql will be used to update the tables from 2.x to 3.0.0. 4 | 5 | upgradescript-2.x-to-3.0.0.sql will be used to change the previous statuses to new statuses when we will update the current running system of 2.x to 3.0.0 6 | 7 | For all the scripts please change the db name and run the script. 8 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/oozie-derby-orm.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/oozie-hsqldb-orm.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/oozie-postgresql-orm.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /core/src/test/resources/adminusers.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. See accompanying LICENSE file. 14 | # 15 | admin 16 | -------------------------------------------------------------------------------- /utils/dbutils/updatescripts/upgradescript-2.x-to-3.0.0.sql: -------------------------------------------------------------------------------- 1 | # please replace "OOZIEDB" to your schema name 2 | 3 | UPDATE OOZIEDB.COORD_JOBS 4 | SET STATUS = 'RUNNING',PENDING = 1 5 | WHERE ID IN 6 | ( 7 | SELECT JOB_ID FROM COORD_ACTIONS WHERE JOB_ID IN ( 8 | SELECT ID FROM COORD_JOBS WHERE STATUS = 'SUCCEEDED') AND (STATUS != 'FAILED' AND 9 | STATUS != 'SUCCEEDED' AND STATUS != 'KILLED' AND STATUS != 'TIMEDOUT') 10 | ); 11 | 12 | UPDATE OOZIEDB.COORD_JOBS SET STATUS = 'RUNNING' WHERE STATUS = 'PREMATER'; 13 | 14 | UPDATE OOZIEDB.COORD_ACTIONS 15 | SET STATUS = 'SUSPENDED' 16 | WHERE ID IN( 17 | SELECT A.ID FROM COORD_ACTIONS A, WF_JOBS B WHERE A.EXTERNAL_ID = B.ID 18 | AND B.STATUS = 'SUSPENDED' AND A.STATUS = 'RUNNING' 19 | ); 20 | -------------------------------------------------------------------------------- /core/src/main/conf/adminusers.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. See accompanying LICENSE file. 14 | # 15 | 16 | # Admin Users, one user by line 17 | -------------------------------------------------------------------------------- /webapp/src/main/webapp/META-INF/context.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/src/test/resources/localoozieexample-end.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. See accompanying LICENSE file. 14 | 15 | # 16 | 17 | parameter=end 18 | -------------------------------------------------------------------------------- /examples/src/test/resources/localoozieexample-kill.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. See accompanying LICENSE file. 14 | 15 | # 16 | 17 | parameter=kill 18 | -------------------------------------------------------------------------------- /src/main/assemblies/empty.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | empty 17 | 18 | 19 | -------------------------------------------------------------------------------- /core/src/test/resources/oozie-site1.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /core/src/test/resources/wf-schema-invalid.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /client/src/test/resources/valid.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /client/src/test/resources/invalid.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /examples/src/main/apps/cron/workflow.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /examples/src/main/apps/no-op/workflow.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/command/PreconditionException.java: -------------------------------------------------------------------------------- 1 | package org.apache.oozie.command; 2 | 3 | import org.apache.oozie.ErrorCode; 4 | import org.apache.oozie.XException; 5 | 6 | public class PreconditionException extends XException{ 7 | /** 8 | * Create a verifyXCommand exception for verify conditions purposes. 9 | * 10 | * @param cause the XException cause. 11 | */ 12 | public PreconditionException(XException cause) { 13 | super(cause); 14 | } 15 | 16 | /** 17 | * Create a verifyXCommand exception for verify conditions purposes. 18 | * 19 | * @param errorCode error code. 20 | * @param params parameters for the error code message template. 21 | */ 22 | public PreconditionException(ErrorCode errorCode, Object... params) { 23 | super(errorCode, params); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/action/hadoop/LauncherMainTester2.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.action.hadoop; 16 | 17 | public class LauncherMainTester2 extends LauncherMainTester { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /core/src/test/resources/hadoop-site.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | ======================================================================= 2 | NOTICE file for use with, and corresponding to Section 4 of, 3 | the Apache License, Version 2.0, 4 | in this case for the Oozie, Workflow Engine for Hadoop project 5 | ======================================================================= 6 | 7 | This product includes software developed by 8 | Yahoo! Inc. (www.yahoo.com) 9 | Copyright (c) 2010 Yahoo! Inc. All rights reserved. 10 | 11 | 12 | This product includes software developed by Yahoo! Inc., 13 | powering the largest Hadoop clusters in the Universe! 14 | (http://developer.yahoo.com/hadoop). 15 | 16 | This product includes software developed by The Apache Software 17 | Foundation (http://www.apache.org/). 18 | 19 | Detailed License information for all components can be found in the 20 | documentation in the ooziedocs.war at index.html##LicenseInfo 21 | 22 | -------------------------------------------------------------------------------- /examples/src/main/java/org/apache/oozie/example/DemoPigMain.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.example; 16 | 17 | import org.apache.oozie.action.hadoop.PigMain; 18 | 19 | public class DemoPigMain extends PigMain { 20 | } 21 | -------------------------------------------------------------------------------- /core/src/test/resources/test-oozie-default.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | oozie.dummy 21 | DEFAULT 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /sharelib/src/main/resources/sharelib.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. See accompanying LICENSE file. 14 | 15 | # 16 | 17 | ###################### 18 | build.user=${user.name} 19 | build.time=${build.time} 20 | build.version=${pom.version} 21 | vc.revision=${vc.revision} 22 | vc.url=${vc.url} 23 | ###################### 24 | -------------------------------------------------------------------------------- /client/src/main/resources/oozie-buildinfo.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. See accompanying LICENSE file. 14 | 15 | # 16 | 17 | ###################### 18 | build.user=${user.name} 19 | build.time=${build.time} 20 | build.version=${pom.version} 21 | vc.revision=${vc.revision} 22 | vc.url=${vc.url} 23 | ###################### 24 | -------------------------------------------------------------------------------- /examples/src/main/java/org/apache/oozie/example/DemoMapReduceMain.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.example; 16 | 17 | import org.apache.oozie.action.hadoop.MapReduceMain; 18 | 19 | public class DemoMapReduceMain extends MapReduceMain { 20 | } 21 | -------------------------------------------------------------------------------- /core/src/test/resources/auth-disabled-oozie-site.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | oozie.service.AuthorizationService.admin.enabled 19 | false 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/src/main/java/Dummy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | 16 | /** 17 | * Dummy class to force the creation of a JAR file for the oozie-docs module. 18 | * If the JAR does not exists Maven test phase fails in oozie-webapp module. 19 | */ 20 | public class Dummy { 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/oozie-mysql-orm.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /core/src/test/resources/oozie-site-with-security.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | oozie.service.AuthorizationService.security.enabled 21 | true 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /core/src/test/resources/wf-schema-action-name-too-long.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/src/site/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 19 | 20 | 21 | OOZIE DOCS 22 | 23 | -------------------------------------------------------------------------------- /distro/src/main/tomcat/ROOT/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 19 | 20 | 21 | ROOT 22 | 23 | -------------------------------------------------------------------------------- /docs/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 19 | 20 | 21 | OOZIE DOCS 22 | 23 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/command/wf/StartCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.command.wf; 16 | 17 | public class StartCommand extends SignalCommand { 18 | 19 | public StartCommand(String id) { 20 | super("start", 1, id); 21 | incrJobCounter(1); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /core/src/test/resources/oozie-site2.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | oozie.system.id 21 | SITE1 22 | 23 | 24 | 25 | oozie.dummy 26 | SITE2 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /docs/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | Oozie 19 | 20 | 21 | 22 | org.apache.maven.skins 23 | maven-stylus-skin 24 | 1.1 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /core/src/test/resources/oozie-sitealternate.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | oozie.system.id 21 | ALTERNATE1 22 | 23 | 24 | 25 | oozie.dummy 26 | ALTERNATE2 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /core/src/test/resources/oozie-site-instrumentation.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | oozie.services 21 | 22 | org.apache.oozie.service.SchedulerService, 23 | org.apache.oozie.service.InstrumentationService 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /core/src/test/resources/wf-loop2-invalid.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | true 20 | false 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/util/TestClassUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.util; 16 | 17 | import org.apache.oozie.test.XTestCase; 18 | import org.apache.hadoop.io.Writable; 19 | 20 | public class TestClassUtils extends XTestCase { 21 | 22 | public void testContainingJar() { 23 | assertTrue(ClassUtils.findContainingJar(Writable.class).contains("hadoop-core")); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/command/coord/CoordinatorXCommand.java: -------------------------------------------------------------------------------- 1 | package org.apache.oozie.command.coord; 2 | 3 | import org.apache.oozie.command.XCommand; 4 | 5 | /** 6 | * Abstract coordinator command class derived from XCommand 7 | */ 8 | public abstract class CoordinatorXCommand extends XCommand { 9 | 10 | /** 11 | * Base class constructor for coordinator commands. 12 | * 13 | * @param name command name 14 | * @param type command type 15 | * @param priority command priority 16 | */ 17 | public CoordinatorXCommand(String name, String type, int priority) { 18 | super(name, type, priority); 19 | } 20 | 21 | /** 22 | * Base class constructor for coordinator commands. 23 | * 24 | * @param name command name 25 | * @param type command type 26 | * @param priority command priority 27 | * @param dryrun true if rerun is enabled for command 28 | */ 29 | public CoordinatorXCommand(String name, String type, int priority, boolean dryrun) { 30 | super(name, type, priority, dryrun); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /core/src/test/resources/wf-unsupported-action.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | to 21 | subject 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /client/src/main/java/org/apache/oozie/cli/OozieCLIException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.cli; 16 | 17 | /** 18 | * Exception thrown by OozieCLI 19 | */ 20 | public class OozieCLIException extends Exception { 21 | 22 | public OozieCLIException(String msg) { 23 | super(msg); 24 | } 25 | 26 | public OozieCLIException(String msg, Throwable throwable) { 27 | super(msg, throwable); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/util/db/ValidateConnectionBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.util.db; 16 | 17 | import javax.persistence.Basic; 18 | import javax.persistence.Column; 19 | import javax.persistence.Entity; 20 | import javax.persistence.Table; 21 | 22 | @Entity 23 | @Table(name = "VALIDATE_CONN") 24 | public class ValidateConnectionBean { 25 | 26 | @Basic 27 | @Column 28 | public int dummy; 29 | 30 | } -------------------------------------------------------------------------------- /src/main/assemblies/docs.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | docs 17 | 18 | zip 19 | 20 | false 21 | 22 | 23 | ${basedir}/target/${project.artifactId}-${project.version} 24 | / 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/command/wf/StartXCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.command.wf; 16 | 17 | import org.apache.oozie.util.InstrumentUtils; 18 | 19 | /** 20 | * Starting the command. 21 | */ 22 | public class StartXCommand extends SignalXCommand { 23 | 24 | public StartXCommand(String id) { 25 | super("start", 1, id); 26 | InstrumentUtils.incrJobCounter(getName(), 1, getInstrumentation()); 27 | } 28 | } -------------------------------------------------------------------------------- /core/src/test/resources/failover-fs-wf.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | kill 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/client/rest/JsonBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.client.rest; 16 | 17 | import org.json.simple.JSONObject; 18 | 19 | /** 20 | * Inteface for beans that serialize into JSON. 21 | */ 22 | public interface JsonBean { 23 | 24 | /** 25 | * Return the JSONObject for the bean. 26 | * 27 | * @return the JSONObject for the bean. 28 | */ 29 | public JSONObject toJSONObject(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/service/TestMemoryLocksService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.service; 16 | 17 | import org.apache.oozie.test.XTestCase; 18 | 19 | public class TestMemoryLocksService extends XTestCase { 20 | 21 | public void testService() throws Exception { 22 | new Services().init(); 23 | assertNotNull(Services.get().get(MemoryLocksService.class)); 24 | Services.get().destroy(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /distro/src/main/bin/oozie-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. See accompanying LICENSE file. 15 | # 16 | 17 | # resolve links - $0 may be a softlink 18 | PRG="${0}" 19 | 20 | while [ -h "${PRG}" ]; do 21 | ls=`ls -ld "${PRG}"` 22 | link=`expr "$ls" : '.*-> \(.*\)$'` 23 | if expr "$link" : '/.*' > /dev/null; then 24 | PRG="$link" 25 | else 26 | PRG=`dirname "${PRG}"`/"$link" 27 | fi 28 | done 29 | 30 | BASEDIR=`dirname ${PRG}` 31 | BASEDIR=`cd ${BASEDIR}/..;pwd` 32 | 33 | exec ${BASEDIR}/bin/oozied.sh run 34 | -------------------------------------------------------------------------------- /distro/src/main/bin/oozie-start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. See accompanying LICENSE file. 15 | # 16 | 17 | # resolve links - $0 may be a softlink 18 | PRG="${0}" 19 | 20 | while [ -h "${PRG}" ]; do 21 | ls=`ls -ld "${PRG}"` 22 | link=`expr "$ls" : '.*-> \(.*\)$'` 23 | if expr "$link" : '/.*' > /dev/null; then 24 | PRG="$link" 25 | else 26 | PRG=`dirname "${PRG}"`/"$link" 27 | fi 28 | done 29 | 30 | BASEDIR=`dirname ${PRG}` 31 | BASEDIR=`cd ${BASEDIR}/..;pwd` 32 | 33 | exec ${BASEDIR}/bin/oozied.sh start 34 | -------------------------------------------------------------------------------- /distro/src/main/bin/oozie-stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. See accompanying LICENSE file. 15 | # 16 | 17 | # resolve links - $0 may be a softlink 18 | PRG="${0}" 19 | 20 | while [ -h "${PRG}" ]; do 21 | ls=`ls -ld "${PRG}"` 22 | link=`expr "$ls" : '.*-> \(.*\)$'` 23 | if expr "$link" : '/.*' > /dev/null; then 24 | PRG="$link" 25 | else 26 | PRG=`dirname "${PRG}"`/"$link" 27 | fi 28 | done 29 | 30 | BASEDIR=`dirname ${PRG}` 31 | BASEDIR=`cd ${BASEDIR}/..;pwd` 32 | 33 | exec ${BASEDIR}/bin/oozied.sh stop 34 | -------------------------------------------------------------------------------- /examples/src/main/java/org/apache/oozie/example/DemoJavaMain.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.example; 16 | 17 | public class DemoJavaMain { 18 | public static void main(String[] args) { 19 | System.out.println("Demo Java Main"); 20 | 21 | System.out.println("# Arguments: " + args.length); 22 | for (int i = 0; i < args.length; i++) { 23 | System.out.println("Argument[" + i + "]: " + args[i]); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/action/hadoop/MainTestCase.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.action.hadoop; 16 | 17 | import org.apache.oozie.test.XFsTestCase; 18 | 19 | import java.util.concurrent.Callable; 20 | 21 | public abstract class MainTestCase extends XFsTestCase implements Callable { 22 | 23 | //TODO remove this trick when we compile 20.100 onwards 24 | public void testMain() throws Exception { 25 | DoAs.call(getTestUser(), this); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/util/Instrumentable.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.util; 16 | 17 | /** 18 | * Managed entities (like services) that implement this interface are injected with the system {@link Instrumentation} 19 | * object. 20 | */ 21 | public interface Instrumentable { 22 | 23 | /** 24 | * Set the system instrumentation. 25 | * 26 | * @param instr system instrumentation. 27 | */ 28 | public void instrument(Instrumentation instr); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/service/AuthorizationException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.service; 16 | 17 | import org.apache.oozie.XException; 18 | import org.apache.oozie.ErrorCode; 19 | 20 | public class AuthorizationException extends XException { 21 | 22 | public AuthorizationException(ErrorCode errorCode, Object... params) { 23 | super(errorCode, params); 24 | } 25 | 26 | public AuthorizationException(XException cause) { 27 | super(cause); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/workflow/lite/DecisionNodeDef.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.workflow.lite; 16 | 17 | import org.apache.oozie.util.ParamChecker; 18 | 19 | import java.util.List; 20 | 21 | public class DecisionNodeDef extends NodeDef { 22 | 23 | DecisionNodeDef() { 24 | } 25 | 26 | public DecisionNodeDef(String name, String conf, Class clazz, List evals) { 27 | super(name, ParamChecker.notNull(conf, "conf"), clazz, evals); 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /core/src/test/resources/coord-matLookup-trigger.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 10 18 | 2 19 | LIFO 20 | 21 | 22 | 23 | hdfs:///tmp/workflows/ 24 | 25 | 26 | -------------------------------------------------------------------------------- /core/src/test/resources/wf-ext-schema-invalid.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | signal-value 22 | external-status 23 | error 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /examples/src/main/java/org/apache/oozie/example/TimeUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.example; 16 | 17 | import java.util.Calendar; 18 | 19 | public enum TimeUnit { 20 | MINUTES(Calendar.MINUTE), HOURS(Calendar.HOUR), DAYS(Calendar.DATE), MONTHS( 21 | Calendar.MONTH); 22 | 23 | private int calendarUnit; 24 | 25 | private TimeUnit(int calendarUnit) { 26 | this.calendarUnit = calendarUnit; 27 | } 28 | 29 | /** 30 | * @return calendar unit 31 | */ 32 | public int getCalendarUnit() { 33 | return calendarUnit; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/service/TestInstrumentationService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.service; 16 | 17 | import org.apache.oozie.test.XTestCase; 18 | 19 | public class TestInstrumentationService extends XTestCase { 20 | 21 | public void testInstrumentation() throws Exception { 22 | Services services = new Services(); 23 | services.init(); 24 | assertNotNull(services.get(InstrumentationService.class)); 25 | assertNotNull(services.get(InstrumentationService.class).get()); 26 | services.destroy(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/coord/TimeUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.coord; 16 | 17 | import java.util.Calendar; 18 | 19 | public enum TimeUnit { 20 | MINUTE(Calendar.MINUTE), HOUR(Calendar.HOUR), DAY(Calendar.DATE), MONTH(Calendar.MONTH), END_OF_DAY(Calendar.DATE), END_OF_MONTH( 21 | Calendar.MONTH), NONE(-1); 22 | 23 | private int calendarUnit; 24 | 25 | private TimeUnit(int calendarUnit) { 26 | this.calendarUnit = calendarUnit; 27 | } 28 | 29 | public int getCalendarUnit() { 30 | return calendarUnit; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /core/src/test/resources/wf-loop1-invalid.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | true 20 | false 21 | 22 | 23 | 24 | 25 | kill 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /core/src/test/resources/wf-transition-invalid.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | true 20 | false 21 | 22 | 23 | 24 | 25 | kill 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /core/src/test/resources/rerun-el-wf.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | ${fs:exists(checkDir)} 27 | 28 | 29 | 30 | 31 | kill 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /core/src/test/resources/rerun-elerr-wf.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | ${fs:exsts(checkDir)} 27 | 28 | 29 | 30 | 31 | kill 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /core/src/main/resources/ssh-base.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. See accompanying LICENSE file. 15 | # 16 | 17 | path=`echo $0` 18 | dir=`dirname $path` 19 | 20 | res1=`ls $dir/ssh-wrapper.sh` > /dev/null 21 | if [ $? -ne 0 ] 22 | then 23 | echo $dir"/ssh-wrapper.sh"" : ""No such file or directory" > /dev/stderr ; 24 | exit 127 25 | fi 26 | 27 | #Leaving this out since it can get a little tricky. (Shell commands / commands in the path / user-scripts) 28 | #res2=`/usr/bin/which $5` > /dev/null 29 | #if [ $? -ne 0 ] 30 | #then 31 | # echo $5" : ""command not found" > /dev/stderr ; 32 | # exit 127 33 | #fi 34 | 35 | cmnd="$dir/ssh-wrapper.sh ${*}" 36 | ${cmnd} /dev/null 2>&1 & 37 | echo $! 38 | -------------------------------------------------------------------------------- /core/src/test/resources/test-custom-log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. See accompanying LICENSE file. 14 | 15 | # 16 | 17 | log4j.appender.oozie=org.apache.log4j.ConsoleAppender 18 | log4j.appender.oozie.Target=System.out 19 | log4j.appender.oozie.layout=org.apache.log4j.PatternLayout 20 | log4j.appender.oozie.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n 21 | 22 | log4j.appender.null=org.apache.log4j.varia.NullAppender 23 | 24 | log4j.logger.org.apache=INFO, oozie 25 | log4j.logger.org.mortbay=WARN, oozie 26 | log4j.logger.org.hsqldb=WARN, oozie 27 | 28 | log4j.logger.opslog=NONE, null 29 | log4j.logger.applog=NONE, null 30 | log4j.logger.instrument=NONE, null 31 | 32 | log4j.logger.a=NONE, null 33 | 34 | -------------------------------------------------------------------------------- /core/src/test/resources/test-oozie-log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. See accompanying LICENSE file. 14 | 15 | # 16 | 17 | log4j.appender.oozie=org.apache.log4j.ConsoleAppender 18 | log4j.appender.oozie.Target=System.out 19 | log4j.appender.oozie.layout=org.apache.log4j.PatternLayout 20 | log4j.appender.oozie.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n 21 | 22 | log4j.appender.null=org.apache.log4j.varia.NullAppender 23 | 24 | log4j.logger.org.apache=INFO, oozie 25 | log4j.logger.org.mortbay=WARN, oozie 26 | log4j.logger.org.hsqldb=WARN, oozie 27 | 28 | log4j.logger.opslog=NONE, null 29 | log4j.logger.applog=NONE, null 30 | log4j.logger.instrument=NONE, null 31 | 32 | log4j.logger.a=ALL, null 33 | 34 | -------------------------------------------------------------------------------- /examples/src/test/resources/localoozieexample-wf.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | ${parameter == 'end'} 20 | ${parameter == 'kill'} 21 | 22 | 23 | 24 | 25 | got 'kill' parameter 26 | 27 | 28 | killed because [${wf:errorMessage(wf:lastErrorNode())}] 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/workflow/WorkflowApp.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.workflow; 16 | 17 | /** 18 | * A workflow definition is a programmatic definition of a workflow application. 19 | */ 20 | public interface WorkflowApp { 21 | 22 | /** 23 | * Return the name of teh workflow application. 24 | * 25 | * @return the name of teh workflow application. 26 | */ 27 | public String getName(); 28 | 29 | /** 30 | * Return the original workflow definition (normally XML). 31 | * 32 | * @return the original workflow definition (normally XML). 33 | */ 34 | public String getDefinition(); 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/executor/jpa/CoordActionsActiveCountJPAExecutor.java: -------------------------------------------------------------------------------- 1 | package org.apache.oozie.executor.jpa; 2 | 3 | import javax.persistence.EntityManager; 4 | import javax.persistence.Query; 5 | 6 | import org.apache.oozie.ErrorCode; 7 | import org.apache.oozie.util.ParamChecker; 8 | 9 | /** 10 | * Load the number of running actions for a coordinator job. 11 | */ 12 | public class CoordActionsActiveCountJPAExecutor implements JPAExecutor { 13 | 14 | private String coordJobId = null; 15 | 16 | public CoordActionsActiveCountJPAExecutor(String coordJobId) { 17 | ParamChecker.notNull(coordJobId, "coordJobId"); 18 | this.coordJobId = coordJobId; 19 | } 20 | 21 | @Override 22 | public String getName() { 23 | return "CoordActionsActiveCountJPAExecutor"; 24 | } 25 | 26 | @Override 27 | public Integer execute(EntityManager em) throws JPAExecutorException { 28 | try { 29 | Query q = em.createNamedQuery("GET_COORD_ACTIVE_ACTIONS_COUNT_BY_JOBID"); 30 | 31 | q.setParameter("jobId", coordJobId); 32 | Long count = (Long) q.getSingleResult(); 33 | return Integer.valueOf(count.intValue()); 34 | } 35 | catch (Exception e) { 36 | throw new JPAExecutorException(ErrorCode.E0603, e); 37 | } 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/executor/jpa/BundleActionsCountForJobGetJPAExecutor.java: -------------------------------------------------------------------------------- 1 | package org.apache.oozie.executor.jpa; 2 | 3 | import javax.persistence.EntityManager; 4 | import javax.persistence.Query; 5 | 6 | import org.apache.oozie.ErrorCode; 7 | import org.apache.oozie.util.ParamChecker; 8 | 9 | /** 10 | * Load the number of actions for a bundle job. 11 | */ 12 | public class BundleActionsCountForJobGetJPAExecutor implements JPAExecutor { 13 | 14 | private String bundleJobId = null; 15 | 16 | public BundleActionsCountForJobGetJPAExecutor(String bundleJobId) { 17 | ParamChecker.notNull(bundleJobId, "bundleJobId"); 18 | this.bundleJobId = bundleJobId; 19 | } 20 | 21 | @Override 22 | public String getName() { 23 | return "BundleActionsCountForJobGetJPAExecutor"; 24 | } 25 | 26 | @Override 27 | public Integer execute(EntityManager em) throws JPAExecutorException { 28 | try { 29 | Query q = em.createNamedQuery("GET_BUNDLE_ACTIONS_COUNT_BY_JOB"); 30 | 31 | q.setParameter("bundleId", bundleJobId); 32 | Long count = (Long) q.getSingleResult(); 33 | return Integer.valueOf(count.intValue()); 34 | } 35 | catch (Exception e) { 36 | throw new JPAExecutorException(ErrorCode.E0603, e); 37 | } 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/service/ForTestAuthorizationService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.service; 16 | 17 | public class ForTestAuthorizationService extends AuthorizationService { 18 | 19 | public ForTestAuthorizationService() { 20 | } 21 | 22 | protected boolean isUserInGroup(String user, String group) throws AuthorizationException { 23 | return group.equals("users"); 24 | } 25 | 26 | public String getDefaultGroup(String user) throws AuthorizationException { 27 | return (user.equals("uu")) ? "gg" : "users"; 28 | } 29 | 30 | protected boolean isAdmin(String user) { 31 | return user.equals("admin"); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/executor/jpa/CoordActionsPendingFalseCountGetJPAExecutor.java: -------------------------------------------------------------------------------- 1 | package org.apache.oozie.executor.jpa; 2 | 3 | import javax.persistence.EntityManager; 4 | import javax.persistence.Query; 5 | 6 | import org.apache.oozie.ErrorCode; 7 | import org.apache.oozie.util.ParamChecker; 8 | 9 | /** 10 | * Load the number of pending actions for a coordinator job. 11 | */ 12 | public class CoordActionsPendingFalseCountGetJPAExecutor implements JPAExecutor { 13 | 14 | private String coordJobId = null; 15 | 16 | public CoordActionsPendingFalseCountGetJPAExecutor(String coordJobId) { 17 | ParamChecker.notNull(coordJobId, "coordJobId"); 18 | this.coordJobId = coordJobId; 19 | } 20 | 21 | @Override 22 | public String getName() { 23 | return "CoordActionsPendingFalseCountGetJPAExecutor"; 24 | } 25 | 26 | @Override 27 | public Integer execute(EntityManager em) throws JPAExecutorException { 28 | try { 29 | Query q = em.createNamedQuery("GET_COORD_ACTIONS_PENDING_FALSE_COUNT"); 30 | 31 | q.setParameter("jobId", coordJobId); 32 | Long count = (Long) q.getSingleResult(); 33 | return Integer.valueOf(count.intValue()); 34 | } 35 | catch (Exception e) { 36 | throw new JPAExecutorException(ErrorCode.E0603, e); 37 | } 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /docs/src/main/webapp/docs/configuration.xsl: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |

Configuration Properties

23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
namevaluedescription
37 | 38 | 39 |
40 |
41 | -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/command/SkipCommitFaultInjection.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.command; 16 | 17 | import org.apache.oozie.FaultInjection; 18 | 19 | public class SkipCommitFaultInjection extends FaultInjection { 20 | 21 | public static final String ACTION_FAILOVER_FAULT_INJECTION = "oozie.fault.injection.action.failover"; 22 | 23 | private static boolean ACTIVE = false; 24 | 25 | public boolean activate() { 26 | ACTIVE = Boolean.parseBoolean(System.getProperty(ACTION_FAILOVER_FAULT_INJECTION, "false")); 27 | return ACTIVE; 28 | } 29 | 30 | public void deactivate() { 31 | ACTIVE = false; 32 | } 33 | 34 | public boolean isActive() { 35 | return ACTIVE; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/CoordinatorActionInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie; 16 | 17 | import java.util.List; 18 | 19 | public class CoordinatorActionInfo { 20 | private List actions; 21 | 22 | /** 23 | * Create a coordiantor actions info bean. 24 | * 25 | * @param coordiantor actions being returned. 26 | */ 27 | public CoordinatorActionInfo(List actions) { 28 | this.actions = actions; 29 | } 30 | 31 | /** 32 | * Return the coordiantor actions being returned. 33 | * 34 | * @return the coordiantor actions being returned. 35 | */ 36 | public List getCoordActions() { 37 | return actions; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /examples/src/main/apps/bundle/bundle.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | ${nameNode}/user/${userName}/${examplesRoot}/apps/aggregator/coordinator.xml 18 | 19 | 20 | start 21 | ${start} 22 | 23 | 24 | end 25 | ${end} 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/coord/CoordELConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.coord; 16 | 17 | public class CoordELConstants { 18 | /* 19 | * Echo backing some constants used in Coordinator EL variables 20 | */ 21 | public static final String SUBMIT_MINUTE = "${MINUTE}"; 22 | public static final String SUBMIT_HOUR = "${HOUR}"; 23 | public static final String SUBMIT_MONTH = "${MONTH}"; 24 | public static final String SUBMIT_DAY = "${DAY}"; 25 | public static final String SUBMIT_YEAR = "${YEAR}"; 26 | 27 | public static final int SUBMIT_MINUTES = 1; 28 | public static final int SUBMIT_HOURS = 60; 29 | public static final int SUBMIT_DAYS = 24 * 60; 30 | 31 | public static final String DEFAULT_DONE_FLAG = "_SUCCESS"; 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/util/ELEvaluationException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.util; 16 | 17 | /** 18 | * Exception thrown by EL functions when they find a transient error. 19 | */ 20 | public class ELEvaluationException extends Exception { 21 | 22 | /** 23 | * Create a EL evaluation exception. 24 | * 25 | * @param message exception message. 26 | * @param cause exception cause. 27 | */ 28 | public ELEvaluationException(String message, Throwable cause) { 29 | super(message, cause); 30 | } 31 | 32 | /** 33 | * Create a EL evaluation exception. 34 | * 35 | * @param cause exception cause. 36 | */ 37 | public ELEvaluationException(Throwable cause) { 38 | super(cause); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /docs/src/site/twiki/DG_WorkflowReRun.twiki: -------------------------------------------------------------------------------- 1 | 2 | 3 | [[index][::Go back to Oozie Documentation Index::]] 4 | 5 | ---+!! Workflow ReRrun 6 | 7 | %TOC% 8 | ---++ Configs 9 | 10 | * oozie.wf.application.path 11 | * Only one of following two configurations is mandatory. Both should not be defined at the same time 12 | * oozie.wf.rerun.skip.nodes 13 | * oozie.wf.rerun.failnodes 14 | * Skip nodes are comma separated list of action names. They can be any action nodes including decision node. 15 | * The valid value of =oozie.wf.rerun.failnodes= is true or false. 16 | * If secured hadoop version is used, the following two properties needs to be specified as well 17 | * mapreduce.jobtracker.kerberos.principal 18 | * dfs.namenode.kerberos.principal. 19 | ---++ Pre-Conditions 20 | 21 | * Workflow with id wfId should exist. 22 | * Workflow with id wfId should be in SUCCEEDED/KILLED/FAILED. 23 | * If specified , nodes in the config oozie.wf.rerun.skip.nodes must be completed successfully. 24 | 25 | ---++ ReRun 26 | 27 | * Reloads the configs. 28 | * Creates a new Workflow Instance with the same wfId. 29 | * Deletes the actions that are not skipped from the DB and copies data from old Workflow Instance to new one for skipped actions. 30 | * Action handler will skip the nodes given in the config with the same exit transition as before. 31 | 32 | [[index][::Go back to Oozie Documentation Index::]] 33 | 34 | 35 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/BaseEngineException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie; 16 | 17 | /** 18 | * Exception thrown by the {@link DagEngine}. 19 | */ 20 | public class BaseEngineException extends XException { 21 | 22 | /** 23 | * Create an engine exception from a XException. 24 | * 25 | * @param cause the XException cause. 26 | */ 27 | public BaseEngineException(XException cause) { 28 | super(cause); 29 | } 30 | 31 | /** 32 | * Create an engine exception. 33 | * 34 | * @param errorCode error code. 35 | * @param params parameters for the error code message template. 36 | */ 37 | public BaseEngineException(ErrorCode errorCode, Object... params) { 38 | super(errorCode, params); 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/DagEngineException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie; 16 | 17 | /** 18 | * Exception thrown by the {@link DagEngine}. 19 | */ 20 | public class DagEngineException extends BaseEngineException { 21 | 22 | /** 23 | * Create an dag engine exception from a XException. 24 | * 25 | * @param cause the XException cause. 26 | */ 27 | public DagEngineException(XException cause) { 28 | super(cause); 29 | } 30 | 31 | /** 32 | * Create a dag engine exception. 33 | * 34 | * @param errorCode error code. 35 | * @param params parameters for the error code message template. 36 | */ 37 | public DagEngineException(ErrorCode errorCode, Object... params) { 38 | super(errorCode, params); 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /client/src/main/resources/email-action-0.1.xsd: -------------------------------------------------------------------------------- 1 | 2 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/executor/jpa/CoordJobUpdateJPAExecutor.java: -------------------------------------------------------------------------------- 1 | package org.apache.oozie.executor.jpa; 2 | 3 | import javax.persistence.EntityManager; 4 | import org.apache.oozie.CoordinatorJobBean; 5 | import org.apache.oozie.ErrorCode; 6 | import org.apache.oozie.util.ParamChecker; 7 | 8 | /** 9 | * Update the CoordinatorJob into a Bean and persist it. 10 | */ 11 | public class CoordJobUpdateJPAExecutor implements JPAExecutor { 12 | 13 | private CoordinatorJobBean coordJob = null; 14 | 15 | /** 16 | * @param coordJob 17 | */ 18 | public CoordJobUpdateJPAExecutor(CoordinatorJobBean coordJob) { 19 | ParamChecker.notNull(coordJob, "CoordinatorJobBean"); 20 | this.coordJob = coordJob; 21 | } 22 | 23 | /* 24 | * (non-Javadoc) 25 | * 26 | * @see org.apache.oozie.executor.jpa.JPAExecutor#execute(javax.persistence. 27 | * EntityManager) 28 | */ 29 | @Override 30 | public Void execute(EntityManager em) throws JPAExecutorException { 31 | try { 32 | em.merge(coordJob); 33 | return null; 34 | } 35 | catch (Exception e) { 36 | throw new JPAExecutorException(ErrorCode.E0603, e); 37 | } 38 | } 39 | 40 | /* 41 | * (non-Javadoc) 42 | * 43 | * @see org.apache.oozie.executor.jpa.JPAExecutor#getName() 44 | */ 45 | @Override 46 | public String getName() { 47 | return "CoordinatorUpdateJobJPAExecutor"; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/BundleEngineException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie; 16 | 17 | /** 18 | * Exception thrown by the {@link BundleEngine}. 19 | */ 20 | public class BundleEngineException extends BaseEngineException { 21 | 22 | /** 23 | * Create a bundle engine exception from a XException. 24 | * 25 | * @param cause the XException cause. 26 | */ 27 | public BundleEngineException(XException cause) { 28 | super(cause); 29 | } 30 | 31 | /** 32 | * Create a bundle engine exception. 33 | * 34 | * @param errorCode error code. 35 | * @param params parameters for the error code message template. 36 | */ 37 | public BundleEngineException(ErrorCode errorCode, Object... params) { 38 | super(errorCode, params); 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/service/TestStoreService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.service; 16 | 17 | import org.apache.oozie.test.XTestCase; 18 | 19 | import javax.persistence.EntityManager; 20 | 21 | public class TestStoreService extends XTestCase { 22 | 23 | @Override 24 | protected void setUp() throws Exception { 25 | super.setUp(); 26 | new Services().init(); 27 | } 28 | 29 | @Override 30 | protected void tearDown() throws Exception { 31 | Services.get().destroy(); 32 | super.tearDown(); 33 | } 34 | 35 | public void testGetEntityManager() throws Exception { 36 | StoreService ss = Services.get().get(StoreService.class); 37 | EntityManager em = ss.getEntityManager(); 38 | assertNotNull(em); 39 | em.close(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/service/HadoopAccessorException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.service; 16 | 17 | import org.apache.oozie.XException; 18 | import org.apache.oozie.ErrorCode; 19 | 20 | public class HadoopAccessorException extends XException { 21 | 22 | /** 23 | * Create an HadoopAccessor exception from a XException. 24 | * 25 | * @param cause the XException cause. 26 | */ 27 | public HadoopAccessorException(XException cause) { 28 | super(cause); 29 | } 30 | 31 | /** 32 | * Create a HadoopAccessor exception. 33 | * 34 | * @param errorCode error code. 35 | * @param params parameters for the error code message template. 36 | */ 37 | public HadoopAccessorException(ErrorCode errorCode, Object... params) { 38 | super(errorCode, params); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/assemblies/sharelib.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | sharelib 17 | 18 | dir 19 | tar.gz 20 | 21 | false 22 | 23 | 24 | 25 | ${basedir}/target/classes/sharelib.properties 26 | /share/lib 27 | 28 | 29 | 30 | 31 | 32 | /share/lib 33 | false 34 | 35 | ${project.groupId}:oozie-sharelib 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/CoordinatorEngineException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie; 16 | 17 | /** 18 | * Exception thrown by the {@link CoordinatorEngine}. 19 | */ 20 | public class CoordinatorEngineException extends BaseEngineException { 21 | 22 | /** 23 | * Create a coordinator engine exception from a XException. 24 | * 25 | * @param cause the XException cause. 26 | */ 27 | public CoordinatorEngineException(XException cause) { 28 | super(cause); 29 | } 30 | 31 | /** 32 | * Create a coordinator engine exception. 33 | * 34 | * @param errorCode error code. 35 | * @param params parameters for the error code message template. 36 | */ 37 | public CoordinatorEngineException(ErrorCode errorCode, Object... params) { 38 | super(errorCode, params); 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/service/TestActionService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.service; 16 | 17 | import org.apache.oozie.service.Services; 18 | import org.apache.oozie.service.ActionService; 19 | import org.apache.oozie.test.XTestCase; 20 | 21 | public class TestActionService extends XTestCase { 22 | 23 | public void testService() throws Exception { 24 | Services services = new Services(); 25 | services.init(); 26 | assertNotNull(services.get(ActionService.class)); 27 | services.destroy(); 28 | } 29 | 30 | public void testActions() throws Exception { 31 | Services services = new Services(); 32 | services.init(); 33 | ActionService as = services.get(ActionService.class); 34 | assertNotNull(as.getExecutor("switch")); 35 | services.destroy(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /examples/src/main/data/data.txt: -------------------------------------------------------------------------------- 1 | To be or not to be, that is the question; 2 | Whether 'tis nobler in the mind to suffer 3 | The slings and arrows of outrageous fortune, 4 | Or to take arms against a sea of troubles, 5 | And by opposing, end them. To die, to sleep; 6 | No more; and by a sleep to say we end 7 | The heart-ache and the thousand natural shocks 8 | That flesh is heir to ? 'tis a consummation 9 | Devoutly to be wish'd. To die, to sleep; 10 | To sleep, perchance to dream. Ay, there's the rub, 11 | For in that sleep of death what dreams may come, 12 | When we have shuffled off this mortal coil, 13 | Must give us pause. There's the respect 14 | That makes calamity of so long life, 15 | For who would bear the whips and scorns of time, 16 | Th'oppressor's wrong, the proud man's contumely, 17 | The pangs of despised love, the law's delay, 18 | The insolence of office, and the spurns 19 | That patient merit of th'unworthy takes, 20 | When he himself might his quietus make 21 | With a bare bodkin? who would fardels bear, 22 | To grunt and sweat under a weary life, 23 | But that the dread of something after death, 24 | The undiscovered country from whose bourn 25 | No traveller returns, puzzles the will, 26 | And makes us rather bear those ills we have 27 | Than fly to others that we know not of? 28 | Thus conscience does make cowards of us all, 29 | And thus the native hue of resolution 30 | Is sicklied o'er with the pale cast of thought, 31 | And enterprises of great pitch and moment 32 | With this regard their currents turn awry, 33 | And lose the name of action. -------------------------------------------------------------------------------- /client/src/main/bin/oozie: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. See accompanying LICENSE file. 15 | # 16 | 17 | # resolve links - $0 may be a softlink 18 | PRG="${0}" 19 | 20 | while [ -h "${PRG}" ]; do 21 | ls=`ls -ld "${PRG}"` 22 | link=`expr "$ls" : '.*-> \(.*\)$'` 23 | if expr "$link" : '/.*' > /dev/null; then 24 | PRG="$link" 25 | else 26 | PRG=`dirname "${PRG}"`/"$link" 27 | fi 28 | done 29 | 30 | BASEDIR=`dirname ${PRG}` 31 | BASEDIR=`cd ${BASEDIR}/..;pwd` 32 | 33 | OOZIECPPATH="" 34 | for i in "${BASEDIR}/lib/"*.jar; do 35 | OOZIECPPATH="${OOZIECPPATH}:$i" 36 | done 37 | 38 | 39 | if test -z ${JAVA_HOME} 40 | then 41 | JAVA_BIN=java 42 | else 43 | JAVA_BIN=${JAVA_HOME}/bin/java 44 | fi 45 | 46 | JAVA_PROPERTIES="" 47 | while [[ ${1} =~ ^\-D ]]; do 48 | JAVA_PROPERTIES="${JAVA_PROPERTIES} ${1}" 49 | shift 50 | done 51 | ${JAVA_BIN} ${JAVA_PROPERTIES} -cp ${OOZIECPPATH} org.apache.oozie.cli.OozieCLI "${@}" 52 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/store/StoreException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.store; 16 | 17 | import org.apache.oozie.XException; 18 | import org.apache.oozie.ErrorCode; 19 | 20 | /** 21 | * Exception thrown by the {@link WorkflowStore} 22 | */ 23 | public class StoreException extends XException { 24 | 25 | /** 26 | * Create an store exception from a XException. 27 | * 28 | * @param cause the XException cause. 29 | */ 30 | public StoreException(XException cause) { 31 | super(cause); 32 | } 33 | 34 | /** 35 | * Create a store exception. 36 | * 37 | * @param errorCode error code. 38 | * @param params parameters for the error code message template. 39 | */ 40 | public StoreException(ErrorCode errorCode, Object... params) { 41 | super(errorCode, params); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/action/hadoop/KerberosAuthHelper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.action.hadoop; 16 | 17 | import org.apache.hadoop.mapred.JobClient; 18 | import org.apache.hadoop.mapred.JobConf; 19 | import org.apache.hadoop.io.Text; 20 | import org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier; 21 | import org.apache.hadoop.security.token.Token; 22 | import org.apache.oozie.action.hadoop.AuthHelper; 23 | 24 | import java.io.IOException; 25 | 26 | public class KerberosAuthHelper extends AuthHelper { 27 | 28 | public void set(JobClient jobClient, JobConf launcherJobConf) throws IOException, InterruptedException { 29 | Token mrdt = jobClient.getDelegationToken(new Text("mr token")); 30 | launcherJobConf.getCredentials().addToken(new Text("mr token"), mrdt); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /examples/src/main/java/org/apache/oozie/example/SampleMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.example; 16 | 17 | import org.apache.hadoop.io.LongWritable; 18 | import org.apache.hadoop.io.Text; 19 | import org.apache.hadoop.mapred.JobConf; 20 | import org.apache.hadoop.mapred.Mapper; 21 | import org.apache.hadoop.mapred.OutputCollector; 22 | import org.apache.hadoop.mapred.Reporter; 23 | 24 | import java.io.IOException; 25 | 26 | public class SampleMapper implements Mapper { 27 | 28 | public void configure(JobConf jobConf) { 29 | } 30 | 31 | public void map(LongWritable key, Text value, OutputCollector collector, Reporter reporter) 32 | throws IOException { 33 | collector.collect(key, value); 34 | } 35 | 36 | public void close() throws IOException { 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/command/coord/CoordXTestCase.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.command.coord; 16 | 17 | import org.apache.oozie.service.JPAService; 18 | import org.apache.oozie.service.Services; 19 | import org.apache.oozie.test.XTestCase; 20 | 21 | public abstract class CoordXTestCase extends XTestCase { 22 | protected Services services; 23 | protected JPAService jpaService; 24 | 25 | protected void setUp() throws Exception { 26 | super.setUp(); 27 | services = new Services(); 28 | services.init(); 29 | 30 | jpaService = Services.get().get(JPAService.class); 31 | if (jpaService == null) { 32 | fail("jpaService can not be null"); 33 | } 34 | } 35 | 36 | protected void tearDown() throws Exception { 37 | services.destroy(); 38 | super.tearDown(); 39 | } 40 | } -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/command/CommandException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.command; 16 | 17 | import org.apache.oozie.XException; 18 | import org.apache.oozie.ErrorCode; 19 | 20 | /** 21 | * Exception thrown by {@link Command}s. 22 | */ 23 | public class CommandException extends XException { 24 | 25 | /** 26 | * Create an dag command exception from a XException. 27 | * 28 | * @param cause the XException cause. 29 | */ 30 | public CommandException(XException cause) { 31 | super(cause); 32 | } 33 | 34 | /** 35 | * Create a dag command exception. 36 | * 37 | * @param errorCode error code. 38 | * @param params parameters for the error code message template. 39 | */ 40 | public CommandException(ErrorCode errorCode, Object... params) { 41 | super(errorCode, params); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/action/hadoop/CredentialException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.action.hadoop; 16 | 17 | import org.apache.oozie.XException; 18 | import org.apache.oozie.ErrorCode; 19 | 20 | public class CredentialException extends XException { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | /** 25 | * Create an credential exception from a XException. 26 | * 27 | * @param cause the XException cause. 28 | */ 29 | public CredentialException(XException cause) { 30 | super(cause); 31 | } 32 | 33 | /** 34 | * Create a credential exception. 35 | * 36 | * @param errorCode error code. 37 | * @param params parameters for the error code message template. 38 | */ 39 | public CredentialException(ErrorCode errorCode, Object... params) { 40 | super(errorCode, params); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /core/src/test/resources/wf-ext-schema-valid.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ${wf:conf('signal-value')} 22 | ${wf:conf('external-status')} 23 | ${wf:conf('error')} 24 | ${wf:conf('avoid-set-execution-data')} 25 | ${wf:conf('avoid-set-end-data')} 26 | ${wf:conf('running-mode')} 27 | 28 | 29 | 30 | 31 | 32 | 33 | kill 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/workflow/lite/EndNodeDef.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.workflow.lite; 16 | 17 | import java.util.Collections; 18 | 19 | //TODO javadoc 20 | public class EndNodeDef extends NodeDef { 21 | 22 | EndNodeDef() { 23 | } 24 | 25 | @SuppressWarnings("unchecked") 26 | public EndNodeDef(String name) { 27 | super(name, null, EndNodeHandler.class, Collections.EMPTY_LIST); 28 | } 29 | 30 | public static class EndNodeHandler extends NodeHandler { 31 | 32 | public boolean enter(Context context) { 33 | return true; 34 | } 35 | 36 | public String exit(Context context) { 37 | context.completeJob(); 38 | return null; 39 | } 40 | 41 | public void kill(Context context) { 42 | } 43 | 44 | public void fail(Context context) { 45 | } 46 | 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/command/wf/ExternalIdCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.command.wf; 16 | 17 | import org.apache.oozie.store.StoreException; 18 | import org.apache.oozie.store.WorkflowStore; 19 | import org.apache.oozie.store.Store; 20 | import org.apache.oozie.util.ParamChecker; 21 | import org.apache.oozie.util.XLog; 22 | import org.apache.oozie.command.Command; 23 | import org.apache.oozie.command.CommandException; 24 | 25 | public class ExternalIdCommand extends WorkflowCommand { 26 | private String id; 27 | 28 | public ExternalIdCommand(String id) { 29 | super("externalId", "externalId", 1, XLog.STD); 30 | this.id = ParamChecker.notEmpty(id, "id"); 31 | } 32 | 33 | @Override 34 | protected String call(WorkflowStore store) throws StoreException, CommandException { 35 | return store.getWorkflowIdForExternalId(id); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /examples/src/main/apps/cron/coordinator.xml: -------------------------------------------------------------------------------- 1 | 15 | 17 | 18 | 19 | ${workflowAppUri} 20 | 21 | 22 | jobTracker 23 | ${jobTracker} 24 | 25 | 26 | nameNode 27 | ${nameNode} 28 | 29 | 30 | queueName 31 | ${queueName} 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/service/ServiceException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.service; 16 | 17 | import org.apache.oozie.XException; 18 | import org.apache.oozie.ErrorCode; 19 | 20 | /** 21 | * Exception thrown by {@link Services} and {@link Service} during initialization. 22 | */ 23 | public class ServiceException extends XException { 24 | 25 | /** 26 | * Create an service exception from a XException. 27 | * 28 | * @param cause the XException cause. 29 | */ 30 | public ServiceException(XException cause) { 31 | super(cause); 32 | } 33 | 34 | /** 35 | * Create a service exception. 36 | * 37 | * @param errorCode error code. 38 | * @param params parameters for the error code message template. 39 | */ 40 | public ServiceException(ErrorCode errorCode, Object... params) { 41 | super(errorCode, params); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/workflow/lite/KillNodeDef.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.workflow.lite; 16 | 17 | import java.util.Collections; 18 | 19 | //TODO javadoc 20 | public class KillNodeDef extends NodeDef { 21 | 22 | KillNodeDef() { 23 | } 24 | 25 | @SuppressWarnings("unchecked") 26 | public KillNodeDef(String name, String message) { 27 | super(name, message, KillNodeHandler.class, Collections.EMPTY_LIST); 28 | } 29 | 30 | public static class KillNodeHandler extends NodeHandler { 31 | 32 | public boolean enter(Context context) { 33 | return true; 34 | } 35 | 36 | public String exit(Context context) { 37 | context.killJob(); 38 | return null; 39 | } 40 | 41 | public void kill(Context context) { 42 | } 43 | 44 | public void fail(Context context) { 45 | } 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/command/bundle/BundleJobException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.command.bundle; 16 | 17 | import org.apache.oozie.ErrorCode; 18 | import org.apache.oozie.XException; 19 | 20 | /** 21 | * Exception thrown by {@link org.apache.oozie.client.BundleJob} . 22 | */ 23 | public class BundleJobException extends XException { 24 | 25 | /** 26 | * Create an Bundle Job exception from a XException. 27 | * 28 | * @param cause the XException cause. 29 | */ 30 | public BundleJobException(XException cause) { 31 | super(cause); 32 | } 33 | 34 | /** 35 | * Create a Bundle Job exception. 36 | * 37 | * @param errorCode error code. 38 | * @param params parameters for the error code message template. 39 | */ 40 | public BundleJobException(ErrorCode errorCode, Object... params) { 41 | super(errorCode, params); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/executor/jpa/CoordActionsPendingFalseStatusCountGetJPAExecutor.java: -------------------------------------------------------------------------------- 1 | package org.apache.oozie.executor.jpa; 2 | 3 | import javax.persistence.EntityManager; 4 | import javax.persistence.Query; 5 | 6 | import org.apache.oozie.ErrorCode; 7 | import org.apache.oozie.util.ParamChecker; 8 | 9 | /** 10 | * Load the number of pending actions for a status for a coordinator job. 11 | */ 12 | public class CoordActionsPendingFalseStatusCountGetJPAExecutor implements JPAExecutor { 13 | 14 | private String coordJobId = null; 15 | private String status = null; 16 | 17 | public CoordActionsPendingFalseStatusCountGetJPAExecutor(String coordJobId, String status) { 18 | ParamChecker.notNull(coordJobId, "coordJobId"); 19 | ParamChecker.notNull(status, "status"); 20 | this.coordJobId = coordJobId; 21 | this.status = status; 22 | } 23 | 24 | @Override 25 | public String getName() { 26 | return "CoordActionsPendingFalseStatusCountGetJPAExecutor"; 27 | } 28 | 29 | @Override 30 | public Integer execute(EntityManager em) throws JPAExecutorException { 31 | try { 32 | Query q = em.createNamedQuery("GET_COORD_ACTIONS_PENDING_FALSE_STATUS_COUNT"); 33 | q.setParameter("jobId", coordJobId); 34 | q.setParameter("status", status); 35 | Long count = (Long) q.getSingleResult(); 36 | return Integer.valueOf(count.intValue()); 37 | } 38 | catch (Exception e) { 39 | throw new JPAExecutorException(ErrorCode.E0603, e); 40 | } 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/command/wf/WorkflowActionInfoCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.command.wf; 16 | 17 | import org.apache.oozie.WorkflowActionBean; 18 | import org.apache.oozie.store.StoreException; 19 | import org.apache.oozie.store.WorkflowStore; 20 | import org.apache.oozie.util.ParamChecker; 21 | import org.apache.oozie.util.XLog; 22 | 23 | public class WorkflowActionInfoCommand extends WorkflowCommand { 24 | private String id; 25 | 26 | public WorkflowActionInfoCommand(String id) { 27 | super("action.info", "action.info", 1, XLog.OPS, true); 28 | this.id = ParamChecker.notEmpty(id, "id"); 29 | } 30 | 31 | @Override 32 | @SuppressWarnings("unchecked") 33 | protected WorkflowActionBean call(WorkflowStore store) throws StoreException { 34 | WorkflowActionBean action = store.getAction(id, false); 35 | return action; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/workflow/WorkflowException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.workflow; 16 | 17 | import org.apache.oozie.XException; 18 | import org.apache.oozie.ErrorCode; 19 | 20 | /** 21 | * Exception thrown by {@link org.apache.oozie.client.WorkflowJob} and {@link WorkflowLib}. 22 | */ 23 | public class WorkflowException extends XException { 24 | 25 | /** 26 | * Create an workflow exception from a XException. 27 | * 28 | * @param cause the XException cause. 29 | */ 30 | public WorkflowException(XException cause) { 31 | super(cause); 32 | } 33 | 34 | /** 35 | * Create a workflow exception. 36 | * 37 | * @param errorCode error code. 38 | * @param params parameters for the error code message template. 39 | */ 40 | public WorkflowException(ErrorCode errorCode, Object... params) { 41 | super(errorCode, params); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/service/TestDagXLogInfoService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.service; 16 | 17 | import org.apache.oozie.test.XTestCase; 18 | import org.apache.oozie.service.Services; 19 | import org.apache.oozie.service.DagXLogInfoService; 20 | import org.apache.oozie.util.XLog; 21 | 22 | public class TestDagXLogInfoService extends XTestCase { 23 | 24 | public void testLogInfo() throws Exception { 25 | Services services = new Services(); 26 | services.init(); 27 | assertNotNull(services.get(DagXLogInfoService.class)); 28 | String prefix = XLog.Info.get().createPrefix(); 29 | assertTrue(prefix.contains(DagXLogInfoService.TOKEN)); 30 | assertTrue(prefix.contains(DagXLogInfoService.APP)); 31 | assertTrue(prefix.contains(DagXLogInfoService.JOB)); 32 | assertTrue(prefix.contains(DagXLogInfoService.ACTION)); 33 | services.destroy(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /docs/src/site/twiki/DG_UsingHadoopKerberos.twiki: -------------------------------------------------------------------------------- 1 | 2 | 3 | [[index][::Go back to Oozie Documentation Index::]] 4 | 5 | ---+!! Using a Hadoop Cluster with Kerberos Authentication 6 | 7 | When submitting a job or accessing HDFS on a Hadoop cluster running with Kerberos security, the configuration 8 | object used to establish the connection to the cluster (creating a =JobClient= or a =FileSystem= instance) 9 | must include the JobTracker and/or NameNode Kerberos principals. 10 | 11 | If Hadoop uses Kerberos principals of the form =mapred/JOBTRACKER_HOSTNAME@REALM= and 12 | =hdfs/NAMENODE_HOSTNAME@REALM=, Oozie will resolve the principals correctly without any change required when 13 | submitting jobs to Oozie. 14 | 15 | However, if the Kerberos principals don't follow the above rule, the Oozie job configuration properties must 16 | include the following 2 properties set to the right values: 17 | 18 | * =mapreduce.jobtracker.kerberos.principal= : the Kerberos principal name of the Hadoop Jobtracker (i.e. =mapred/bluesky@FOO.BAR= ). 19 | * =dfs.namenode.kerberos.principal= : the Kerberos principal name of the Hadoop Namenode (i.e. =hdfs/bluesky@FOO.BAR= ). 20 | 21 | ---++ Changes in Workflow XML Applications 22 | 23 | There are not required changed in existing workflow applications. 24 | 25 | The 2 configuration properties mentioned above are not allowed in workflow action configuration sections. 26 | 27 | ---++ Limitations 28 | 29 | All actions in a workflow application must interact with the same Hadoop JobTracker and NameNode. 30 | 31 | [[index][::Go back to Oozie Documentation Index::]] 32 | 33 | 34 | -------------------------------------------------------------------------------- /core/src/test/resources/wf-ext-schema-valid-user-retry.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ${wf:conf('signal-value')} 22 | ${wf:conf('external-status')} 23 | ${wf:conf('error')} 24 | ${wf:conf('avoid-set-execution-data')} 25 | ${wf:conf('avoid-set-end-data')} 26 | ${wf:conf('running-mode')} 27 | 28 | 29 | 30 | 31 | 32 | 33 | kill 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /core/src/test/resources/wf-test-kill-node-message.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ${wf:conf('signal-value')} 22 | ${wf:conf('external-status')} 23 | ${wf:conf('error')} 24 | ${wf:conf('avoid-set-execution-data')} 25 | ${wf:conf('avoid-set-end-data')} 26 | ${wf:conf('running-mode')} 27 | 28 | 29 | 30 | 31 | 32 | 33 | [${wf:errorMessage(wf:lastErrorNode())}] 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /examples/src/main/apps/java-main/workflow.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | ${jobTracker} 20 | ${nameNode} 21 | 22 | 23 | mapred.job.queue.name 24 | ${queueName} 25 | 26 | 27 | org.apache.oozie.example.DemoJavaMain 28 | Hello 29 | Oozie! 30 | 31 | 32 | 33 | 34 | 35 | Java failed, error message[${wf:errorMessage(wf:lastErrorNode())}] 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | Oozie, Workflow Engine for Hadoop. 2 | 3 | PLEASE NOTE: 4 | 5 | * Oozie becomes Apache incubator project. Please follow 6 | Oozie at http://incubator.apache.org/oozie/. 7 | 8 | * This distribution includes cryptographic software that 9 | is subject to U.S. export control laws and applicable 10 | export and import laws of other countries. BEFORE using 11 | any software made available from this site, it is your 12 | responsibility to understand and comply with these laws. 13 | This software is being exported in accordance with the 14 | Export Administration Regulations. As of June 2009, you 15 | are prohibited from exporting and re-exporting this 16 | software to Cuba, Iran, North Korea, Sudan, Syria and 17 | any other countries specified by regulatory update to 18 | the U.S. export control laws and regulations. Diversion 19 | contrary to U.S. law is prohibited. 20 | 21 | -------------------------------------- 22 | Oozie Apache Site: 23 | 24 | http://incubator.apache.org/oozie/ 25 | 26 | Oozie Documentation: 27 | 28 | http://yahoo.github.com/oozie/releases/3.0.0 29 | 30 | Oozie Quick Start: 31 | 32 | http://yahoo.github.com/oozie/releases/3.0.0/DG_QuickStart.html 33 | 34 | Oozie Detailed Installation and Configuration: 35 | 36 | http://yahoo.github.com/oozie/releases/3.0.0/AG_Install.html 37 | 38 | Building Oozie: 39 | 40 | http://yahoo.github.com/oozie/releases/3.0.0/ENG_Building.html 41 | 42 | -------------------------------------- 43 | 44 | Please subsuribe Oozie mailing lists at: 45 | 46 | oozie-dev-subscribe@incubator.apache.org 47 | oozie-commits-subscribe@incubator.apache.org 48 | 49 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/executor/jpa/JPAExecutorException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.executor.jpa; 16 | 17 | import org.apache.oozie.XException; 18 | import org.apache.oozie.ErrorCode; 19 | 20 | /** 21 | * Exception thrown by {@link JPAExecutor}s. 22 | */ 23 | public class JPAExecutorException extends XException { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | /** 28 | * Create an jpa executor exception from a XException. 29 | * 30 | * @param cause the XException cause. 31 | */ 32 | public JPAExecutorException(XException cause) { 33 | super(cause); 34 | } 35 | 36 | /** 37 | * Create an jpa executor exception. 38 | * 39 | * @param errorCode error code. 40 | * @param params parameters for the error code message template. 41 | */ 42 | public JPAExecutorException(ErrorCode errorCode, Object... params) { 43 | super(errorCode, params); 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/coord/CoordinatorJobException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.coord; 16 | 17 | import org.apache.oozie.ErrorCode; 18 | import org.apache.oozie.XException; 19 | import org.apache.oozie.util.XLog; 20 | 21 | /** 22 | * Exception thrown by {@link org.apache.oozie.client.CoordintorJob} . 23 | */ 24 | public class CoordinatorJobException extends XException { 25 | 26 | /** 27 | * Create an Coordinator Job exception from a XException. 28 | * 29 | * @param cause the XException cause. 30 | */ 31 | public CoordinatorJobException(XException cause) { 32 | super(cause); 33 | } 34 | 35 | /** 36 | * Create a Coordinator Job exception. 37 | * 38 | * @param errorCode error code. 39 | * @param params parameters for the error code message template. 40 | */ 41 | public CoordinatorJobException(ErrorCode errorCode, Object... params) { 42 | super(errorCode, params); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /examples/src/main/java/org/apache/oozie/example/SampleReducer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.example; 16 | 17 | import org.apache.hadoop.io.LongWritable; 18 | import org.apache.hadoop.io.Text; 19 | import org.apache.hadoop.mapred.JobConf; 20 | import org.apache.hadoop.mapred.OutputCollector; 21 | import org.apache.hadoop.mapred.Reducer; 22 | import org.apache.hadoop.mapred.Reporter; 23 | 24 | import java.io.IOException; 25 | import java.util.Iterator; 26 | 27 | public class SampleReducer implements Reducer { 28 | 29 | public void configure(JobConf jobConf) { 30 | } 31 | 32 | public void reduce(LongWritable key, Iterator values, OutputCollector collector, Reporter reporter) 33 | throws IOException { 34 | while (values.hasNext()) { 35 | collector.collect(key, values.next()); 36 | } 37 | } 38 | 39 | public void close() throws IOException { 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /client/src/test/java/org/apache/oozie/cli/TestValidation.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.cli; 16 | 17 | import junit.framework.TestCase; 18 | 19 | import java.net.URL; 20 | import java.net.URI; 21 | import java.io.File; 22 | 23 | public class TestValidation extends TestCase { 24 | 25 | private String getPath(String resource) throws Exception { 26 | URL url = Thread.currentThread().getContextClassLoader().getResource(resource); 27 | URI uri = url.toURI(); 28 | File file = new File(uri.getPath()); 29 | return file.getAbsolutePath(); 30 | } 31 | 32 | public void testValid() throws Exception { 33 | String[] args = new String[]{"validate", getPath("valid.xml")}; 34 | assertEquals(0, new OozieCLI().run(args)); 35 | } 36 | 37 | public void testInvalid() throws Exception { 38 | String[] args = new String[]{"validate", getPath("invalid.xml")}; 39 | assertEquals(-1, new OozieCLI().run(args)); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/test/TestXFsTestCase.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.test; 16 | 17 | import org.apache.hadoop.fs.FileSystem; 18 | import org.apache.hadoop.fs.Path; 19 | 20 | 21 | public class TestXFsTestCase extends XFsTestCase { 22 | 23 | public void testFsDir() throws Exception { 24 | assertNotNull(getFsTestCaseDir()); 25 | assertNotNull(getFileSystem()); 26 | 27 | String testDir = getTestCaseDir(); 28 | String nameNode = getNameNodeUri(); 29 | String user = getTestUser(); 30 | Path fsTestDir = getFsTestCaseDir(); 31 | 32 | assertTrue(fsTestDir.toString().startsWith(nameNode)); 33 | assertTrue(fsTestDir.toString().contains(user + testDir)); 34 | 35 | FileSystem fs = getFileSystem(); 36 | assertTrue(fs.getUri().toString().startsWith(getNameNodeUri())); 37 | 38 | assertTrue(fs.exists(fsTestDir)); 39 | assertTrue(fs.listStatus(fsTestDir).length == 0); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/service/TestLiteWorkflowStoreService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.service; 16 | 17 | import org.apache.oozie.service.Services; 18 | import org.apache.oozie.service.WorkflowStoreService; 19 | import org.apache.oozie.test.XTestCase; 20 | 21 | public class TestLiteWorkflowStoreService extends XTestCase { 22 | 23 | protected void setUp() throws Exception { 24 | super.setUp(); 25 | new Services().init(); 26 | } 27 | 28 | protected void tearDown() throws Exception { 29 | Services.get().destroy(); 30 | super.tearDown(); 31 | } 32 | 33 | public void testService() throws Exception { 34 | assertNotNull(Services.get().get(WorkflowStoreService.class)); 35 | } 36 | 37 | public void testCreateStore() throws Exception { 38 | WorkflowStoreService wls = Services.get().get(WorkflowStoreService.class); 39 | assertNotNull(wls); 40 | assertNotNull(wls.create()); 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/util/TestXmlUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.util; 16 | 17 | import org.apache.oozie.test.XTestCase; 18 | import org.jdom.Element; 19 | 20 | public class TestXmlUtils extends XTestCase { 21 | 22 | private static String EXTERNAL_ENTITY_XML = "]>\n" 23 | + "&xxe;"; 24 | 25 | public void testExternalEntity() throws Exception { 26 | Element e = XmlUtils.parseXml(EXTERNAL_ENTITY_XML); 27 | assertEquals(0, e.getText().length()); 28 | } 29 | 30 | public void testRemoveComments() throws Exception { 31 | String xmlStr = " 1234 ABCD " 32 | + " EFGH "; 33 | String result = XmlUtils.removeComments(xmlStr); 34 | System.out.println("Result After Comments removal :\n" + result); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/action/hadoop/KerberosDoAs.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.action.hadoop; 16 | 17 | import org.apache.hadoop.security.UserGroupInformation; 18 | import org.apache.oozie.action.hadoop.DoAs; 19 | 20 | import java.security.PrivilegedExceptionAction; 21 | import java.util.concurrent.Callable; 22 | 23 | //TODO this class goes away when doing 20.100+ only 24 | 25 | //TODO this class is for testing, but is here to allow selective compilation 26 | public class KerberosDoAs extends DoAs { 27 | 28 | public Void call() throws Exception { 29 | final Callable callable = getCallable(); 30 | UserGroupInformation ugi = UserGroupInformation.createProxyUser(getUser(), UserGroupInformation.getLoginUser()); 31 | ugi.doAs(new PrivilegedExceptionAction() { 32 | public Void run() throws Exception { 33 | callable.call(); 34 | return null; 35 | } 36 | }); 37 | return null; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/executor/jpa/CoordActionUpdateJPAExecutor.java: -------------------------------------------------------------------------------- 1 | package org.apache.oozie.executor.jpa; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.EntityManager; 6 | 7 | import org.apache.oozie.CoordinatorActionBean; 8 | import org.apache.oozie.ErrorCode; 9 | import org.apache.oozie.util.ParamChecker; 10 | 11 | /** 12 | * Update the CoordinatorAction into a Bean and persist it 13 | */ 14 | public class CoordActionUpdateJPAExecutor implements JPAExecutor { 15 | 16 | private CoordinatorActionBean coordAction = null; 17 | 18 | /** 19 | * Create the object for CoordActionUpdateJPAExecutor to update the CoordinatorAction into a Bean and persist it 20 | * 21 | * @param coordAction 22 | */ 23 | public CoordActionUpdateJPAExecutor(CoordinatorActionBean coordAction) { 24 | ParamChecker.notNull(coordAction, "coordAction"); 25 | this.coordAction = coordAction; 26 | } 27 | 28 | /* (non-Javadoc) 29 | * @see org.apache.oozie.executor.jpa.JPAExecutor#execute(javax.persistence.EntityManager) 30 | */ 31 | @Override 32 | public Void execute(EntityManager em) throws JPAExecutorException { 33 | try { 34 | coordAction.setLastModifiedTime(new Date()); 35 | em.merge(coordAction); 36 | return null; 37 | } 38 | catch (Exception e) { 39 | throw new JPAExecutorException(ErrorCode.E0603, e); 40 | } 41 | } 42 | 43 | /* (non-Javadoc) 44 | * @see org.apache.oozie.executor.jpa.JPAExecutor#getName() 45 | */ 46 | @Override 47 | public String getName() { 48 | return "CoordActionUpdateJPAExecutor"; 49 | } 50 | } -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/command/wf/DefinitionCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.command.wf; 16 | 17 | import org.apache.oozie.WorkflowJobBean; 18 | import org.apache.oozie.command.Command; 19 | import org.apache.oozie.store.StoreException; 20 | import org.apache.oozie.store.WorkflowStore; 21 | import org.apache.oozie.store.Store; 22 | import org.apache.oozie.util.ParamChecker; 23 | import org.apache.oozie.util.XLog; 24 | 25 | public class DefinitionCommand extends WorkflowCommand { 26 | private String id; 27 | 28 | public DefinitionCommand(String id) { 29 | super("definition", "definition", 1, XLog.STD); 30 | this.id = ParamChecker.notEmpty(id, "id"); 31 | } 32 | 33 | @Override 34 | @SuppressWarnings("unchecked") 35 | protected String call(WorkflowStore store) throws StoreException { 36 | WorkflowJobBean workflow = store.getWorkflow(id, false); 37 | return workflow.getWorkflowInstance().getApp().getDefinition(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/command/wf/PurgeCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.command.wf; 16 | 17 | import org.apache.oozie.store.StoreException; 18 | import org.apache.oozie.store.WorkflowStore; 19 | import org.apache.oozie.util.XLog; 20 | import org.apache.oozie.command.CommandException; 21 | 22 | public class PurgeCommand extends WorkflowCommand { 23 | private static XLog LOG = XLog.getLog(PurgeCommand.class); 24 | private int olderThan; 25 | private int limit; 26 | 27 | public PurgeCommand(int olderThan, int limit) { 28 | super("purge", "purge", 0, XLog.OPS); 29 | this.olderThan = olderThan; 30 | this.limit = limit; 31 | } 32 | 33 | @Override 34 | protected Void call(WorkflowStore store) throws StoreException, CommandException { 35 | LOG.debug("Attempting to purge Jobs older than [{0}] days.", olderThan); 36 | store.purge(olderThan, limit); 37 | LOG.debug("Purge succeeded "); 38 | return null; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/command/coord/CoordActionInfoCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.command.coord; 16 | 17 | import java.util.List; 18 | 19 | import org.apache.oozie.CoordinatorActionBean; 20 | import org.apache.oozie.command.CommandException; 21 | import org.apache.oozie.store.CoordinatorStore; 22 | import org.apache.oozie.store.StoreException; 23 | import org.apache.oozie.util.ParamChecker; 24 | import org.apache.oozie.util.XLog; 25 | 26 | public class CoordActionInfoCommand extends CoordinatorCommand { 27 | private String id; 28 | 29 | public CoordActionInfoCommand(String id) { 30 | super("action.info", "action.info", 1, XLog.OPS); 31 | this.id = ParamChecker.notEmpty(id, "id"); 32 | } 33 | 34 | @Override 35 | protected CoordinatorActionBean call(CoordinatorStore store) throws StoreException, CommandException { 36 | CoordinatorActionBean action = store.getCoordinatorAction(id, false); 37 | return action; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /core/src/test/resources/rerun-wf.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | ${fs:exists(concat(nnbase, '/p2'))} 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | kill 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /core/src/main/conf/oozie-env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. See accompanying LICENSE file. 15 | # 16 | 17 | # Set Oozie specific environment variables here. 18 | 19 | # Settings for the Embedded Tomcat that runs Oozie 20 | # Java System properties for Oozie should be specified in this variable 21 | # 22 | # export CATALINA_OPTS= 23 | 24 | # Oozie configuration file to load from Oozie configuration directory 25 | # 26 | # export OOZIE_CONFIG_FILE=oozie-site.xml 27 | 28 | # Oozie logs directory 29 | # 30 | # export OOZIE_LOG=${OOZIE_HOME}/logs 31 | 32 | # Oozie Log4J configuration file to load from Oozie configuration directory 33 | # 34 | # export OOZIE_LOG4J_FILE=oozie-log4j.properties 35 | 36 | # Reload interval of the Log4J configuration file, in seconds 37 | # 38 | # export OOZIE_LOG4J_RELOAD=10 39 | 40 | # The port Oozie server runs 41 | # 42 | # export OOZIE_HTTP_PORT=11000 43 | 44 | # The host name Oozie server runs on 45 | # 46 | # export OOZIE_HTTP_HOSTNAME=`hostname -f` 47 | 48 | # The base URL for callback URLs to Oozie 49 | # 50 | # export OOZIE_BASE_URL="http://${OOZIE_HTTP_HOSTNAME}:${OOZIE_HTTP_PORT}/oozie" 51 | 52 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/command/coord/CoordPurgeCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.command.coord; 16 | 17 | import org.apache.oozie.store.CoordinatorStore; 18 | import org.apache.oozie.store.StoreException; 19 | import org.apache.oozie.util.XLog; 20 | import org.apache.oozie.command.CommandException; 21 | 22 | public class CoordPurgeCommand extends CoordinatorCommand { 23 | private static XLog LOG = XLog.getLog(CoordPurgeCommand.class); 24 | private int olderThan; 25 | private int limit; 26 | 27 | public CoordPurgeCommand(int olderThan, int limit) { 28 | super("coord_purge", "coord_purge", 0, XLog.OPS); 29 | this.olderThan = olderThan; 30 | this.limit = limit; 31 | } 32 | 33 | protected Void call(CoordinatorStore store) throws StoreException, CommandException { 34 | LOG.debug("STARTED Coord Purge to purge Jobs older than [{0}] days.", olderThan); 35 | store.purge(olderThan, limit); 36 | LOG.debug("Coord-Purge succeeded"); 37 | return null; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/command/StatusUpdateXCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.command; 16 | 17 | /** 18 | * Transition command for update status. 19 | */ 20 | public abstract class StatusUpdateXCommand extends XCommand{ 21 | 22 | /** 23 | * The constructor for abstract class {@link StatusUpdateXCommand} 24 | * 25 | * @param name the command name 26 | * @param type the command type 27 | * @param priority the command priority 28 | */ 29 | public StatusUpdateXCommand(String name, String type, int priority) { 30 | super(name, type, priority); 31 | } 32 | 33 | /** 34 | * The constructor for abstract class {@link StatusUpdateXCommand} 35 | * 36 | * @param name the command name 37 | * @param type the command type 38 | * @param priority the command priority 39 | * @param dryrun true if dryrun is enable 40 | */ 41 | public StatusUpdateXCommand(String name, String type, int priority, boolean dryrun) { 42 | super(name, type, priority, dryrun); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /examples/src/main/java/org/apache/oozie/example/DemoReducer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.example; 16 | 17 | import java.io.IOException; 18 | import java.util.Iterator; 19 | 20 | import org.apache.hadoop.io.IntWritable; 21 | import org.apache.hadoop.io.Text; 22 | import org.apache.hadoop.mapred.MapReduceBase; 23 | import org.apache.hadoop.mapred.OutputCollector; 24 | import org.apache.hadoop.mapred.Reducer; 25 | import org.apache.hadoop.mapred.Reporter; 26 | 27 | public class DemoReducer extends MapReduceBase implements Reducer { 28 | 29 | // reduce(WritableComparable, Iterator, OutputCollector, Reporter)- 30 | // Reducer has 3 primary phases: shuffle, sort and reduce.- 31 | public void reduce(Text key, Iterator values, OutputCollector output, 32 | Reporter reporter) throws IOException { 33 | int sum = 0; 34 | while (values.hasNext()) { 35 | sum += values.next().get(); 36 | } 37 | output.collect(key, new IntWritable(sum)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/action/hadoop/Credentials.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.action.hadoop; 16 | 17 | import org.apache.hadoop.mapred.JobConf; 18 | import org.apache.oozie.action.ActionExecutor.Context; 19 | 20 | @SuppressWarnings("deprecation") 21 | public abstract class Credentials { 22 | 23 | /** 24 | * This is the interface for all the Credentials implementation. Any new credential implementaion must implement 25 | * this function. This function should modify the jobconf which will be used further to pass the credentials to the 26 | * tasks while running it. Credentials properties and context is also provided by that user can get all the 27 | * necessary configuration. 28 | * 29 | * @param jobconf job conf where the token will insert into 30 | * @param props properties for getting credential token or certificate 31 | * @param context workflow context 32 | * @throws Exception thrown if failed 33 | */ 34 | public abstract void addtoJobConf(JobConf jobconf, CredentialsProperties props, Context context) throws Exception; 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/command/wf/WorkflowXCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.command.wf; 16 | 17 | import org.apache.oozie.command.XCommand; 18 | 19 | /** 20 | * Abstract coordinator command class derived from XCommand 21 | * 22 | * @param 23 | */ 24 | public abstract class WorkflowXCommand extends XCommand { 25 | /** 26 | * Base class constructor for workflow commands. 27 | * 28 | * @param name command name 29 | * @param type command type 30 | * @param priority command priority 31 | */ 32 | public WorkflowXCommand(String name, String type, int priority) { 33 | super(name, type, priority); 34 | } 35 | 36 | /** 37 | * Base class constructor for workflow commands. 38 | * 39 | * @param name command name 40 | * @param type command type 41 | * @param priority command priority 42 | * @param dryrun true if rerun is enabled for command 43 | */ 44 | public WorkflowXCommand(String name, String type, int priority, boolean dryrun) { 45 | super(name, type, priority, dryrun); 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobDeleteJPAExecutor.java: -------------------------------------------------------------------------------- 1 | package org.apache.oozie.executor.jpa; 2 | 3 | import org.apache.oozie.CoordinatorJobBean; 4 | import org.apache.oozie.client.CoordinatorJob; 5 | import org.apache.oozie.local.LocalOozie; 6 | import org.apache.oozie.service.JPAService; 7 | import org.apache.oozie.service.Services; 8 | import org.apache.oozie.test.XDataTestCase; 9 | 10 | public class TestCoordJobDeleteJPAExecutor extends XDataTestCase { 11 | Services services; 12 | 13 | @Override 14 | protected void setUp() throws Exception { 15 | super.setUp(); 16 | services = new Services(); 17 | services.init(); 18 | cleanUpDBTables(); 19 | LocalOozie.start(); 20 | } 21 | 22 | @Override 23 | protected void tearDown() throws Exception { 24 | LocalOozie.stop(); 25 | services.destroy(); 26 | super.tearDown(); 27 | } 28 | 29 | public void testCoordJobDelete() throws Exception { 30 | CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, false, false); 31 | _testCoordJobDelete(job.getId()); 32 | } 33 | 34 | private void _testCoordJobDelete(String jobId) throws Exception { 35 | JPAService jpaService = Services.get().get(JPAService.class); 36 | assertNotNull(jpaService); 37 | CoordJobDeleteJPAExecutor coordDelCmd = new CoordJobDeleteJPAExecutor(jobId); 38 | jpaService.execute(coordDelCmd); 39 | try { 40 | CoordJobGetJPAExecutor coordGetCmd = new CoordJobGetJPAExecutor(jobId); 41 | CoordinatorJobBean ret = jpaService.execute(coordGetCmd); 42 | fail("Job should not be there"); 43 | } 44 | catch (Exception ex) { 45 | } 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /client/src/test/java/org/apache/oozie/client/rest/TestJsonUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.client.rest; 16 | 17 | import junit.framework.TestCase; 18 | import org.json.simple.JSONObject; 19 | import org.json.simple.JSONArray; 20 | import org.apache.oozie.client.rest.JsonUtils; 21 | 22 | import java.util.Arrays; 23 | import java.util.List; 24 | import java.util.Date; 25 | 26 | public class TestJsonUtils extends TestCase { 27 | 28 | public void testValidDate() { 29 | String str = "Thu, 01 Jan 2009 00:00:00 GMT"; 30 | Date date = JsonUtils.parseDateRfc822(str); 31 | String str1 = JsonUtils.formatDateRfc822(date); 32 | assertEquals(str, str1); 33 | } 34 | 35 | public void testInvalidDateStr() { 36 | Date date = JsonUtils.parseDateRfc822("Xhu, 01 Jan 2009 00:00:00 GMT"); 37 | assertEquals(null, date); 38 | } 39 | 40 | public void testNullDateStr() { 41 | assertEquals(null, JsonUtils.parseDateRfc822(null)); 42 | } 43 | 44 | public void testNullDate() { 45 | assertEquals(null, JsonUtils.formatDateRfc822(null)); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/executor/jpa/BundleActionsGetWaitingOlderJPAExecutor.java: -------------------------------------------------------------------------------- 1 | package org.apache.oozie.executor.jpa; 2 | 3 | import java.sql.Timestamp; 4 | import java.util.List; 5 | 6 | import javax.persistence.EntityManager; 7 | import javax.persistence.Query; 8 | 9 | import org.apache.oozie.BundleActionBean; 10 | import org.apache.oozie.ErrorCode; 11 | import org.apache.oozie.util.ParamChecker; 12 | 13 | public class BundleActionsGetWaitingOlderJPAExecutor implements JPAExecutor>{ 14 | private long checkAgeSecs = 0; 15 | 16 | public BundleActionsGetWaitingOlderJPAExecutor(final long checkAgeSecs) { 17 | ParamChecker.notNull(checkAgeSecs, "checkAgeSecs"); 18 | this.checkAgeSecs = checkAgeSecs; 19 | } 20 | 21 | /* (non-Javadoc) 22 | * @see org.apache.oozie.executor.jpa.JPAExecutor#getName() 23 | */ 24 | @Override 25 | public String getName() { 26 | return "BundleActionsGetWaitingOlderJPAExecutor"; 27 | } 28 | 29 | /* (non-Javadoc) 30 | * @see org.apache.oozie.executor.jpa.JPAExecutor#execute(javax.persistence.EntityManager) 31 | */ 32 | @Override 33 | public List execute(EntityManager em) throws JPAExecutorException { 34 | List actions; 35 | try { 36 | Query q = em.createNamedQuery("GET_BUNDLE_WAITING_ACTIONS_OLDER_THAN"); 37 | Timestamp ts = new Timestamp(System.currentTimeMillis() - this.checkAgeSecs * 1000); 38 | q.setParameter("lastModifiedTime", ts); 39 | actions = q.getResultList(); 40 | return actions; 41 | } 42 | catch (IllegalStateException e) { 43 | throw new JPAExecutorException(ErrorCode.E0601, e.getMessage(), e); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/workflow/lite/DecisionNodeHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.workflow.lite; 16 | 17 | import org.apache.oozie.workflow.WorkflowException; 18 | import org.apache.oozie.ErrorCode; 19 | 20 | 21 | //TODO javadoc 22 | public abstract class DecisionNodeHandler extends NodeHandler { 23 | 24 | @Override 25 | public final boolean enter(Context context) throws WorkflowException { 26 | start(context); 27 | return false; 28 | } 29 | 30 | @Override 31 | public final String exit(Context context) throws WorkflowException { 32 | end(context); 33 | String signalValue = context.getSignalValue(); 34 | if (context.getNodeDef().getTransitions().contains(signalValue)) { 35 | return signalValue; 36 | } 37 | else { 38 | throw new WorkflowException(ErrorCode.E0721, context.getNodeDef().getName(), signalValue); 39 | } 40 | } 41 | 42 | public abstract void start(Context context) throws WorkflowException; 43 | 44 | public abstract void end(Context context) throws WorkflowException; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /core/src/test/resources/coord-matd-job.xml: -------------------------------------------------------------------------------- 1 | 15 | 19 | 20 | 10 21 | 2 22 | LIFO 23 | 24 | 25 | 26 | hdfs:///tmp/workflows/ 27 | 28 | 29 | 30 | test-app 31 | ${coord:nominalTime()} 32 | 5 33 | 120 34 | Notifying User for ${coord:nominalTime()} 35 | nominal time 36 | abc@yahoo.com 37 | abc@yahoo.com 38 | abc@yahoo.com 39 | abc@yahoo.com 40 | 41 | 42 | -------------------------------------------------------------------------------- /core/src/test/resources/wf-ext-schema.xsd: -------------------------------------------------------------------------------- 1 | 2 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /core/src/test/resources/postgresql-oozie-site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 19 | oozie.service.JPAService.jdbc.driver 20 | org.postgresql.Driver 21 | JDBC driver class. 22 | 23 | 24 | oozie.service.JPAService.jdbc.url 25 | jdbc:postgresql://localhost:5432/OOZIEDB 26 | JDBC URL. 27 | 28 | 29 | oozie.service.JPAService.jdbc.username 30 | OOZIE 31 | DB user name. 32 | 33 | 34 | oozie.service.JPAService.jdbc.password 35 | oozie 36 | 37 | DB user password. IMPORTANT: if password is emtpy leave a 1 space string, the service trims the 38 | value, if empty Configuration assumes it is NULL. 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /bin/mkdistro.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2010 Yahoo! Inc. All rights reserved. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. See accompanying LICENSE file. 15 | # 16 | 17 | # resolve links - $0 may be a softlink 18 | PRG="${0}" 19 | 20 | while [ -h "${PRG}" ]; do 21 | ls=`ls -ld "${PRG}"` 22 | link=`expr "$ls" : '.*-> \(.*\)$'` 23 | if expr "$link" : '/.*' > /dev/null; then 24 | PRG="$link" 25 | else 26 | PRG=`dirname "${PRG}"`/"$link" 27 | fi 28 | done 29 | 30 | BASEDIR=`dirname ${PRG}` 31 | BASEDIR=`cd ${BASEDIR}/..;pwd` 32 | 33 | cd ${BASEDIR} 34 | 35 | export DATETIME=`date -u "+%Y.%m.%d-%H:%M:%SGMT"` 36 | export VC_REV=`git branch -v | awk '/^\*/ {printf("%s@%s\n", $2, $3); }'` 37 | # Out canonical repo is @GitHub -- hence hardcoding 38 | export VC_URL="git://github.com/yahoo/oozie.git" 39 | 40 | MVN_OPTS="-Dbuild.time=${DATETIME} -Dvc.revision=${VC_REV} -Dvc.url=${VC_URL} -DgenerateDocs" 41 | 42 | export DATETIME2=`date -u "+%Y%m%d-%H%M%SGMT"` 43 | mvn clean package assembly:single ${MVN_OPTS} "$@" 44 | 45 | if [ "$?" != "0" ]; then 46 | echo 47 | echo "ERROR, Oozie distro creation failed" 48 | echo 49 | exit -1 50 | else 51 | echo 52 | echo "Oozie distro created, DATE[${DATETIME}] VC-REV[${VC_REV}], available at [${BASEDIR}/distro/target]" 53 | echo 54 | fi 55 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/executor/jpa/WorkflowActionUpdateJPAExecutor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.executor.jpa; 16 | 17 | import javax.persistence.EntityManager; 18 | 19 | import org.apache.oozie.WorkflowActionBean; 20 | import org.apache.oozie.util.ParamChecker; 21 | import org.apache.oozie.ErrorCode; 22 | 23 | /** 24 | * Persist the WorkflowAction bean. 25 | */ 26 | public class WorkflowActionUpdateJPAExecutor implements JPAExecutor { 27 | 28 | private WorkflowActionBean wfAction = null; 29 | 30 | public WorkflowActionUpdateJPAExecutor(WorkflowActionBean wfAction) { 31 | ParamChecker.notNull(wfAction, "wfAction"); 32 | this.wfAction = wfAction; 33 | } 34 | 35 | @Override 36 | public String getName() { 37 | return "WorkflowActionUpdateJPAExecutor"; 38 | } 39 | 40 | @Override 41 | public String execute(EntityManager em) throws JPAExecutorException { 42 | 43 | try { 44 | em.merge(wfAction); 45 | return null; 46 | } 47 | catch (Exception e) { 48 | throw new JPAExecutorException(ErrorCode.E0603, e); 49 | } 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /core/src/test/resources/mysql-oozie-site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 19 | oozie.service.DataSourceService.jdbc.driver 20 | com.mysql.jdbc.Driver 21 | JDBC driver class. 22 | 23 | 24 | oozie.service.DataSourceService.jdbc.url 25 | jdbc:mysql://localhost:3306 26 | JDBC URL. 27 | 28 | 29 | oozie.service.DataSourceService.jdbc.username 30 | oozie 31 | DB user name. 32 | 33 | 34 | oozie.service.DataSourceService.jdbc.password 35 | oozie 36 | 37 | DB user password. IMPORTANT: if password is emtpy leave a 1 space string, the service trims the 38 | value, if empty Configuration assumes it is NULL. 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/executor/jpa/SLAEventInsertJPAExecutor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.executor.jpa; 16 | 17 | import javax.persistence.EntityManager; 18 | 19 | import org.apache.oozie.SLAEventBean; 20 | import org.apache.oozie.util.ParamChecker; 21 | 22 | /** 23 | * Persist the SLAEventBean bean. 24 | */ 25 | public class SLAEventInsertJPAExecutor implements JPAExecutor { 26 | 27 | private SLAEventBean slaEvent = null; 28 | 29 | public SLAEventInsertJPAExecutor(SLAEventBean slaEvent) { 30 | ParamChecker.notNull(slaEvent, "slaEvent"); 31 | this.slaEvent = slaEvent; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see org.apache.oozie.executor.jpa.JPAExecutor#getName() 36 | */ 37 | @Override 38 | public String getName() { 39 | return "SLAEventInsertJPAExecutor"; 40 | } 41 | 42 | /* (non-Javadoc) 43 | * @see org.apache.oozie.executor.jpa.JPAExecutor#execute(javax.persistence.EntityManager) 44 | */ 45 | @Override 46 | public String execute(EntityManager em) throws JPAExecutorException { 47 | em.persist(slaEvent); 48 | return null; 49 | } 50 | } -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/executor/jpa/WorkflowJobInsertJPAExecutor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.executor.jpa; 16 | 17 | import javax.persistence.EntityManager; 18 | 19 | import org.apache.oozie.WorkflowJobBean; 20 | import org.apache.oozie.util.ParamChecker; 21 | 22 | /** 23 | * Persist the WorkflowJob bean. 24 | */ 25 | public class WorkflowJobInsertJPAExecutor implements JPAExecutor { 26 | 27 | private WorkflowJobBean wfJob = null; 28 | 29 | public WorkflowJobInsertJPAExecutor(WorkflowJobBean wfJob) { 30 | ParamChecker.notNull(wfJob, "wfJob"); 31 | this.wfJob = wfJob; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see org.apache.oozie.executor.jpa.JPAExecutor#getName() 36 | */ 37 | @Override 38 | public String getName() { 39 | return "WorkflowJobInsertJPAExecutor"; 40 | } 41 | 42 | /* (non-Javadoc) 43 | * @see org.apache.oozie.executor.jpa.JPAExecutor#execute(javax.persistence.EntityManager) 44 | */ 45 | @Override 46 | public String execute(EntityManager em) throws JPAExecutorException { 47 | em.persist(wfJob); 48 | return null; 49 | } 50 | } -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/servlet/ServicesLoader.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.servlet; 16 | 17 | import org.apache.oozie.service.ServiceException; 18 | import org.apache.oozie.service.Services; 19 | 20 | import javax.servlet.ServletContextListener; 21 | import javax.servlet.ServletContextEvent; 22 | 23 | /** 24 | * Webapp context listener that initializes Oozie {@link Services}. 25 | */ 26 | public class ServicesLoader implements ServletContextListener { 27 | private static Services services; 28 | 29 | /** 30 | * Initialize Oozie services. 31 | * 32 | * @param event context event. 33 | */ 34 | public void contextInitialized(ServletContextEvent event) { 35 | try { 36 | services = new Services(); 37 | services.init(); 38 | } 39 | catch (ServiceException ex) { 40 | throw new RuntimeException(ex); 41 | } 42 | } 43 | 44 | /** 45 | * Destroy Oozie services. 46 | * 47 | * @param event context event. 48 | */ 49 | public void contextDestroyed(ServletContextEvent event) { 50 | services.destroy(); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /core/src/main/java/org/apache/oozie/executor/jpa/CoordJobInsertJPAExecutor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. See accompanying LICENSE file. 14 | */ 15 | package org.apache.oozie.executor.jpa; 16 | 17 | import javax.persistence.EntityManager; 18 | 19 | import org.apache.oozie.CoordinatorJobBean; 20 | import org.apache.oozie.util.ParamChecker; 21 | 22 | /** 23 | * Persist the CoordinatorJob bean. 24 | */ 25 | public class CoordJobInsertJPAExecutor implements JPAExecutor { 26 | 27 | private CoordinatorJobBean coordJob = null; 28 | 29 | public CoordJobInsertJPAExecutor(CoordinatorJobBean coordJob) { 30 | ParamChecker.notNull(coordJob, "coordJob"); 31 | this.coordJob = coordJob; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see org.apache.oozie.executor.jpa.JPAExecutor#getName() 36 | */ 37 | @Override 38 | public String getName() { 39 | return "CoordJobInsertJPAExecutor"; 40 | } 41 | 42 | /* (non-Javadoc) 43 | * @see org.apache.oozie.executor.jpa.JPAExecutor#execute(javax.persistence.EntityManager) 44 | */ 45 | @Override 46 | public String execute(EntityManager em) throws JPAExecutorException { 47 | em.persist(coordJob); 48 | return null; 49 | } 50 | } --------------------------------------------------------------------------------