/** Return tag for state containing the output watermark hold used for elements. */ public static <W extends BoundedWindow> StateTag<WatermarkHoldState> watermarkHoldTagForTimestampCombiner( TimestampCombiner timestampCombiner) { return StateTags.makeSystemTagInternal( StateTags.<W>watermarkStateInternal("hold", timestampCombiner)); }
/** * Create a factory that produces {@link SystemReduceFn} instances that that buffer all of the * input values in persistent state and produces an {@code Iterable<T>}. */ public static <K, T, W extends BoundedWindow> SystemReduceFn<K, T, Iterable<T>, Iterable<T>, W> buffering(final Coder<T> inputCoder) { final StateTag<BagState<T>> bufferTag = StateTags.makeSystemTagInternal(StateTags.bag(BUFFER_NAME, inputCoder)); return new SystemReduceFn<K, T, Iterable<T>, Iterable<T>, W>(bufferTag) { @Override public void prefetchOnMerge(MergingStateAccessor<K, W> state) throws Exception { StateMerging.prefetchBags(state, bufferTag); } @Override public void onMerge(OnMergeContext c) throws Exception { StateMerging.mergeBags(c.state(), bufferTag); } }; }
if (combineFn.getFn() instanceof CombineFnWithContext) { bufferTag = StateTags.makeSystemTagInternal( StateTags.combiningValueWithContext( BUFFER_NAME, StateTags.makeSystemTagInternal( StateTags.combiningValue( BUFFER_NAME,
public MergingActiveWindowSet(WindowFn<Object, W> windowFn, StateInternals state) { this.windowFn = windowFn; StateTag<ValueState<Map<W, Set<W>>>> tag = StateTags.makeSystemTagInternal( StateTags.value( "tree", MapCoder.of(windowFn.windowCoder(), SetCoder.of(windowFn.windowCoder())))); valueState = state.state(StateNamespaces.global(), tag); // Little use trying to prefetch this state since the ReduceFnRunner // is stymied until it is available. activeWindowToStateAddressWindows = emptyIfNull(valueState.read()); originalActiveWindowToStateAddressWindows = deepCopy(activeWindowToStateAddressWindows); }
StateTags.makeSystemTagInternal( StateTags.combiningValueFromInputInternal( "delayed", InstantCoder.of(), Min.naturalOrder()));