flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-7475) support update() in ListState
Date Wed, 03 Jan 2018 22:56:02 GMT

    [ https://issues.apache.org/jira/browse/FLINK-7475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16310433#comment-16310433
] 

ASF GitHub Bot commented on FLINK-7475:
---------------------------------------

Github user StefanRRichter commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4963#discussion_r159548273
  
    --- Diff: flink-contrib/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBListState.java
---
    @@ -158,4 +158,28 @@ public void mergeNamespaces(N target, Collection<N> sources)
throws Exception {
     			throw new Exception("Error while merging state in RocksDB", e);
     		}
     	}
    +
    +	@Override
    +	public void update(List<V> values) throws Exception {
    +		clear();
    +
    +		if (values != null && !values.isEmpty()) {
    --- End diff --
    
    What I meant, is not a RocksDB question, but a question if the list state should return
`null` or empty iterator if after the user stored an empty list under a key. That might make
a difference and right now, I the caller updates with empty list, the get is identical to
a non-existing mapping (`null`).


> support update() in ListState
> -----------------------------
>
>                 Key: FLINK-7475
>                 URL: https://issues.apache.org/jira/browse/FLINK-7475
>             Project: Flink
>          Issue Type: Improvement
>          Components: Core, DataStream API, State Backends, Checkpointing
>    Affects Versions: 1.4.0
>            Reporter: yf
>            Assignee: Bowen Li
>             Fix For: 1.5.0
>
>
> 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) ?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message