[
https://issues.apache.org/jira/browse/BEAM-2980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16176570#comment-16176570
]
Kenneth Knowles commented on BEAM-2980:
---------------------------------------
Yea, it actually came up because the tests added for BEAM-2975 enforce that
{{isEmpty()}} does *not* take a snapshot.
https://github.com/apache/beam/blob/master/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/ParDoTest.java#L1991
> BagState.isEmpty needs a tighter spec
> -------------------------------------
>
> Key: BEAM-2980
> URL: https://issues.apache.org/jira/browse/BEAM-2980
> Project: Beam
> Issue Type: Bug
> Components: beam-model
> Reporter: Kenneth Knowles
> Assignee: Kenneth Knowles
>
> Consider the following:
> {code}
> BagState<X> myBag = // empty
> ReadableState<Boolean> isMyBagEmpty = myBag.isEmpty();
> myBag.add(bizzle);
> bool empty = isMyBagEmpty.read();
> {code}
> Should {{empty}} be true or false? We need a consistent answer, across all
> kinds of state, when snapshots are required.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)