Index: src/site/site.xml
===================================================================
--- src/site/site.xml (revision 1359451)
+++ src/site/site.xml (working copy)
@@ -27,16 +27,16 @@
Here's an example of a hama-site.xml file:
-+<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> @@ -99,7 +99,7 @@If you are managing your own ZooKeeper, you have to specify the port number as below:
-+<property> <name>hama.zookeeper.property.clientPort</name> <value>2181</value> @@ -111,16 +111,16 @@NOTE: Skip this step if you're in Local Mode.
-
Run the command:+% $HAMA_HOME/bin/start-bspd.shThis will startup a BSPMaster, GroomServers and Zookeeper on your machine.
Run the command:
-+% $HAMA_HOME/bin/stop-bspd.shto stop all the daemons running on your cluster.
- +% $HAMA_HOME/bin/hama jar hama-examples-x.x.x.jar [args]Index: src/site/xdoc/hama_bsp_tutorial.xml =================================================================== --- src/site/xdoc/hama_bsp_tutorial.xml (revision 1359451) +++ src/site/xdoc/hama_bsp_tutorial.xml (working copy) @@ -40,7 +40,7 @@
The extending class must override the bsp() method, which is declared like this: -+public abstract void bsp(BSPPeer<K1, V1, K2, V2, M extends Writable> peer) throws IOException, SyncException, InterruptedException;@@ -56,7 +56,7 @@
After your own BSP is created, you will need to configure a BSPJob and submit it to Hama cluster to execute a job. The BSP job configuration and submission interfaces is almost the same as the MapReduce job configuration: -+HamaConfiguration conf = new HamaConfiguration(); BSPJob job = new BSPJob(conf, MyBSP.class); job.setJobName("My BSP program"); @@ -68,9 +68,9 @@See the below section for more detailed description of BSP user interfaces.
- Inputs and Outputs
+Inputs and Outputs
When setting up a BSPJob, you can provide a Input/OutputFormat and Paths like this:
-+job.setInputPath(new Path("/tmp/sequence.dat"); job.setInputFormat(org.apache.hama.bsp.SequenceFileInputFormat.class); or, @@ -87,7 +87,7 @@Then, you can read the input and write the output from the methods in BSP class which has "BSPPeer" which contains an communication, counters, and IO interfaces as parameter. In this case we read a normal text file:
-+@Override public final void bsp( BSPPeer<LongWritable, Text, Text, LongWritable, Text> peer) @@ -108,7 +108,7 @@ There is also a function which allows you to re-read the input from the beginning. This snippet reads the input five times: -+for(int i = 0; i < 5; i++){ LongWritable key = new LongWritable(); Text value = new Text(); @@ -119,7 +119,7 @@ peer.reopenInput() }-Communication
+Communication
Hama BSP provides simple but powerful communication APIs for many purposes. We tried to follow the standard library of BSP world as much as possible. The following table describes all the methods you can use:
@@ -137,7 +137,7 @@The send() and all the other functions are very flexible. Here is an example that sends a message to all peers:
-+@Override public void bsp( BSPPeer<NullWritable, NullWritable, Text, DoubleWritable, Text> peer) @@ -150,7 +150,7 @@ peer.sync(); }-Synchronization
+Synchronization
When all the processes have entered the barrier via the sync() method, the Hama proceeds to the next superstep. @@ -162,7 +162,7 @@ For example, the sync() method also can be called in a for loop so that you can use to program the iterative methods sequentially:
-+@Override public void bsp( BSPPeer<NullWritable, NullWritable, Text, DoubleWritable, Text> peer) @@ -191,7 +191,7 @@Here is an BSP-based Pi Calculation example and submit it to Hama cluster:
-+private static Path TMP_OUTPUT = new Path("/tmp/pi-" + System.currentTimeMillis()); public static class MyEstimator extends Index: src/site/xdoc/hama_graph_tutorial.xml =================================================================== --- src/site/xdoc/hama_graph_tutorial.xml (revision 1359451) +++ src/site/xdoc/hama_graph_tutorial.xml (working copy) @@ -30,7 +30,7 @@Writing a Hama graph application involves subclassing the predefined Vertex class. Its template arguments define three value types, associated with vertices, edges, and messages.
-+public abstract class Vertex<V extends Writable, E extends Writable, M extends Writable> implements VertexInterface<V, E, M> { @@ -48,7 +48,7 @@ From Superstep 1 to 30, each vertex sums up the values arriving on all its messages and sets its tentative page rank to (1 - 0.85) / numOfVertices + (0.85 * sum). -+public static class PageRankVertex extends Vertex<Text, NullWritable, DoubleWritable> { Index: src/site/xdoc/hama_on_clouds.xml =================================================================== --- src/site/xdoc/hama_on_clouds.xml (revision 1359451) +++ src/site/xdoc/hama_on_clouds.xml (working copy) @@ -27,7 +27,7 @@The following commands install Whirr and start a 5 node Hama cluster on Amazon EC2 in 5 minutes or less. -
+% curl -O http://www.apache.org/dist/whirr/whirr-0.x.0/whirr-0.x.0.tar.gz % tar zxf whirr-0.x.0.tar.gz; cd whirr-0.x.0 @@ -38,7 +38,7 @@ % bin/whirr launch-cluster --config recipes/hama-ec2.properties --private-key-file ~/.ssh/id_rsa_whirr- +% cd /usr/local/hama-0.x.0 % bin/hama jar hama-examples-x.x.x.jar [args]