title: How to create custom set accumulator, i.e. Set[String]?
body: <p>I am trying to use custom accumulator in Apache Spark to accumulate in a set. The result should have Set[String] type. For this I creat custom accumulator:</p>
  
  <pre><code>object SetAccumulatorParam extends AccumulatorParam[Set[String]] {
      def addInPlace(r1: mutable.Set[String], r2: mutable.Set[String]): mutable.Set[String] = {
          r1 ++= r2
      }
  
      def zero(initialValue: mutable.Set[String]): mutable.Set[String] = {
          Set()
      }
  }
  </code></pre>
  
  <p>Yet I can not instantiate variable of this type.</p>
  
  <pre><code>val tags = sc.accumulator(Set(""))(SetAccumulatorParam)
  </code></pre>
  
  <p>result in error .Please help.</p>
  
  <pre><code>required: org.apache.spark.AccumulatorParam[Set[String]]
  </code></pre>