sjwiesman commented on a change in pull request #12253:
URL: https://github.com/apache/flink/pull/12253#discussion_r427550788
##########
File path: docs/dev/event_time.md
##########
@@ -34,30 +34,22 @@ For information about how to use time in Flink programs
refer to
[ProcessFunction]({% link
dev/stream/operators/process_function.md %}).
-* toc
-{:toc}
+A prerequisite for using *event time* processing is setting the right *time
+characteristic*. That setting defines how data stream sources behave (for
+example, whether they will assign timestamps), and what notion of time should
+be used by window operations like `KeyedStream.timeWindow(Time.seconds(30))`.
-## Setting a Time Characteristic
-
-The first part of a Flink DataStream program usually sets the base *time
characteristic*. That setting
-defines how data stream sources behave (for example, whether they will assign
timestamps), and what notion of
-time should be used by window operations like
`KeyedStream.timeWindow(Time.seconds(30))`.
-
-The following example shows a Flink program that aggregates events in hourly
time windows. The behavior of the
-windows adapts with the time characteristic.
+You can set the time characteristic using
+`StreamExecutionEnvironment.setStreamTimeCharacteristic()`:
<div class="codetabs" markdown="1">
<div data-lang="java" markdown="1">
{% highlight java %}
final StreamExecutionEnvironment env =
StreamExecutionEnvironment.getExecutionEnvironment();
-env.setStreamTimeCharacteristic(TimeCharacteristic.ProcessingTime);
-
-// alternatively:
-// env.setStreamTimeCharacteristic(TimeCharacteristic.IngestionTime);
-// env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime);
+env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime);
-DataStream<MyEvent> stream = env.addSource(new
FlinkKafkaConsumer010<MyEvent>(topic, schema, props));
Review comment:
+1
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]