You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beam.apache.org by Kenneth Knowles <kl...@google.com> on 2018/02/01 18:54:44 UTC

[PROPOSAL] Switch from Guava futures vs Java 8 futures

Hi all,

Luke, Thomas, and I had some in-person discussions about the use of Java 8
futures and Guava futures in the portability support code. I wanted to
bring our thoughts to the dev list for feedback.

As background:

 - Java 5+ "Future" lacks the main purpose of future, which is async
chaining.
 - Guava introduced ListenableFuture to do real future-oriented programming
 - Java 8 added CompletionStage which is more-or-less the expected interface

It is still debatable whether Java got it right [1]. But since it is
standardized, doesn't need to be shaded, etc, it is worth trying to just
use it carefully in the right ways. So we thought to propose that we
migrate most uses of Guava futures to Java 8 futures.

What do you think? Have we missed an important problem that would make this
a deal-breaker?

Kenn

[1] e.g.
https://stackoverflow.com/questions/38744943/listenablefuture-vs-completablefuture#comment72041244_39250452
and such discussions are likely to occur whenever you bring it up with
someone who cares a lot about futures :-)

Re: [PROPOSAL] Switch from Guava futures vs Java 8 futures

Posted by Ismaël Mejía <ie...@gmail.com>.
+1

On Thu, Feb 1, 2018 at 9:53 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> +1 indeed
>
> Le 1 févr. 2018 21:34, "Eugene Kirpichov" <ki...@google.com> a écrit :
>>
>> Reducing dependency on Guava in favor of something Java-standard sounds
>> great, +1.
>>
>> On Thu, Feb 1, 2018 at 11:53 AM Reuven Lax <re...@google.com> wrote:
>>>
>>> Unless there's something that doesn't work in Java 8 future, +1 to
>>> migrating.
>>>
>>> On Thu, Feb 1, 2018 at 10:54 AM, Kenneth Knowles <kl...@google.com> wrote:
>>>>
>>>> Hi all,
>>>>
>>>> Luke, Thomas, and I had some in-person discussions about the use of Java
>>>> 8 futures and Guava futures in the portability support code. I wanted to
>>>> bring our thoughts to the dev list for feedback.
>>>>
>>>> As background:
>>>>
>>>>  - Java 5+ "Future" lacks the main purpose of future, which is async
>>>> chaining.
>>>>  - Guava introduced ListenableFuture to do real future-oriented
>>>> programming
>>>>  - Java 8 added CompletionStage which is more-or-less the expected
>>>> interface
>>>>
>>>> It is still debatable whether Java got it right [1]. But since it is
>>>> standardized, doesn't need to be shaded, etc, it is worth trying to just use
>>>> it carefully in the right ways. So we thought to propose that we migrate
>>>> most uses of Guava futures to Java 8 futures.
>>>>
>>>> What do you think? Have we missed an important problem that would make
>>>> this a deal-breaker?
>>>>
>>>> Kenn
>>>>
>>>> [1] e.g.
>>>> https://stackoverflow.com/questions/38744943/listenablefuture-vs-completablefuture#comment72041244_39250452
>>>> and such discussions are likely to occur whenever you bring it up with
>>>> someone who cares a lot about futures :-)
>>>
>>>
>

Re: [PROPOSAL] Switch from Guava futures vs Java 8 futures

Posted by Romain Manni-Bucau <rm...@gmail.com>.
+1 indeed

Le 1 févr. 2018 21:34, "Eugene Kirpichov" <ki...@google.com> a écrit :

> Reducing dependency on Guava in favor of something Java-standard sounds
> great, +1.
>
> On Thu, Feb 1, 2018 at 11:53 AM Reuven Lax <re...@google.com> wrote:
>
>> Unless there's something that doesn't work in Java 8 future, +1 to
>> migrating.
>>
>> On Thu, Feb 1, 2018 at 10:54 AM, Kenneth Knowles <kl...@google.com> wrote:
>>
>>> Hi all,
>>>
>>> Luke, Thomas, and I had some in-person discussions about the use of Java
>>> 8 futures and Guava futures in the portability support code. I wanted to
>>> bring our thoughts to the dev list for feedback.
>>>
>>> As background:
>>>
>>>  - Java 5+ "Future" lacks the main purpose of future, which is async
>>> chaining.
>>>  - Guava introduced ListenableFuture to do real future-oriented
>>> programming
>>>  - Java 8 added CompletionStage which is more-or-less the expected
>>> interface
>>>
>>> It is still debatable whether Java got it right [1]. But since it is
>>> standardized, doesn't need to be shaded, etc, it is worth trying to just
>>> use it carefully in the right ways. So we thought to propose that we
>>> migrate most uses of Guava futures to Java 8 futures.
>>>
>>> What do you think? Have we missed an important problem that would make
>>> this a deal-breaker?
>>>
>>> Kenn
>>>
>>> [1] e.g. https://stackoverflow.com/questions/38744943/
>>> listenablefuture-vs-completablefuture#comment72041244_39250452 and such
>>> discussions are likely to occur whenever you bring it up with someone who
>>> cares a lot about futures :-)
>>>
>>
>>

