Github user jerryshao commented on a diff in the pull request:
https://github.com/apache/spark/pull/4875#discussion_r25746891
--- Diff:
streaming/src/test/java/org/apache/spark/streaming/JavaAPISuite.java ---
@@ -160,6 +160,38 @@ public void testWindowWithSlideDuration() {
@SuppressWarnings("unchecked")
@Test
+ public void testWindowWithInitialData()
+ {
+
+ List<JavaRDD<Integer>> initialData = Arrays.asList(
+ ssc.sparkContext().parallelize(Arrays.asList(-3, -2, -1)),
+ ssc.sparkContext().parallelize(Arrays.asList(1, 2, 3)),
+ ssc.sparkContext().parallelize(Arrays.asList(4, 5, 6)));
+
+ List<List<Integer>> inputData = Arrays.asList(
+ Arrays.asList(7, 8, 9),
+ Arrays.asList(10, 11, 12),
+ Arrays.asList(13, 14, 15),
+ Arrays.asList(16, 17, 18),
+ Arrays.asList(19, 20, 21),
+ Arrays.asList(22, 23, 24));
+
+ List<List<Integer>> expected = Arrays.asList(
+ Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12),
+ Arrays.asList(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18),
+ Arrays.asList(13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24),
+ Arrays.asList(19, 20, 21, 22, 23, 24));
+
+ JavaDStream<Integer> stream = JavaTestUtils.attachTestInputStream(ssc,
inputData, 1);
+ JavaDStream<Integer> windowed = stream.window(new Duration(4000), new
Duration(2000), Optional.of(initialData));
--- End diff --
I think this line is > 100.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]