@Override public <X> void output(OutputTag<X> outputTag, X value) { internalContext.output(outputTag, value); } }
public InternalAggregateProcessWindowFunction( AggregateFunction<T, ACC, V> aggFunction, ProcessWindowFunction<V, R, K, W> windowFunction) { super(windowFunction); this.aggFunction = aggFunction; this.ctx = new InternalProcessWindowContext<>(windowFunction); }
@Override public long currentProcessingTime() { return internalContext.currentProcessingTime(); }
@Override public KeyedStateStore windowState() { return internalContext.windowState(); }
@Override public long currentWatermark() { return internalContext.currentWatermark(); }
@Override public KeyedStateStore globalState() { return internalContext.globalState(); }
/** * Emits the contents of the given window using the {@link InternalWindowFunction}. */ @SuppressWarnings("unchecked") private void emitWindowContents(W window, ACC contents) throws Exception { timestampedCollector.setAbsoluteTimestamp(window.maxTimestamp()); processContext.window = window; userFunction.process(triggerContext.key, window, processContext, contents, timestampedCollector); }
@Override public void open(Configuration parameters) throws Exception { super.open(parameters); ProcessAllWindowFunction<V, R, W> wrappedFunction = this.wrappedFunction; this.ctx = new InternalProcessAllWindowContext<>(wrappedFunction); }
@Override public KeyedStateStore windowState() { return internalContext.windowState(); }
@Override public void verifyCorrectTime( OneInputStreamOperatorTestHarness testHarness, InternalWindowFunction.InternalWindowContext context) { assertEquals(testHarness.getProcessingTime(), context.currentProcessingTime()); } }
@Override public void verifyCorrectTime( OneInputStreamOperatorTestHarness testHarness, InternalWindowFunction.InternalWindowContext context) { assertEquals(testHarness.getCurrentWatermark(), context.currentWatermark()); } }
@Override public KeyedStateStore globalState() { return internalContext.globalState(); }
@Override public <X> void output(OutputTag<X> outputTag, X value) { internalContext.output(outputTag, value); } }
public InternalSingleValueProcessWindowFunction(ProcessWindowFunction<IN, OUT, KEY, W> wrappedFunction) { super(wrappedFunction); ctx = new InternalProcessWindowContext<>(wrappedFunction); }
@Override public void open(Configuration parameters) throws Exception { super.open(parameters); ProcessAllWindowFunction<IN, OUT, W> wrappedFunction = this.wrappedFunction; this.ctx = new InternalProcessAllWindowContext<>(wrappedFunction); }
@Override public Object answer(InvocationOnMock invocationOnMock) throws Throwable { InternalWindowFunction.InternalWindowContext context = (InternalWindowFunction.InternalWindowContext) invocationOnMock.getArguments()[2]; context.windowState().getState(valueStateDescriptor).update("hello"); return null; } }).when(mockWindowFunction).process(anyInt(), anyTimeWindow(), anyInternalWindowContext(), anyIntIterable(), WindowOperatorContractTest.<Void>anyCollector());
public InternalIterableProcessWindowFunction(ProcessWindowFunction<IN, OUT, KEY, W> wrappedFunction) { super(wrappedFunction); this.ctx = new InternalProcessWindowContext<>(wrappedFunction); }
@Override public void open(Configuration parameters) throws Exception { super.open(parameters); ProcessAllWindowFunction<IN, OUT, W> wrappedFunction = this.wrappedFunction; this.ctx = new InternalProcessAllWindowContext<>(wrappedFunction); }
@Override public Object answer(InvocationOnMock invocationOnMock) throws Throwable { InternalWindowFunction.InternalWindowContext context = (InternalWindowFunction.InternalWindowContext) invocationOnMock.getArguments()[1]; context.windowState().getState(valueStateDescriptor).clear(); return null; } }).when(mockWindowFunction).clear(anyTimeWindow(), anyInternalWindowContext());