我有一个多节点 giraph 集群在我的 PC 中正常工作。我从 Giraph 执行了 SimpleShortestPathExample 并且执行得很好。
这个算法是用这个文件(tiny_graph.txt)运行的:
[0,0,[[1,1],[3,3]]]
[1,0,[[0,1],[2,2],[3,1]]]
[2,0,[[1,2],[4,4]]]
[3,0,[[0,3],[1,1],[4,4]]]
[4,0,[[3,4],[2,4]]]
该文件具有以下输入格式:
[source_id,source_value,[[dest_id, edge_value],...]]
现在,我正在尝试在同一个集群中执行相同的算法,但输入文件与原始文件不同。我自己的文件是这样的:
[Portada,0,[[Sugerencias para la cita del día,1]]]
[Proverbios españoles,0,[]]
[Neil Armstrong,0,[[Luna,1][ideal,1][verdad,1][Categoria:Ingenieros,2,[Categoria:Estadounidenses,2][Categoria:Astronautas,2]]]
[Categoria:Ingenieros,1,[[Neil Armstrong,2]]]
[Categoria:Estadounidenses,1,[[Neil Armstrong,2]]]
[Categoria:Astronautas,1,[[Neil Armstrong,2]]]
它与原版非常相似,但 id 是 String,顶点和边值是 Long。我的问题是我应该使用哪个 TextInputFormat ,因为我已经尝试过org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat
并且org.apache.giraph.io.formats.TextDoubleDoubleAdjacencyListVertexInputFormat
我无法让它工作。
解决了这个问题后,我可以调整原始的最短路径示例算法并让它适用于我的文件,但是在我得到解决方案之前,我无法达到这一点。
如果这种格式不是一个好的决定,我可能会调整它,但我不知道哪个是我最好的选择,我从 giraph 中的文本输入和输出格式中获得的知识真的很糟糕,这就是为什么 i0me 在这里寻求建议。