Search in sources :

Example 1 with WatermarkStrategy

use of org.apache.flink.api.common.eventtime.WatermarkStrategy in project flink by apache.

the class SavepointWriterWindowITCase method testTumbleWindowWithEvictor.

@Test
public void testTumbleWindowWithEvictor() throws Exception {
    final String savepointPath = getTempDirPath(new AbstractID().toHexString());
    StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
    env.setStateBackend(stateBackend);
    env.setRuntimeMode(RuntimeExecutionMode.AUTOMATIC);
    DataStream<Tuple2<String, Integer>> bootstrapData = env.fromCollection(WORDS).map(word -> Tuple2.of(word, 1)).returns(TUPLE_TYPE_INFO).assignTimestampsAndWatermarks(WatermarkStrategy.<Tuple2<String, Integer>>noWatermarks().withTimestampAssigner((record, ts) -> 2L));
    WindowedStateTransformation<Tuple2<String, Integer>, String, TimeWindow> transformation = OperatorTransformation.bootstrapWith(bootstrapData).keyBy(tuple -> tuple.f0, Types.STRING).window(TumblingEventTimeWindows.of(Time.milliseconds(5))).evictor(CountEvictor.of(1));
    SavepointWriter.newSavepoint(stateBackend, 128).withOperator(UID, windowBootstrap.bootstrap(transformation)).write(savepointPath);
    env.execute("write state");
    WindowedStream<Tuple2<String, Integer>, String, TimeWindow> stream = env.addSource(new MaxWatermarkSource<Tuple2<String, Integer>>()).returns(TUPLE_TYPE_INFO).keyBy(tuple -> tuple.f0).window(TumblingEventTimeWindows.of(Time.milliseconds(5))).evictor(CountEvictor.of(1));
    DataStream<Tuple2<String, Integer>> windowed = windowStream.window(stream).uid(UID);
    CompletableFuture<Collection<Tuple2<String, Integer>>> future = collector.collect(windowed);
    submitJob(savepointPath, env);
    Collection<Tuple2<String, Integer>> results = future.get();
    Assert.assertThat("Incorrect results from bootstrapped windows", results, EVICTOR_MATCHER);
}
Also used : Arrays(java.util.Arrays) Tuple3(org.apache.flink.api.java.tuple.Tuple3) Tuple2(org.apache.flink.api.java.tuple.Tuple2) JobGraph(org.apache.flink.runtime.jobgraph.JobGraph) RunWith(org.junit.runner.RunWith) CompletableFuture(java.util.concurrent.CompletableFuture) CountEvictor(org.apache.flink.streaming.api.windowing.evictors.CountEvictor) EmbeddedRocksDBStateBackend(org.apache.flink.contrib.streaming.state.EmbeddedRocksDBStateBackend) TypeHint(org.apache.flink.api.common.typeinfo.TypeHint) ArrayList(java.util.ArrayList) AggregateFunction(org.apache.flink.api.common.functions.AggregateFunction) StateBackend(org.apache.flink.runtime.state.StateBackend) StreamCollector(org.apache.flink.streaming.util.StreamCollector) WindowedStream(org.apache.flink.streaming.api.datastream.WindowedStream) Collector(org.apache.flink.util.Collector) TimeWindow(org.apache.flink.streaming.api.windowing.windows.TimeWindow) TypeInformation(org.apache.flink.api.common.typeinfo.TypeInformation) ReduceFunction(org.apache.flink.api.common.functions.ReduceFunction) Parameterized(org.junit.runners.Parameterized) AbstractTestBase(org.apache.flink.test.util.AbstractTestBase) Types(org.apache.flink.api.common.typeinfo.Types) Time(org.apache.flink.streaming.api.windowing.time.Time) Iterator(java.util.Iterator) AbstractID(org.apache.flink.util.AbstractID) Collection(java.util.Collection) SingleOutputStreamOperator(org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator) SlidingEventTimeWindows(org.apache.flink.streaming.api.windowing.assigners.SlidingEventTimeWindows) Matchers(org.hamcrest.Matchers) WatermarkStrategy(org.apache.flink.api.common.eventtime.WatermarkStrategy) Test(org.junit.Test) MaxWatermarkSource(org.apache.flink.state.api.utils.MaxWatermarkSource) ProcessWindowFunction(org.apache.flink.streaming.api.functions.windowing.ProcessWindowFunction) Collectors(java.util.stream.Collectors) DataStream(org.apache.flink.streaming.api.datastream.DataStream) WindowFunction(org.apache.flink.streaming.api.functions.windowing.WindowFunction) List(java.util.List) Rule(org.junit.Rule) TumblingEventTimeWindows(org.apache.flink.streaming.api.windowing.assigners.TumblingEventTimeWindows) ClusterClient(org.apache.flink.client.program.ClusterClient) HashMapStateBackend(org.apache.flink.runtime.state.hashmap.HashMapStateBackend) Matcher(org.hamcrest.Matcher) SerializedThrowable(org.apache.flink.util.SerializedThrowable) Optional(java.util.Optional) Assert(org.junit.Assert) RuntimeExecutionMode(org.apache.flink.api.common.RuntimeExecutionMode) SavepointRestoreSettings(org.apache.flink.runtime.jobgraph.SavepointRestoreSettings) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) TimeWindow(org.apache.flink.streaming.api.windowing.windows.TimeWindow) Tuple2(org.apache.flink.api.java.tuple.Tuple2) Collection(java.util.Collection) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) AbstractID(org.apache.flink.util.AbstractID) Test(org.junit.Test)

