[
https://issues.apache.org/jira/browse/FLINK-8364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16346406#comment-16346406
]
ASF GitHub Bot commented on FLINK-8364:
---------------------------------------
Github user bowenli86 commented on the issue:
https://github.com/apache/flink/pull/5356
I also agree that changing `get()` API may not be good because it will
break user's logic.
From a user point of view, I found that receiving `null` from `get()` API
is a bit inelegant and confusing. As a user, instinctively, I'd expect an empty
Iterable when there's no state value. In practice, I had to debug several times
and ended up finding the true semantics of `get()`. This is where
`iterator()`'s value lies - to help users avoid such cases.
Frankly, the `iterator()` API is not hard to maintain at all. It only
invokes `get()`, handles the `null` situation, and returns users an empty
iterable.
> Add iterator() to ListState which returns empty iterator when it has no value
> -----------------------------------------------------------------------------
>
> Key: FLINK-8364
> URL: https://issues.apache.org/jira/browse/FLINK-8364
> Project: Flink
> Issue Type: Improvement
> Components: State Backends, Checkpointing
> Affects Versions: 1.4.0
> Reporter: Bowen Li
> Assignee: Bowen Li
> Priority: Major
> Fix For: 1.5.0
>
>
> Add iterator() to ListState which returns empty iterator when it has no value
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)