Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEAM-1556] Make PipelineOptions a lazy-singleton and init IOs as par… #2169

Closed
wants to merge 1 commit into from

Conversation

amitsela
Copy link
Member

@amitsela amitsela commented Mar 6, 2017

…t of it.

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.

@amitsela
Copy link
Member Author

amitsela commented Mar 6, 2017

Trying to avoid the need to "figure-out" if a Read/Write requires IO resgistration, I simply put PipelineOptions in a holder that is a lazy-singleton so that it gets deserialized and initialized (registers IO factories) once per JVM.

@amitsela
Copy link
Member Author

amitsela commented Mar 6, 2017

Run Spark RunnableOnService

@amitsela
Copy link
Member Author

amitsela commented Mar 6, 2017

R: @davorbonaci CC: @francesperry
Please check on GCP because I don't have access.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 70.088% when pulling caf7818 on amitsela:BEAM-1556 into 34b38ef on apache:master.

@amitsela
Copy link
Member Author

amitsela commented Mar 6, 2017

ResumeFromCheckpointStreamingTest.testWithResume flakes
is covered by BEAM-1582.

@asfbot
Copy link

asfbot commented Mar 6, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/8142/
--none--

@francesperry
Copy link
Member

Confirmed this fixes the issue for me!

Copy link
Member

@davorbonaci davorbonaci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'll merge, but will leave a few comments afterwards.

@asfgit asfgit closed this in 1fd52f5 Mar 7, 2017
}
}
// register IO factories.
IOChannelUtils.registerIOFactoriesAllowOverride(pipelineOptions);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment after the merge:

Can it happen, in some clusters, that this process on the worker runs multiple pipelines at the same time? If so, different pipelines may have different pipeline options, and the second registration may clobber the first one.

Is this relevant? If not, great. If so, perhaps we should log a JIRA issue for later.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question!
From Spark docs: "Each application gets its own executor processes".
This page in Spark docs should cover it a lot better than me.
So I think a lazy-singleton should work (pretty common pattern for Spark users..).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

@davorbonaci
Copy link
Member

And, thank you so much for fixing this quickly!

@amitsela amitsela deleted the BEAM-1556 branch March 7, 2017 08:11
Sign up for free to 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.

None yet

5 participants