赞
踩
我们以滑动窗口为列,程序采用eventTime,直接上源码:
@PublicEvolving public class EventTimeTrigger extends Trigger<Object, TimeWindow> { private static final long serialVersionUID = 1L; private EventTimeTrigger() { } @Override public TriggerResult onElement(Object element, long timestamp, TimeWindow window, TriggerContext ctx) throws Exception { if (window.maxTimestamp() <= ctx.getCurrentWatermark()) { // if the watermark is already past the window fire immediately return TriggerResult.FIRE; }<
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。