Skip to content

[BEAM-22] Explicitly use a ConcurrentLinkedQueue in UnboundedReadEvaluatorFactory - #289

Closed
tgroh wants to merge 1 commit into
apache:masterfrom
tgroh:unbounded_evaluator_close_before_requeue
Closed

[BEAM-22] Explicitly use a ConcurrentLinkedQueue in UnboundedReadEvaluatorFactory#289
tgroh wants to merge 1 commit into
apache:masterfrom
tgroh:unbounded_evaluator_close_before_requeue

Conversation

@tgroh

@tgrohtgroh commented May 5, 2016

Copy link
Copy Markdown
Member

Be sure to do all of the following to help us incorporate your contribution
quickly and easily:

  • Make sure the PR title is formatted like:
    [BEAM-<Jira issue #>] Description of pull request
  • Make sure tests pass via mvn clean verify. (Even better, enable
    Travis-CI on your fork and ensure the whole test matrix passes).
  • Replace <Jira issue #> in the title with the actual Jira issue
    number, if there is one.
  • If this contribution is large, please file an Apache
    Individual Contributor License Agreement.

The evaluator may be reused in a different thread, and updates to the
checkpoint must be visible.

@tgroh

tgroh commented May 5, 2016

Copy link
Copy Markdown
MemberAuthor

R: @dhalperi

@dhalperi

Copy link
Copy Markdown
Contributor

Can you say more about why? Is there a test that can add?

@tgroh
tgrohforce-pushed the unbounded_evaluator_close_before_requeue branch from e6ba15d to febc608CompareMay 6, 2016 21:51
@tgrohtgroh changed the title [BEAM-22] Mark CheckpointMark as volatile in UnboundedReadEvaluator[BEAM-22] Explicitly use a ConcurrentLinkedQueue in UnboundedReadEvaluatorFactoryMay 6, 2016
@tgroh
tgrohforce-pushed the unbounded_evaluator_close_before_requeue branch from febc608 to 263f436CompareMay 6, 2016 21:53
@tgroh

tgroh commented May 9, 2016

Copy link
Copy Markdown
MemberAuthor

Updated the description; changed what's actually being implemented.

There must be a visibility restriction between uses of the evaluators - as an evaluator may be used by different threads, any update to the state of that evaluator must be visible between uses. ConcurrentLinkedQueue provides a happens-before relationship between offering an element to the queue and polling it from that queue.

As we offer the evaluator to the queue after completing any updates to the evaluator state, this ensures that reads to the value of CheckpointMark are consistent with the writes to that value.

@tgroh
tgrohforce-pushed the unbounded_evaluator_close_before_requeue branch from 263f436 to 05f8d88CompareMay 9, 2016 17:15
@dhalperi

Copy link
Copy Markdown
Contributor

LGTM

@asfgitasfgit closed this in 31da925May 9, 2016
iemejia pushed a commit to iemejia/beam that referenced this pull request Jan 12, 2018
pl04351820 pushed a commit to pl04351820/beam that referenced this pull request Dec 20, 2023
PEP 484 specifies that they be hinted as the type of a single element,
as seen from the caller's perspective.
Closesapache#289.
Co-authored-by: Christopher Wilcox <crwilcox@google.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@tgroh@dhalperi