Example 2 with WatermarkStrategy

use of org.apache.flink.api.common.eventtime.WatermarkStrategy in project flink by apache.

the class SavepointWriterWindowITCase method testSlideWindowWithEvictor.

@Test
public void testSlideWindowWithEvictor() throws Exception {
    final String savepointPath = getTempDirPath(new AbstractID().toHexString());
    StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
    env.setStateBackend(stateBackend);
    env.setRuntimeMode(RuntimeExecutionMode.AUTOMATIC);
    DataStream<Tuple2<String, Integer>> bootstrapData = env.fromCollection(WORDS).map(word -> Tuple2.of(word, 1)).returns(TUPLE_TYPE_INFO).assignTimestampsAndWatermarks(WatermarkStrategy.<Tuple2<String, Integer>>noWatermarks().withTimestampAssigner((record, ts) -> 2L));
    WindowedStateTransformation<Tuple2<String, Integer>, String, TimeWindow> transformation = OperatorTransformation.bootstrapWith(bootstrapData).keyBy(tuple -> tuple.f0, Types.STRING).window(SlidingEventTimeWindows.of(Time.milliseconds(5), Time.milliseconds(1))).evictor(CountEvictor.of(1));
    SavepointWriter.newSavepoint(stateBackend, 128).withOperator(UID, windowBootstrap.bootstrap(transformation)).write(savepointPath);
    env.execute("write state");
    WindowedStream<Tuple2<String, Integer>, String, TimeWindow> stream = env.addSource(new MaxWatermarkSource<Tuple2<String, Integer>>()).returns(TUPLE_TYPE_INFO).keyBy(tuple -> tuple.f0).window(SlidingEventTimeWindows.of(Time.milliseconds(5), Time.milliseconds(1))).evictor(CountEvictor.of(1));
    DataStream<Tuple2<String, Integer>> windowed = windowStream.window(stream).uid(UID);
    CompletableFuture<Collection<Tuple2<String, Integer>>> future = collector.collect(windowed);
    submitJob(savepointPath, env);
    Collection<Tuple2<String, Integer>> results = future.get().stream().distinct().collect(Collectors.toList());
    Assert.assertThat("Incorrect results from bootstrapped windows", results, EVICTOR_MATCHER);
}
Also used : Arrays(java.util.Arrays) Tuple3(org.apache.flink.api.java.tuple.Tuple3) Tuple2(org.apache.flink.api.java.tuple.Tuple2) JobGraph(org.apache.flink.runtime.jobgraph.JobGraph) RunWith(org.junit.runner.RunWith) CompletableFuture(java.util.concurrent.CompletableFuture) CountEvictor(org.apache.flink.streaming.api.windowing.evictors.CountEvictor) EmbeddedRocksDBStateBackend(org.apache.flink.contrib.streaming.state.EmbeddedRocksDBStateBackend) TypeHint(org.apache.flink.api.common.typeinfo.TypeHint) ArrayList(java.util.ArrayList) AggregateFunction(org.apache.flink.api.common.functions.AggregateFunction) StateBackend(org.apache.flink.runtime.state.StateBackend) StreamCollector(org.apache.flink.streaming.util.StreamCollector) WindowedStream(org.apache.flink.streaming.api.datastream.WindowedStream) Collector(org.apache.flink.util.Collector) TimeWindow(org.apache.flink.streaming.api.windowing.windows.TimeWindow) TypeInformation(org.apache.flink.api.common.typeinfo.TypeInformation) ReduceFunction(org.apache.flink.api.common.functions.ReduceFunction) Parameterized(org.junit.runners.Parameterized) AbstractTestBase(org.apache.flink.test.util.AbstractTestBase) Types(org.apache.flink.api.common.typeinfo.Types) Time(org.apache.flink.streaming.api.windowing.time.Time) Iterator(java.util.Iterator) AbstractID(org.apache.flink.util.AbstractID) Collection(java.util.Collection) SingleOutputStreamOperator(org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator) SlidingEventTimeWindows(org.apache.flink.streaming.api.windowing.assigners.SlidingEventTimeWindows) Matchers(org.hamcrest.Matchers) WatermarkStrategy(org.apache.flink.api.common.eventtime.WatermarkStrategy) Test(org.junit.Test) MaxWatermarkSource(org.apache.flink.state.api.utils.MaxWatermarkSource) ProcessWindowFunction(org.apache.flink.streaming.api.functions.windowing.ProcessWindowFunction) Collectors(java.util.stream.Collectors) DataStream(org.apache.flink.streaming.api.datastream.DataStream) WindowFunction(org.apache.flink.streaming.api.functions.windowing.WindowFunction) List(java.util.List) Rule(org.junit.Rule) TumblingEventTimeWindows(org.apache.flink.streaming.api.windowing.assigners.TumblingEventTimeWindows) ClusterClient(org.apache.flink.client.program.ClusterClient) HashMapStateBackend(org.apache.flink.runtime.state.hashmap.HashMapStateBackend) Matcher(org.hamcrest.Matcher) SerializedThrowable(org.apache.flink.util.SerializedThrowable) Optional(java.util.Optional) Assert(org.junit.Assert) RuntimeExecutionMode(org.apache.flink.api.common.RuntimeExecutionMode) SavepointRestoreSettings(org.apache.flink.runtime.jobgraph.SavepointRestoreSettings) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) TimeWindow(org.apache.flink.streaming.api.windowing.windows.TimeWindow) Tuple2(org.apache.flink.api.java.tuple.Tuple2) Collection(java.util.Collection) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) AbstractID(org.apache.flink.util.AbstractID) Test(org.junit.Test)

