alpinegizmo commented on a change in pull request #7475: [FLINK-11292][doc] 
Update document about how to use new CompositeType…
URL: https://github.com/apache/flink/pull/7475#discussion_r249035603
 
 

 ##########
 File path: docs/dev/stream/state/custom_serialization.md
 ##########
 @@ -223,15 +227,38 @@ the same `TypeSerializerSnapshot` class as their 
snapshot would complicate the i
 This would also be a bad separation of concerns; a single serializer's 
serialization schema,
 configuration, as well as how to restore it, should be consolidated in its own 
dedicated `TypeSerializerSnapshot` class.
 
-#### 3. Use the `CompositeSerializerSnapshot` utility for serializers that 
contain nested serializers
+### Extending `CompositeTypeSerializerSnapshot` for serializer snapshot with 
nested serializers
 
-There may be cases where a `TypeSerializer` relies on other nested 
`TypeSerializer`s; take for example Flink's
-`TupleSerializer`, where it is configured with nested `TypeSerializer`s for 
the tuple fields. In this case,
-the snapshot of the most outer serializer should also contain snapshots of the 
nested serializers.
+Before further explanation, we call the serializer, which relies on other 
nested serializer(s), as "outer" serializer in this context.
+Eamples for this could be `MapSerializer`, `ListSerializer`, 
`GenericArraySerializer`, etc., and take `MapSerializer` for example,
+the map-key and map-value serializers consist as the nested serializers, while 
`MapSerialize` itself is the "outer" serializer.
+In this case, the snapshot of the most outer serializer should also contain 
snapshots of the nested serializers.
+Besides, unlike the former two serializers, `GenericArraySerializer` also 
contains some extra static information, a class of the component type,
+that needs to be persisted beyond the nested component serializer.
 
 Review comment:
   Examples for this could be `MapSerializer`, `ListSerializer`, 
`GenericArraySerializer`, etc.. Considering `MapSerializer`, for example,
   the map-key and map-value serializers would be the nested serializers, while 
`MapSerialize` itself is the "outer" serializer.
   In this case, the snapshot of the outermost serializer should also contain 
snapshots of the nested serializers.
   Also, note that unlike the other two serializers mentioned above, 
`GenericArraySerializer` contains some additional static information (a class 
of the component type)
   that needs to be persisted along with the nested component serializer.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to