[ 
https://issues.apache.org/jira/browse/FLINK-8058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16559663#comment-16559663
 ] 

ASF GitHub Bot commented on FLINK-8058:
---------------------------------------

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_r205753009
 
 

 ##########
 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() + "]");
+                               
Preconditions.checkArgument(requestStateDescriptor.getSerializer().equals(registStateDescriptor.getSerializer()),
+                                       "State value serializer mismatch, need 
[" + registStateDescriptor.getSerializer() + "] gotten[" + 
requestStateDescriptor.getSerializer() + "]");
 
 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:
us...@infra.apache.org


> Queryable state should check types
> ----------------------------------
>
>                 Key: FLINK-8058
>                 URL: https://issues.apache.org/jira/browse/FLINK-8058
>             Project: Flink
>          Issue Type: Improvement
>          Components: Queryable State
>    Affects Versions: 1.4.0
>            Reporter: Chesnay Schepler
>            Assignee: Congxian Qiu
>            Priority: Major
>              Labels: pull-request-available
>
> The queryable state currently doesn't do any type checks on the client or 
> server and generally relies on serializers to catch errors.
> Neither the type of state is checked (ValueState, ListState etc.) nor the 
> type of contained values.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to