flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Radu Tudoran <radu.tudo...@huawei.com>
Subject RE: ListState to List
Date Thu, 18 May 2017 01:31:38 GMT
Hi Aljoscha,

Thanks for the clarification. I understand that there might be advantages in some cases not
to have the List-like interface, while in other scenarios (like the one I described there
aren't). Considering this, why not having 2 type of states: ListState and StreamInListState
- users would use the one it is more appropriate. What do you think?

-----Original Message-----
From: Aljoscha Krettek [mailto:aljoscha@apache.org] 
Sent: Thursday, May 18, 2017 12:15 AM
To: dev@flink.apache.org
Subject: Re: ListState to List

The interface is restrictive on purpose because depending on the state backend it might not
be possible to provide a List-like interface. There might be state backends that stream in
the list from somewhere else or other restrictions. If we now allowed a more general interface
here we would possibly prevent optimisations in the future or make certain implementations
very hard to to efficiently.


> On 16. May 2017, at 21:56, Radu Tudoran <radu.tudoran@huawei.com> wrote:
> Hi,
> I would like to work with ListState, more specifically I would need to access the contents
and sort them. For this I would need a collection type (e.g., the List, Array...).
> However, I see that if I have a variable of type <<ListState state=..>> the
only interfaces I have are:
> state.get -> which returns an Iterable Or state.get.getIterator which 
> returns an Iterator
> Basically if I use any of these I need now to copy the contents in an actual List of
Array.  Is there any way to avoid this? ..perhaps there is an implicit type that I can convert

View raw message