@@ -414,40 +414,99 @@ class JavaSparkContext(val sc: SparkContext) extends JavaSparkContextVarargsWork
414
414
def intAccumulator (initialValue : Int ): Accumulator [java.lang.Integer ] =
415
415
sc.accumulator(initialValue)(IntAccumulatorParam ).asInstanceOf [Accumulator [java.lang.Integer ]]
416
416
417
+ /**
418
+ * Create an [[org.apache.spark.Accumulator ]] integer variable, which tasks can "add" values
419
+ * to using the `add` method. Only the master can access the accumulator's `value`.
420
+ *
421
+ * This version supports naming the accumulator for display in Spark's web UI.
422
+ */
423
+ def intAccumulator (initialValue : Int , name : String ): Accumulator [java.lang.Integer ] =
424
+ sc.accumulator(initialValue, name)(IntAccumulatorParam )
425
+ .asInstanceOf [Accumulator [java.lang.Integer ]]
426
+
417
427
/**
418
428
* Create an [[org.apache.spark.Accumulator ]] double variable, which tasks can "add" values
419
429
* to using the `add` method. Only the master can access the accumulator's `value`.
420
430
*/
421
431
def doubleAccumulator (initialValue : Double ): Accumulator [java.lang.Double ] =
422
432
sc.accumulator(initialValue)(DoubleAccumulatorParam ).asInstanceOf [Accumulator [java.lang.Double ]]
423
433
434
+ /**
435
+ * Create an [[org.apache.spark.Accumulator ]] double variable, which tasks can "add" values
436
+ * to using the `add` method. Only the master can access the accumulator's `value`.
437
+ *
438
+ * This version supports naming the accumulator for display in Spark's web UI.
439
+ */
440
+ def doubleAccumulator (initialValue : Double , name : String ): Accumulator [java.lang.Double ] =
441
+ sc.accumulator(initialValue, name)(DoubleAccumulatorParam )
442
+ .asInstanceOf [Accumulator [java.lang.Double ]]
443
+
424
444
/**
425
445
* Create an [[org.apache.spark.Accumulator ]] integer variable, which tasks can "add" values
426
446
* to using the `add` method. Only the master can access the accumulator's `value`.
427
447
*/
428
448
def accumulator (initialValue : Int ): Accumulator [java.lang.Integer ] = intAccumulator(initialValue)
429
449
450
+ /**
451
+ * Create an [[org.apache.spark.Accumulator ]] integer variable, which tasks can "add" values
452
+ * to using the `add` method. Only the master can access the accumulator's `value`.
453
+ *
454
+ * This version supports naming the accumulator for display in Spark's web UI.
455
+ */
456
+ def accumulator (initialValue : Int , name : String ): Accumulator [java.lang.Integer ] =
457
+ intAccumulator(initialValue, name)
458
+
430
459
/**
431
460
* Create an [[org.apache.spark.Accumulator ]] double variable, which tasks can "add" values
432
461
* to using the `add` method. Only the master can access the accumulator's `value`.
433
462
*/
434
463
def accumulator (initialValue : Double ): Accumulator [java.lang.Double ] =
435
464
doubleAccumulator(initialValue)
436
465
466
+
467
+ /**
468
+ * Create an [[org.apache.spark.Accumulator ]] double variable, which tasks can "add" values
469
+ * to using the `add` method. Only the master can access the accumulator's `value`.
470
+ *
471
+ * This version supports naming the accumulator for display in Spark's web UI.
472
+ */
473
+ def accumulator (initialValue : Double , name : String ): Accumulator [java.lang.Double ] =
474
+ doubleAccumulator(initialValue, name)
475
+
437
476
/**
438
477
* Create an [[org.apache.spark.Accumulator ]] variable of a given type, which tasks can "add"
439
478
* values to using the `add` method. Only the master can access the accumulator's `value`.
440
479
*/
441
480
def accumulator [T ](initialValue : T , accumulatorParam : AccumulatorParam [T ]): Accumulator [T ] =
442
481
sc.accumulator(initialValue)(accumulatorParam)
443
482
483
+ /**
484
+ * Create an [[org.apache.spark.Accumulator ]] variable of a given type, which tasks can "add"
485
+ * values to using the `add` method. Only the master can access the accumulator's `value`.
486
+ *
487
+ * This version supports naming the accumulator for display in Spark's web UI.
488
+ */
489
+ def accumulator [T ](initialValue : T , name : String , accumulatorParam : AccumulatorParam [T ])
490
+ : Accumulator [T ] =
491
+ sc.accumulator(initialValue, name)(accumulatorParam)
492
+
444
493
/**
445
494
* Create an [[org.apache.spark.Accumulable ]] shared variable of the given type, to which tasks
446
495
* can "add" values with `add`. Only the master can access the accumuable's `value`.
447
496
*/
448
497
def accumulable [T , R ](initialValue : T , param : AccumulableParam [T , R ]): Accumulable [T , R ] =
449
498
sc.accumulable(initialValue)(param)
450
499
500
+ /**
501
+ * Create an [[org.apache.spark.Accumulable ]] shared variable of the given type, to which tasks
502
+ * can "add" values with `add`. Only the master can access the accumuable's `value`.
503
+ *
504
+ * This version supports naming the accumulator for display in Spark's web UI.
505
+ */
506
+ def accumulable [T , R ](initialValue : T , name : String , param : AccumulableParam [T , R ])
507
+ : Accumulable [T , R ] =
508
+ sc.accumulable(initialValue, name)(param)
509
+
451
510
/**
452
511
* Broadcast a read-only variable to the cluster, returning a
453
512
* [[org.apache.spark.broadcast.Broadcast ]] object for reading it in distributed functions.
0 commit comments