Skip to content

Commit

Permalink
Fixed ant issues and updated README.
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaas Bosteels authored and Klaas Bosteels committed Nov 4, 2008
1 parent 8640a3d commit cc695f8
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 32 deletions.
10 changes: 7 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ DESCRIPTION
Originally, Dumbo was just a simple Python module that made writing
and running Streaming programs very easy, but now it also consists
of some helper code in Java (although it can still be used without
the Java code).
the Java code). More generally, Dumbo can be considered to be a
convenient Python API for writing MapReduce programs.


INSTALLATION
Expand All @@ -14,9 +15,12 @@ The Java code gets build together with the rest of Hadoop when the
"dumbo/" directory is put in Hadoop's "src/contrib/", and the Python
module can be installed by running

sudo ant install_pymod
sudo ant -f build-pymod.xml install_pymod

in the "src/contrib/dumbo" directory. If the dir "dumbo/" is a subdir
of Hadoop's "src/contrib/", then the -f option can be omitted:

in the "src/contrib/dumbo" directory.
sudo ant install_pymod


USAGE
Expand Down
46 changes: 46 additions & 0 deletions build-pymod.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0"?>

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

<project name="dumbo_pymod" default="install_pymod">

<property name="src.test" location="${basedir}/src/test/java"/>

<target name="install_pymod">
<exec executable="/bin/sh">
<arg value="-c" />
<arg value="cd ${basedir}/src/python/; python setup.py install; python setup.py clean -a" />
</exec>
</target>

<target name="test_pymod">
<exec executable="/bin/sh" resultproperty="pymodtest.failedTests">
<arg value="-c" />
<arg value="cd ${basedir}/src/test/python/; python main.py" />
</exec>
<exec executable="/bin/sh">
<arg value="-c" />
<arg value="cd ${basedir}/src/test/python/; rm *.pyc" />
</exec>
<condition property="pymodtest.success">
<equals arg1="${pymodtest.failedTests}" arg2="0"/>
</condition>
<fail message="TestCases failed. ${pymodtest.failedTests} failed to run successfully." unless="pymodtest.success"/>
</target>

</project>
32 changes: 3 additions & 29 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@ to call at top-level: ant deploy-contrib compile-core-test
-->
<project name="dumbo" default="jar">

<property name="src.test" location="${basedir}/src/test/java"/>

<!-- dummy compile target -->
<target name="compile" />

<import file="../build-contrib.xml" optional="true" />
<import file="../build-contrib.xml" />
<import file="build-pymod.xml" />

<!-- Override jar target to specify main class -->
<target name="jar" depends="compile">
<target name="jar" if="buildcontrib" depends="compile">
<jar
jarfile="${build.dir}/hadoop-${version}-${name}.jar"
basedir="${build.classes}"
Expand All @@ -42,26 +38,4 @@ to call at top-level: ant deploy-contrib compile-core-test
</jar>
</target>

<target name="install_pymod">
<exec executable="/bin/sh">
<arg value="-c" />
<arg value="cd ${basedir}/src/python/; python setup.py install; python setup.py clean -a" />
</exec>
</target>

<target name="test_pymod">
<exec executable="/bin/sh" resultproperty="pymodtest.failedTests">
<arg value="-c" />
<arg value="cd ${basedir}/src/test/python/; python main.py" />
</exec>
<exec executable="/bin/sh">
<arg value="-c" />
<arg value="cd ${basedir}/src/test/python/; rm *.pyc" />
</exec>
<condition property="pymodtest.success">
<equals arg1="${pymodtest.failedTests}" arg2="0"/>
</condition>
<fail message="TestCases failed. ${pymodtest.failedTests} failed to run successfully." unless="pymodtest.success"/>
</target>

</project>

0 comments on commit cc695f8

Please sign in to comment.