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:aljos...@apache.org] 
Sent: Thursday, May 18, 2017 12:15 AM
To: dev@flink.apache.org
Subject: Re: ListState to List

Hi,
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.

Best,
Aljoscha

> On 16. May 2017, at 21:56, Radu Tudoran <radu.tudo...@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 to...
> 

Reply via email to