Re: [PROPOSAL] Switch from Guava futures vs Java 8 futures

Posted by Eugene Kirpichov <ki...@google.com>.
Reducing dependency on Guava in favor of something Java-standard sounds
great, +1.

On Thu, Feb 1, 2018 at 11:53 AM Reuven Lax <re...@google.com> wrote:

> Unless there's something that doesn't work in Java 8 future, +1 to
> migrating.
>
> On Thu, Feb 1, 2018 at 10:54 AM, Kenneth Knowles <kl...@google.com> wrote:
>
>> Hi all,
>>
>> Luke, Thomas, and I had some in-person discussions about the use of Java
>> 8 futures and Guava futures in the portability support code. I wanted to
>> bring our thoughts to the dev list for feedback.
>>
>> As background:
>>
>>  - Java 5+ "Future" lacks the main purpose of future, which is async
>> chaining.
>>  - Guava introduced ListenableFuture to do real future-oriented
>> programming
>>  - Java 8 added CompletionStage which is more-or-less the expected
>> interface
>>
>> It is still debatable whether Java got it right [1]. But since it is
>> standardized, doesn't need to be shaded, etc, it is worth trying to just
>> use it carefully in the right ways. So we thought to propose that we
>> migrate most uses of Guava futures to Java 8 futures.
>>
>> What do you think? Have we missed an important problem that would make
>> this a deal-breaker?
>>
>> Kenn
>>
>> [1] e.g.
>> https://stackoverflow.com/questions/38744943/listenablefuture-vs-completablefuture#comment72041244_39250452
>> and such discussions are likely to occur whenever you bring it up with
>> someone who cares a lot about futures :-)
>>
>
>

Re: [PROPOSAL] Switch from Guava futures vs Java 8 futures

Posted by Reuven Lax <re...@google.com>.
Unless there's something that doesn't work in Java 8 future, +1 to
migrating.

On Thu, Feb 1, 2018 at 10:54 AM, Kenneth Knowles <kl...@google.com> wrote:

> Hi all,
>
> Luke, Thomas, and I had some in-person discussions about the use of Java 8
> futures and Guava futures in the portability support code. I wanted to
> bring our thoughts to the dev list for feedback.
>
> As background:
>
>  - Java 5+ "Future" lacks the main purpose of future, which is async
> chaining.
>  - Guava introduced ListenableFuture to do real future-oriented programming
>  - Java 8 added CompletionStage which is more-or-less the expected
> interface
>
> It is still debatable whether Java got it right [1]. But since it is
> standardized, doesn't need to be shaded, etc, it is worth trying to just
> use it carefully in the right ways. So we thought to propose that we
> migrate most uses of Guava futures to Java 8 futures.
>
> What do you think? Have we missed an important problem that would make
> this a deal-breaker?
>
> Kenn
>
> [1] e.g. https://stackoverflow.com/questions/38744943/listenablefuture-vs-
> completablefuture#comment72041244_39250452 and such discussions are
> likely to occur whenever you bring it up with someone who cares a lot about
> futures :-)
>

Re: [PROPOSAL] Switch from Guava futures vs Java 8 futures

Posted by Kenneth Knowles <kl...@google.com>.
For anyone just following the dev list, this is completed.

On Fri, Feb 2, 2018 at 12:34 AM, Holden Karau <ho...@pigscanfly.ca> wrote:

