title: How to set StorageLevel.MEMORY_AND_DISK_SER for KafkaUtils.createDirectStream?
body: <p>I wanted to set <code>StorageLevel.MEMORY_AND_DISK_SER</code> in my Spark Streaming application hoping to prevent a <code>MetadataFetchFailedException</code>.</p>
  
  <p>I am not sure where I should pass <code>StorageLevel.MEMORY_AND_DISK</code> as it seems like <code>createDirectStream</code> doesn't allow to pass that parameter.</p>
  
  <pre><code>val messages = KafkaUtils.createDirectStream[String, String, StringDecoder, StringDecoder](
    ssc, kafkaParams, topicsSet)
  </code></pre>
  
  <p>Full Error:</p>
  
  <pre><code>org.apache.spark.shuffle.MetadataFetchFailedException: Missing an output location for shuffle 0
      at org.apache.spark.MapOutputTracker$$anonfun$org$apache$spark$MapOutputTracker$$convertMapStatuses$2.apply(MapOutputTracker.scala:460)
      at org.apache.spark.MapOutputTracker$$anonfun$org$apache$spark$MapOutputTracker$$convertMapStatuses$2.apply(MapOutputTracker.scala:456)
      at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
      at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
      at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
      at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)
      at org.apache.spark.MapOutputTracker$.org$apache$spark$MapOutputTracker$$convertMapStatuses(MapOutputTracker.scala:456)
      at org.apache.spark.MapOutputTracker.getMapSizesByExecutorId(MapOutputTracker.scala:183)
      at org.apache.spark.shuffle.hash.HashShuffleReader.read(HashShuffleReader.scala:47)
      at org.apache.spark.rdd.ShuffledRDD.compute(ShuffledRDD.scala:90)
      at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:300)
      at org.apache.spark.rdd.RDD.iterator(RDD.scala:264)
      at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
      at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:300)
      at org.apache.spark.CacheManager.getOrCompute(CacheManager.scala:69)
      at org.apache.spark.rdd.RDD.iterator(RDD.scala:262)
      at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:66)
      at org.apache.spark.scheduler.Task.run(Task.scala:88)
      at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:214)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>