Search in sources :

Example 21 with TransformWatermarks

use of org.apache.beam.runners.direct.WatermarkManager.TransformWatermarks in project beam by apache.

the class EvaluationContext method commitBundles.

private Iterable<? extends CommittedBundle<?>> commitBundles(Iterable<? extends UncommittedBundle<?>> bundles) {
    ImmutableList.Builder<CommittedBundle<?>> completed = ImmutableList.builder();
    for (UncommittedBundle<?> inProgress : bundles) {
        AppliedPTransform<?, ?, ?> producing = graph.getProducer(inProgress.getPCollection());
        TransformWatermarks watermarks = watermarkManager.getWatermarks(producing);
        CommittedBundle<?> committed = inProgress.commit(watermarks.getSynchronizedProcessingOutputTime());
        // filter them out
        if (!Iterables.isEmpty(committed.getElements())) {
            completed.add(committed);
        }
    }
    return completed.build();
}
Also used : TransformWatermarks(org.apache.beam.runners.direct.WatermarkManager.TransformWatermarks) ImmutableList(com.google.common.collect.ImmutableList)

Example 22 with TransformWatermarks

use of org.apache.beam.runners.direct.WatermarkManager.TransformWatermarks in project beam by apache.

the class EvaluationContext method fireAvailableCallbacks.

private void fireAvailableCallbacks(AppliedPTransform<?, ?, ?> producingTransform) {
    TransformWatermarks watermarks = watermarkManager.getWatermarks(producingTransform);
    Instant outputWatermark = watermarks.getOutputWatermark();
    callbackExecutor.fireForWatermark(producingTransform, outputWatermark);
}
Also used : TransformWatermarks(org.apache.beam.runners.direct.WatermarkManager.TransformWatermarks) Instant(org.joda.time.Instant)

Aggregations

TransformWatermarks (org.apache.beam.runners.direct.WatermarkManager.TransformWatermarks)22 Instant (org.joda.time.Instant)18 Test (org.junit.Test)18 ReadableInstant (org.joda.time.ReadableInstant)17 KV (org.apache.beam.sdk.values.KV)5 TimerData (org.apache.beam.runners.core.TimerInternals.TimerData)2 ImmutableList (com.google.common.collect.ImmutableList)1 Collection (java.util.Collection)1 FiredTimers (org.apache.beam.runners.direct.WatermarkManager.FiredTimers)1 TimerUpdate (org.apache.beam.runners.direct.WatermarkManager.TimerUpdate)1 AppliedPTransform (org.apache.beam.sdk.runners.AppliedPTransform)1 PCollection (org.apache.beam.sdk.values.PCollection)1