/** Prefetch watermark holds in preparation for merging. */ public void prefetchOnMerge(MergingStateAccessor<?, W> context) { Map<W, WatermarkHoldState> map = context.accessInEachMergingWindow(elementHoldTag); WatermarkHoldState result = context.access(elementHoldTag); if (map.isEmpty()) { // Nothing to prefetch. return; } if (map.size() == 1 && map.values().contains(result) && result.getTimestampCombiner().dependsOnlyOnEarliestTimestamp()) { // Nothing to merge if our source and sink is the same. return; } if (result.getTimestampCombiner().dependsOnlyOnWindow()) { // No need to read existing holds since we will just clear. return; } // Prefetch. for (WatermarkHoldState source : map.values()) { source.readLater(); } }
&& result.getTimestampCombiner().dependsOnlyOnEarliestTimestamp()) { } else if (result.getTimestampCombiner().dependsOnlyOnWindow()) { } else { mergedHold = result.getTimestampCombiner().merge(context.window(), mergedHold, sourceOutputTime);