RichAllWindowFunction的open方法在什么时候被触发
全局window必须通过触发器设置触发条件来进行触发。例如:
val env = StreamExecutionEnvironment.getExecutionEnvironment
env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime)
val source = env.addSource(new SimpleSource)
var triggerTest = EventTimeTrigger.create()
val window = source
.keyBy(_._1)
.window(GlobalWindows.create())
.trigger(CountTrigger.of(1))
.apply(new WindowFunctionTest)
.print().name('GlobalWindows')
env.execute('GlobalWindows')
赞0
踩0