giraph-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Heitmann <>
Subject Re: Getting Started Code
Date Sat, 21 Apr 2012 10:41:11 GMT

On 20 Apr 2012, at 17:27, Etienne Dumoulin wrote:

> Like it is a bit difficult to start from scratch a first time,
> I copied/pasted the getting started code.
> I do not understand why there is 3 template classes when
> TextVertexInputFormat has 4
> (from the javadoc and eclipse).
> For example:
> "public static class SimpleShortestPathsVertexInputFormat extends
> TextVertexInputFormat<LongWritable, DoubleWritable, FloatWritable>"
> Is there something I miss?

Personally, I dont think that the code to which the getting started guide refers, 
is the best place to start *understanding* Giraph.
But its the best code to execute in order to see if your Hadoop setup actually works for Giraph.

A better example for understanding Giraph IMHO is the ConnectedComponentsVertexTest class
(in the test directory of the code). 
It shows that you need to implement a Vertex class, an TextInputFormat and a TextOutputFormat
class in order to define your own job. 
Then you can use in order to test your code inside of Giraph, and
figure out Hadoop later. 

I was puzzled about your "3 templates versus 4" error, but then I tried it out in Eclipse.
If you are also using eclipse, then I know what you mean ;) 
If you mouse over e.g. SimpleShortesPathsVertex, then eclipse will display a tool-tip. However,
thats just the top part of the javadoc with 3 template parameters, you need to scroll down,

in order to see all 4 elements of the template signature. To do that, you can either press
F2, to see the scroll bar or resize the window. 
Or you click on the class, and then you can read the source of the javadoc. 

However, keep in mind, that some specific classes which are used in the TextInputFormat and
the TextOutputFormat have template signatures
which really only have 2 or 3 elements. 

As a second thing, I would look at the SimpleShortestPathVertexTest class (again in the test

Then you can look at the PageRankeBenchmark class in giraph.benchmark. 

Let me/us know if you have more questions. 
View raw message