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

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

Github user aljoscha commented on the issue:

    https://github.com/apache/flink/pull/5735
  
    I think I'd favour the second approach because the default value is closer 
to where the return value is used. If it's define "far away" when defining the 
state descriptor it's easier for code to get out of sync. But I think both 
approaches would work well.
    
    Though I'm also a bit skeptical about adding the feature again unless a lot 
of people absolutely want it. I can see that it might be useful but in the past 
we prematurely added a lot of API because we thought people might need it and 
now we have a lot of legacy stuff that we need to keep (for example all the 
"source" methods on `StreamingExecutionEnvironment` and the various `write*()` 
methods on `DataStream`. Still not opposed, though.


> Add default value via suppliers
> -------------------------------
>
>                 Key: FLINK-9036
>                 URL: https://issues.apache.org/jira/browse/FLINK-9036
>             Project: Flink
>          Issue Type: Improvement
>          Components: State Backends, Checkpointing
>            Reporter: Stephan Ewen
>            Assignee: Stephan Ewen
>            Priority: Major
>             Fix For: 1.6.0
>
>
> Earlier versions had a default value in {{ValueState}}. We dropped that, 
> because the value would have to be duplicated on each access, to be safe 
> against side effects when using mutable types.
> For convenience, we should re-add the feature, but using a supplier/factory 
> function to create the default value on access.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to