flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From StephanEwen <...@git.apache.org>
Subject [GitHub] flink issue #5735: [FLINK-9036] [core] Add default values to State Descripto...
Date Fri, 11 May 2018 15:16:32 GMT
Github user StephanEwen commented on the issue:

    @aljoscha Would be interested in your opinion here.
    This is basically one of two ways to improve the handling of default values:
      1. Add a default value supplier on the state descriptor (this approach). Advantage is
that you can use this to backwards compatibly handle the previous cases of default values
(including the starting value for folding state)
      2. Add a `T getOrDefault(Supplier<T>)` method to `ValueState`. This might me almost
simpler to do even, and more flexible as it allows for different default values in different
contexts. This can get inefficient though when users naively create an anonymous class for
the supplier (probably not a big deal any more since lambdas) and it breaks with the current
approach, meaning we two different ways for default values that need to work together, one
of which is deprecated, but still needs to be supported until Flink 2.0


View raw message