WindowFnTestUtils (Google Cloud Dataflow SDK 1.9.1 API)

Google Cloud Dataflow SDK for Java, version 1.9.1

com.google.cloud.dataflow.sdk.testing

Class WindowFnTestUtils



  • public class WindowFnTestUtils
    extends Object
    A utility class for testing WindowFns.
    • Constructor Detail

      • WindowFnTestUtils

        public WindowFnTestUtils()
    • Method Detail

      • validateNonInterferingOutputTimes

        public static <T,W extends BoundedWindow> void validateNonInterferingOutputTimes(WindowFn<T,W> windowFn,
                                                                                         long timestamp)
                                                                                  throws Exception
        Assigns the given timestamp to windows using the specified windowFn, and verifies that result of windowFn.getOutputTimestamp for each window is within the proper bound.
        Throws:
        Exception
      • validateGetOutputTimestamp

        public static <T,W extends BoundedWindow> void validateGetOutputTimestamp(WindowFn<T,W> windowFn,
                                                                                  long timestamp)
                                                                           throws Exception
        Assigns the given timestamp to windows using the specified windowFn, and verifies that result of windowFn.getOutputTime for later windows (as defined by maxTimestamp won't prevent the watermark from passing the end of earlier windows.

        This verifies that overlapping windows don't interfere at all. Depending on the windowFn this may be stricter than desired.

        Throws:
        Exception
      • validateGetOutputTimestamps

        public static <T,W extends IntervalWindow> void validateGetOutputTimestamps(WindowFn<T,W> windowFn,
                                                                                    OutputTimeFn<? super W> outputTimeFn,
                                                                                    List<List<Long>> timestampsPerWindow)
                                                                             throws Exception
        Verifies that later-ending merged windows from any of the timestamps hold up output of earlier-ending windows, using the provided WindowFn and OutputTimeFn.

        Given a list of lists of timestamps, where each list is expected to merge into a single window with end times in ascending order, assigns and merges windows for each list (as though each were a separate key/user session). Then maps each timestamp in the list according to outputTimeFn.assignOutputTime() and outputTimeFn.combine().

        Verifies that a overlapping windows do not hold each other up via the watermark.

        Throws:
        Exception


이 페이지가 도움이 되었나요? 평가를 부탁드립니다.

다음에 대한 의견 보내기...

도움이 필요하시나요? 지원 페이지를 방문하세요.