public final void injectElements(List<TimestampedValue<InputT>> values) throws Exception {
for (TimestampedValue<InputT> value : values) {
WindowTracing.trace("TriggerTester.injectElements: {}", value);
}
Iterable<WindowedValue<InputT>> inputs =
values
.stream()
.map(
input -> {
try {
InputT value = input.getValue();
Instant timestamp = input.getTimestamp();
Collection<W> windows =
windowFn.assignWindows(
new TestAssignContext<W>(
windowFn, value, timestamp, GlobalWindow.INSTANCE));
return WindowedValue.of(value, timestamp, windows, PaneInfo.NO_FIRING);
} catch (Exception e) {
throw new RuntimeException(e);
}
})
.collect(Collectors.toList());
ReduceFnRunner<String, InputT, OutputT, W> runner = createRunner();
runner.processElements(
new LateDataDroppingDoFnRunner.LateDataFilter(objectStrategy, timerInternals)
.filter(KEY, inputs));
runner.persist();
}