【发布时间】:2024-04-22 01:35:01
【问题描述】:
我想使用 Giraph 作为我工作的图形处理工具。我熟悉 Mahout,我知道我可以在不使用 Hadoop 的情况下使用 Mahout 的某些部分,例如推荐系统。但是,我不知道这对于 Giraph 是否相同,以及我是否可以在不使用 Hadoop 的情况下使用它。
【问题讨论】:
我想使用 Giraph 作为我工作的图形处理工具。我熟悉 Mahout,我知道我可以在不使用 Hadoop 的情况下使用 Mahout 的某些部分,例如推荐系统。但是,我不知道这对于 Giraph 是否相同,以及我是否可以在不使用 Hadoop 的情况下使用它。
【问题讨论】:
您需要 Hadoop 才能运行 Giraph,因为单个任务(master 和 worker)在内部作为 map-only 作业执行。或者,您也可以将 Giraph 作为纱线应用程序运行。
查看giraph quick start guide,如果遇到问题,请搜索mailing list。
【讨论】:
您需要 Hadoop 依赖项,但不需要 Hadoop 集群,甚至不需要伪分布式集群。 Practical Graph Analytics with Apache Giraph 这本书的第 5 章展示了一个示例 - 源代码可在 GitHub 上获得。
需要以下依赖项:
将您的计算实现为BasicComputation 的子类并运行它as follows:
String[] graphSeed = new String[] { "seed\t0" }
GiraphConfiguration conf = new GiraphConfiguration();
conf.setComputationClass(GenerateTwitterParallel.class);
conf.setVertexInputFormatClass(
TextDoubleDoubleAdjacencyListVertexInputFormat.class);
conf.setVertexOutputFormatClass(
AdjacencyListTextVertexOutputFormat.class);
Iterable<String> results =
InternalVertexRunner.run(conf, graphSeed);
【讨论】: