Skip to content

Commit

Permalink
Validates snippets with mdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-daroussin committed Dec 20, 2024
1 parent 172ff9f commit 1fb1acf
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,19 @@ import org.apache.flinkx.api.serializers._

### State

Ensure to replace state descriptor constructors using `Class[T]` param with constructors using `TypeInformation[T]` or `TypeSerializer[T]` param:
```scala
Ensure to replace state descriptor constructors using `Class[T]` param with constructors using `TypeInformation[T]` or `TypeSerializer[T]` param:
```scala mdoc
import org.apache.flink.api.common.state.ValueStateDescriptor
import org.apache.flink.api.common.typeinfo.TypeInformation
// state using Kryo
val eventStateDescriptor = new ValueStateDescriptor[Event]("event", classOf[Event])
val eventStateDescriptor = new ValueStateDescriptor[Option[String]]("event", classOf[Option[String]])
```
```scala
```scala mdoc:reset-object
import org.apache.flinkx.api.serializers._
import org.apache.flink.api.common.state.ValueStateDescriptor
import org.apache.flink.api.common.typeinfo.TypeInformation
// state using flink-scala-api
val eventStateDescriptor = new ValueStateDescriptor[Event]("event", implicitly[TypeInformation[Event]])
val eventStateDescriptor = new ValueStateDescriptor[Option[String]]("event", implicitly[TypeInformation[Option[String]]])
```

## Usage
Expand Down

0 comments on commit 1fb1acf

Please sign in to comment.