> For what it's worth there exists a relatively easy Java8 to Scala future
> conversion so this shouldn't cause an issue on the Spark runner.
>
> On Thu, Feb 1, 2018 at 11:22 PM, Alexey Romanenko <
> aromanenko.dev@gmail.com> wrote:
>
>> +1, sounds great!
>>
>> Regards,
>> Alexey
>>
>>
>> On 2 Feb 2018, at 07:14, Thomas Weise <th...@apache.org> wrote:
>>
>> +1
>>
>>
>> On Thu, Feb 1, 2018 at 9:07 PM, Jean-Baptiste Onofré <jb...@nanthrax.net>
>> wrote:
>>
>>> +1
>>>
>>> Regards
>>> JB
>>>
>>> On 02/01/2018 07:54 PM, Kenneth Knowles wrote:
>>> > Hi all,
>>> >
>>> > Luke, Thomas, and I had some in-person discussions about the use of
>>> Java 8
>>> > futures and Guava futures in the portability support code. I wanted to
>>> bring our
>>> > thoughts to the dev list for feedback.
>>> >
>>> > As background:
>>> >
>>> >  - Java 5+ "Future" lacks the main purpose of future, which is async
>>> chaining.
>>> >  - Guava introduced ListenableFuture to do real future-oriented
>>> programming
>>> >  - Java 8 added CompletionStage which is more-or-less the expected
>>> interface
>>> >
>>> > It is still debatable whether Java got it right [1]. But since it is
>>> > standardized, doesn't need to be shaded, etc, it is worth trying to
>>> just use it
>>> > carefully in the right ways. So we thought to propose that we migrate
>>> most uses
>>> > of Guava futures to Java 8 futures.
>>> >
>>> > What do you think? Have we missed an important problem that would make
>>> this a
>>> > deal-breaker?
>>> >
>>> > Kenn
>>> >
>>> > [1]
>>> > e.g. https://stackoverflow.com/questions/38744943/listenable
>>> future-vs-completablefuture#comment72041244_39250452
>>> > and such discussions are likely to occur whenever you bring it up with
>>> someone
>>> > who cares a lot about futures :-)
>>>
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>
>>
>>
>
>
> --
> Twitter: https://twitter.com/holdenkarau
>

Re: [PROPOSAL] Switch from Guava futures vs Java 8 futures

Posted by Holden Karau <ho...@pigscanfly.ca>.
For what it's worth there exists a relatively easy Java8 to Scala future
conversion so this shouldn't cause an issue on the Spark runner.

On Thu, Feb 1, 2018 at 11:22 PM, Alexey Romanenko <ar...@gmail.com>
wrote:

> +1, sounds great!
>
> Regards,
> Alexey
>
>
> On 2 Feb 2018, at 07:14, Thomas Weise <th...@apache.org> wrote:
>
> +1
>
>
> On Thu, Feb 1, 2018 at 9:07 PM, Jean-Baptiste Onofré <jb...@nanthrax.net>
> wrote:
>
>> +1
>>
>> Regards
>> JB
>>
>> On 02/01/2018 07:54 PM, Kenneth Knowles wrote:
>> > Hi all,
>> >
>> > Luke, Thomas, and I had some in-person discussions about the use of
>> Java 8
>> > futures and Guava futures in the portability support code. I wanted to
>> bring our
>> > thoughts to the dev list for feedback.
>> >
>> > As background:
>> >
>> >  - Java 5+ "Future" lacks the main purpose of future, which is async
>> chaining.
>> >  - Guava introduced ListenableFuture to do real future-oriented
>> programming
>> >  - Java 8 added CompletionStage which is more-or-less the expected
>> interface
>> >
>> > It is still debatable whether Java got it right [1]. But since it is
>> > standardized, doesn't need to be shaded, etc, it is worth trying to
>> just use it
>> > carefully in the right ways. So we thought to propose that we migrate
>> most uses
>> > of Guava futures to Java 8 futures.
>> >
>> > What do you think? Have we missed an important problem that would make
>> this a
>> > deal-breaker?
>> >
>> > Kenn
>> >
>> > [1]
>> > e.g. https://stackoverflow.com/questions/38744943/listenable
>> future-vs-completablefuture#comment72041244_39250452
>> > and such discussions are likely to occur whenever you bring it up with
>> someone
>> > who cares a lot about futures :-)
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
>
>


-- 
Twitter: https://twitter.com/holdenkarau

Re: [PROPOSAL] Switch from Guava futures vs Java 8 futures

Posted by Alexey Romanenko <ar...@gmail.com>.
+1, sounds great!

Regards,
Alexey

