flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sunjincheng (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FLINK-6018) Minor improvements about `AbstractKeyedStateBackend#getPartitionedState` method
Date Fri, 10 Mar 2017 04:34:38 GMT
sunjincheng created FLINK-6018:

             Summary: Minor improvements about `AbstractKeyedStateBackend#getPartitionedState`
                 Key: FLINK-6018
                 URL: https://issues.apache.org/jira/browse/FLINK-6018
             Project: Flink
          Issue Type: Improvement
          Components: DataStream API, State Backends, Checkpointing
            Reporter: sunjincheng
            Assignee: sunjincheng

The code snippet currently in the `AbstractKeyedStateBackend # getPartitionedState` method,
as follows:
// TODO: This is wrong, it should throw an exception that the initialization has not properly
		if (!stateDescriptor.isSerializerInitialized()) {
			stateDescriptor.initializeSerializerUnlessSet(new ExecutionConfig());
I hope this code has a little improvement to the following:
approach 1: 
According to the `TODO` information  we throw an exception
if (!stateDescriptor.isSerializerInitialized()) {
			throw new IllegalStateException("The serializer of the descriptor has not been initialized!");

approach 2:
Try to initialize and remove `if (!stateDescriptor.isSerializerInitialized()) {` logic.
stateDescriptor.initializeSerializerUnlessSet(new ExecutionConfig());
Meanwhile, If we use the approach 2, I suggest that `AbstractKeyedStateBackend` add a `private
final ExecutionConfig executionConfig` property. then we can change the code like this:
Are the above suggestions reasonable for you? 
Welcome anybody's feedback and corrections.

This message was sent by Atlassian JIRA

View raw message