File tree Expand file tree Collapse file tree 5 files changed +30
-10
lines changed
flume/src/test/java/org/apache/spark/streaming
mqtt/src/test/java/org/apache/spark/streaming
zeromq/src/test/java/org/apache/spark/streaming
streaming/src/test/java/org/apache/spark/streaming Expand file tree Collapse file tree 5 files changed +30
-10
lines changed Original file line number Diff line number Diff line change 1717
1818package org .apache .spark .streaming ;
1919
20+ import org .apache .spark .SparkConf ;
2021import org .apache .spark .streaming .api .java .JavaStreamingContext ;
2122import org .junit .After ;
2223import org .junit .Before ;
@@ -27,8 +28,11 @@ public abstract class LocalJavaStreamingContext {
2728
2829 @ Before
2930 public void setUp () {
30- System .setProperty ("spark.streaming.clock" , "org.apache.spark.streaming.util.ManualClock" );
31- ssc = new JavaStreamingContext ("local[2]" , "test" , new Duration (1000 ));
31+ SparkConf conf = new SparkConf ()
32+ .setMaster ("local[2]" )
33+ .setAppName ("test" )
34+ .set ("spark.streaming.clock" , "org.apache.spark.streaming.util.ManualClock" );
35+ ssc = new JavaStreamingContext (conf , new Duration (1000 ));
3236 ssc .checkpoint ("checkpoint" );
3337 }
3438
Original file line number Diff line number Diff line change 1717
1818package org .apache .spark .streaming ;
1919
20+ import org .apache .spark .SparkConf ;
2021import org .apache .spark .streaming .api .java .JavaStreamingContext ;
2122import org .junit .After ;
2223import org .junit .Before ;
@@ -27,8 +28,11 @@ public abstract class LocalJavaStreamingContext {
2728
2829 @ Before
2930 public void setUp () {
30- System .setProperty ("spark.streaming.clock" , "org.apache.spark.streaming.util.ManualClock" );
31- ssc = new JavaStreamingContext ("local[2]" , "test" , new Duration (1000 ));
31+ SparkConf conf = new SparkConf ()
32+ .setMaster ("local[2]" )
33+ .setAppName ("test" )
34+ .set ("spark.streaming.clock" , "org.apache.spark.streaming.util.ManualClock" );
35+ ssc = new JavaStreamingContext (conf , new Duration (1000 ));
3236 ssc .checkpoint ("checkpoint" );
3337 }
3438
Original file line number Diff line number Diff line change 1717
1818package org .apache .spark .streaming ;
1919
20+ import org .apache .spark .SparkConf ;
2021import org .apache .spark .streaming .api .java .JavaStreamingContext ;
2122import org .junit .After ;
2223import org .junit .Before ;
@@ -27,8 +28,11 @@ public abstract class LocalJavaStreamingContext {
2728
2829 @ Before
2930 public void setUp () {
30- System .setProperty ("spark.streaming.clock" , "org.apache.spark.streaming.util.ManualClock" );
31- ssc = new JavaStreamingContext ("local[2]" , "test" , new Duration (1000 ));
31+ SparkConf conf = new SparkConf ()
32+ .setMaster ("local[2]" )
33+ .setAppName ("test" )
34+ .set ("spark.streaming.clock" , "org.apache.spark.streaming.util.ManualClock" );
35+ ssc = new JavaStreamingContext (conf , new Duration (1000 ));
3236 ssc .checkpoint ("checkpoint" );
3337 }
3438
Original file line number Diff line number Diff line change 1717
1818package org .apache .spark .streaming ;
1919
20+ import org .apache .spark .SparkConf ;
2021import org .apache .spark .streaming .api .java .JavaStreamingContext ;
2122import org .junit .After ;
2223import org .junit .Before ;
@@ -27,8 +28,11 @@ public abstract class LocalJavaStreamingContext {
2728
2829 @ Before
2930 public void setUp () {
30- System .setProperty ("spark.streaming.clock" , "org.apache.spark.streaming.util.ManualClock" );
31- ssc = new JavaStreamingContext ("local[2]" , "test" , new Duration (1000 ));
31+ SparkConf conf = new SparkConf ()
32+ .setMaster ("local[2]" )
33+ .setAppName ("test" )
34+ .set ("spark.streaming.clock" , "org.apache.spark.streaming.util.ManualClock" );
35+ ssc = new JavaStreamingContext (conf , new Duration (1000 ));
3236 ssc .checkpoint ("checkpoint" );
3337 }
3438
Original file line number Diff line number Diff line change 1717
1818package org .apache .spark .streaming ;
1919
20+ import org .apache .spark .SparkConf ;
2021import org .apache .spark .streaming .api .java .JavaStreamingContext ;
2122import org .junit .After ;
2223import org .junit .Before ;
@@ -27,8 +28,11 @@ public abstract class LocalJavaStreamingContext {
2728
2829 @ Before
2930 public void setUp () {
30- System .setProperty ("spark.streaming.clock" , "org.apache.spark.streaming.util.ManualClock" );
31- ssc = new JavaStreamingContext ("local[2]" , "test" , new Duration (1000 ));
31+ SparkConf conf = new SparkConf ()
32+ .setMaster ("local[2]" )
33+ .setAppName ("test" )
34+ .set ("spark.streaming.clock" , "org.apache.spark.streaming.util.ManualClock" );
35+ ssc = new JavaStreamingContext (conf , new Duration (1000 ));
3236 ssc .checkpoint ("checkpoint" );
3337 }
3438
You can’t perform that action at this time.
0 commit comments