You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Stephan Ewen (JIRA)" <ji...@apache.org> on 2015/11/06 14:03:27 UTC

[jira] [Commented] (FLINK-2983) Add StateLoader as an alternative to default KvState

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

Stephan Ewen commented on FLINK-2983:
-------------------------------------

Hmmm, I am not fully sure about this. It seems like another mechanism to work around something quite simple (just manually initialize on null). Adding this is yet another level of interfaces, complexity, method overhead for the common case, ...

At this point (especially heading towards 1.0 where we want to be backwards compatible), I am a bit skeptical about adding extra levels of interfaces for things that are not really problems...

> Add StateLoader as an alternative to default KvState 
> -----------------------------------------------------
>
>                 Key: FLINK-2983
>                 URL: https://issues.apache.org/jira/browse/FLINK-2983
>             Project: Flink
>          Issue Type: Improvement
>          Components: Streaming
>            Reporter: Gyula Fora
>
> To create key-value states the user currently needs to specify a default state value that will be returned on first access. Even though this support nulls for implementing the initialization logic this is not a clean solution.
> I propose to allow the user to pass a StateLoader instance which would load the default state:
> interface StateLoader<I, K,S>{
>     S loadState(K key, I currentInput);
> }
> The default value implementation could also use the state loader logic where the stateloader would just return a copy of the given value on the loadState call.



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