Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import scala.reflect.ClassTag
import scala.util.Random

import org.apache.spark.SparkException
import org.apache.spark.SparkContext._
import org.apache.spark.graphx.lib._
import org.apache.spark.rdd.RDD

Expand Down Expand Up @@ -379,7 +378,7 @@ class GraphOps[VD: ClassTag, ED: ClassTag](graph: Graph[VD, ED]) extends Seriali
* @see [[org.apache.spark.graphx.lib.PageRank$#runUntilConvergenceWithOptions]]
*/
def personalizedPageRank(src: VertexId, tol: Double,
resetProb: Double = 0.15) : Graph[Double, Double] = {
resetProb: Double = 0.15): Graph[Double, Double] = {
PageRank.runUntilConvergenceWithOptions(graph, tol, resetProb, Some(src))
}

Expand All @@ -392,7 +391,7 @@ class GraphOps[VD: ClassTag, ED: ClassTag](graph: Graph[VD, ED]) extends Seriali
* @see [[org.apache.spark.graphx.lib.PageRank$#runWithOptions]]
*/
def staticPersonalizedPageRank(src: VertexId, numIter: Int,
resetProb: Double = 0.15) : Graph[Double, Double] = {
resetProb: Double = 0.15): Graph[Double, Double] = {
PageRank.runWithOptions(graph, numIter, resetProb, Some(src))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class ReplicatedVertexView[VD: ClassTag, ED: ClassTag](
* shipping level.
*/
def withEdges[VD2: ClassTag, ED2: ClassTag](
edges_ : EdgeRDDImpl[ED2, VD2]): ReplicatedVertexView[VD2, ED2] = {
new ReplicatedVertexView(edges_, hasSrcId, hasDstId)
_edges: EdgeRDDImpl[ED2, VD2]): ReplicatedVertexView[VD2, ED2] = {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed we need a white space if the name of variables ends with _.
Those variables might be used internally so can we rename to which like prepended _ right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

new ReplicatedVertexView(_edges, hasSrcId, hasDstId)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class ShippableVertexPartition[VD: ClassTag](
extends VertexPartitionBase[VD] {

/** Return a new ShippableVertexPartition with the specified routing table. */
def withRoutingTable(routingTable_ : RoutingTablePartition): ShippableVertexPartition[VD] = {
new ShippableVertexPartition(index, values, mask, routingTable_)
def withRoutingTable(_routingTable: RoutingTablePartition): ShippableVertexPartition[VD] = {
new ShippableVertexPartition(index, values, mask, _routingTable)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.apache.spark.util.collection.BitSet
* example, [[VertexPartition.VertexPartitionOpsConstructor]]).
*/
private[graphx] abstract class VertexPartitionBaseOps
[VD: ClassTag, Self[X] <: VertexPartitionBase[X] : VertexPartitionBaseOpsConstructor]
[VD: ClassTag, Self[X] <: VertexPartitionBase[X]: VertexPartitionBaseOpsConstructor]
(self: Self[VD])
extends Serializable with Logging {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ object PageRank extends Logging {
// edge partitions.
prevRankGraph = rankGraph
val rPrb = if (personalized) {
(src: VertexId , id: VertexId) => resetProb * delta(src, id)
(src: VertexId, id: VertexId) => resetProb * delta(src, id)
} else {
(src: VertexId, id: VertexId) => resetProb
}
Expand Down