Skip to content

Commit f8f125e

Browse files
author
Imran Rashid
committed
fix stupid typo and add documentation
1 parent 823878c commit f8f125e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/src/main/scala/spark/SparkContext.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,13 @@ class SparkContext(
253253
def accumulable[T,R](initialValue: T)(implicit param: AccumulableParam[T,R]) =
254254
new Accumulable(initialValue, param)
255255

256-
def accumlableCollection[R <% Growable[T] with TraversableOnce[T] with Serializable, T](initialValue: R) = {
256+
/**
257+
* create an accumulator from a "mutable collection" type.
258+
*
259+
* Growable and TraversableOnce are the standard apis that guarantee += and ++=, implemented by
260+
* standard mutable collections. So you can use this with mutable Map, Set, etc.
261+
*/
262+
def accumulableCollection[R <% Growable[T] with TraversableOnce[T] with Serializable, T](initialValue: R) = {
257263
val param = new GrowableAccumulableParam[R,T]
258264
new Accumulable(initialValue, param)
259265
}

0 commit comments

Comments
 (0)