コード例 #1
0
 @Before
 public void setUp() {
   kafkaTestUtils = new KafkaTestUtils();
   kafkaTestUtils.setup();
   SparkConf sparkConf =
       new SparkConf().setMaster("local[4]").setAppName(this.getClass().getSimpleName());
   ssc = new JavaStreamingContext(sparkConf, Durations.milliseconds(200));
 }
コード例 #2
0
 public SparkOperatorCreater(String appName) throws IOException {
   super(appName);
   properties = new Properties();
   properties.load(
       this.getClass().getClassLoader().getResourceAsStream("spark-cluster.properties"));
   SparkConf conf = new SparkConf().setMaster(this.getMaster()).setAppName(appName);
   conf.set("spark.streaming.ui.retainedBatches", "2000");
   jssc = new JavaStreamingContext(conf, Durations.milliseconds(this.getDurationsMilliseconds()));
 }