@Override public void startBundle() { underlying.startBundle(); }
@Override public void startBundle() { doFnRunner.startBundle(); }
@Override public void startBundle() { doFnRunner.startBundle(); }
@Override public void startBundle() { notReadyWindows = new HashSet<>(); underlying.startBundle(); }
@Override public void startBundle() { try (Closeable ignored = MetricsEnvironment.scopedMetricsContainer(container.getMetricsContainer(stepName))) { delegate.startBundle(); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public void startBundle() { try (Closeable ignored = MetricsEnvironment.scopedMetricsContainer(container.getMetricsContainer(stepName))) { delegate.startBundle(); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public void startBundle() { try (Closeable ignored = MetricsEnvironment.scopedMetricsContainer(container.getMetricsContainer(stepName))) { delegate.startBundle(); } catch (IOException e) { throw new RuntimeException(e); } }
/** * Checks whether the bundle is finished or not. * Starts the bundle if it is done. * * TODO #263: Partial Combining for Beam Streaming * We may want to use separate methods for doFnRunner/pushBackRunner * (same applies to the other bundle-related methods) */ final void checkAndInvokeBundle() { if (bundleFinished) { bundleFinished = false; if (pushBackRunner == null) { doFnRunner.startBundle(); } else { pushBackRunner.startBundle(); } prevBundleStartTime = System.currentTimeMillis(); currBundleCount = 0; } currBundleCount += 1; }
@Override public void startBundle() { try (Closeable ignored = MetricsEnvironment.scopedMetricsContainer(metricsContainer())) { delegate.startBundle(); } catch (IOException e) { throw new RuntimeException(e); } }
@Test public void testStartBundleExceptionsWrappedAsUserCodeException() { ThrowingDoFn fn = new ThrowingDoFn(); DoFnRunner<String, String> runner = new SimpleDoFnRunner<>( null, fn, NullSideInputReader.empty(), null, null, Collections.emptyList(), mockStepContext, null, Collections.emptyMap(), WindowingStrategy.of(new GlobalWindows())); thrown.expect(UserCodeException.class); thrown.expectCause(is(fn.exceptionToThrow)); runner.startBundle(); }
doFnRunner.startBundle();
doFnRunner.startBundle();
WindowingStrategy.of(new GlobalWindows())); runner.startBundle();
WindowingStrategy.of(new GlobalWindows())); runner.startBundle();
WindowingStrategy.of(new GlobalWindows())); runner.startBundle(); runner.processElement( WindowedValue.timestampedValueInGlobalWindow(Duration.millis(1L), new Instant(0)));
@Test public void testLateDropping() throws Exception { MetricsContainerImpl container = new MetricsContainerImpl("any"); MetricsEnvironment.setCurrentContainer(container); timerInternals.advanceInputWatermark(new Instant(BoundedWindow.TIMESTAMP_MAX_VALUE)); timerInternals.advanceOutputWatermark(new Instant(BoundedWindow.TIMESTAMP_MAX_VALUE)); DoFn<KV<String, Integer>, Integer> fn = new MyDoFn(); DoFnRunner<KV<String, Integer>, Integer> runner = DoFnRunners.defaultStatefulDoFnRunner( fn, getDoFnRunner(fn), WINDOWING_STRATEGY, new StatefulDoFnRunner.TimeInternalsCleanupTimer(timerInternals, WINDOWING_STRATEGY), new StatefulDoFnRunner.StateInternalsStateCleaner<>( fn, stateInternals, (Coder) WINDOWING_STRATEGY.getWindowFn().windowCoder())); runner.startBundle(); IntervalWindow window = new IntervalWindow(new Instant(0), new Instant(0L + WINDOW_SIZE)); Instant timestamp = new Instant(0); runner.processElement( WindowedValue.of(KV.of("hello", 1), timestamp, window, PaneInfo.NO_FIRING)); long droppedValues = container .getCounter( MetricName.named( StatefulDoFnRunner.class, StatefulDoFnRunner.DROPPED_DUE_TO_LATENESS_COUNTER)) .getCumulative(); assertEquals(1L, droppedValues); runner.finishBundle(); }