flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] yanghua commented on a change in pull request #6430: [FLINK-8058][Queryable State]Queryable state should check types
Date Fri, 27 Jul 2018 12:15:54 GMT
yanghua commented on a change in pull request #6430: [FLINK-8058][Queryable State]Queryable
state should check types
URL: https://github.com/apache/flink/pull/6430#discussion_r205752940
 
 

 ##########
 File path: flink-queryable-state/flink-queryable-state-runtime/src/main/java/org/apache/flink/queryablestate/server/KvStateServerHandler.java
 ##########
 @@ -81,6 +83,14 @@ public KvStateServerHandler(
 			} else {
 				byte[] serializedKeyAndNamespace = request.getSerializedKeyAndNamespace();
 
+				StateDescriptor<?, ?> requestStateDescriptor = KvStateSerializer.deserializeStateDescriptor(request.getSerializedStateDescriptor());
+				StateDescriptor<?, ?> registStateDescriptor = kvState.getStateDescriptor();
+
+				Preconditions.checkArgument(requestStateDescriptor.getType().equals(registStateDescriptor.getType()),
+					"State type mismatch, need[" + registStateDescriptor.getType() + "] gotten[" + requestStateDescriptor.getType()
+ "]");
 
 Review comment:
   use string format looks better~

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


With regards,
Apache Git Services

Mime
View raw message