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-59] Beam FileSystem.setDefaultConfig: remove scheme from the signature. #1826

Closed
wants to merge 2 commits into from

Conversation

peihe
Copy link
Contributor

@peihe peihe commented Jan 24, 2017

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.

@asfbot
Copy link

asfbot commented Jan 24, 2017

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

@peihe
Copy link
Contributor Author

peihe commented Jan 24, 2017

R: @dhalperi

This PR is to fix the NPE in #1808
After the PR is merge, I will need to do a moe pull and update workers to make the defaultConfig available in workers.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 69.727% when pulling d08879f on peihe:file-system-set-default into cb6e0a8 on apache:master.

@asfbot
Copy link

asfbot commented Jan 24, 2017

@@ -108,7 +94,8 @@ static PipelineOptions getDefaultConfig(String scheme) {
static FileSystem getFileSystemInternal(URI uri) {
String lowerCaseScheme = (uri.getScheme() != null
? uri.getScheme().toLowerCase() : LocalFileSystemRegistrar.LOCAL_FILE_SCHEME);
return getRegistrarInternal(lowerCaseScheme).fromOptions(getDefaultConfig(lowerCaseScheme));
return getRegistrarInternal(lowerCaseScheme)
.fromOptions(checkNotNull(defaultConfig, "defaultConfig"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the error message be improved? It seems like if this fails the resolution is complex. Like a runner should have called FileSystems.setDefaultConfigInWorkers? Or the user needs to register a config for the specific URI?

Probably the URI should be in the error message too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Didn't include the URI, since the check fail will happen for any scheme for now.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 69.761% when pulling 974975e on peihe:file-system-set-default into b333487 on apache:master.

@asfbot
Copy link

asfbot commented Jan 24, 2017

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

@peihe
Copy link
Contributor Author

peihe commented Jan 24, 2017

PTAL

}

/**
* Internal method to get {@link FileSystem} for {@code spec}.
*/
@VisibleForTesting
static FileSystem getFileSystemInternal(URI uri) {
checkNotNull(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: checkState(defaultConfig != null to throw the proper exception type. But, I can fix this in the merge if LGTY.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

LGTM

Thanks!

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.008%) to 69.764% when pulling fb54273 on peihe:file-system-set-default into b333487 on apache:master.

@asfbot
Copy link

asfbot commented Jan 24, 2017

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

@asfgit asfgit closed this in e77de7c Jan 24, 2017
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

4 participants