Example 3 with WatermarkStrategy

use of org.apache.flink.api.common.eventtime.WatermarkStrategy in project flink by apache.

the class SavepointWriterWindowITCase method testTumbleWindow.

@Test
public void testTumbleWindow() throws Exception {
    final String savepointPath = getTempDirPath(new AbstractID().toHexString());
    StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
    env.setStateBackend(stateBackend);
    env.setRuntimeMode(RuntimeExecutionMode.AUTOMATIC);
    DataStream<Tuple2<String, Integer>> bootstrapData = env.fromCollection(WORDS).map(word -> Tuple2.of(word, 1)).returns(TUPLE_TYPE_INFO).assignTimestampsAndWatermarks(WatermarkStrategy.<Tuple2<String, Integer>>noWatermarks().withTimestampAssigner((record, ts) -> 2L));
    WindowedStateTransformation<Tuple2<String, Integer>, String, TimeWindow> transformation = OperatorTransformation.bootstrapWith(bootstrapData).keyBy(tuple -> tuple.f0, Types.STRING).window(TumblingEventTimeWindows.of(Time.milliseconds(5)));
    SavepointWriter.newSavepoint(stateBackend, 128).withOperator(UID, windowBootstrap.bootstrap(transformation)).write(savepointPath);
    env.execute("write state");
    WindowedStream<Tuple2<String, Integer>, String, TimeWindow> stream = env.addSource(new MaxWatermarkSource<Tuple2<String, Integer>>()).returns(TUPLE_TYPE_INFO).keyBy(tuple -> tuple.f0).window(TumblingEventTimeWindows.of(Time.milliseconds(5)));
    DataStream<Tuple2<String, Integer>> windowed = windowStream.window(stream).uid(UID);
    CompletableFuture<Collection<Tuple2<String, Integer>>> future = collector.collect(windowed);
    submitJob(savepointPath, env);
    Collection<Tuple2<String, Integer>> results = future.get();
    Assert.assertThat("Incorrect results from bootstrapped windows", results, STANDARD_MATCHER);
}
Also used : Arrays(java.util.Arrays) Tuple3(org.apache.flink.api.java.tuple.Tuple3) Tuple2(org.apache.flink.api.java.tuple.Tuple2) JobGraph(org.apache.flink.runtime.jobgraph.JobGraph) RunWith(org.junit.runner.RunWith) CompletableFuture(java.util.concurrent.CompletableFuture) CountEvictor(org.apache.flink.streaming.api.windowing.evictors.CountEvictor) EmbeddedRocksDBStateBackend(org.apache.flink.contrib.streaming.state.EmbeddedRocksDBStateBackend) TypeHint(org.apache.flink.api.common.typeinfo.TypeHint) ArrayList(java.util.ArrayList) AggregateFunction(org.apache.flink.api.common.functions.AggregateFunction) StateBackend(org.apache.flink.runtime.state.StateBackend) StreamCollector(org.apache.flink.streaming.util.StreamCollector) WindowedStream(org.apache.flink.streaming.api.datastream.WindowedStream) Collector(org.apache.flink.util.Collector) TimeWindow(org.apache.flink.streaming.api.windowing.windows.TimeWindow) TypeInformation(org.apache.flink.api.common.typeinfo.TypeInformation) ReduceFunction(org.apache.flink.api.common.functions.ReduceFunction) Parameterized(org.junit.runners.Parameterized) AbstractTestBase(org.apache.flink.test.util.AbstractTestBase) Types(org.apache.flink.api.common.typeinfo.Types) Time(org.apache.flink.streaming.api.windowing.time.Time) Iterator(java.util.Iterator) AbstractID(org.apache.flink.util.AbstractID) Collection(java.util.Collection) SingleOutputStreamOperator(org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator) SlidingEventTimeWindows(org.apache.flink.streaming.api.windowing.assigners.SlidingEventTimeWindows) Matchers(org.hamcrest.Matchers) WatermarkStrategy(org.apache.flink.api.common.eventtime.WatermarkStrategy) Test(org.junit.Test) MaxWatermarkSource(org.apache.flink.state.api.utils.MaxWatermarkSource) ProcessWindowFunction(org.apache.flink.streaming.api.functions.windowing.ProcessWindowFunction) Collectors(java.util.stream.Collectors) DataStream(org.apache.flink.streaming.api.datastream.DataStream) WindowFunction(org.apache.flink.streaming.api.functions.windowing.WindowFunction) List(java.util.List) Rule(org.junit.Rule) TumblingEventTimeWindows(org.apache.flink.streaming.api.windowing.assigners.TumblingEventTimeWindows) ClusterClient(org.apache.flink.client.program.ClusterClient) HashMapStateBackend(org.apache.flink.runtime.state.hashmap.HashMapStateBackend) Matcher(org.hamcrest.Matcher) SerializedThrowable(org.apache.flink.util.SerializedThrowable) Optional(java.util.Optional) Assert(org.junit.Assert) RuntimeExecutionMode(org.apache.flink.api.common.RuntimeExecutionMode) SavepointRestoreSettings(org.apache.flink.runtime.jobgraph.SavepointRestoreSettings) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) TimeWindow(org.apache.flink.streaming.api.windowing.windows.TimeWindow) MaxWatermarkSource(org.apache.flink.state.api.utils.MaxWatermarkSource) Tuple2(org.apache.flink.api.java.tuple.Tuple2) Collection(java.util.Collection) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) AbstractID(org.apache.flink.util.AbstractID) Test(org.junit.Test)

