@Override public void onEventTime(InternalTimer<K, VoidNamespace> timer) throws Exception { collector.setAbsoluteTimestamp(timer.getTimestamp()); invokeUserFunction(TimeDomain.EVENT_TIME, timer); }
@Override public void open() throws Exception { super.open(); collector = new TimestampedCollector<>(output); }
@Override public void open() throws Exception { super.open(); this.sinkContext = new SimpleContext<>(getProcessingTimeService()); }
@Override public void open() throws Exception { super.open(); collector = new TimestampedCollector<>(output); InternalTimerService<VoidNamespace> internalTimerService = getInternalTimerService("user-timers", VoidNamespaceSerializer.INSTANCE, this); TimerService timerService = new SimpleTimerService(internalTimerService); context = new ContextImpl(userFunction, timerService); onTimerContext = new OnTimerContextImpl(userFunction, timerService); }
@Override public void open() throws Exception { super.open(); collector = new TimestampedCollector<>(output); context = new ContextImpl(userFunction, getProcessingTimeService()); }
@Override public void open() throws Exception { super.open(); collector = new TimestampedCollector<>(output); InternalTimerService<VoidNamespace> internalTimerService = getInternalTimerService("user-timers", VoidNamespaceSerializer.INSTANCE, this); TimerService timerService = new SimpleTimerService(internalTimerService); context = new ContextImpl(userFunction, timerService); onTimerContext = new OnTimerContextImpl(userFunction, timerService); }
public void advanceWatermark(long time) throws Exception { currentWatermark = time; InternalTimer<K, N> timer; while ((timer = eventTimeTimersQueue.peek()) != null && timer.getTimestamp() <= time) { eventTimeTimersQueue.poll(); keyContext.setCurrentKey(timer.getKey()); triggerTarget.onEventTime(timer); } }
public void processWatermark(Watermark mark) throws Exception { if (timeServiceManager != null) { timeServiceManager.advanceWatermark(mark); } output.emitWatermark(mark); }
@Override public void onEventTime(InternalTimer<K, VoidNamespace> timer) throws Exception { collector.setAbsoluteTimestamp(timer.getTimestamp()); invokeUserFunction(TimeDomain.EVENT_TIME, timer); }
@Override public void open() throws Exception { super.open(); this.timerService = getInternalTimerService( "test-timers", VoidNamespaceSerializer.INSTANCE, this); }
@SuppressWarnings("unchecked") public <N> InternalTimerService<N> getInternalTimerService( String name, TimerSerializer<K, N> timerSerializer, Triggerable<K, N> triggerable) { InternalTimerServiceImpl<K, N> timerService = registerOrGetTimerService(name, timerSerializer); timerService.startTimerService( timerSerializer.getKeySerializer(), timerSerializer.getNamespaceSerializer(), triggerable); return timerService; }
@SuppressWarnings("unchecked") private <N> InternalTimerServiceImpl<K, N> registerOrGetTimerService( String serviceName, InternalTimersSnapshot<?, ?> restoredTimersSnapshot) { final TypeSerializer<K> keySerializer = (TypeSerializer<K>) restoredTimersSnapshot.getKeySerializer(); final TypeSerializer<N> namespaceSerializer = (TypeSerializer<N>) restoredTimersSnapshot.getNamespaceSerializer(); TimerSerializer<K, N> timerSerializer = new TimerSerializer<>(keySerializer, namespaceSerializer); return timerServicesManager.registerOrGetTimerService(serviceName, timerSerializer); } }
@Override public void onProcessingTime(InternalTimer<K, VoidNamespace> timer) throws Exception { collector.eraseTimestamp(); invokeUserFunction(TimeDomain.PROCESSING_TIME, timer); }
@Override public void onProcessingTime(InternalTimer<K, VoidNamespace> timer) throws Exception { collector.eraseTimestamp(); invokeUserFunction(TimeDomain.PROCESSING_TIME, timer); }
public void processElements(Collection<StreamRecord<IN>> elements) throws Exception { for (StreamRecord<IN> element: elements) { operator.setKeyContextElement1(element); oneInputOperator.processElement(element); } }
@Override public final void setChainingStrategy(ChainingStrategy strategy) { operator.setChainingStrategy(strategy); } }
/** * This method can be called to indicate that the timer is no longer managed be a timer heap, e.g. because it as * removed. */ void removedFromTimerQueue() { setInternalIndex(NOT_CONTAINED); }
@Override public Object answer(InvocationOnMock invocation) throws Exception { timerService.registerProcessingTimeTimer("ciao", 30); return null; } }).when(mockTriggerable).onProcessingTime(anyInternalTimer());
@Override public void open() throws Exception { super.open(); collector = new TimestampedCollector<OUT>(output); }
public void processElement(StreamRecord<IN> element) throws Exception { operator.setKeyContextElement1(element); oneInputOperator.processElement(element); }