title: Spark - Get earliest and latest offset of Kafka without opening stream
body: <p>I am currently using <code>spark-streaming-kafka-0-10_2.11</code> to connect my spark application with the kafka queue. For Streams everything works fine. For a specific scenario however I just need the whole content of the kafka queue exactly once - for this I got the suggestion to better use <code>KafkaUtils.createRDD</code> (<a href="https://stackoverflow.com/questions/44625956/sparkstreaming-read-kafka-stream-and-provide-it-as-rdd-for-further-processing">SparkStreaming: Read Kafka Stream and provide it as RDD for further processing</a>) </p>
  
  <p>However for <code>spark-streaming-kafka-0-10_2.11</code> I cannot figure out how to get the earliest and latest offset for my Kafka topic that would be needed to create the Offset-Range I have to hand of the the <code>createRDD</code> method.</p>
  
  <p>What is the recommended way to get those offsets without opening a stream? Any help would be greatly appreciated.</p>