title: how to cache data in apache spark that can be used by other spark job
body: <p>I have a simple spark code in which I read a file using <code>SparkContext.textFile()</code> and then doing some operations on that data, and I am using <code>spark-jobserver</code> for getting output.
  In code I am caching the data but after job ends and I execute that <code>spark-job</code> again then it is not taking that same file which is already there in cache. So, every time file is getting loaded which is taking more time.</p>
  
  <p>Sample Code is as:</p>
  
  <pre><code>val sc=new SparkContext("local","test")
  val data=sc.textFile("path/to/file.txt").cache()
  val lines=data.count()
  println(lines)
  </code></pre>
  
  <p>Here, if I am reading the same file then when I execute it second time then it should take data from cache but it is not taking that data from cache.</p>
  
  <p>Is there any way using which I can share the cached data among multiple spark jobs?</p>