The 0.10.0 release introduced API breaking changes. This guide tries to ease the transition from 0.9.x to 0.10.x. It is highly recommended to update to this release as it includes many improvements all over the system.
DataStream API Java Dependency
The flink-streaming-core dependency has been renamed to flink-streaming-java. For the Scala API dependency, nothing has changed.
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java</artifactId>
<version>0.10.0</version>
</dependency>
DataStream API
Replaced groupBy with keyBy
The groupBy method has been replaced with keyBy, which creates a partitioned stream. Reduce-style operations such as reduce, sum, or fold work on elements that have the same key. You can replace your old groupBy operations directly keyBy.
Aggregations require a partitioned stream
In 0.9.x it was possible to run a aggregations like count, fold, min, minBy, max, maxBy or sum over the entire DataStream without partitioning the stream. This has been removed and you have to partition the stream via keyBy before you can run any of these operations.
Windows
The windowing mechanism has been completely reworked for the 0.10.0 release with support for event time and session windows whereas Flink 0.9.x only supports processing time windows. This is still the default time semantic used in 0.10.0. Check out the DataStream API documentation for an overview of the APIs. The following table gives an overview of how to migrate your windowing code:
0.9.x | 0.10.x | |
---|---|---|
Time windows | ||
Tumbling | stream | stream |
Sliding | stream | stream |
Count Windows | ||
Tumbling | stream | stream |
Sliding | stream | stream |
All Windows (over non-partitioned streams) | ||
Time | stream | stream |
Count | stream | stream |
Removed cross operator
The cross operator has been removed.
Added new operations
- Custom stream partitioning via partitionCustom(Partitioner<K> partitioner, [int field | String field | KeySelector<T, K> keySelector | Keys<T> keys])