You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/05/30 08:40:59 UTC

[GitHub] [flink] becketqin commented on a change in pull request #8570: [FLINK-11987] [state] Make serializer lazy initialization thread safe in StateDescriptor

becketqin commented on a change in pull request #8570: [FLINK-11987] [state] Make serializer lazy initialization thread safe in StateDescriptor
URL: https://github.com/apache/flink/pull/8570#discussion_r288906573
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/api/common/state/StateDescriptor.java
 ##########
 @@ -82,8 +87,7 @@
 	/** 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;
+	private final AtomicReference<TypeSerializer<T>> serializerAtomicReference = new AtomicReference<>();
 
 Review comment:
   Should `queryableStateName` and `ttlConfig` also be protected as they are also mutable fields?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services