我在博客上为自己讲述了这一点:
http://codingwiththomas.blogspot.de/2011/04/graph-exploration-with-hadoop-mapreduce.html http://codingwiththomas.blogspot.de/2011/04/graph-exploration-with-hadoop-mapreduce.html
但 MapReduce 不太适合这些图形分析。为此,最好使用 BSP(批量同步并行),Apache Hama 在 Hadoop HDFS 之上提供了良好的图形 API。
我在这里用 MapReduce 编写了一个连接组件算法:(Mindist 搜索)
https://github.com/thomasjungblut/tjungblut-graph/tree/master/src/de/jungblut/graph/mapreduce https://github.com/thomasjungblut/tjungblut-graph/tree/master/src/de/jungblut/graph/mapreduce
还可以在此处找到 Apache Hama 的 BSP 版本:
https://github.com/thomasjungblut/tjungblut-graph/blob/master/src/de/jungblut/graph/bsp/MindistSearch.java https://github.com/thomasjungblut/tjungblut-graph/blob/master/src/de/jungblut/graph/bsp/MindistSearch.java
实现并不像 MapReduce 那样困难,而且速度至少快 10 倍。
如果您有兴趣,请查看 TRUNK 的最新版本并访问我们的邮件列表。
http://hama.apache.org/ http://hama.apache.org/
http://apache.org/hama/mail-lists.html http://apache.org/hama/mail-lists.html