title: How to be notified when Spark Streaming application is started?
body: <p>I use Spark 2.3 (HDP 2.3.0.2.6.5.108-1) and <a href="https://spark.apache.org/docs/latest/streaming-programming-guide.html" rel="nofollow noreferrer">Spark Streaming</a> (<code>JavaInputDStream</code>).</p>
  
  <p>I am writing a test of some component that use spark streaming. What I am trying to do is:</p>
  
  <ol>
  <li>start the component in a separate thread, which start spark streaming</li>
  <li>wait it is started</li>
  <li>send a notification in kafka (read by spark)</li>
  <li>wait it is processed</li>
  <li>validate the outputs</li>
  </ol>
  
  <p>However, I am stuck on the (2) and I don't know how I can at least check the streaming job has started. Is there any api that I can use?</p>
  
  <p>Notes:</p>
  
  <ul>
  <li>I only have access to the spark context, not the streaming one... So it would be perfect if I could access such api from the spark context.</li>
  <li>the 3 comes after the 2 because setting spark auto.offset.reset` to earliest seams useless :\</li>
  </ul>