Brand new to Apache Spark and I'm a little confused how to make updates to a value that sits outside of a .mapTriplets iteration in GraphX. I'm aware mapTriplets is really only for modifying values inside the graph. What about using it in conjunction with other computations? See below:
def mapTripletsMethod(edgeWeights: Graph[Int, Double], stationaryDistribution: Graph[Double, Double]) = { val tempMatrix: SparseDoubleMatrix2D = graphToSparseMatrix(edgeWeights) stationaryDistribution.mapTriplets{ e => val row = e.srcId.toInt val column = e.dstId.toInt var cellValue = -1 * tempMatrix.get(row, column) + e.dstAttr tempMatrix.set(row, column, cellValue) // this doesn't do anything to tempMatrix e } } My first guess is that since the input param for mapTriplets is a function, then somehow the value for tempMatrix is getting lost or duplicated. If this really isn't the proper design pattern to do this, does anyone have any insight on the "right way"? Implementing some of the more complex centrality algorithms is rather difficult until I can wrap my head around this paradigm. Thank you! -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/How-do-I-manipulate-values-outside-of-a-GraphX-loop-tp14400.html Sent from the Apache Spark User List mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@spark.apache.org For additional commands, e-mail: user-h...@spark.apache.org