[ https://issues.apache.org/jira/browse/FLINK-5023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15646286#comment-15646286 ]
ASF GitHub Bot commented on FLINK-5023: --------------------------------------- GitHub user shixiaogang opened a pull request: https://github.com/apache/flink/pull/2768 [FLINK-5023 & FLINK-5024] Add SimpleStateDescriptor to clarify the concepts Changes in the definition of `State` and `StateDescriptor`: - Add `get()` in the `State` interface. - Remove type serializers of state values from `StateDescriptor`s. - Add `SimpleStateDescriptor` to simplify the construction of `ValueStateDescriptor`, `ReducingStateDescriptor` and `FoldingStateDescriptor`. - Changes the definition of `KeyedStateBackend` and `AbstractKeyedStateBackend` accordingly. - Modify the implementation of `ListStateDescriptor` accordingly. Changes in HeapStateBackend: - Let `AbstractHeapState` not implement the `State` interface. The `clear()` method now is removed from `AbstractHeapState`. - Add `HeapSimpleState` to simplify the implementation of `HeapValueState`, `HeapReducingState` and `HeapFoldingState`. - Change the implementation of `HeapValueState`, `HeapReducingState` and `HeapFoldingState` accordingly. Changes in RocksDBStateBackend: - Let `AbstractRocksDBState` not implement the `State` interface, removing the `clear()` method. Now, `AbstractRocksDBState` does not depend on the types of `State` and `StateDescriptor` any more. - Add `RocksDBSimpleState` to simplify the implementation of `RocksDBValueState`, `RocksDBReducingState` and `RocksDBFoldingState`. - Change the implementation of `RocksDBValueState`, `RocksDBReducingState` and `RocksDBFoldingState` accordingly. Others: - Update the usage of `State`s in the implementation of window operators. - Update the usage of `State`s in unit tests. You can merge this pull request into a Git repository by running: $ git pull https://github.com/alibaba/flink flink-5023 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/2768.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2768 ---- commit 007a93b454e693bc3662f540ac5f33e899ce9058 Author: xiaogang.sxg <xiaogang....@alibaba-inc.com> Date: 2016-11-08T02:38:22Z Refactor the interface of State and StateDescriptor ---- > 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 > > 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)