【问题标题】:import/save SNAP Facebook edges in Apache Giraph在 Apache Giraph 中导入/保存 SNAP Facebook 边缘
【发布时间】:2015-07-19 10:03:50
【问题描述】:

我正在使用 SNAP facebook 数据集进行社交网络分析。 SNAP 使用简单边列表作为数据格式 "node1 node2" 。如何在 Apache Giraph 中读取 SNAP 数据集?我正在使用每行 BufferedReader 行读取文件,但不知道如何将其保存在具有邻接列表的 BSP 模型中。有人可以帮助我提供 java 中的代码示例吗? 我还想添加有关节点的信息(每个用户/节点具有的特征)我如何在 Giraph 中做到这一点?

【问题讨论】:

    标签: facebook data-import giraph


    【解决方案1】:

    您可以直接使用 SNAP facebook 数据集。在您的命令中,而不是使用 -vif ... 使用 -eif org.apache.giraph.io.formats.IntNullTextEdgeInputFormat。这种格式将每一行读取为 (source_vertex destination_vertex),就像 SNAP 数据集一样。

    【讨论】:

    • 对于命令:./hadoop jar /usr/local/giraph-1.1.0/giraph-examples/target/giraph-examples-1.1.0-for-hadoop-2.5.1-jar- with-dependencies.jar org.apache.giraph.GiraphRunner org.apache.giraph.examples.SimpleShortestPathsComputation -eif org.apache.giraph.io.formats.IntNullTextEdgeInputFormat -vip /user/hduser/input/facebook/0.edges -vof org.apache.giraph.io.formats.IdWithValueTextOutputFormat -op /user/hduser/output/shortestpaths -w 1 我收到 IllegalArgument 错误
    • 使用 -eip 代替 -vip
    • ./hadoop jar /usr/local/giraph-1.1.0/giraph-examples/target/giraph-examples-1.1.0-for-hadoop-‌​2.5.1-jar-with -dependencies.jar org.apache.giraph.GiraphRunner org.apache.giraph.examples.SimpleShortestPathsComputation -eif org.apache.giraph.io.formats.IntNullTextEdgeInputFormat -eip /user/hduser/input/facebook/0.edges -vof org .apache.giraph.io.formats.IdWithValueTextOutputFormat -op /user/hduser/output/shortestpaths -w 1
    • 未指定顶点输入。没有指定顶点输出
    • 由于在该命令中使用了-eif(边输入格式)和-eip(边输入路径),所以没有指定顶点输入的警告并不重要。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-23
    • 1970-01-01
    • 2017-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多