Skip to content
This repository has been archived by the owner on Jan 6, 2018. It is now read-only.

Commit

Permalink
import of oozie-2
Browse files Browse the repository at this point in the history
  • Loading branch information
tucu00 committed Jun 28, 2010
1 parent 4019541 commit 6e57655
Show file tree
Hide file tree
Showing 413 changed files with 35,421 additions and 7,374 deletions.
1 change: 0 additions & 1 deletion MERGE-INFO.txt

This file was deleted.

6 changes: 3 additions & 3 deletions NOTICE.txt
Expand Up @@ -10,11 +10,11 @@ Components licenses:
HSQL License : HSQLDB
JDOM License : JDOM
BSD License : xmlenc Library
Apache 2.0 License: Apache Log4j, Codec, Commons CLI, Commons DBCP,
Commons Pool, EL, Hadoop, JSON.simple,
Apache 2.0 License: Apache Log4j, Codec, Commons CLI, Commons DBCP,
Commons Pool, EL, Hadoop, JSON.simple,
Jakarta Commons Net, Logging
GNU GPL v3.0 : Ext JS 2.2 (with Open Source License Exception)

Detailed License information can be found in the documentation
Detailed License information can be found in the documentation
in the ooziedocs.war at index.html##LicenseInfo

192 changes: 192 additions & 0 deletions bin/createjpaconf.sh
@@ -0,0 +1,192 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

SCRIPT_DIR=$(dirname $0)
CURRENT_DIR=$(pwd)
DBTYPE=
USERNAME=
PASSWORD=
DBURL=

function usage()
{
echo >&2 \
"usage: $0 [-ddbtype] [-uusername] [-ppassword] [-lurl]"
exit 1
}

while getopts :d:u:p:l: opt
do
case "$opt" in
d) DBTYPE="$OPTARG";;
u) USERNAME="$OPTARG";;
p) PASSWORD="$OPTARG";;
l) DBURL="$OPTARG";;
\?) #unknown flag
usage;;
esac
done

# check all arguments are given:
[ -z "$DBTYPE" ] && usage
[ -z "$USERNAME" ] && usage
[ -z "$DBURL" ] && usage

DriverClassName=
Url=

if [ "$DBTYPE" == "oracle" ]; then
DriverClassName=oracle.jdbc.driver.OracleDriver
Url=jdbc:oracle:thin:@${DBURL}
DB_ISOLATION="read-committed"
elif [ "$DBTYPE" == "mysql" ]; then
DriverClassName=com.mysql.jdbc.Driver
Url=jdbc:mysql://${DBURL}
DB_ISOLATION="repeatable-read"
else
DriverClassName=org.hsqldb.jdbcDriver
Url="jdbc:hsqldb:${DBURL};create=true"
DB_ISOLATION="read-committed"
fi

CONNECTSTRING="DriverClassName=${DriverClassName},Url=${Url},Username=${USERNAME},Password=${PASSWORD},MaxActive=100"

