spark streaming using ConstantInputDStream in java
<p>I am trying to use ConstantInputDStream in java spark streaming program, but not able to do so. I am doing:</p>

<pre><code>            final SparkConf sparkConf2 = new SparkConf().setAppName("NetworkWordCount");
            final JavaStreamingContext ssc2 = new JavaStreamingContext(sparkConf2, new Duration(10000));
            final List&lt;Integer&gt; data = Arrays.asList(1, 2, 3, 4, 5);
            JavaRDD&lt;Integer&gt; distData = ssc2.sparkContext().parallelize(data);
            final JavaDStream&lt;Integer&gt; numStream = new JavaDStream&lt;Integer&gt;(new ConstantInputDStream&lt;Integer&gt;(ssc2, distData));
</code></pre>

<p>But the final statement is giving compilation error: "error: constructor ConstantInputDStream in class ConstantInputDStream&lt;'T'> cannot be applied to given types;"</p>

<p>What could be the problem and how to fix that?</p>