flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-9036) Add default value via suppliers
Date Wed, 21 Mar 2018 14:33:01 GMT

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

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

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

    https://github.com/apache/flink/pull/5735#discussion_r176099684
  
    --- Diff: flink-core/src/main/java/org/apache/flink/api/common/state/FoldingStateDescriptor.java
---
    @@ -89,7 +89,7 @@ public FoldingStateDescriptor(String name, ACC initialValue, FoldFunction<T,
ACC
     	 * @param typeSerializer The type serializer of the values in the state.
     	 */
     	public FoldingStateDescriptor(String name, ACC initialValue, FoldFunction<T, ACC>
foldFunction, TypeSerializer<ACC> typeSerializer) {
    -		super(name, typeSerializer, initialValue);
    +		super(name, typeSerializer, DefaultValueFactory.create(typeSerializer, requireNonNull(initialValue)));
     		this.foldFunction = requireNonNull(foldFunction);
    --- End diff --
    
    same as above.


> 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)

Mime
View raw message