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

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

Github user aljoscha commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2768#discussion_r89160249
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyedStateBackend.java
 ---
    @@ -69,25 +69,26 @@
         * @param stateDescriptor The identifier for the state. This contains 
name and can create a default state value.
     
         * @param <N> The type of the namespace.
    +    * @param <V> The type of the values in the state.
         * @param <S> The type of the state.
         *
         * @return A new key/value state backed by this backend.
         *
         * @throws Exception Exceptions may occur during initialization of the 
state and should be forwarded.
         */
        @SuppressWarnings({"rawtypes", "unchecked"})
    -   <N, S extends State> S getPartitionedState(
    +   <N, V, S extends State<V>> S getPartitionedState(
    --- End diff --
    
    I think we don't need the additional `V` parameter. It's never used and 
`State<?>` works just as while while `State<V>` just pretends to add more type 
safety. Because both ways work I would prefer to go with the solution that 
doesn't add additional generic parameters to methods.
    
    Same holds for `mergePartitionedStates()`.


> Add get() method in State interface
> -----------------------------------
>
>                 Key: FLINK-5023
>                 URL: https://issues.apache.org/jira/browse/FLINK-5023
>             Project: Flink
>          Issue Type: Improvement
>          Components: State Backends, Checkpointing
>            Reporter: Xiaogang Shi
>            Assignee: Xiaogang Shi
>
> Currently, the only method provided by the State interface is `clear()`. I 
> think we should provide another method called `get()` to return the 
> structured value (e.g., value, list, or map) under the current key. 
> In fact, the functionality of `get()` has already been implemented in all 
> types of states: e.g., `value()` in ValueState and `get()` in ListState. The 
> modification to the interface can better abstract these states.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to