@SuppressWarnings("unchecked") @Test public void testWindow_applyIf() { Flow flow = Flow.create("TEST"); Dataset<String> dataset = Util.createMockDataset(flow, 2); Windowing<String, ?> windowing = Time.of(Duration.ofHours(1)); Dataset<Long> output = ReduceWindow.of(dataset) .reduceBy(e -> 1L) .withSortedValues((l, r) -> l.compareTo(r)) .applyIf(true, b -> b.windowBy(windowing)) .output(); ReduceWindow<String, String, Long, ?> producer; producer = (ReduceWindow<String, String, Long, ?>) output.getProducer(); assertTrue(producer.windowing instanceof Time); }
public static <IN> ValueBuilder<IN> of(Dataset<IN> input) { return new ValueBuilder<>("ReduceWindow", input); }
ReduceWindow extends StateAwareWindowWiseSingleInputOperator<
        IN, IN, IN, Byte, OUT, W,
            ReduceWindow<IN, VALUE, OUT, W>> { public static <IN> ValueBuilder<IN> of(Dataset<IN> input) { return new ValueBuilder<>("ReduceWindow", input); } }
ReduceWindow extends StateAwareWindowWiseSingleInputOperator<
        IN, IN, IN, Byte, OUT, W,
            ReduceWindow<IN, VALUE, OUT, W>> { public static <IN> ValueBuilder<IN> of(Dataset<IN> input) { return new ValueBuilder<>("ReduceWindow", input); } private  ReduceWindow(
          String name,
          Flow flow,
          Dataset<IN> input,
          UnaryFunction<IN, VALUE> valueExtractor,
          @Nullable Windowing<IN, W> windowing,
          ReduceFunctor<VALUE, OUT> reducer,
          @Nullable BinaryFunction<VALUE, VALUE, Integer> valueComparator); }
ReduceWindow extends StateAwareWindowWiseSingleInputOperator<
        IN, IN, IN, Byte, OUT, W,
            ReduceWindow<IN, VALUE, OUT, W>> { public static <IN> ValueBuilder<IN> of(Dataset<IN> input) { return new ValueBuilder<>("ReduceWindow", input); } private  ReduceWindow(
          String name,
          Flow flow,
          Dataset<IN> input,
          UnaryFunction<IN, VALUE> valueExtractor,
          @Nullable Windowing<IN, W> windowing,
          ReduceFunctor<VALUE, OUT> reducer,
          @Nullable BinaryFunction<VALUE, VALUE, Integer> valueComparator); static ValueBuilder<IN> of(Dataset<IN> input); static OfBuilder named(String name); ReduceFunctor<VALUE, OUT> getReducer(); @SuppressWarnings("unchecked") @Override DAG<Operator<?, ?>> getBasicOps(); }
ReduceWindow extends StateAwareWindowWiseSingleInputOperator<
        IN, IN, IN, Byte, OUT, W,
            ReduceWindow<IN, VALUE, OUT, W>> { public static <IN> ValueBuilder<IN> of(Dataset<IN> input) { return new ValueBuilder<>("ReduceWindow", input); } private  ReduceWindow(
          String name,
          Flow flow,
          Dataset<IN> input,
          UnaryFunction<IN, VALUE> valueExtractor,
          @Nullable Windowing<IN, W> windowing,
          ReduceFunctor<VALUE, OUT> reducer,
          @Nullable BinaryFunction<VALUE, VALUE, Integer> valueComparator); static ValueBuilder<IN> of(Dataset<IN> input); static OfBuilder named(String name); ReduceFunctor<VALUE, OUT> getReducer(); @SuppressWarnings("unchecked") @Override DAG<Operator<?, ?>> getBasicOps();  }