[ https://issues.apache.org/jira/browse/FLINK-8058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16559661#comment-16559661 ]
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_r205753939 ########## File path: flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/client/state/serialization/KvStateSerializer.java ########## @@ -264,4 +269,39 @@ return null; } } + + /** + * Serialize a stateDescriptor to bytes[]. + * @param stateDescriptor the value will be serialized. + * + * @return The serialized values + * @throws IOException On failure during serialization + */ + public static byte[] serializedStateDescriptor(StateDescriptor<?, ?> stateDescriptor) throws IOException { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream out = new ObjectOutputStream(bos); + out.writeObject(stateDescriptor); + out.close(); Review comment: shall we use `try-with-resource` to make sure the stream can be closed? ---------------------------------------------------------------- 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)