> On 2 Feb 2018, at 07:14, Thomas Weise <th...@apache.org> wrote:
> 
> +1
> 
> 
> On Thu, Feb 1, 2018 at 9:07 PM, Jean-Baptiste Onofré <jb@nanthrax.net <ma...@nanthrax.net>> wrote:
> +1
> 
> Regards
> JB
> 
> On 02/01/2018 07:54 PM, Kenneth Knowles wrote:
> > Hi all,
> >
> > Luke, Thomas, and I had some in-person discussions about the use of Java 8
> > futures and Guava futures in the portability support code. I wanted to bring our
> > thoughts to the dev list for feedback.
> >
> > As background:
> >
> >  - Java 5+ "Future" lacks the main purpose of future, which is async chaining.
> >  - Guava introduced ListenableFuture to do real future-oriented programming
> >  - Java 8 added CompletionStage which is more-or-less the expected interface
> >  
> > It is still debatable whether Java got it right [1]. But since it is
> > standardized, doesn't need to be shaded, etc, it is worth trying to just use it
> > carefully in the right ways. So we thought to propose that we migrate most uses
> > of Guava futures to Java 8 futures.
> >
> > What do you think? Have we missed an important problem that would make this a
> > deal-breaker?
> >
> > Kenn
> >
> > [1]
> > e.g. https://stackoverflow.com/questions/38744943/listenablefuture-vs-completablefuture#comment72041244_39250452 <https://stackoverflow.com/questions/38744943/listenablefuture-vs-completablefuture#comment72041244_39250452>
> > and such discussions are likely to occur whenever you bring it up with someone
> > who cares a lot about futures :-)
> 
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org <ma...@apache.org>
> http://blog.nanthrax.net <http://blog.nanthrax.net/>
> Talend - http://www.talend.com <http://www.talend.com/>
> 


Re: [PROPOSAL] Switch from Guava futures vs Java 8 futures

Posted by Thomas Weise <th...@apache.org>.
+1


On Thu, Feb 1, 2018 at 9:07 PM, Jean-Baptiste Onofré <jb...@nanthrax.net>
wrote:

> +1
>
> Regards
> JB
>
> On 02/01/2018 07:54 PM, Kenneth Knowles wrote:
> > Hi all,
> >
> > Luke, Thomas, and I had some in-person discussions about the use of Java
> 8
> > futures and Guava futures in the portability support code. I wanted to
> bring our
> > thoughts to the dev list for feedback.
> >
> > As background:
> >
> >  - Java 5+ "Future" lacks the main purpose of future, which is async
> chaining.
> >  - Guava introduced ListenableFuture to do real future-oriented
> programming
> >  - Java 8 added CompletionStage which is more-or-less the expected
> interface
> >
> > It is still debatable whether Java got it right [1]. But since it is
> > standardized, doesn't need to be shaded, etc, it is worth trying to just
> use it
> > carefully in the right ways. So we thought to propose that we migrate
> most uses
> > of Guava futures to Java 8 futures.
> >
> > What do you think? Have we missed an important problem that would make
> this a
> > deal-breaker?
> >
> > Kenn
> >
> > [1]
> > e.g. https://stackoverflow.com/questions/38744943/listenablefuture-vs-
> completablefuture#comment72041244_39250452
> > and such discussions are likely to occur whenever you bring it up with
> someone
> > who cares a lot about futures :-)
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: [PROPOSAL] Switch from Guava futures vs Java 8 futures

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
+1

Regards
JB

On 02/01/2018 07:54 PM, Kenneth Knowles wrote:
> Hi all,
> 
> Luke, Thomas, and I had some in-person discussions about the use of Java 8
> futures and Guava futures in the portability support code. I wanted to bring our
> thoughts to the dev list for feedback.
> 
> As background:
> 
>  - Java 5+ "Future" lacks the main purpose of future, which is async chaining.
>  - Guava introduced ListenableFuture to do real future-oriented programming
>  - Java 8 added CompletionStage which is more-or-less the expected interface
>  
> It is still debatable whether Java got it right [1]. But since it is
> standardized, doesn't need to be shaded, etc, it is worth trying to just use it
> carefully in the right ways. So we thought to propose that we migrate most uses
> of Guava futures to Java 8 futures.
> 
> What do you think? Have we missed an important problem that would make this a
> deal-breaker?
> 
> Kenn
> 
> [1]
> e.g. https://stackoverflow.com/questions/38744943/listenablefuture-vs-completablefuture#comment72041244_39250452
> and such discussions are likely to occur whenever you bring it up with someone
> who cares a lot about futures :-)

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com