GitHub user bowenli86 opened a pull request:
https://github.com/apache/flink/pull/4963
[FLINK-7475] [core][state backend] support update() in ListState
## What is the purpose of the change
If users want to update the list, they have to do two steps:
```java
listState.clear()
for (Element e : myList) {
listState.add(e);
}
```
We should enable users to do such actions by providing an API
`listState.update(myNewList)`
## Brief change log
- Added `update()` API to `ListState`
- Added and updated unit/IT tests
- Updated Flink doc
`update()` can actually be an API in `AppendingState`, or at least in
`MapState`. We can consider it later.
## Verifying this change
This change added tests and can be verified in
`testListStateAddUpdateAndGet()`
## Does this pull request potentially affect one of the following parts:
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: (yes)
## Documentation
- Does this pull request introduce a new feature? (yes)
- If yes, how is the feature documented? (docs and JavaDocs)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/bowenli86/flink FLINK-7475
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/4963.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #4963
----
commit 6ee905066137bafe2619be24446a7ed3439ec65d
Author: Bowen Li <[email protected]>
Date: 2017-10-27T08:21:20Z
[FLINK-7475] add ListState#update() API and implementations to Flink
commit 390b5656988505c69367118ed295dd83cb7ae784
Author: Bowen Li <[email protected]>
Date: 2017-10-27T08:59:08Z
add IT tests
commit e63baa1fae56681d3760ba833b5da8c0cfbcae1a
Author: Bowen Li <[email protected]>
Date: 2017-10-27T09:04:04Z
update doc
commit 03be4982a490df8d4d8da805916c9a29c9174ebd
Author: Bowen Li <[email protected]>
Date: 2017-10-27T23:17:50Z
format comments
commit 75dcdc134f705a3a997d65d6c547fd3a35d19edd
Author: Bowen Li <[email protected]>
Date: 2017-10-27T23:23:55Z
checkout empty list
commit 18a952c9978b24287c01aa865d8f28beb4fe31ec
Author: Bowen Li <[email protected]>
Date: 2017-10-27T23:42:19Z
format code
commit c4daba92b04d3789aeb7f72419b7fdd36e11177b
Author: Bowen Li <[email protected]>
Date: 2017-10-28T05:12:18Z
add update() to FlinkKafkaConsumerBaseTest
----
---