#create persistence.xml
mkdir ${SCRIPT_DIR}/tmp
cat << EOF-persistence.xml > ${SCRIPT_DIR}/tmp/persistence.xml
exit
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0">
<!--
We need to enumerate each persistent class first in the persistence.xml
See: http://issues.apache.org/jira/browse/OPENJPA-78
-->
<persistence-unit name="none" transaction-type="RESOURCE_LOCAL">
<!--
<mapping-file>oozie/schema.xml</mapping-file>
-->
</persistence-unit>
<!--
A persistence unit is a set of listed persistent entities as well
the configuration of an EntityManagerFactory. We configure each
example in a separate persistence-unit.
-->
<persistence-unit name="oozie" transaction-type="RESOURCE_LOCAL">
<!--
The default provider can be OpenJPA, or some other product.
This element is optional if OpenJPA is the only JPA provider
in the current classloading environment, but can be specified
in cases where there are multiple JPA implementations available.
-->
<!--
<provider>
org.apache.openjpa.persistence.PersistenceProviderImpl
</provider>
-->
<!-- We must enumerate each entity in the persistence unit -->
<class>org.apache.oozie.WorkflowActionBean</class>
<class>org.apache.oozie.WorkflowJobBean</class>
<class>org.apache.oozie.CoordinatorJobBean</class>
<class>org.apache.oozie.CoordinatorActionBean</class>
<class>org.apache.oozie.SLAEventBean</class>
<class>org.apache.oozie.client.rest.JsonWorkflowJob</class>
<class>org.apache.oozie.client.rest.JsonWorkflowAction</class>
<class>org.apache.oozie.client.rest.JsonCoordinatorJob</class>
<class>org.apache.oozie.client.rest.JsonCoordinatorAction</class>
<class>org.apache.oozie.client.rest.JsonSLAEvent</class>
<properties>
<!--
We can configure the default OpenJPA properties here. They
happen to be commented out here since the provided examples
all specify the values via System properties.
-->
<property name="openjpa.ConnectionDriverName" value="org.apache.oozie.util.db.InstrumentedBasicDataSource"/>
<property name="openjpa.ConnectionProperties" value="$CONNECTSTRING"/>
<property name="openjpa.MetaDataFactory" value="jpa(Types=org.apache.oozie.WorkflowActionBean;
org.apache.oozie.WorkflowJobBean;
org.apache.oozie.CoordinatorJobBean;
org.apache.oozie.CoordinatorActionBean;
org.apache.oozie.SLAEventBean;
org.apache.oozie.client.rest.JsonSLAEvent;
org.apache.oozie.client.rest.JsonWorkflowJob;
org.apache.oozie.client.rest.JsonWorkflowAction;
org.apache.oozie.client.rest.JsonCoordinatorJob;
org.apache.oozie.client.rest.JsonCoordinatorAction)"></property>
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
<property name="openjpa.DetachState" value="fetch-groups(DetachedStateField=true)"/>
<!--property name="openjpa.FlushBeforeQueries" value="false" /-->
<property name="openjpa.LockManager" value="pessimistic"/>
<property name="openjpa.ReadLockLevel" value="read"/>
<property name="openjpa.WriteLockLevel" value="write"/>
<property name="openjpa.jdbc.TransactionIsolation" value="$DB_ISOLATION"/>
<property name="openjpa.jdbc.DBDictionary" value="UseGetBytesForBlobs=true"/>
<property name="openjpa.jdbc.DBDictionary" value="UseSetBytesForBlobs=true"/>
<property name="openjpa.jdbc.DBDictionary" value="BlobBufferSize=500000"/>
<property name="openjpa.jdbc.DBDictionary" value="batchLimit=50"/>
<!-- property name="openjpa.Log" value="File=/tmp/sql.log, DefaultLevel=TRACE, SQL=TRACE"/-->
<!-- property name="openjpa.DynamicEnhancementAgent" value="false"/-->
<property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>
</properties>
</persistence-unit>
</persistence>
EOF-persistence.xml

cd ${SCRIPT_DIR}
cp tmp/persistence.xml ../webapp/src/main/resources/META-INF/

#oracle
if [ "$DBTYPE" == "oracle" ]; then
cp ../webapp/src/main/resources/META-INF/orm.xml.oracle ../webapp/src/main/resources/META-INF/orm.xml
#mysql
elif [ "$DBTYPE" == "mysql" ]; then
cp ../webapp/src/main/resources/META-INF/orm.xml.mysql ../webapp/src/main/resources/META-INF/orm.xml
#hsql
else
cp ../webapp/src/main/resources/META-INF/orm.xml.hsql ../webapp/src/main/resources/META-INF/orm.xml
fi


rm -fr tmp
111 changes: 88 additions & 23 deletions bin/mkdistro.sh
@@ -1,20 +1,20 @@
#!/bin/sh
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# resolve links - $0 may be a softlink
Expand All @@ -39,6 +39,17 @@ if [ "$1" == "-full" ]; then
shift
fi

if [ "$1" == "-h" ]; then
echo
echo "**persistence.xml replacement**"
echo
echo "usage: $0 [-ddbtype] [-uusername] [-ppassword] [-lurl]"
echo
echo "**mvn help**"
mvn -h
exit 0
fi

