title: java.lang.IllegalStateException: Adding new inputs, transformations, and output operations after starting a context is not supported
body: <p>I get below exception when I try to create a dStream within a Function call of Spark.</p>
  
  <p>My call method :</p>
  
  <pre><code>@Override
  public JavaRDD&lt;Object&gt; call(JavaRDD&lt;Object&gt; v1) throws Exception {
      Queue&lt;JavaRDD&lt;Object&gt;&gt; queue = new LinkedList&lt;&gt;();
      queue.add(v1);
      JavaDStream&lt;Object&gt; dStream = context.queueStream(queue);
      JavaDStream&lt;Object&gt; newDStream = dStream.map(AbstractProcessor.this);
      final JavaRDD&lt;Object&gt; rdd = context.sparkContext().emptyRDD();
      newDStream.foreachRDD(new SaxFunction&lt;JavaRDD&lt;Object&gt;, Void&gt;() {
          private static final long serialVersionUID = 672054140484217234L;
  
          @Override
          public Void execute(JavaRDD&lt;Object&gt; object) throws Exception {
              rdd.union(object);
              return null;
          }
      });
      return rdd;
  }
  </code></pre>
  
  <p>Exception : </p>
  
  <pre><code>Caused by: java.lang.IllegalStateException: Adding new inputs, transformations, and output operations after starting a context is not supported
      at org.apache.spark.streaming.dstream.DStream.validateAtInit(DStream.scala:220)
      at org.apache.spark.streaming.dstream.DStream.&lt;init&gt;(DStream.scala:64)
      at org.apache.spark.streaming.dstream.InputDStream.&lt;init&gt;(InputDStream.scala:42)
      at org.apache.spark.streaming.dstream.QueueInputDStream.&lt;init&gt;(QueueInputDStream.scala:29)
      at org.apache.spark.streaming.StreamingContext.queueStream(StreamingContext.scala:513)
      at org.apache.spark.streaming.StreamingContext.queueStream(StreamingContext.scala:492)
      at org.apache.spark.streaming.api.java.JavaStreamingContext.queueStream(JavaStreamingContext.scala:436)
  </code></pre>
  
  <p>Is there any way I can create a dStream and do operations on it in runtime or I can update DAG after context is started?
  Thanks in advance.</p>