You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by Francesco Guardiani <fr...@ververica.com> on 2021/10/11 13:25:49 UTC

[DISCUSS] Should TableResult implement JDK's Future?

Hi all,
Looking at the TableResult type I was wondering, given the interface has
await methods, should we instead implement the JDK's Future as
Future<CloseableIterator<Row>> and deprecate the await methods?

This should allow users to integrate with other JDK types without going
through the conversion from TableResult to Future/CompletableFuture.

WDYT?

FG

-- 

Francesco Guardiani | Software Engineer

francesco@ververica.com


<https://www.ververica.com/>

Follow us @VervericaData

--

Join Flink Forward <https://flink-forward.org/> - The Apache Flink
Conference

Stream Processing | Event Driven | Real Time

--

Ververica GmbH | Invalidenstrasse 115, 10115 Berlin, Germany

--

Ververica GmbH

Registered at Amtsgericht Charlottenburg: HRB 158244 B

Managing Directors: Karl Anton Wehner, Holger Temme, Yip Park Tung Jason,
Jinwei (Kevin) Zhang

Re: [DISCUSS] Should TableResult implement JDK's Future?

Posted by Marios Trivyzas <ma...@ververica.com>.
To me it sounds like a nice idea, to give the opportunity to users to combine several
tasks together (even outside of flink) with TableResult.

On 2021/10/14 09:37:56, Francesco Guardiani <fr...@ververica.com> wrote: 
> I'm sorry, in the previous mail I was wrong and what I had in mind was the
> CompletableFuture.
> 
> The use case I have in mind is a user that wants to fire say N batch jobs
> and then, after all these are complete, fire a last job. If TableResult
> extends CompletableFuture or has a method to convert to CompletableFuture,
> the user can use the JDK methods to compose async results, like
> CompletableFuture.allOf(taskOne, taskTwo, taskThree). The point of this is
> just to have a better integration with JDK built-in concurrency utilities.
> 
> On Mon, Oct 11, 2021 at 5:01 PM Jark Wu <im...@gmail.com> wrote:
> 
> > Hi Francesco,
> >
> > Do you have a use case for "Future<CloseableIterator<Row>>"?
> > When do users need this?
> >
> > Best,
> > Jark
> >
> > On Mon, 11 Oct 2021 at 21:27, Francesco Guardiani <francesco@ververica.com
> > >
> > wrote:
> >
> > > Hi all,
> > > Looking at the TableResult type I was wondering, given the interface has
> > > await methods, should we instead implement the JDK's Future as
> > > Future<CloseableIterator<Row>> and deprecate the await methods?
> > >
> > > This should allow users to integrate with other JDK types without going
> > > through the conversion from TableResult to Future/CompletableFuture.
> > >
> > > WDYT?
> > >
> > > FG
> > >
> > > --
> > >
> > > Francesco Guardiani | Software Engineer
> > >
> > > francesco@ververica.com
> > >
> > >
> > > <https://www.ververica.com/>
> > >
> > > Follow us @VervericaData
> > >
> > > --
> > >
> > > Join Flink Forward <https://flink-forward.org/> - The Apache Flink
> > > Conference
> > >
> > > Stream Processing | Event Driven | Real Time
> > >
> > > --
> > >
> > > Ververica GmbH | Invalidenstrasse 115, 10115 Berlin, Germany
> > >
> > > --
> > >
> > > Ververica GmbH
> > >
> > > Registered at Amtsgericht Charlottenburg: HRB 158244 B
> > >
> > > Managing Directors: Karl Anton Wehner, Holger Temme, Yip Park Tung Jason,
> > > Jinwei (Kevin) Zhang
> > >
> >
> 

Re: [DISCUSS] Should TableResult implement JDK's Future?

Posted by Francesco Guardiani <fr...@ververica.com>.
I'm sorry, in the previous mail I was wrong and what I had in mind was the
CompletableFuture.

The use case I have in mind is a user that wants to fire say N batch jobs
and then, after all these are complete, fire a last job. If TableResult
extends CompletableFuture or has a method to convert to CompletableFuture,
the user can use the JDK methods to compose async results, like
CompletableFuture.allOf(taskOne, taskTwo, taskThree). The point of this is
just to have a better integration with JDK built-in concurrency utilities.

On Mon, Oct 11, 2021 at 5:01 PM Jark Wu <im...@gmail.com> wrote:

> Hi Francesco,
>
> Do you have a use case for "Future<CloseableIterator<Row>>"?
> When do users need this?
>
> Best,
> Jark
>
> On Mon, 11 Oct 2021 at 21:27, Francesco Guardiani <francesco@ververica.com
> >
> wrote:
>
> > Hi all,
> > Looking at the TableResult type I was wondering, given the interface has
> > await methods, should we instead implement the JDK's Future as
> > Future<CloseableIterator<Row>> and deprecate the await methods?
> >
> > This should allow users to integrate with other JDK types without going
> > through the conversion from TableResult to Future/CompletableFuture.
> >
> > WDYT?
> >
> > FG
> >
> > --
> >
> > Francesco Guardiani | Software Engineer
> >
> > francesco@ververica.com
> >
> >
> > <https://www.ververica.com/>
> >
> > Follow us @VervericaData
> >
> > --
> >
> > Join Flink Forward <https://flink-forward.org/> - The Apache Flink
> > Conference
> >
> > Stream Processing | Event Driven | Real Time
> >
> > --
> >
> > Ververica GmbH | Invalidenstrasse 115, 10115 Berlin, Germany
> >
> > --
> >
> > Ververica GmbH
> >
> > Registered at Amtsgericht Charlottenburg: HRB 158244 B
> >
> > Managing Directors: Karl Anton Wehner, Holger Temme, Yip Park Tung Jason,
> > Jinwei (Kevin) Zhang
> >
>

Re: [DISCUSS] Should TableResult implement JDK's Future?

Posted by Jark Wu <im...@gmail.com>.
Hi Francesco,

Do you have a use case for "Future<CloseableIterator<Row>>"?
When do users need this?

Best,
Jark

On Mon, 11 Oct 2021 at 21:27, Francesco Guardiani <fr...@ververica.com>
wrote:

> Hi all,
> Looking at the TableResult type I was wondering, given the interface has
> await methods, should we instead implement the JDK's Future as
> Future<CloseableIterator<Row>> and deprecate the await methods?
>
> This should allow users to integrate with other JDK types without going
> through the conversion from TableResult to Future/CompletableFuture.
>
> WDYT?
>
> FG
>
> --
>
> Francesco Guardiani | Software Engineer
>
> francesco@ververica.com
>
>
> <https://www.ververica.com/>
>
> Follow us @VervericaData
>
> --
>
> Join Flink Forward <https://flink-forward.org/> - The Apache Flink
> Conference
>
> Stream Processing | Event Driven | Real Time
>
> --
>
> Ververica GmbH | Invalidenstrasse 115, 10115 Berlin, Germany
>
> --
>
> Ververica GmbH
>
> Registered at Amtsgericht Charlottenburg: HRB 158244 B
>
> Managing Directors: Karl Anton Wehner, Holger Temme, Yip Park Tung Jason,
> Jinwei (Kevin) Zhang
>