[
https://issues.apache.org/jira/browse/BEAM-2980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16487964#comment-16487964
]
Ben Chambers edited comment on BEAM-2980 at 5/23/18 8:15 PM:
-------------------------------------------------------------
I think `StateFuture` was considered, but intentionally not used because it
would generally suggest we snapshot the value from the time the future is
created. The intuition behind `ReadableState` should be it is like a ref-cell.
As a reference, when you `read` it you get the current value stored in the
location it references.
This is also why `read()` javadoc indicates the *current* value is returned,
rather than the value from when the `ReadableState` was created.
was (Author: bchambers):
I think `StateFuture` was considered, but intentionally not used because it
would generally suggest we snapshot the value from the time the future is
created. The intuition behind `ReadableState` should be it is like a ref-cell.
As a reference, when you `read` it you get the current value stored in the
location it references.
> 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: Daniel Mills
> Priority: Major
>
> 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
(v7.6.3#76005)