It's the exact same API you've already found, and it's documented:
http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.AccumulatorParam

JavaSparkContext has helper methods for int and double but not long. You
can just make your own little implementation of AccumulatorParam<Long>
right? ... which would be nice to add to JavaSparkContext.

On Wed, Nov 12, 2014 at 11:05 PM, Steve Lewis <lordjoe2...@gmail.com> wrote:

>      JavaSparkContext currentContext = ...;
>         Accumulator<Integer> accumulator = currentContext.accumulator(0,
> "MyAccumulator");
>
> will create an Accumulator of Integers. For many large Data problems
> Integer is too small and Long is a better type.
>   I see a call like the following
>
>       AccumulatorParam<Long> param = ?? how do I get one of these;
> // no compiler is unhappy with this call
>         Accumulator<Long> accumulatorLong = currentContext.accumulator(new
> Long(0), acc ,param);
>
> but NONE - ZERO documentation on its use, how to get a
>  AccumulatorParam<Long> or how to turn one into an Accumulator.
>    Any ideas
>
>
>

Reply via email to