title: Spark StreamingContext awaitTerminationOrTimeout
body: <p>I'm calling <code>streamingContext.awaitTerminationOrTimeout(timeout)</code>, but I want to make <code>timeout</code> environment dependent.</p>
  
  <p>This means that I want to stop my job if my environment is UAT, but I don't want it to timeout at all if my environment is production.</p>
  
  <p>I have checked the documentation <a href="https://spark.apache.org/docs/1.5.0/api/java/org/apache/spark/streaming/StreamingContext.html#awaitTerminationOrTimeout(long)" rel="nofollow noreferrer">here</a>, but I can't find any references to whether passing <code>0</code> or <code>-1</code> as timeout will just make the job run forever (or until it fails).</p>
  
  <p>Are there any possible <code>timeout</code> values that could do the trick? Or any other alternatives that don't imply calling <code>awaitTermination</code> for my production environment and <code>awaitTerminationOrTimeout</code> for my UAT environment?</p>