aboutsummaryrefslogtreecommitdiff
path: root/graphx
diff options
context:
space:
mode:
authorReynold Xin <rxin@apache.org>2014-01-13 18:30:26 -0800
committerReynold Xin <rxin@apache.org>2014-01-13 18:30:26 -0800
commit87f335db78221fc250bd64f39a334293db490379 (patch)
treeb45aff27603c288bbe40ad3600d62ce2151eb40c /graphx
parenta4e12af7aa7324653b7c65fc3c1c0454333520bf (diff)
downloadspark-87f335db78221fc250bd64f39a334293db490379.tar.gz
spark-87f335db78221fc250bd64f39a334293db490379.tar.bz2
spark-87f335db78221fc250bd64f39a334293db490379.zip
Made more things private.
Diffstat (limited to 'graphx')
-rw-r--r--graphx/src/main/scala/org/apache/spark/graphx/Edge.scala8
-rw-r--r--graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala4
-rw-r--r--graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartition.scala1
-rw-r--r--graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartitionBuilder.scala1
-rw-r--r--graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala2
-rw-r--r--graphx/src/main/scala/org/apache/spark/graphx/impl/MessageToPartition.scala5
-rw-r--r--graphx/src/main/scala/org/apache/spark/graphx/impl/ReplicatedVertexView.scala3
-rw-r--r--graphx/src/main/scala/org/apache/spark/graphx/impl/RoutingTable.scala1
-rw-r--r--graphx/src/main/scala/org/apache/spark/graphx/impl/Serializers.scala11
-rw-r--r--graphx/src/main/scala/org/apache/spark/graphx/impl/package.scala2
10 files changed, 26 insertions, 12 deletions
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/Edge.scala b/graphx/src/main/scala/org/apache/spark/graphx/Edge.scala
index 6c396c3dbe..85463052bc 100644
--- a/graphx/src/main/scala/org/apache/spark/graphx/Edge.scala
+++ b/graphx/src/main/scala/org/apache/spark/graphx/Edge.scala
@@ -1,18 +1,18 @@
package org.apache.spark.graphx
-
/**
* A single directed edge consisting of a source id, target id,
* and the data associated with the edge.
*
* @tparam ED type of the edge attribute
+ *
+ * @param srcId The vertex id of the source vertex
+ * @param dstId The vertex id of the target vertex
+ * @param attr The attribute associated with the edge
*/
case class Edge[@specialized(Char, Int, Boolean, Byte, Long, Float, Double) ED] (
- /** The vertex id of the source vertex */
var srcId: VertexID = 0,
- /** The vertex id of the target vertex. */
var dstId: VertexID = 0,
- /** The attribute associated with the edge. */
var attr: ED = null.asInstanceOf[ED])
extends Serializable {
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala b/graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala
index 66d5180020..447ef555ca 100644
--- a/graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala
+++ b/graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala
@@ -209,12 +209,8 @@ class GraphOps[VD: ClassTag, ED: ClassTag](graph: Graph[VD, ED]) {
* This function iterates until there are no remaining messages, or
* for `maxIterations` iterations.
*
- * @tparam VD the vertex data type
- * @tparam ED the edge data type
* @tparam A the Pregel message type
*
- * @param graph the input graph.
- *
* @param initialMsg the message each vertex will receive at the on
* the first iteration
*
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartition.scala b/graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartition.scala
index d4d71627e1..ee95ead3ad 100644
--- a/graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartition.scala
+++ b/graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartition.scala
@@ -15,6 +15,7 @@ import org.apache.spark.graphx.util.collection.PrimitiveKeyOpenHashMap
* @param index a clustered index on source vertex id
* @tparam ED the edge attribute type.
*/
+private[graphx]
class EdgePartition[@specialized(Char, Int, Boolean, Byte, Long, Float, Double) ED: ClassTag](
val srcIds: Array[VertexID],
val dstIds: Array[VertexID],
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartitionBuilder.scala b/graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartitionBuilder.scala
index fbc29409b5..9d072f9335 100644
--- a/graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartitionBuilder.scala
+++ b/graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartitionBuilder.scala
@@ -7,6 +7,7 @@ import org.apache.spark.graphx._
import org.apache.spark.graphx.util.collection.PrimitiveKeyOpenHashMap
import org.apache.spark.util.collection.PrimitiveVector
+private[graphx]
class EdgePartitionBuilder[@specialized(Long, Int, Double) ED: ClassTag](size: Int = 64) {
var edges = new PrimitiveVector[Edge[ED]](size)
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala b/graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala
index 97ca642f9b..348490c186 100644
--- a/graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala
+++ b/graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala
@@ -15,7 +15,7 @@ import org.apache.spark.util.ClosureCleaner
/**
- * A Graph RDD that supports computation on graphs.
+ * A graph that supports computation on graphs.
*
* Graphs are represented using two classes of data: vertex-partitioned and
* edge-partitioned. `vertices` contains vertex attributes, which are vertex-partitioned. `edges`
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/impl/MessageToPartition.scala b/graphx/src/main/scala/org/apache/spark/graphx/impl/MessageToPartition.scala
index ad5daf8f6a..05508ff716 100644
--- a/graphx/src/main/scala/org/apache/spark/graphx/impl/MessageToPartition.scala
+++ b/graphx/src/main/scala/org/apache/spark/graphx/impl/MessageToPartition.scala
@@ -7,6 +7,7 @@ import org.apache.spark.graphx.{PartitionID, VertexID}
import org.apache.spark.rdd.{ShuffledRDD, RDD}
+private[graphx]
class VertexBroadcastMsg[@specialized(Int, Long, Double, Boolean) T](
@transient var partition: PartitionID,
var vid: VertexID,
@@ -26,6 +27,7 @@ class VertexBroadcastMsg[@specialized(Int, Long, Double, Boolean) T](
* @param partition index of the target partition.
* @param data value to send
*/
+private[graphx]
class MessageToPartition[@specialized(Int, Long, Double, Char, Boolean/*, AnyRef*/) T](
@transient var partition: PartitionID,
var data: T)
@@ -39,6 +41,7 @@ class MessageToPartition[@specialized(Int, Long, Double, Char, Boolean/*, AnyRef
}
+private[graphx]
class VertexBroadcastMsgRDDFunctions[T: ClassTag](self: RDD[VertexBroadcastMsg[T]]) {
def partitionBy(partitioner: Partitioner): RDD[VertexBroadcastMsg[T]] = {
val rdd = new ShuffledRDD[PartitionID, (VertexID, T), VertexBroadcastMsg[T]](self, partitioner)
@@ -56,6 +59,7 @@ class VertexBroadcastMsgRDDFunctions[T: ClassTag](self: RDD[VertexBroadcastMsg[T
}
+private[graphx]
class MsgRDDFunctions[T: ClassTag](self: RDD[MessageToPartition[T]]) {
/**
@@ -68,6 +72,7 @@ class MsgRDDFunctions[T: ClassTag](self: RDD[MessageToPartition[T]]) {
}
+private[graphx]
object MsgRDDFunctions {
implicit def rdd2PartitionRDDFunctions[T: ClassTag](rdd: RDD[MessageToPartition[T]]) = {
new MsgRDDFunctions(rdd)
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/impl/ReplicatedVertexView.scala b/graphx/src/main/scala/org/apache/spark/graphx/impl/ReplicatedVertexView.scala
index 0e2f5a9dd9..4ebe0b0267 100644
--- a/graphx/src/main/scala/org/apache/spark/graphx/impl/ReplicatedVertexView.scala
+++ b/graphx/src/main/scala/org/apache/spark/graphx/impl/ReplicatedVertexView.scala
@@ -138,7 +138,7 @@ class ReplicatedVertexView[VD: ClassTag](
}
}
-object ReplicatedVertexView {
+private object ReplicatedVertexView {
protected def buildBuffer[VD: ClassTag](
pid2vidIter: Iterator[Array[Array[VertexID]]],
vertexPartIter: Iterator[VertexPartition[VD]]) = {
@@ -187,6 +187,7 @@ object ReplicatedVertexView {
}
}
+private[graphx]
class VertexAttributeBlock[VD: ClassTag](val vids: Array[VertexID], val attrs: Array[VD])
extends Serializable {
def iterator: Iterator[(VertexID, VD)] =
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/impl/RoutingTable.scala b/graphx/src/main/scala/org/apache/spark/graphx/impl/RoutingTable.scala
index 3bd8b24133..f342fd7437 100644
--- a/graphx/src/main/scala/org/apache/spark/graphx/impl/RoutingTable.scala
+++ b/graphx/src/main/scala/org/apache/spark/graphx/impl/RoutingTable.scala
@@ -12,6 +12,7 @@ import org.apache.spark.util.collection.PrimitiveVector
* may be used multiple times in ReplicatedVertexView -- once to ship the vertex attributes and
* (possibly) once to ship the active-set information.
*/
+private[impl]
class RoutingTable(edges: EdgeRDD[_], vertices: VertexRDD[_]) {
val bothAttrs: RDD[Array[Array[VertexID]]] = createPid2Vid(true, true)
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/impl/Serializers.scala b/graphx/src/main/scala/org/apache/spark/graphx/impl/Serializers.scala
index 1c3c87f08d..cbd6318f33 100644
--- a/graphx/src/main/scala/org/apache/spark/graphx/impl/Serializers.scala
+++ b/graphx/src/main/scala/org/apache/spark/graphx/impl/Serializers.scala
@@ -7,6 +7,7 @@ import org.apache.spark.SparkConf
import org.apache.spark.graphx._
import org.apache.spark.serializer._
+private[graphx]
class VertexIDMsgSerializer(conf: SparkConf) extends Serializer {
override def newInstance(): SerializerInstance = new ShuffleSerializerInstance {
@@ -27,6 +28,7 @@ class VertexIDMsgSerializer(conf: SparkConf) extends Serializer {
}
/** A special shuffle serializer for VertexBroadcastMessage[Int]. */
+private[graphx]
class IntVertexBroadcastMsgSerializer(conf: SparkConf) extends Serializer {
override def newInstance(): SerializerInstance = new ShuffleSerializerInstance {
@@ -50,6 +52,7 @@ class IntVertexBroadcastMsgSerializer(conf: SparkConf) extends Serializer {
}
/** A special shuffle serializer for VertexBroadcastMessage[Long]. */
+private[graphx]
class LongVertexBroadcastMsgSerializer(conf: SparkConf) extends Serializer {
override def newInstance(): SerializerInstance = new ShuffleSerializerInstance {
@@ -73,6 +76,7 @@ class LongVertexBroadcastMsgSerializer(conf: SparkConf) extends Serializer {
}
/** A special shuffle serializer for VertexBroadcastMessage[Double]. */
+private[graphx]
class DoubleVertexBroadcastMsgSerializer(conf: SparkConf) extends Serializer {
override def newInstance(): SerializerInstance = new ShuffleSerializerInstance {
@@ -96,6 +100,7 @@ class DoubleVertexBroadcastMsgSerializer(conf: SparkConf) extends Serializer {
}
/** A special shuffle serializer for AggregationMessage[Int]. */
+private[graphx]
class IntAggMsgSerializer(conf: SparkConf) extends Serializer {
override def newInstance(): SerializerInstance = new ShuffleSerializerInstance {
@@ -119,6 +124,7 @@ class IntAggMsgSerializer(conf: SparkConf) extends Serializer {
}
/** A special shuffle serializer for AggregationMessage[Long]. */
+private[graphx]
class LongAggMsgSerializer(conf: SparkConf) extends Serializer {
override def newInstance(): SerializerInstance = new ShuffleSerializerInstance {
@@ -142,6 +148,7 @@ class LongAggMsgSerializer(conf: SparkConf) extends Serializer {
}
/** A special shuffle serializer for AggregationMessage[Double]. */
+private[graphx]
class DoubleAggMsgSerializer(conf: SparkConf) extends Serializer {
override def newInstance(): SerializerInstance = new ShuffleSerializerInstance {
@@ -168,6 +175,7 @@ class DoubleAggMsgSerializer(conf: SparkConf) extends Serializer {
// Helper classes to shorten the implementation of those special serializers.
////////////////////////////////////////////////////////////////////////////////
+private[graphx]
abstract class ShuffleSerializationStream(s: OutputStream) extends SerializationStream {
// The implementation should override this one.
def writeObject[T](t: T): SerializationStream
@@ -281,6 +289,7 @@ abstract class ShuffleSerializationStream(s: OutputStream) extends Serialization
override def close(): Unit = s.close()
}
+private[graphx]
abstract class ShuffleDeserializationStream(s: InputStream) extends DeserializationStream {
// The implementation should override this one.
def readObject[T](): T
@@ -371,7 +380,7 @@ abstract class ShuffleDeserializationStream(s: InputStream) extends Deserializat
override def close(): Unit = s.close()
}
-sealed trait ShuffleSerializerInstance extends SerializerInstance {
+private[graphx] sealed trait ShuffleSerializerInstance extends SerializerInstance {
override def serialize[T](t: T): ByteBuffer = throw new UnsupportedOperationException
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/impl/package.scala b/graphx/src/main/scala/org/apache/spark/graphx/impl/package.scala
index a6bbf63888..cfc3281b64 100644
--- a/graphx/src/main/scala/org/apache/spark/graphx/impl/package.scala
+++ b/graphx/src/main/scala/org/apache/spark/graphx/impl/package.scala
@@ -3,5 +3,5 @@ package org.apache.spark.graphx
import org.apache.spark.util.collection.OpenHashSet
package object impl {
- type VertexIdToIndexMap = OpenHashSet[VertexID]
+ private[graphx] type VertexIdToIndexMap = OpenHashSet[VertexID]
}