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

SAMZA-1143 Include fs.<scheme>.impl.* subkeys to YarnConfiguration used in YarnJobFactory and YarnClusterResourceManager #97

Closed
wants to merge 8 commits into from

Conversation

fredji97
Copy link

@fredji97 fredji97 commented Mar 27, 2017

SAMZA-1143 Include fs.<scheme>.impl.* subkeys, in addition tofs.<scheme>.impl, to YarnConfiguration used in YarnJobFactory and YarnClusterResourceManager.

When there are additional subconfigurations under fs.myScheme.impl, such as fs.myScheme.impl.client, we need to keep the set of configuration completed in YarnJobFactory and YarnClusterResourceManager. When the context is set for localizing the resource in ClientHelper and YarnContainerRunner, it may rely on this configuration to get the FileStatus information, which may or may not depends on fs.<scheme>.impl and all possible fs.<scheme>.impl.* sub-configuration.

This is an enhanced feature to the PR#90.

* @param scheme scheme name, such as http, hdfs, myscheme
* @return a set of subKeys from the configuration without stripping off prefix
*/
public Set<String> getFsImplSubKeys(final String scheme) {
Copy link
Contributor

@vjagadish1989 vjagadish1989 Mar 28, 2017

Choose a reason for hiding this comment

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

Prefer an API like

public Map<String, String> getSchemeConfig(final String scheme) {

} 
  1. It makes it more obvious from the API.
  2. Usually, returning just keys is of limited value. Almost always, you will want to lookup the value configured for that key. Atleast in all interactions with FsImplConfig in the code base this is true.

@fredji97
Copy link
Author

Thanks @vjagadish1989 ! I have updated based on your comments.

Copy link
Contributor

@vjagadish1989 vjagadish1989 left a comment

Choose a reason for hiding this comment

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

approved.

final round of feedback from my review:

* @param scheme scheme name, such as http, hdfs, myscheme
* @return fs.&lt;scheme&gt;impl
* @return a set of sub configurations without stripping off prefix
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:
@return config for the particular scheme

set of sub configurations is slightly mis-leading. Probably not worth calling out that the pre-fix is not stripped.

assertEquals("fs.http.impl", manager.getFsImplKey("http"));
assertEquals("fs.myscheme.impl", manager.getFsImplKey("myscheme"));

assertEquals("org.apache.samza.HttpFileSystem", manager.getFsImplClassName("http"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we remove these two assertions?

Copy link
Author

Choose a reason for hiding this comment

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

Because we removed these two functions, and introduced another function to get the key-value together as a sub-config.

@@ -61,15 +57,28 @@ public void testNullConfig() {
}

@Test
public void testEmptyImpl() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we removing this test for empty implementation?

Copy link
Author

Choose a reason for hiding this comment

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

It is because we removed getFsImplClassName(), and this test was originally for testing against getFsImplClassName().

@vjagadish1989
Copy link
Contributor

@fredji97 Looks like there are some conflicts. Can we please resolve them?

Fred Ji and others added 6 commits April 5, 2017 15:25
…>.impl, to YarnConfiguration used in YarnJobFactory and YarnClusterResourceManager. When there are additional subconfigurations under fs.<scheme>.impl, such as fs.<scheme>.impl.client, we need to keep the set of configuration completed.
    Added support for scala 2.12

    Author: Maxim Logvinenko <mlogvinenko@gmail.com>

    Reviewers: Jagadish <jagadish@apache.org>,Prateek Maheshwari <prateekm@linkedin.com>

    Closes apache#82 from metamx:scala-2.12
…>.impl, to YarnConfiguration used in YarnJobFactory and YarnClusterResourceManager. When there are additional subconfigurations under fs.<scheme>.impl, such as fs.<scheme>.impl.client, we need to keep the set of configuration completed.
@fredji97
Copy link
Author

fredji97 commented Apr 6, 2017

@vjagadish1989 thanks I resolved the conflicts. Please let me know if you have any question.

@asfgit asfgit closed this in c1b778a Apr 6, 2017
@vjagadish1989
Copy link
Contributor

@fredji97 : Thanks for the patch, Merged, and submitted to master. Can you please close the associated JIRA with the fix version?

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.

4 participants