File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ This project is a community-maintained fork of official Apache Flink Scala API,
1313` flink-scala-api ` uses a different package name for all api-related classes like ` DataStream ` , so you can do
1414gradual migration of a big project and use both upstream and this versions of scala API in the same project.
1515
16+ ### API
17+
1618The actual migration should be straightforward and simple, replace old import to the new ones:
1719``` scala
1820// original api import
@@ -24,6 +26,27 @@ import org.apache.flinkx.api._
2426import org .apache .flinkx .api .serializers ._
2527```
2628
29+ ### State
30+
31+ Ensure to replace state descriptor constructors using ` Class[T] ` param with constructors using ` TypeInformation[T] ` or ` TypeSerializer[T] ` param:
32+ ``` scala mdoc
33+ import org .apache .flink .api .common .state .ValueStateDescriptor
34+ import org .apache .flink .api .common .typeinfo .TypeInformation
35+
36+ // state using Kryo
37+ val eventStateDescriptor = new ValueStateDescriptor [Option [String ]](" event" ,
38+ classOf [Option [String ]])
39+ ```
40+ ``` scala mdoc:reset-object
41+ import org .apache .flinkx .api .serializers ._
42+ import org .apache .flink .api .common .state .ValueStateDescriptor
43+ import org .apache .flink .api .common .typeinfo .TypeInformation
44+
45+ // state using flink-scala-api
46+ val eventStateDescriptor = new ValueStateDescriptor [Option [String ]](" event" ,
47+ implicitly[TypeInformation [Option [String ]]])
48+ ```
49+
2750## Usage
2851
2952` flink-scala-api ` is released to Maven-central for 2.13 and 3. For SBT, add this snippet to ` build.sbt ` :
You can’t perform that action at this time.
0 commit comments