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-2005] Move getScheme from FileSystemRegistrar to FileSystem #2757

Closed
wants to merge 4 commits into from

Conversation

lukecwik
Copy link
Member

@lukecwik lukecwik commented Apr 28, 2017

Note that I needed to update FileSystems to instantiate the FileSystem(s) upfront instead of remembering the mapping from scheme to registrar during "registration" of the PipelineOptions.

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.

@lukecwik
Copy link
Member Author

R: @dhalperi @davorbonaci

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 69.672% when pulling a2ccc73 on lukecwik:hdfs2 into 948f7ef on apache:master.

*
* <p>The scheme is required to be unique among all
* <p>The {@link FileSystem#getScheme() scheme} is required to be unique among all
Copy link
Contributor

Choose a reason for hiding this comment

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

Each scheme?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -413,19 +408,11 @@ private static String parseScheme(String spec) {
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

for scheme?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

SCHEME_TO_REGISTRAR.clear();
public static void setDefaultConfigInWorkers(PipelineOptions options) {
checkNotNull(options, "options");
SCHEME_TO_FILESYSTEM.clear();
Copy link
Contributor

Choose a reason for hiding this comment

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

we may need locks around this now -- there's a race condition if setDefaultConfigInWorkers is called while anything else is happening.

FWICT the Dataflow worker is the only one that initializes once at the beginning.

Copy link
Member Author

Choose a reason for hiding this comment

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

Made it synchronized.

@dhalperi
Copy link
Contributor

Eventually the plan is for HadoopFileSystem to return customizable schemes?

Note that I needed to update FileSystems to instantiate the FileSystem(s) upfront instead of remembering the mapping from scheme to registrar.
@lukecwik
Copy link
Member Author

Yes, the plan is for HadoopFileSystem to return customizable schemes, its just hardcoded right now since its an empty implementation.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.008%) to 69.677% when pulling 7778f35 on lukecwik:hdfs2 into 47aaf11 on apache:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.001%) to 69.684% when pulling 7778f35 on lukecwik:hdfs2 into 47aaf11 on apache:master.

*/
private static void loadFileSystemRegistrars() {
SCHEME_TO_REGISTRAR.clear();
public static synchronized void setDefaultConfigInWorkers(PipelineOptions options) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Also need to synchronize accessors to SCHEME_TO_FILESYSTEM -- specifically, #getFileSystemInternal.

Copy link
Contributor

@dhalperi dhalperi left a comment

Choose a reason for hiding this comment

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

Still LGTM

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.002%) to 69.682% when pulling 817a0f6 on lukecwik:hdfs2 into 47aaf11 on apache:master.

@asfgit asfgit closed this in ddabab3 Apr 28, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.002%) to 69.682% when pulling 8dff96f on lukecwik:hdfs2 into 47aaf11 on apache:master.

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

3 participants