Example 4 with WatermarkStrategy

use of org.apache.flink.api.common.eventtime.WatermarkStrategy in project flink by apache.

the class SavepointWindowReaderITCase method testProcessEvictorWindowStateReader.

@Test
public void testProcessEvictorWindowStateReader() throws Exception {
    StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
    env.setStateBackend(getStateBackend());
    env.setParallelism(4);
    env.addSource(createSource(numbers)).rebalance().assignTimestampsAndWatermarks(WatermarkStrategy.<Integer>noWatermarks().withTimestampAssigner((event, timestamp) -> 0)).keyBy(id -> id).window(TumblingEventTimeWindows.of(Time.milliseconds(10))).evictor(new NoOpEvictor<>()).process(new NoOpProcessWindowFunction()).uid(uid).addSink(new DiscardingSink<>());
    String savepointPath = takeSavepoint(env);
    SavepointReader savepoint = SavepointReader.read(env, savepointPath, getStateBackend());
    List<Integer> results = JobResultRetriever.collect(savepoint.window(TumblingEventTimeWindows.of(Time.milliseconds(10))).evictor().process(uid, new BasicReaderFunction(), Types.INT, Types.INT, Types.INT));
    Assert.assertThat("Unexpected results from keyed state", results, Matchers.containsInAnyOrder(numbers));
}
Also used : TimestampedValue(org.apache.flink.streaming.runtime.operators.windowing.TimestampedValue) CountTrigger(org.apache.flink.streaming.api.windowing.triggers.CountTrigger) ReduceSum(org.apache.flink.state.api.utils.ReduceSum) ReducingStateDescriptor(org.apache.flink.api.common.state.ReducingStateDescriptor) PurgingTrigger(org.apache.flink.streaming.api.windowing.triggers.PurgingTrigger) JobResultRetriever(org.apache.flink.state.api.utils.JobResultRetriever) SavepointTestBase(org.apache.flink.state.api.utils.SavepointTestBase) Window(org.apache.flink.streaming.api.windowing.windows.Window) WindowReaderFunction(org.apache.flink.state.api.functions.WindowReaderFunction) StateBackend(org.apache.flink.runtime.state.StateBackend) ReducingState(org.apache.flink.api.common.state.ReducingState) Collector(org.apache.flink.util.Collector) TimeWindow(org.apache.flink.streaming.api.windowing.windows.TimeWindow) LongSerializer(org.apache.flink.api.common.typeutils.base.LongSerializer) ReduceFunction(org.apache.flink.api.common.functions.ReduceFunction) GlobalWindow(org.apache.flink.streaming.api.windowing.windows.GlobalWindow) Types(org.apache.flink.api.common.typeinfo.Types) Time(org.apache.flink.streaming.api.windowing.time.Time) DiscardingSink(org.apache.flink.streaming.api.functions.sink.DiscardingSink) Evictor(org.apache.flink.streaming.api.windowing.evictors.Evictor) Matchers(org.hamcrest.Matchers) WatermarkStrategy(org.apache.flink.api.common.eventtime.WatermarkStrategy) Test(org.junit.Test) AggregateSum(org.apache.flink.state.api.utils.AggregateSum) ProcessWindowFunction(org.apache.flink.streaming.api.functions.windowing.ProcessWindowFunction) WindowFunction(org.apache.flink.streaming.api.functions.windowing.WindowFunction) List(java.util.List) TumblingEventTimeWindows(org.apache.flink.streaming.api.windowing.assigners.TumblingEventTimeWindows) Assert(org.junit.Assert) GlobalWindows(org.apache.flink.streaming.api.windowing.assigners.GlobalWindows) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) Test(org.junit.Test)

