2016-11-23 3 views
1

Flinkでストリームとバッチ処理を並べて実行するのは意味がありますか?Flinkを使用してストリームとバッチ環境を並行して実行する

//calculate median using DataSet (Batch Environment) 
BatchFunctions batch = new BatchFunctions(); 
DataSet<Tuple2<Double, Integer>> dataSet1 = batch.loadDataSetOfOctober2016(); 
double median = batch.getMedianReactionTime(dataSet1); 

// now use the calculated median in the DataStream (stream environment) 
StreamFunctions stream = new StreamFunctions(); 
DataStream<Tuple7<String, String, Integer, String, Date, String, List<Double>>> dataStream1 = stream.getKafkaStream(); 
stream.printPredictionForNextReactionTimeByMedians(dataStream1, median, Time.seconds(10)); 
stream.execute(); 

答えて

2

私はむしろそれをやりたいです。 ストリーミングプロセスがバッチ結果に依存する場合。あなたは事前にバッチ結果を取得し、キューまたはデータベーステーブルに入れて、ストリーミングプロセスは結果を得ることができるので、バッチ結果の変更時に再起動する必要はありません。 ストリーミングプロセスはいくぶん無限です。バッチ処理の結果は、異なる入力で実行する可能性があるため、変更される可能性があります。

+0

ご意見ありがとうございます – lidox

関連する問題