Repository: spark
Updated Branches:
  refs/heads/master 8d22dbb5e -> fd7b15539


Rectify gereneric parameter names between SparkContext and AccumulablePa...

AccumulableParam gave its generic parameters as 'R, T', whereas SparkContext 
labeled them 'T, R'.

Trivial, but really confusing.

I resolved this in favor of AccumulableParam, because it seemed to have some 
logic for its names.  I also extended this minimal, but at least present, 
justification into the SparkContext comments.

Author: Nathan Kronenfeld <nkronenf...@oculusinfo.com>

Closes #2637 from nkronenfeld/accumulators and squashes the following commits:

98d6b74 [Nathan Kronenfeld] Rectify gereneric parameter names between 
SparkContext and AccumulableParam


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/fd7b1553
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/fd7b1553
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/fd7b1553

Branch: refs/heads/master
Commit: fd7b15539669b14996a51610d6724ca0811f9d65
Parents: 8d22dbb
Author: Nathan Kronenfeld <nkronenf...@oculusinfo.com>
Authored: Sun Oct 5 21:03:48 2014 -0700
Committer: Patrick Wendell <pwend...@gmail.com>
Committed: Sun Oct 5 21:03:48 2014 -0700

----------------------------------------------------------------------
 core/src/main/scala/org/apache/spark/SparkContext.scala | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/fd7b1553/core/src/main/scala/org/apache/spark/SparkContext.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala 
b/core/src/main/scala/org/apache/spark/SparkContext.scala
index 97109b9..396cdd1 100644
--- a/core/src/main/scala/org/apache/spark/SparkContext.scala
+++ b/core/src/main/scala/org/apache/spark/SparkContext.scala
@@ -779,20 +779,20 @@ class SparkContext(config: SparkConf) extends Logging {
   /**
    * Create an [[org.apache.spark.Accumulable]] shared variable, to which 
tasks can add values
    * with `+=`. Only the driver can access the accumuable's `value`.
-   * @tparam T accumulator type
-   * @tparam R type that can be added to the accumulator
+   * @tparam R accumulator result type
+   * @tparam T type that can be added to the accumulator
    */
-  def accumulable[T, R](initialValue: T)(implicit param: AccumulableParam[T, 
R]) =
+  def accumulable[R, T](initialValue: R)(implicit param: AccumulableParam[R, 
T]) =
     new Accumulable(initialValue, param)
 
   /**
    * Create an [[org.apache.spark.Accumulable]] shared variable, with a name 
for display in the
    * Spark UI. Tasks can add values to the accumuable using the `+=` operator. 
Only the driver can
    * access the accumuable's `value`.
-   * @tparam T accumulator type
-   * @tparam R type that can be added to the accumulator
+   * @tparam R accumulator result type
+   * @tparam T type that can be added to the accumulator
    */
-  def accumulable[T, R](initialValue: T, name: String)(implicit param: 
AccumulableParam[T, R]) =
+  def accumulable[R, T](initialValue: R, name: String)(implicit param: 
AccumulableParam[R, T]) =
     new Accumulable(initialValue, param, Some(name))
 
   /**


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to