Eugenio Gastelum
07/28/2023, 2:31 PMAssigning Operator IDs
It is highly recommended that you specify operator IDs via the uid(String) method. These IDs are used to scope the state of each operator.
DataStream<String> stream = env.
// Stateful source (e.g. Kafka) with ID
.addSource(new StatefulSource())
.uid("source-id") // ID for the source operator
.shuffle()
// Stateful mapper with ID
.map(new StatefulMapper())
.uid("mapper-id") // ID for the mapper
// Stateless printing sink
.print(); // Auto-generated IDSHIVA CHAITANYA
09/06/2023, 3:06 PM