carp84 commented on a change in pull request #8570: [FLINK-12688] [state] Make
serializer lazy initialization thread safe in StateDescriptor
URL: https://github.com/apache/flink/pull/8570#discussion_r289273148
##########
File path:
flink-core/src/main/java/org/apache/flink/api/common/state/StateDescriptor.java
##########
@@ -82,8 +88,8 @@
/** The serializer for the type. May be eagerly initialized in the
constructor,
* or lazily once the {@link
#initializeSerializerUnlessSet(ExecutionConfig)} method
* is called. */
- @Nullable
- protected TypeSerializer<T> serializer;
+ @VisibleForTesting
+ protected final AtomicReference<TypeSerializer<T>>
serializerAtomicReference = new AtomicReference<>();
Review comment:
I was a little bit struggling about reducing the visibility but I agree
exposing this original serializer is dangerous. So I agree to reduce the
visibility to private.
And since `StateDescriptor` is annotated as `PublicEvolving`, will add a
release note about this on JIRA. Thanks.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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