Skip to content

Commit

Permalink
Add installation manual and 'sculptor sample' command to initialize a…
Browse files Browse the repository at this point in the history
…nd run sample easily
  • Loading branch information
uprush committed Mar 11, 2012
1 parent 25047c7 commit 3af3940
Show file tree
Hide file tree
Showing 6 changed files with 525 additions and 44 deletions.
37 changes: 37 additions & 0 deletions README
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,40 @@
Sculptor is a framework and command line interface that makes using Apache HBase much easier. Sculptor is a framework and command line interface that makes using Apache HBase much easier.


Please see the doc at the wiki page. Please see the doc at the wiki page.

== Pre-requirements ==
- Apache Ivy is required to build Sculptor
- Apache HBase installed
- Hadoop MapReduce (Sculptor MapReduce mode only)

== Build ==
$ cd sculptor
$ ant

== Run Sculptor ==
1. Copy sculptor folder to your HBase client

2. Edit $SCULPTOR_HOME/sculptor, change HBASE_HOME variable to fit your environment

3. For Sculptor MapReduce mode only, get your environment ready to run customized MapReduce jobs over HBase.
This usually requires the following steps:
- Add HBase and ZooKeeper jars to Hadoop classpath by:
$ echo "export HADOOP_CLASSPATH=$HBASE_HOME/hbase-0.9x.jar:$HBASE_HOME/lib/zookeeper-3.x.y.jar" >> hadoop-env.sh
- Let Hadoop know where HBase is running
$ ln -s $HBASE_HOME/conf/hbase-site.xml $HADOOP_HOME/conf/hbase-site.xml
- Add sculptor-sample.jar to Hadoop classpath.
The easiest way to do this is to drop sculptor-sample.jar to $HADOOP_HOME/lib directory.
- Sync the above changes across the cluster
- Restart Hadoop MapReduce

4. Start Sculptor
$ sh $SCULPTOR_HOME/sculptor
sculptor> help

5. To initialize and run the sample
$ sh $SCULPTOR_HOME/sculptor sample
sculptor> get from sc_item_data limit=1

6. Run ad-hoc MapReduce via Sculptor
sculptor> set process mapreduce
sculptor> get from sc_item_data item_id>100
103 changes: 63 additions & 40 deletions build.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
--> -->
<project name="sculptor" default="sample-jar" xmlns:ivy="antlib:org.apache.ivy.ant"> <project name="sculptor" default="sample-test-jar" xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- some variables used --> <!-- some variables used -->
<property name="lib.dir" value="lib" /> <property name="lib.dir" value="lib" />
<property name="build.dir" value="build" /> <property name="build.dir" value="build" />
Expand All @@ -42,48 +42,71 @@
<mkdir dir="${build.dir}/sample/classes" /> <mkdir dir="${build.dir}/sample/classes" />
</target> </target>


<target name="framework-compile" depends="clean,resolve"> <target name="framework-compile" depends="clean,resolve">
<javac <javac
encoding="UTF-8" encoding="UTF-8"
srcdir="framework/src" srcdir="framework/src"
destdir="${build.dir}/framework/classes" destdir="${build.dir}/framework/classes"
debug="true"> debug="true">
<classpath> <classpath>
<fileset dir="${lib.dir}"> <fileset dir="${lib.dir}">
<include name="**/*.jar" /> <include name="**/*.jar" />
</fileset> </fileset>
</classpath> </classpath>
</javac> </javac>
</target> </target>


<target name="framework-jar" depends="framework-compile" description="Making sculptor-${version}.jar"> <target name="framework-jar" depends="framework-compile" description="Making sculptor-${version}.jar">
<jar jarfile="sculptor-${version}.jar" <jar jarfile="sculptor-${version}.jar"
basedir="${build.dir}/framework/classes"> basedir="${build.dir}/framework/classes">
</jar> </jar>
</target> </target>


<target name="sample-compile" depends="framework-jar"> <target name="sample-compile" depends="framework-jar">
<javac <javac
encoding="UTF-8" encoding="UTF-8"
srcdir="sample/src" srcdir="sample/src"
destdir="${build.dir}/sample/classes" destdir="${build.dir}/sample/classes"
debug="true"> debug="true">
<classpath> <classpath>
<fileset dir="${lib.dir}"> <fileset dir="${lib.dir}">
<include name="**/*.jar" /> <include name="**/*.jar" />
</fileset> </fileset>
<fileset dir="./"> <fileset dir="./">
<include name="*.jar" /> <include name="*.jar" />
</fileset> </fileset>
</classpath> </classpath>
</javac> </javac>
</target> </target>


<target name="sample-jar" depends="sample-compile" description="Making sculptor-sample-${version}.jar"> <target name="sample-jar" depends="sample-compile" description="Making sculptor-sample-${version}.jar">
<jar jarfile="sculptor-sample-${version}.jar" <jar jarfile="sculptor-sample-${version}.jar"
basedir="${build.dir}/sample/classes"> basedir="${build.dir}/sample/classes">
</jar> </jar>
</target> </target>

<target name="sample-test-compile" depends="sample-compile" description="Compiling sculptor sample test source">
<javac
encoding="UTF-8"
srcdir="sample/test"
destdir="${build.dir}/sample/classes"
debug="true">
<classpath>
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
<fileset dir="./">
<include name="*.jar" />
</fileset>
</classpath>
</javac>
</target>

<target name="sample-test-jar" depends="sample-test-compile" description="Making sculptor-sample-${version}.jar with test source">
<jar jarfile="sculptor-sample-${version}.jar"
basedir="${build.dir}/sample/classes">
</jar>
</target>


<!-- javadoc target --> <!-- javadoc target -->
<target name="javadoc" depends="clean"> <target name="javadoc" depends="clean">
Expand Down
2 changes: 2 additions & 0 deletions ivy.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@
<dependency org="org.apache.zookeeper" name="zookeeper" rev="3.3.3" transitive="false"/> <dependency org="org.apache.zookeeper" name="zookeeper" rev="3.3.3" transitive="false"/>
<dependency org="commons-lang" name="commons-lang" rev="2.5" transitive="false"/> <dependency org="commons-lang" name="commons-lang" rev="2.5" transitive="false"/>
<dependency org="commons-logging" name="commons-logging" rev="1.1.1" transitive="false"/> <dependency org="commons-logging" name="commons-logging" rev="1.1.1" transitive="false"/>
<dependency org="log4j" name="log4j" rev="1.2.16" transitive="false"/>
<dependency org="junit" name="junit" rev="4.10" transitive="false"/>
</dependencies> </dependencies>
</ivy-module> </ivy-module>
Loading

0 comments on commit 3af3940

Please sign in to comment.