Nico Kruber created FLINK-5651:
----------------------------------

             Summary: state backends: forbid Iterator#remove() from the 
Iterable returned by HeapListState#get()
                 Key: FLINK-5651
                 URL: https://issues.apache.org/jira/browse/FLINK-5651
             Project: Flink
          Issue Type: Improvement
          Components: State Backends, Checkpointing
    Affects Versions: 1.2.0
            Reporter: Nico Kruber
            Assignee: Nico Kruber


The idiom behind AppendingState#get() is to return a copy of the value behind 
or at least not to allow changes to the underlying state storage. However, the 
heap state backend returns the original list and thus is prone to changes.

The returned Iterable offers Iterable#iterator() which in turn offers 
Iterator#remove() that would change the stored state. While we cannot 
efficiently block the user from modifying the objects in the list, we can at 
least prevent him from doing structural changes to the list by forbidding 
Iterator#remove() there.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to