From issues-return-166113-archive-asf-public=cust-asf.ponee.io@flink.apache.org Fri May 11 17:16:33 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 67D70180647 for ; Fri, 11 May 2018 17:16:33 +0200 (CEST) Received: (qmail 97128 invoked by uid 500); 11 May 2018 15:16:32 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 97117 invoked by uid 99); 11 May 2018 15:16:32 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2018 15:16:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 461D6DFF06; Fri, 11 May 2018 15:16:32 +0000 (UTC) From: StephanEwen To: issues@flink.apache.org Reply-To: issues@flink.apache.org References: In-Reply-To: Subject: [GitHub] flink issue #5735: [FLINK-9036] [core] Add default values to State Descripto... Content-Type: text/plain Message-Id: <20180511151632.461D6DFF06@git1-us-west.apache.org> Date: Fri, 11 May 2018 15:16:32 +0000 (UTC) Github user StephanEwen commented on the issue: https://github.com/apache/flink/pull/5735 @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)` 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 ---