title: How to provide a codec to the SaveAsSequenceFile method in Spark?
body: <p>I am trying to figure out how to pass a codec to the saveAsSequenceFile method in Apache Spark.  Below is the code I am trying to run.  I am running Scala 2.10.4, Spark 1.0.0, Java 1.7.60, and Apache Hadoop 2.4.0.  </p>
  
  <pre><code>val rdd:RDD[(String, String)] = sc.sequenceFile(secPath,
                                  classOf[Text],
                                  classOf[Text]
                                 ).map { case (k,v) =&gt; (k.toString, v.toString)}
  
  val sortedOutput = rdd.sortByKey(true, 1)
  
  sortedOutput.saveAsSequenceFile(secPathOut)
  </code></pre>
  
  <p>My issue is that I am new to Spark and Scala.  I do not understand what the javadoc means for the codec variable passed to the saveAsSequenceFile method.  </p>
  
  <pre><code>def saveAsSequenceFile(path: String, codec: Option[Class[_ &lt;: CompressionCodec]] = None): Unit 
  </code></pre>
  
  <p>What does the &lt;: mean?  I get that the codec is optional, because when I run the above code it works.  Could someone please show an example of a properly formatted codec call to this method?</p>
  
  <p>Thanks!</p>