错误会话:Neo4j会话对象泄露

时间:2016-07-17 01:41:50

标签: apache-spark neo4j

当我尝试在Github上显示的Neo4j-Spark连接器的GraphX示例时,一切正常,直到我尝试保存我的图形。我得到错误 " 错误会话:Neo4j会话对象泄露,请确保您的应用程序在处置对象之前调用Sessions上的`close`方法。"什么时候 我运行以下内容:

import org.neo4j.spark._
     val g = Neo4jGraph.loadGraph(sc, "Person", Seq("KNOWS"), "Person")
    // g: org.apache.spark.graphx.Graph[Any,Int] = org.apache.spark.graphx.impl.GraphImpl@574985d8

    g.vertices.count
    // res0: Long = 999937

    g.edges.count
    // res1: Long = 999906

    import org.apache.spark.graphx._
    import org.apache.spark.graphx.lib._

    val g2 = PageRank.run(g, 5)

    val v = g2.vertices.take(5)
    // v: Array[(org.apache.spark.graphx.VertexId, Double)] = Array((185012,0.15), (612052,1.0153273593749998), (354796,0.15), (182316,0.15), (199516,0.38587499999999997))

    Neo4jGraph.saveGraph(sc, g2, "rank")
    // res2: (Long, Long) = (999937,0)

0 个答案:

没有答案