Home > Uncategorized > Commands to Run MapReduce Job

Commands to Run MapReduce Job

ant build your mapreduce job jar first. See the following ant build.xml

<project name=”MyProject” basedir=”.” default=”distr”>

<property name=”Name” value=”TSMapReduce”/>

<property name=”name” value=”TSMapReduce”/>

 

<property name=”version” value=”0.1.0″/>

<property name=”final.name” value=”${name}-${version}”/>

 

<property name=”src.dir” value=”src”/>

    <property name=”lib.dir” value=”lib”/>

 

<property name=”build.dir” value=”build”/>

<property name=”jar.dir” value=”${build.dir}”/>

<property name=”build.lib.dir” value=”${build.dir}/lib”/>

 

<property name=”main-class” value=”com.your_xxx_domain.timeseries.MyMapReduceJob”/>

<property name=”tmp.dir” value=”tmp”/>

    <path id=”classpath”>

        <fileset dir=”${lib.dir}” includes=”**/*.jar”/>

    </path>

 

<target name=”clean”>

<delete dir=”${build.dir}”/>

<delete dir=”${tmp.dir}”/>

</target>

 

<target name=”compile”>

<mkdir dir=”${tmp.dir}”/>

<mkdir dir=”${build.dir}”/>

 

<javac srcdir=”${src.dir}” destdir=”${tmp.dir}” debug=”on”

classpathref=”classpath”/>

</target>

 

<target name=”distr” depends=”jar”>

<mkdir dir=”${build.lib.dir}”/>

<copy todir=”${build.lib.dir}”>

<fileset dir=”${lib.dir}”/>

</copy>

 

<delete dir=”${tmp.dir}”/>

</target>

 

<target name=”jar” depends=”clean, compile”>

 

<jar destfile=”${build.dir}/${final.name}.jar” basedir=”${tmp.dir}”>

<!– <manifest>

<attribute name=”Main-Class” value=”${main-class}”/>

<attribute name=”Class-Path” value=”classpath”/>

</manifest>

–>

<fileset dir=”.”>

<include name=”**/${lib.dir}/**” />

</fileset>

 

</jar>

</target>

</project>

./bin/hadoop jar YOUR_MAP_REDUCE_JOB.jar com.your_xxx_domain.path.to.your.class.MyMapReduceClass programArgs1 programArgs2

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: