You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hama.apache.org by ed...@apache.org on 2013/04/02 07:25:51 UTC

svn commit: r1463389 - in /hama/trunk/src/site/xdoc: getting_started_with_hama.xml hama_graph_tutorial.xml

Author: edwardyoon
Date: Tue Apr  2 05:25:51 2013
New Revision: 1463389

URL: http://svn.apache.org/r1463389
Log:
Minor website updates

Modified:
    hama/trunk/src/site/xdoc/getting_started_with_hama.xml
    hama/trunk/src/site/xdoc/hama_graph_tutorial.xml

Modified: hama/trunk/src/site/xdoc/getting_started_with_hama.xml
URL: http://svn.apache.org/viewvc/hama/trunk/src/site/xdoc/getting_started_with_hama.xml?rev=1463389&r1=1463388&r2=1463389&view=diff
==============================================================================
--- hama/trunk/src/site/xdoc/getting_started_with_hama.xml (original)
+++ hama/trunk/src/site/xdoc/getting_started_with_hama.xml Tue Apr  2 05:25:51 2013
@@ -27,7 +27,7 @@ xsi:schemaLocation="http://maven.apache.
     <subsection name="Requirements"></subsection>
     <p>1. Make sure all required software is installed on all nodes in your cluster:</p>
     <ul>
-      <li>hadoop-0.20.x (non-secure version)</li>
+      <li>hadoop-1.0.x or higher version (non-secure version)</li>
       <li>Sun Java JDK 1.6.x or higher version</li>
       <li>SSH access to manage BSP deamons</li>
     </ul>

Modified: hama/trunk/src/site/xdoc/hama_graph_tutorial.xml
URL: http://svn.apache.org/viewvc/hama/trunk/src/site/xdoc/hama_graph_tutorial.xml?rev=1463389&r1=1463388&r2=1463389&view=diff
==============================================================================
--- hama/trunk/src/site/xdoc/hama_graph_tutorial.xml (original)
+++ hama/trunk/src/site/xdoc/hama_graph_tutorial.xml Tue Apr  2 05:25:51 2013
@@ -41,6 +41,29 @@ xsi:schemaLocation="http://maven.apache.
 
    <p>The user overrides the Compute() method, which will be executed at each active vertex in every superstep. Predefined Vertex methods allow Compute() to query information about the current vertex and its edges, and to send messages to other vertices. Compute() can inspect the value associated with its vertex via GetValue().</p>
 
+   <subsection name="VertexReader API"></subsection>
+   <p>You can create your own VertexReader for your data format by exending org.apache.hama.graph.<b>VertexInputReader</b> class.
+
+   For example, an sequence file contains a linked list of Vertex, can be parse as following:
+   </p>
+   <pre>
+  public static class PagerankSeqReader
+      extends
+      VertexInputReader&lt;Text, TextArrayWritable, Text, NullWritable, DoubleWritable&gt; {
+    @Override
+    public boolean parseVertex(Text key, TextArrayWritable value,
+        Vertex&lt;Text, NullWritable, DoubleWritable&gt; vertex) throws Exception {
+      vertex.setVertexID(key);
+
+      for (Writable v : value.get()) {
+        vertex.addEdge(new Edge&lt;Text, NullWritable&gt;((Text) v, null));
+      }
+
+      return true;
+    }
+  }
+</pre>
+
    <subsection name="Example: PageRankVertex"></subsection>
    <p>To solve the Page Rank problem using Hama Graph, you can extends the Vertex class to create a PageRankVertex class.
 In this example, the algorithm described Google's Pregel paper was used. The value of a vertex represents the tentative page rank of the vertex. The graph is intialized with each vertex value equal to 1/numOfVertices. In each of the first 30 supersteps, each vertex sends its tentative page rank along all of its outgoing edges.