Example 5 with WatermarkStrategy

use of org.apache.flink.api.common.eventtime.WatermarkStrategy in project flink by apache.

the class SavepointWindowReaderITCase method testAggregateEvictorWindowStateReader.

@Test
public void testAggregateEvictorWindowStateReader() throws Exception {
    StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
    env.setStateBackend(getStateBackend());
    env.setParallelism(4);
    env.addSource(createSource(numbers)).rebalance().assignTimestampsAndWatermarks(WatermarkStrategy.<Integer>noWatermarks().withTimestampAssigner((event, timestamp) -> 0)).keyBy(id -> id).window(TumblingEventTimeWindows.of(Time.milliseconds(10))).evictor(new NoOpEvictor<>()).aggregate(new AggregateSum()).uid(uid).addSink(new DiscardingSink<>());
    String savepointPath = takeSavepoint(env);
    SavepointReader savepoint = SavepointReader.read(env, savepointPath, getStateBackend());
    List<Integer> results = JobResultRetriever.collect(savepoint.window(TumblingEventTimeWindows.of(Time.milliseconds(10))).evictor().aggregate(uid, new AggregateSum(), Types.INT, Types.INT, Types.INT));
    Assert.assertThat("Unexpected results from keyed state", results, Matchers.containsInAnyOrder(numbers));
}
Also used : TimestampedValue(org.apache.flink.streaming.runtime.operators.windowing.TimestampedValue) CountTrigger(org.apache.flink.streaming.api.windowing.triggers.CountTrigger) ReduceSum(org.apache.flink.state.api.utils.ReduceSum) ReducingStateDescriptor(org.apache.flink.api.common.state.ReducingStateDescriptor) PurgingTrigger(org.apache.flink.streaming.api.windowing.triggers.PurgingTrigger) JobResultRetriever(org.apache.flink.state.api.utils.JobResultRetriever) SavepointTestBase(org.apache.flink.state.api.utils.SavepointTestBase) Window(org.apache.flink.streaming.api.windowing.windows.Window) WindowReaderFunction(org.apache.flink.state.api.functions.WindowReaderFunction) StateBackend(org.apache.flink.runtime.state.StateBackend) ReducingState(org.apache.flink.api.common.state.ReducingState) Collector(org.apache.flink.util.Collector) TimeWindow(org.apache.flink.streaming.api.windowing.windows.TimeWindow) LongSerializer(org.apache.flink.api.common.typeutils.base.LongSerializer) ReduceFunction(org.apache.flink.api.common.functions.ReduceFunction) GlobalWindow(org.apache.flink.streaming.api.windowing.windows.GlobalWindow) Types(org.apache.flink.api.common.typeinfo.Types) Time(org.apache.flink.streaming.api.windowing.time.Time) DiscardingSink(org.apache.flink.streaming.api.functions.sink.DiscardingSink) Evictor(org.apache.flink.streaming.api.windowing.evictors.Evictor) Matchers(org.hamcrest.Matchers) WatermarkStrategy(org.apache.flink.api.common.eventtime.WatermarkStrategy) Test(org.junit.Test) AggregateSum(org.apache.flink.state.api.utils.AggregateSum) ProcessWindowFunction(org.apache.flink.streaming.api.functions.windowing.ProcessWindowFunction) WindowFunction(org.apache.flink.streaming.api.functions.windowing.WindowFunction) List(java.util.List) TumblingEventTimeWindows(org.apache.flink.streaming.api.windowing.assigners.TumblingEventTimeWindows) Assert(org.junit.Assert) GlobalWindows(org.apache.flink.streaming.api.windowing.assigners.GlobalWindows) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) AggregateSum(org.apache.flink.state.api.utils.AggregateSum) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) Test(org.junit.Test)

