i have List object bellow:
List<Tuple2<Tuple3<String, Long, Object>, Tuple2<Long, Object[]>>> rddQueue =
    Arrays.asList(tupleList);
how can convert its to JavaDStream Spark ? thank advance !
You can do that using the JavaStreamingContext and a Queue<T>:
List<Tuple2<Tuple3<String, Long, Object>, Tuple2<Long, Object[]>>> 
  list = Arrays.asList();
// Random batch time, for the sake of the example.
JavaStreamingContext jssc = 
  new JavaStreamingContext("local[*]", "TestApp", new Duration(4000));
Queue<JavaRDD<Tuple2<Tuple3<String, Long, Object>, Tuple2<Long, Object[]>>>> rddQueue = 
  new LinkedList<>();
rddQueue.add(jssc.sparkContext().parallelize(list));
JavaDStream<Tuple2<Tuple3<String, Long, Object>, Tuple2<Long, Object[]>>> dStream = 
  jssc.queueStream(rddQueue);
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With