mesos/spark — pull request #145 by squito (2012-07-12 17:05:18+00:00)
Title: add Accumulatable, add corresponding docs & tests for accumulators

Preliminary version of some updates to accumulators -- it works, but probably requires some discussion around the exact API.

I didn't want to break all existing accumulators, so to add an `addInPlace(T,Y)`
method meant creating a whole new type, which I've called `Accumulatable`. Also, I had to distinguish the old `+=` method from the new one. I chose `+:=`, but that was rather arbitrary, I'm no expert on scala idioms. (It seems that the old operator is really closer to `++=`, and the new one should be `+=`, but I guess we can't change that.)

I've also added tests for accumulators. These include an example where the current value of an accumulator is read during a task. The example application is stochastic gradient descent, where seeing the current value is really critical. Should `accumulator.value` throw an exception (so the user doesn't think they're getting the global value), but maybe instead we expose `accumulator.localValue`?