@Test public void testBuild_Windowing() { Flow flow = Flow.create("TEST"); Dataset<String> dataset = Util.createMockDataset(flow, 2); Dataset<Pair<String, Long>> reduced = ReduceStateByKey.of(dataset) .keyBy(s -> s) .valueBy(s -> 1L) .stateFactory(WordCountState::new) .mergeStatesBy(WordCountState::combine) .windowBy(Time.of(Duration.ofHours(1))) .output(); ReduceStateByKey reduce = (ReduceStateByKey) flow.operators().iterator().next(); assertTrue(reduce.getWindowing() instanceof Time); }
public static <IN> KeyByBuilder<IN> of(Dataset<IN> input) { return new KeyByBuilder<>("ReduceStateByKey", input); }
ReduceStateByKey extends StateAwareWindowWiseSingleInputOperator<
        IN, IN, IN, KEY, Pair<KEY, OUT>, W, ReduceStateByKey<IN, KEY, VALUE, OUT, STATE, W>> { public static <IN> KeyByBuilder<IN> of(Dataset<IN> input) { return new KeyByBuilder<>("ReduceStateByKey", input); } }
ReduceStateByKey extends StateAwareWindowWiseSingleInputOperator<
        IN, IN, IN, KEY, Pair<KEY, OUT>, W, ReduceStateByKey<IN, KEY, VALUE, OUT, STATE, W>> { public static <IN> KeyByBuilder<IN> of(Dataset<IN> input) { return new KeyByBuilder<>("ReduceStateByKey", input); } ReduceStateByKey(String name,
                   Flow flow,
                   Dataset<IN> input,
                   UnaryFunction<IN, KEY> keyExtractor,
                   UnaryFunction<IN, VALUE> valueExtractor,
                   @Nullable Windowing<IN, W> windowing,
                   StateFactory<VALUE, OUT, STATE> stateFactory,
                   StateMerger<VALUE, OUT, STATE> stateMerger,
                   Set<OutputHint> outputHints); }
ReduceStateByKey extends StateAwareWindowWiseSingleInputOperator<
        IN, IN, IN, KEY, Pair<KEY, OUT>, W, ReduceStateByKey<IN, KEY, VALUE, OUT, STATE, W>> { public static <IN> KeyByBuilder<IN> of(Dataset<IN> input) { return new KeyByBuilder<>("ReduceStateByKey", input); } ReduceStateByKey(String name,
                   Flow flow,
                   Dataset<IN> input,
                   UnaryFunction<IN, KEY> keyExtractor,
                   UnaryFunction<IN, VALUE> valueExtractor,
                   @Nullable Windowing<IN, W> windowing,
                   StateFactory<VALUE, OUT, STATE> stateFactory,
                   StateMerger<VALUE, OUT, STATE> stateMerger,
                   Set<OutputHint> outputHints); static KeyByBuilder<IN> of(Dataset<IN> input); static OfBuilder named(String name); StateFactory<VALUE, OUT, STATE> getStateFactory(); StateMerger<VALUE, OUT, STATE> getStateMerger(); UnaryFunction<IN, VALUE> getValueExtractor(); }
ReduceStateByKey extends StateAwareWindowWiseSingleInputOperator<
        IN, IN, IN, KEY, Pair<KEY, OUT>, W, ReduceStateByKey<IN, KEY, VALUE, OUT, STATE, W>> { public static <IN> KeyByBuilder<IN> of(Dataset<IN> input) { return new KeyByBuilder<>("ReduceStateByKey", input); } ReduceStateByKey(String name,
                   Flow flow,
                   Dataset<IN> input,
                   UnaryFunction<IN, KEY> keyExtractor,
                   UnaryFunction<IN, VALUE> valueExtractor,
                   @Nullable Windowing<IN, W> windowing,
                   StateFactory<VALUE, OUT, STATE> stateFactory,
                   StateMerger<VALUE, OUT, STATE> stateMerger,
                   Set<OutputHint> outputHints); static KeyByBuilder<IN> of(Dataset<IN> input); static OfBuilder named(String name); StateFactory<VALUE, OUT, STATE> getStateFactory(); StateMerger<VALUE, OUT, STATE> getStateMerger(); UnaryFunction<IN, VALUE> getValueExtractor();  }