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
Conversation
Refer to this link for build results (access rights to CI server needed): |
a5193ae
to
d08879f
Compare
Refer to this link for build results (access rights to CI server needed): Failed Tests: 1beam_PreCommit_Java_MavenInstall/org.apache.beam:beam-sdks-java-core: 1--none-- |
d08879f
to
974975e
Compare
@@ -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")); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Refer to this link for build results (access rights to CI server needed): |
PTAL |
} | ||
|
||
/** | ||
* Internal method to get {@link FileSystem} for {@code spec}. | ||
*/ | ||
@VisibleForTesting | ||
static FileSystem getFileSystemInternal(URI uri) { | ||
checkNotNull( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks!
Refer to this link for build results (access rights to CI server needed): |
Be sure to do all of the following to help us incorporate your contribution
quickly and easily:
[BEAM-<Jira issue #>] Description of pull request
mvn clean verify
. (Even better, enableTravis-CI on your fork and ensure the whole test matrix passes).
<Jira issue #>
in the title with the actual Jira issuenumber, if there is one.
Individual Contributor License Agreement.