You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "xuhuang (Jira)" <ji...@apache.org> on 2025/02/13 09:21:00 UTC

[jira] [Created] (FLINK-37316) Add StateManager#getStateOptional and StateManager#getState methods for DataStream V2

xuhuang created FLINK-37316:
-------------------------------

             Summary: Add StateManager#getStateOptional and StateManager#getState methods for DataStream V2
                 Key: FLINK-37316
                 URL: https://issues.apache.org/jira/browse/FLINK-37316
             Project: Flink
          Issue Type: New Feature
            Reporter: xuhuang


Currently, the `StateManager` only provides the `getState` method. Below is the method signature:

    /**
     * Get the specific list state.
     *
     * @param stateDeclaration of this state.
     * @return the list state corresponds to the state declaration.
     */
    <T> Optional<ListState<T>> getState(ListStateDeclaration<T> stateDeclaration) throws Exception;

In most scenarios, the `getState` method will return a non-empty instance. Therefore, we can consider providing another API that handles errors internally for users and returns the state directly, rather than wrapping it in an Optional.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)