flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Richter <s.rich...@data-artisans.com>
Subject Re: Why ListState of flink don't support update?
Date Thu, 17 Aug 2017 10:00:32 GMT

this is because the list state is intended to be append only. The underlying reason is that
this allows certain optimizations in the underlying datastructures. For example, a list state
for the RocksDB backend can make use of RocksDB’s merge operator and does not require a
full rewrite to the DB on appends.

If you need to have a list that supports this, you could use a value state of type list or
use a map state where you map from list-index -> element.


> Am 17.08.2017 um 06:07 schrieb yunfan123 <yunfanfighting@foxmail.com>:
> If I want to update the list.
> I have to do two steps:
> listState.clear()
> for (Element e : myList) {
>    listState.add(e);
> }
> Why not I update the state by:
> listState.update(myList) ?
> --
> View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Why-ListState-of-flink-don-t-support-update-tp14957.html
> Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.

View raw message