function checkExitStatus {
if [ "$?" != "0" ]; then
echo
Expand All @@ -51,33 +62,84 @@ function checkExitStatus {

function cleanUpLocalRepo {
rm -rf ~/.m2/repository/org/apache/oozie/*
rm -rf $PWD/core/mem
}

#process createjpaconf.sh arguments - begin
while getopts :d:u:p:l: opt
do
case "$opt" in
d) DBTYPE="$OPTARG";;
u) USERNAME="$OPTARG";;
p) PASSWORD="$OPTARG";;
l) DBURL="$OPTARG";;
\?) #unknown flag
break;;
esac
done

if [ -z "$DBTYPE" ]; then
echo "[INFO] Use default persistence.xml!!"
else
if [ -z "$USERNAME" ]; then
echo "[ERROR] DB UserName required!!"
exit 1
fi
if [ -z "$DBURL" ]; then
echo "[ERROR] DB URL required!!"
exit 1
fi
[[ "$DBTYPE" = [-]* ]] && { echo "[ERROR] Wrong DBTYPE!!" ; exit 1 ; }
[[ "$USERNAME" = [-]* ]] && { echo "[ERROR] Wrong USERNAME" ; exit 1 ; }
[[ "$PASSWORD" = [-]* ]] && { echo "[ERROR] Wrong PASSWORD" ; exit 1 ; }
[[ "$DBURL" = [-]* ]] && { echo "[ERROR] Wrong DBURL" ; exit 1 ; }
echo "[INFO] Use replaced persistence.xml!!"
shift $(( $OPTIND - 1 ))
SCRIPT_DIR=$(dirname $0)
if [ -z "$PASSWORD" ]; then
${SCRIPT_DIR}/createjpaconf.sh -d${DBTYPE} -u${USERNAME} -l${DBURL}
else
${SCRIPT_DIR}/createjpaconf.sh -d${DBTYPE} -u${USERNAME} -p${PASSWORD} -l${DBURL}
fi
fi
#process createjpaconf.sh arguments - end

export DATETIME=`date -u "+%Y.%m.%d-%H:%M:%SGMT"`
cd ${BASEDIR}
export SVNREV=`svn info | grep "Revision" | awk '{print $2}'`
export SVNURL=`svn info | grep "URL" | awk '{print $2}'`

#clean up local repo
#ln -s $PWD/client/src $PWD/client_enhanced/src
#ln -s $PWD/client_enhanced/pom.xml.enhance $PWD/client_enhanced/pom.xml
cleanUpLocalRepo

MVN_OPTS="-Dbuild.time=${DATETIME} -Dsvn.revision=${SVNREV} -Dsvn.url=${SVNURL}"

cd client
mvn clean package -Doozie.build.jpa.enhanced=false ${MVN_OPTS} $*
mvn assembly:single -Doozie.build.jpa.enhanced=false ${MVN_OPTS} $*
cd ..

#clean, compile, test, package, install
mvn clean install ${MVN_OPTS} $*
checkExitStatus "running: clean compile, test, package, install"

if [ "$FULLDISTRO" == "true" ]; then
#cobertura
mvn cobertura:cobertura ${MVN_OPTS} $*
checkExitStatus "running: cobertura"
#if [ "$FULLDISTRO" == "true" ]; then

#clover
#mvn clover2:instrument clover2:aggregate clover2:clover ${MVN_OPTS} $*
#checkExitStatus "running: clover"

#dependencies report
mvn project-info-reports:dependencies ${MVN_OPTS} $*
checkExitStatus "running: dependencies"
#mvn project-info-reports:dependencies ${MVN_OPTS} $*
#checkExitStatus "running: dependencies"

#TODO findbugs report
fi
#findbugs report
#mvn findbugs:findbugs ${MVN_OPTS} $*
#checkExitStatus "running: findbugs"

#fi

#javadocs
mvn javadoc:javadoc ${MVN_OPTS} $*
Expand All @@ -94,7 +156,10 @@ mvn assembly:single ${MVN_OPTS} $*
checkExitStatus "running: assembly"

cleanUpLocalRepo
#unlink $PWD/client_enhanced/src
#unlink $PWD/client_enhanced/pom.xml

echo
echo "Oozie distro created, DATE[${DATETIME}] SVN-REV[${SVNREV}], available at [${BASEDIR}/distro/target]"
echo
echo

0 comments on commit 6e57655

Please sign in to comment.