15
15
* limitations under the License.
16
16
*/
17
17
18
- package spark .bagel
18
+ package org . apache . spark .bagel
19
19
20
- import spark ._
21
- import spark .SparkContext ._
22
-
23
- import scala .collection .mutable .ArrayBuffer
24
- import storage .StorageLevel
20
+ import org .apache .spark ._
21
+ import org .apache .spark .SparkContext ._
22
+ import org .apache .spark .rdd .RDD
23
+ import org .apache .spark .storage .StorageLevel
25
24
26
25
object Bagel extends Logging {
27
26
val DEFAULT_STORAGE_LEVEL = StorageLevel .MEMORY_AND_DISK
28
27
29
28
/**
30
29
* Runs a Bagel program.
31
- * @param sc [[spark.SparkContext ]] to use for the program.
30
+ * @param sc [[org.apache. spark.SparkContext ]] to use for the program.
32
31
* @param vertices vertices of the graph represented as an RDD of (Key, Vertex) pairs. Often the Key will be
33
32
* the vertex id.
34
33
* @param messages initial set of messages represented as an RDD of (Key, Message) pairs. Often this will be an
35
34
* empty array, i.e. sc.parallelize(Array[K, Message]()).
36
- * @param combiner [[spark.bagel.Combiner ]] combines multiple individual messages to a given vertex into one
35
+ * @param combiner [[org.apache. spark.bagel.Combiner ]] combines multiple individual messages to a given vertex into one
37
36
* message before sending (which often involves network I/O).
38
- * @param aggregator [[spark.bagel.Aggregator ]] performs a reduce across all vertices after each superstep,
37
+ * @param aggregator [[org.apache. spark.bagel.Aggregator ]] performs a reduce across all vertices after each superstep,
39
38
* and provides the result to each vertex in the next superstep.
40
- * @param partitioner [[spark.Partitioner ]] partitions values by key
39
+ * @param partitioner [[org.apache. spark.Partitioner ]] partitions values by key
41
40
* @param numPartitions number of partitions across which to split the graph.
42
41
* Default is the default parallelism of the SparkContext
43
- * @param storageLevel [[spark.storage.StorageLevel ]] to use for caching of intermediate RDDs in each superstep.
42
+ * @param storageLevel [[org.apache. spark.storage.StorageLevel ]] to use for caching of intermediate RDDs in each superstep.
44
43
* Defaults to caching in memory.
45
44
* @param compute function that takes a Vertex, optional set of (possibly combined) messages to the Vertex,
46
45
* optional Aggregator and the current superstep,
@@ -98,7 +97,7 @@ object Bagel extends Logging {
98
97
verts
99
98
}
100
99
101
- /** Runs a Bagel program with no [[spark.bagel.Aggregator ]] and the default storage level */
100
+ /** Runs a Bagel program with no [[org.apache. spark.bagel.Aggregator ]] and the default storage level */
102
101
def run [K : Manifest , V <: Vertex : Manifest , M <: Message [K ] : Manifest , C : Manifest ](
103
102
sc : SparkContext ,
104
103
vertices : RDD [(K , V )],
@@ -110,7 +109,7 @@ object Bagel extends Logging {
110
109
compute : (V , Option [C ], Int ) => (V , Array [M ])
111
110
): RDD [(K , V )] = run(sc, vertices, messages, combiner, numPartitions, DEFAULT_STORAGE_LEVEL )(compute)
112
111
113
- /** Runs a Bagel program with no [[spark.bagel.Aggregator ]] */
112
+ /** Runs a Bagel program with no [[org.apache. spark.bagel.Aggregator ]] */
114
113
def run [K : Manifest , V <: Vertex : Manifest , M <: Message [K ] : Manifest , C : Manifest ](
115
114
sc : SparkContext ,
116
115
vertices : RDD [(K , V )],
@@ -128,7 +127,7 @@ object Bagel extends Logging {
128
127
}
129
128
130
129
/**
131
- * Runs a Bagel program with no [[spark.bagel.Aggregator ]], default [[spark.HashPartitioner ]]
130
+ * Runs a Bagel program with no [[org.apache. spark.bagel.Aggregator ]], default [[org.apache. spark.HashPartitioner ]]
132
131
* and default storage level
133
132
*/
134
133
def run [K : Manifest , V <: Vertex : Manifest , M <: Message [K ] : Manifest , C : Manifest ](
@@ -141,7 +140,7 @@ object Bagel extends Logging {
141
140
compute : (V , Option [C ], Int ) => (V , Array [M ])
142
141
): RDD [(K , V )] = run(sc, vertices, messages, combiner, numPartitions, DEFAULT_STORAGE_LEVEL )(compute)
143
142
144
- /** Runs a Bagel program with no [[spark.bagel.Aggregator ]] and the default [[spark.HashPartitioner ]]*/
143
+ /** Runs a Bagel program with no [[org.apache. spark.bagel.Aggregator ]] and the default [[org.apache. spark.HashPartitioner ]]*/
145
144
def run [K : Manifest , V <: Vertex : Manifest , M <: Message [K ] : Manifest , C : Manifest ](
146
145
sc : SparkContext ,
147
146
vertices : RDD [(K , V )],
@@ -159,8 +158,8 @@ object Bagel extends Logging {
159
158
}
160
159
161
160
/**
162
- * Runs a Bagel program with no [[spark.bagel.Aggregator ]], default [[spark.HashPartitioner ]],
163
- * [[spark.bagel.DefaultCombiner ]] and the default storage level
161
+ * Runs a Bagel program with no [[org.apache. spark.bagel.Aggregator ]], default [[org.apache. spark.HashPartitioner ]],
162
+ * [[org.apache. spark.bagel.DefaultCombiner ]] and the default storage level
164
163
*/
165
164
def run [K : Manifest , V <: Vertex : Manifest , M <: Message [K ] : Manifest ](
166
165
sc : SparkContext ,
@@ -172,8 +171,8 @@ object Bagel extends Logging {
172
171
): RDD [(K , V )] = run(sc, vertices, messages, numPartitions, DEFAULT_STORAGE_LEVEL )(compute)
173
172
174
173
/**
175
- * Runs a Bagel program with no [[spark.bagel.Aggregator ]], the default [[spark.HashPartitioner ]]
176
- * and [[spark.bagel.DefaultCombiner ]]
174
+ * Runs a Bagel program with no [[org.apache. spark.bagel.Aggregator ]], the default [[org.apache. spark.HashPartitioner ]]
175
+ * and [[org.apache. spark.bagel.DefaultCombiner ]]
177
176
*/
178
177
def run [K : Manifest , V <: Vertex : Manifest , M <: Message [K ] : Manifest ](
179
178
sc : SparkContext ,
0 commit comments