Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 92508200D56 for ; Tue, 12 Dec 2017 12:11:52 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 908B4160C0F; Tue, 12 Dec 2017 11:11:52 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 88792160BE7 for ; Tue, 12 Dec 2017 12:11:51 +0100 (CET) Received: (qmail 62840 invoked by uid 500); 12 Dec 2017 11:11:50 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 62828 invoked by uid 99); 12 Dec 2017 11:11:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Dec 2017 11:11:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id B0C6C18070D for ; Tue, 12 Dec 2017 11:11:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.379 X-Spam-Level: *** X-Spam-Status: No, score=3.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id P-I8Nda0R9iE for ; Tue, 12 Dec 2017 11:11:46 +0000 (UTC) Received: from mail-ua0-f173.google.com (mail-ua0-f173.google.com [209.85.217.173]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id C10125FAE1 for ; Tue, 12 Dec 2017 11:11:45 +0000 (UTC) Received: by mail-ua0-f173.google.com with SMTP id q13so14086692uaq.8 for ; Tue, 12 Dec 2017 03:11:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=KymvhkKrjz9G8S5JSDFq4kFl/AQygNVaUO1MZQ0Dk6I=; b=qLnVaRDuLLODq8Zf8BSs0nB+iP0O6PT4Ow8+5iZyrMh+q0GulrVhI3HPAbhrSKVDXu BX545aKszCyPNKDQYMaOG5u91E9ZPa58HzVtLVsSo2JKjZbPXEClUkwmKrd9qZJCkY9b kqIYLmCdfjMWjkBeeNVMlCGjYzP20m/+TJbLmpSAA9c9IugmJpZvM1PghCROvcqnb/Ro 3HYIEKYZUyf2t8bI5/jyRO36gpOPPODL/B67rKmIyIywGHsD4ufh5XW77aDxES8r+3ij YdhDCKSWwMNT5IuMoEqn3yK1B6N4/QbOOiNWUUy23BDiq+dU+aW2lp8sJlZpjNnE+jBz 6o0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=KymvhkKrjz9G8S5JSDFq4kFl/AQygNVaUO1MZQ0Dk6I=; b=k858AURsu3miQWv0mtmmksqHV6RFvRW/XOb+aPjH5ymLjQAM8fN3jcPZVXyyWV93Sf uaZSMwphmzudXDcxsE5U851DcnjicnNIlI7YmxNNXAAh4R1zx/jdKcfIqfA01CTRTZeS 5tCoPPvBC1Ol57ApUvPl2P4SN+8Ih8NsaFnWPndNJm+HBvdJ2XZKRB2CRCox9D5xCvsW oR5hUWNTpvK57AdGy3kTrYtMvTQ52R8zHQREcOIw12Uudi5Gel7yvSXkzHp05gzCCYj/ 2d1pBlm4KnhWyCDDrmzfw4PjeHSSC97nVw5XJ5QQ6ZnNxqICxqTDFGMGnKNndxDdesIf ZDlg== X-Gm-Message-State: AKGB3mKSeNbtC8qPY7yqJcUkXq32PoU2FHZHVc0rWKPANw9pjftPuxHb 0AwYfrywYouXskkyaBKD6dy6BEia4OUYq0JiVPM= X-Google-Smtp-Source: ACJfBotFxyi07qDdIiw9j6wNuU1CP4rNOkJFHP+XUTQlke/gNJXA++hw1q9DsD+F/H4Ve+0PZj82DiS5gFxrvqUCXCk= X-Received: by 10.176.83.37 with SMTP id x34mr3749185uax.29.1513077098954; Tue, 12 Dec 2017 03:11:38 -0800 (PST) MIME-Version: 1.0 References: <1509995885.2977722.1163515256.51D49E8A@webmail.messagingengine.com> <1513047241.516184.1201934328.324519C2@webmail.messagingengine.com> In-Reply-To: <1513047241.516184.1201934328.324519C2@webmail.messagingengine.com> From: Steven Aerts Date: Tue, 12 Dec 2017 11:11:28 +0000 Message-ID: Subject: Re: [DISCUSS] KIP-218: Make KafkaFuture.Function java 8 lambda compatible To: dev@kafka.apache.org Content-Type: multipart/alternative; boundary="94eb2c191c6c0045f7056022b71c" archived-at: Tue, 12 Dec 2017 11:11:52 -0000 --94eb2c191c6c0045f7056022b71c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xavier, Colin and Tom can you line up on this? I don't really mind which solution is chosen, but I think it needs to be done be before I can close the vote. I want to help you with the implementation after a decision has been made. Just let me know. Thanks, Steven Op di 12 dec. 2017 om 03:54 schreef Colin McCabe : > Thanks, Xavier.... we should definitely think about what happens when > exceptions are thrown from these functions. > > I would suggest maybe we should just implement whenComplete, rather than > exposing addWaiter. addWaiter was never intended as a public API, and > it's a little weird. whenComplete is nice because it supports chaining, > and should be more familiar to users of other async APIs. > > best, > Colin > > > On Fri, Dec 8, 2017, at 16:26, Xavier L=C3=A9aut=C3=A9 wrote: > > Hi Steven, > > > > I noticed you are making KafkaFuture.addWaiter(...) public as part of > > your > > PR. This is a very useful method to add =E2=80=93 and you should mentio= n it in > > the > > KIP =E2=80=93 however addWaiter currently doesn't guard against excepti= ons thrown > > inside of the BiConsumer function, which is something we should probabl= y > > fix before making it public. > > > > I was about to make the necessary exception handling changes as part of > > https://github.com/apache/kafka/pull/4308 until someone pointed out you= r > > KIP to me. Since you already have a PR out, it might be worth > > incorporating > > my fixes (and the extra docs), what do you think? > > > > I'll rebase my PR onto yours to make it easier to merge. > > > > Thanks! > > Xavier > > > > > > On Mon, Dec 4, 2017 at 4:03 AM Steven Aerts > > wrote: > > > > > Tom, > > > > > > Thanks for the review. > > > updated the motivation a little bit, it's better, but I have to admit > can > > > be improved. > > > I made addWaiters public. > > > > > > Enjoy, > > > > > > Steven > > > > > > > > > > > > Op ma 4 dec. 2017 om 11:01 schreef Tom Bentley >: > > > > > > > Hi Steven, > > > > > > > > Thanks for updating the KIP. I have a couple of points: > > > > > > > > 1. Typo in the first sentence of the Motivation. Also what does > "empty > > > > public abstract classes with one abstract method" mean -- if it's > got one > > > > abstract method in what way is it empty? > > > > 2.From an entirely self-centred point of view, the main thing that'= s > > > > missing for my work in KIP-183 is that addWaiter() needs to be > public. > > > > > > > > Thanks again, > > > > > > > > Tom > > > > > > > > On 2 December 2017 at 10:07, Steven Aerts > > > wrote: > > > > > > > > > Hi Tom, > > > > > > > > > > I just made changes to the proposal of KIP-218, to make everythin= g > more > > > > > backwards compatible as suggested by Collin. > > > > > For me it is now in a state where starts to become final. > > > > > > > > > > I propose to wait a few days so everybody can take a look and ope= n > the > > > > > votes when I do not receive any major comments. > > > > > > > > > > Does that sound ok for you? > > > > > > > > > > https://cwiki.apache.org/confluence/display/KAFKA/KIP- > > > > > 218%3A+Make+KafkaFuture.Function+java+8+lambda+compatible > > > > > > > > > > Thanks for your patience, > > > > > > > > > > > > > > > Steven > > > > > > > > > > > > > > > Op vr 1 dec. 2017 om 11:55 schreef Tom Bentley < > t.j.bentley@gmail.com > > > >: > > > > > > > > > > > Hi Steven, > > > > > > > > > > > > I'm particularly interested in seeing progress on this KIP as t= he > > > work > > > > > for > > > > > > KIP-183 needs a public version of BiConsumer. do you have any > idea > > > when > > > > > the > > > > > > KIP might be ready for voting? > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Tom > > > > > > > > > > > > On 10 November 2017 at 13:38, Steven Aerts < > steven.aerts@gmail.com> > > > > > wrote: > > > > > > > > > > > > > Collin, Ben, > > > > > > > > > > > > > > Thanks for the input. > > > > > > > > > > > > > > I will work out this proposa, so I get an idea on the impact. > > > > > > > > > > > > > > Do you think it is a good idea to line up the new method name= s > with > > > > > those > > > > > > > of CompletableFuture? > > > > > > > > > > > > > > Thanks, > > > > > > > > > > > > > > > > > > > > > Steven > > > > > > > > > > > > > > Op vr 10 nov. 2017 om 12:12 schreef Ben Stopford < > ben@confluent.io > > > >: > > > > > > > > > > > > > > > Sounds like a good middle ground to me. What do you think > Steven? > > > > > > > > > > > > > > > > On Mon, Nov 6, 2017 at 8:18 PM Colin McCabe < > cmccabe@apache.org> > > > > > > wrote: > > > > > > > > > > > > > > > > > It would definitely be nice to use the jdk8 > > > CompletableFuture. I > > > > > > think > > > > > > > > > that's a bit of a separate discussion, though, since it h= as > > > such > > > > > > heavy > > > > > > > > > compatibility implications. > > > > > > > > > > > > > > > > > > How about making KIP-218 backwards compatible? As a > starting > > > > > point, > > > > > > > you > > > > > > > > > can change KafkaFuture#BiConsumer to an interface with no > > > > > > compatibility > > > > > > > > > implications, since there are currently no public functio= ns > > > > exposed > > > > > > > that > > > > > > > > > use it. That leaves KafkaFuture#Function, which is > publicly > > > used > > > > > > now. > > > > > > > > > > > > > > > > > > For the purposes of KIP-218, how about adding a new > interface > > > > > > > > > FunctionInterface? Then you can add a function like this= : > > > > > > > > > > > > > > > > > > > public abstract KafkaFuture > > > > > thenApply(FunctionInterface > > > > > R> > > > > > > > > > function); > > > > > > > > > > > > > > > > > > And mark the older declaration as deprecated: > > > > > > > > > > > > > > > > > > > @deprecated > > > > > > > > > > public abstract KafkaFuture > thenApply(Function > > > > > > > function); > > > > > > > > > > > > > > > > > > This is a 100% compatible way to make things nicer for > java 8. > > > > > > > > > > > > > > > > > > cheers, > > > > > > > > > Colin > > > > > > > > > > > > > > > > > > > > > > > > > > > On Thu, Nov 2, 2017, at 10:38, Steven Aerts wrote: > > > > > > > > > > Hi Tom, > > > > > > > > > > > > > > > > > > > > Nice observation. > > > > > > > > > > I changed "Rejected Alternatives" section to "Other > > > > > Alternatives", > > > > > > as > > > > > > > > > > I see myself as too much of an outsider to the kafka > > > community > > > > to > > > > > > be > > > > > > > > > > able to decide without this discussion. > > > > > > > > > > > > > > > > > > > > I see two major factors to decide: > > > > > > > > > > - how soon will KIP-118 (drop support of java 7) be > > > > implemented? > > > > > > > > > > - for which reasons do we drop backwards compatibility > for > > > > > public > > > > > > > > > > interfaces marked as Evolving > > > > > > > > > > > > > > > > > > > > If KIP-118 which is scheduled for version 2.0.0 is goin= g > to > > > be > > > > > > > > > > implemented soon, I agree with you that replacing > KafkaFuture > > > > > with > > > > > > > > > > CompletableFuture (or CompletionStage) is a preferable > > > option. > > > > > > > > > > But as I am not familiar with the roadmap it is > difficult to > > > > tell > > > > > > for > > > > > > > > me. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Steven > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 2017-11-02 11:27 GMT+01:00 Tom Bentley < > > > t.j.bentley@gmail.com > > > > >: > > > > > > > > > > > Hi Steven, > > > > > > > > > > > > > > > > > > > > > > I notice you've renamed the template's "Rejected > > > > Alternatives" > > > > > > > > section > > > > > > > > > to > > > > > > > > > > > "Other Alternatives", suggesting they're not rejected > yet > > > > (or, > > > > > if > > > > > > > you > > > > > > > > > have > > > > > > > > > > > rejected them, I think you should give your reasons). > > > > > > > > > > > > > > > > > > > > > > Personally, I'd like to understand the arguments > against > > > > simply > > > > > > > > > replacing > > > > > > > > > > > KafkaFuture with CompletableFuture in Kafka 2.0. In > other > > > > > words, > > > > > > if > > > > > > > > we > > > > > > > > > were > > > > > > > > > > > starting without needing to support Java 7 what would > be > > > the > > > > > > > > arguments > > > > > > > > > for > > > > > > > > > > > having our own KafkaFuture? > > > > > > > > > > > > > > > > > > > > > > Thanks, > > > > > > > > > > > > > > > > > > > > > > Tom > > > > > > > > > > > > > > > > > > > > > > On 1 November 2017 at 16:01, Ted Yu < > yuzhihong@gmail.com> > > > > > wrote: > > > > > > > > > > > > > > > > > > > > > >> KAFKA-4423 is still open. > > > > > > > > > > >> When would Java 7 be dropped ? > > > > > > > > > > >> > > > > > > > > > > >> Thanks > > > > > > > > > > >> > > > > > > > > > > >> On Wed, Nov 1, 2017 at 8:56 AM, Ismael Juma < > > > > > ismael@juma.me.uk> > > > > > > > > > wrote: > > > > > > > > > > >> > > > > > > > > > > >> > On Wed, Nov 1, 2017 at 3:51 PM, Ted Yu < > > > > yuzhihong@gmail.com > > > > > > > > > > > > > > wrote: > > > > > > > > > > >> > > > > > > > > > > > >> > > bq. Wait for a kafka release which will not > support > > > > java 7 > > > > > > > > anymore > > > > > > > > > > >> > > > > > > > > > > > > >> > > Do you want to raise a separate thread for the > above ? > > > > > > > > > > >> > > > > > > > > > > > > >> > > > > > > > > > > > >> > There is already a KIP for this so a separate > thread is > > > > not > > > > > > > > needed. > > > > > > > > > > >> > > > > > > > > > > > >> > Ismael > > > > > > > > > > >> > > > > > > > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --94eb2c191c6c0045f7056022b71c--