2017-11-27 3 views
0

私はFlinkを初めて使用していますが、カフカコネクタを使用してウィンドウを使用したときに問題が発生しました。windowedFunctionを適用した後にウィンドウに内容が表示されない

コードは次のようである:

val env: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment 

..... 

// a KeyedStream with name as the key 
val eventsStream: KeyedStream[CustomedObject, String] = env 
    .addSource[CustomedObject](source.getSource) 
    .keyBy(c.get("name")) 

// defines a Sliding window assigner with event time 
val windowedStream: WindowedStream[CustomedObject, String, TimeWindow] = eventsStream.window(SlidingEventTimeWindows.of(Time.seconds(2L), Time.seconds(1L))) 

// applys a window function 
val result = windowedStream.apply(
    (key, window, input: Iterable[CustomedObject], out: Collector[(String, TimeWindow)]) => { 
    out.collect((key, window)) 
    } 
) 

問題:私は()eventsStream.printをしようとしたとき、そこコンソールの出力であるが、私は()result.printしようとしたとき、出力はありません。

に関する情報:各ウィンドウの内容の出力がない理由 鍵は、各イベントで値を存在してい

は、誰かが私に教えてもらえますか?

答えて

関連する問題