beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luke Cwik (JIRA)" <>
Subject [jira] [Commented] (BEAM-2975) Results of should be snapshots of the underlying state
Date Mon, 25 Sep 2017 23:11:00 GMT


Luke Cwik commented on BEAM-2975:

Also, what are the semantics of readLater(), should it return a view of the state when readLater
was called or when read() is called.

@StateId("tag") BagState<Integer> state;
BagState<Integer> laterInts = state.readLater();
Iterable<Integer> ints =;
// what should be inside ints?

How do you expect this to work in the Fn API world since all appends done by the SDK harness
will be doing a blind append so it can't know how many values are within state without reading
it first so code like:
@StateId("tag") BagState<Integer> state;
Iterable<Integer> ints =;
for (int i  = 0; i < big number; ++i) {
// SDK harness writes the appends out to the runner harness.
// Only way to know what ints stored is by having the SDK harness read it all before writing
out so it can limit the length of the ints iterable.

> Results of should be snapshots of the underlying state
> ---------------------------------------------------------------------------
>                 Key: BEAM-2975
>                 URL:
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Daniel Mills
>            Assignee: Daniel Mills
>            Priority: Minor
> Future modification of state should not be reflected in previous calls to read().  For
> @StateId("tag") BagState<Integer> state;
> Iterable<Integer> ints =;
> state.add(17);
> // ints should still be empty here.

This message was sent by Atlassian JIRA

View raw message