/** * Creates a new {@code Trigger} like the this, except that it fires repeatedly whenever the * given {@code Trigger} fires after the watermark has passed the end of the window. */ public AfterWatermarkEarlyAndLate withLateFirings(OnceTrigger lateFirings) { checkNotNull(lateFirings, "Must specify the trigger to use for late firings"); return new AfterWatermarkEarlyAndLate(Never.ever(), lateFirings); }
private <SignalT> PCollectionView<?> expandTyped(PCollection<SignalT> input) { return input .apply(Window.<SignalT>configure().triggering(Never.ever()).discardingFiredPanes()) // Perform a per-window pre-combine so that our performance does not critically depend // on combiner lifting. .apply(ParDo.of(new CollectWindowsFn<>())) .apply(Sample.any(1)) .apply(View.asList()); } }
@Test public void testFireDeadline() throws Exception { assertEquals( BoundedWindow.TIMESTAMP_MAX_VALUE, Never.ever() .getWatermarkThatGuaranteesFiring(new IntervalWindow(new Instant(0), new Instant(10)))); }
@Override public PCollection<Iterable<ValueInSingleWindow<T>>> expand(PCollection<T> input) { WindowFn<?, ?> originalWindowFn = input.getWindowingStrategy().getWindowFn(); return input .apply(Reify.windows()) .apply( WithKeys.<Integer, ValueInSingleWindow<T>>of(0) .withKeyType(new TypeDescriptor<Integer>() {})) .apply( Window.into( new IdentityWindowFn<KV<Integer, ValueInSingleWindow<T>>>( originalWindowFn.windowCoder())) .triggering(Never.ever()) .withAllowedLateness(input.getWindowingStrategy().getAllowedLateness()) .discardingFiredPanes()) // all values have the same key so they all appear as a single output element .apply(GroupByKey.create()) .apply(Values.create()) .setWindowingStrategyInternal(input.getWindowingStrategy()); } }
return AfterPane.elementCountAtLeast(triggerProto.getElementCount().getElementCount()); case NEVER: return Never.ever(); case OR_FINALLY: return fromProto(triggerProto.getOrFinally().getMain())
removeTriggering = Window.<KV<Integer, Iterable<ValueInSingleWindow<T>>>>configure() .triggering(Never.ever()) .discardingFiredPanes() .withAllowedLateness(input.getWindowingStrategy().getAllowedLateness()); "NeverTrigger", Window.<KV<Integer, Iterable<ValueInSingleWindow<T>>>>configure() .triggering(Never.ever()) .withAllowedLateness(input.getWindowingStrategy().getAllowedLateness()) .discardingFiredPanes())
private void testOutputAfterCheckpoint(IsBounded bounded) { PCollection<Integer> outputs = p.apply(Create.of("foo")) .apply(ParDo.of(sdfWithMultipleOutputsPerBlock(bounded, 3))) .apply(Window.<Integer>configure().triggering(Never.ever()).discardingFiredPanes()); PAssert.thatSingleton(outputs.apply(Count.globally())) .isEqualTo((long) SDFWithMultipleOutputsPerBlockBase.MAX_INDEX); p.run(); }
WindowingStrategy.of((WindowFn<?, IntervalWindow>) windowFn) .withTimestampCombiner(TimestampCombiner.EARLIEST) .withTrigger(AfterWatermark.pastEndOfWindow().withLateFirings(Never.ever())) .withMode(AccumulationMode.DISCARDING_FIRED_PANES) .withAllowedLateness(allowedLateness);
"UpdateWindowingStrategy", Window.<Boolean>configure() .triggering(Never.ever()) .withAllowedLateness(Duration.ZERO) .accumulatingFiredPanes());
AfterWatermark.pastEndOfWindow() .withEarlyFirings(AfterPane.elementCountAtLeast(2)) .withLateFirings(Never.ever())) .discardingFiredPanes() .withAllowedLateness(allowedLateness))
toProtoAndBackSpec(AfterPane.elementCountAtLeast(73)), toProtoAndBackSpec(AfterSynchronizedProcessingTime.ofFirstElement()), toProtoAndBackSpec(Never.ever()), toProtoAndBackSpec(DefaultTrigger.of()), toProtoAndBackSpec(AfterProcessingTime.pastFirstElementInPane()),