Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix style errors
  • Loading branch information
ankurdave committed Apr 23, 2014
commit ae361108c2885d173cdc73b3124ad7b40e9fdfdf
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ object VertexRDD {
* @param numPartitions the desired number of partitions for the resulting `VertexRDD`
* @param defaultVal the vertex attribute to use when creating missing vertices
*/
def fromEdges[VD: ClassTag](edges: EdgeRDD[_, _], numPartitions: Int, defaultVal: VD): VertexRDD[VD] = {
def fromEdges[VD: ClassTag](
edges: EdgeRDD[_, _], numPartitions: Int, defaultVal: VD): VertexRDD[VD] = {
val routingTables = createRoutingTables(edges, new HashPartitioner(numPartitions))
val vertexPartitions = routingTables.mapPartitions({ routingTableIter =>
val routingTable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ import org.apache.spark.graphx.util.collection.PrimitiveKeyOpenHashMap
* @param activeSet an optional active vertex set for filtering computation on the edges
*/
private[graphx]
class EdgePartition[@specialized(Char, Int, Boolean, Byte, Long, Float, Double) ED: ClassTag, VD: ClassTag](
class EdgePartition[
@specialized(Char, Int, Boolean, Byte, Long, Float, Double) ED: ClassTag, VD: ClassTag](
Copy link
Contributor Author

Choose a reason for hiding this comment

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

specialize VD

val srcIds: Array[VertexId],
val dstIds: Array[VertexId],
val data: Array[ED],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ class GraphImpl[VD: ClassTag, ED: ClassTag] protected (
// updateF preserves type, so we can use incremental replication
val newVerts = vertices.leftJoin(other)(updateF).cache()
val changedVerts = vertices.asInstanceOf[VertexRDD[VD2]].diff(newVerts)
val newReplicatedVertexView =
replicatedVertexView.asInstanceOf[ReplicatedVertexView[VD2, ED]].updateVertices(changedVerts)
val newReplicatedVertexView = replicatedVertexView.asInstanceOf[ReplicatedVertexView[VD2, ED]]
.updateVertices(changedVerts)
new GraphImpl(newVerts, newReplicatedVertexView)
} else {
// updateF does not preserve type, so we must re-replicate all vertices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class ReplicatedVertexView[VD: ClassTag, ED: ClassTag](
var hasDstId: Boolean = false) {

/**
* Return a new `ReplicatedVertexView` with the specified `EdgeRDD`, which must have the same shipping level.
* Return a new `ReplicatedVertexView` with the specified `EdgeRDD`, which must have the same
* shipping level.
*/
def withEdges[VD2: ClassTag, ED2: ClassTag](
edges_ : EdgeRDD[ED2, VD2]): ReplicatedVertexView[VD2, ED2] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ object ShippableVertexPartition {
apply(iter, RoutingTablePartition.empty, null.asInstanceOf[VD])

/**
* Construct a `ShippableVertexPartition` from the given vertices with the specified routing table,
* filling in missing vertices mentioned in the routing table using `defaultVal`.
* Construct a `ShippableVertexPartition` from the given vertices with the specified routing
* table, filling in missing vertices mentioned in the routing table using `defaultVal`.
*/
def apply[VD: ClassTag](
iter: Iterator[(VertexId, VD)], routingTable: RoutingTablePartition, defaultVal: VD)
Expand Down