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/31 05:51:16 UTC

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

tzulitai 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_r289262323
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/api/common/state/StateDescriptor.java
 ##########
 @@ -343,6 +351,9 @@ private void writeObject(final ObjectOutputStream out) throws IOException {
 			// we have a default value
 			out.writeBoolean(true);
 
+			TypeSerializer<T> serializer = serializerAtomicReference.get();
+			checkNotNull(serializer, "Serializer not yet initialized.");
 
 Review comment:
   IMO, would be cleaner to move this check to the beginning of else-branch.
   Moving early-returns / validations as early as possible would improve readability.

----------------------------------------------------------------
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