Extending Spark's Accumulators

Spark’s accumulators can be used for much more than just adding up numbers. Spark only ships with int/double accumulators, but you can always create your own by implementing AccumulatorParam. Let’s say we’re processing log files with Spark Streaming and we would like to create a running tally of the most used browsers.