flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From StefanRRichter <...@git.apache.org>
Subject [GitHub] flink pull request #4963: [FLINK-7475] [core][DataStream API] support update...
Date Wed, 03 Jan 2018 09:49:09 GMT
Github user StefanRRichter commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4963#discussion_r159387760
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapListState.java
---
    @@ -120,4 +121,16 @@ public void add(V value) {
     		a.addAll(b);
     		return a;
     	}
    +
    +	@Override
    +	public void update(List<V> values) throws Exception {
    +		clear();
    +
    +		if (values != null && !values.isEmpty()) {
    +			final N namespace = currentNamespace;
    +			final StateTable<K, N, ArrayList<V>> map = stateTable;
    +
    +			map.put(namespace, new ArrayList<>(values));
    --- End diff --
    
    Why do we need to make a defensive copy of the list?


---

Mime
View raw message