Aggregations

WatermarkStrategy (org.apache.flink.api.common.eventtime.WatermarkStrategy)25 StreamExecutionEnvironment (org.apache.flink.streaming.api.environment.StreamExecutionEnvironment)25 Collector (org.apache.flink.util.Collector)25 Test (org.junit.Test)25 List (java.util.List)19 ReduceFunction (org.apache.flink.api.common.functions.ReduceFunction)19 TumblingEventTimeWindows (org.apache.flink.streaming.api.windowing.assigners.TumblingEventTimeWindows)19 Time (org.apache.flink.streaming.api.windowing.time.Time)19 ProcessWindowFunction (org.apache.flink.streaming.api.functions.windowing.ProcessWindowFunction)18 WindowFunction (org.apache.flink.streaming.api.functions.windowing.WindowFunction)18 TimeWindow (org.apache.flink.streaming.api.windowing.windows.TimeWindow)18 DataStream (org.apache.flink.streaming.api.datastream.DataStream)17 SingleOutputStreamOperator (org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator)17 Assert (org.junit.Assert)15 Types (org.apache.flink.api.common.typeinfo.Types)13 StateBackend (org.apache.flink.runtime.state.StateBackend)12 Matchers (org.hamcrest.Matchers)12 Tuple2 (org.apache.flink.api.java.tuple.Tuple2)11 Arrays (java.util.Arrays)10 RuntimeExecutionMode (org.apache.flink.api.common.RuntimeExecutionMode)10