Skip to content

Commit 57741c3

Browse files
add more information on kryo trap
1 parent 29a2ed9 commit 57741c3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ import org.apache.flink.api.common.typeinfo.TypeInformation
3737
val eventStateDescriptor = new ValueStateDescriptor[Option[String]]("event",
3838
classOf[Option[String]])
3939
```
40+
Although `flink-scala-api` does fallback to Kryo silently, above code example will eventually use Kryo. This may happen when old flink-scala-api is already disabled, but this Flink Scala API is not yet properly used: no serializers are used or imported from `org.apache.flinkx.api.serializers._`.
41+
Below code example is the right way to use Scala serializers coming from this library: it completely prevents Kryo from being used. Even if `implicitly` cannot find an appropriate TypeInformation instance for your type `T`, it will fail in compile time.
42+
4043
```scala mdoc:reset-object
4144
import org.apache.flinkx.api.serializers._
4245
import org.apache.flink.api.common.state.ValueStateDescriptor
@@ -47,6 +50,8 @@ val eventStateDescriptor = new ValueStateDescriptor[Option[String]]("event",
4750
implicitly[TypeInformation[Option[String]]])
4851
```
4952

53+
See more on Java types serilization here: [java-types](README.md#java-types)
54+
5055
## Usage
5156

5257
`flink-scala-api` is released to Maven-central for 2.13 and 3. For SBT, add this snippet to `build.sbt`:

0 commit comments

Comments
 (0)