@Override protected Dataset<Pair<Integer, Long>> getOutput( Dataset<Pair<Integer, Long>> input) { input = AssignEventTime.of(input).using(Pair::getSecond).output(); return CountByKey.of(input) .keyBy(Pair::getFirst) .windowBy(Time.of(Duration.ofSeconds(1))) .output(); }
@Override protected Dataset<Pair<Integer, Long>> getOutput( Dataset<Pair<Integer, Long>> input) { input = AssignEventTime.of(input).using(Pair::getSecond).output(); return CountByKey.of(input) .keyBy(Pair::getFirst) .windowBy(Time.of(Duration.ofSeconds(1))) .output(); }
@Override protected Dataset<Pair<Integer, Long>> getOutput(Dataset<Integer> input) { // ~ use stable event-time watermark input = AssignEventTime.of(input).using(e -> 0).output(); return CountByKey.of(input) .keyBy(e -> e) .windowBy(Time.of(Duration.ofSeconds(1))) .output(); }
@Override protected Dataset<Pair<Integer, Long>> getOutput(Dataset<Integer> input) { // ~ use stable event-time watermark input = AssignEventTime.of(input).using(e -> 0).output(); return CountByKey.of(input) .keyBy(e -> e) .windowBy(Time.of(Duration.ofSeconds(1))) .output(); }
@Override protected Dataset<Pair<Integer, Long>> getOutput(Dataset<Integer> input) { // ~ use stable event-time watermark input = AssignEventTime.of(input).using(e -> 0).output(); return CountByKey.of(input) .keyBy(e -> e) .windowBy(Time.of(Duration.ofSeconds(1))) .output(); }
@Override protected Dataset<Pair<Integer, Long>> getOutput(Dataset<Integer> input) { // ~ use stable event-time watermark input = AssignEventTime.of(input).using(e -> 0).output(); return CountByKey.of(input) .keyBy(e -> e) .windowBy(Time.of(Duration.ofSeconds(1))) .output(); }
@Test public void testBuild_ImplicitName() { Flow flow = Flow.create("TEST"); Dataset<String> dataset = Util.createMockDataset(flow, 3); CountByKey.of(dataset) .keyBy(s -> s) .output(); CountByKey count = (CountByKey) flow.operators().iterator().next(); assertEquals("CountByKey", count.getName()); }