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

Automatically inject Azkaban properties prefixed with hadoop-inject. into ... #164

Merged
merged 6 commits into from
Dec 16, 2014
Merged

Automatically inject Azkaban properties prefixed with hadoop-inject. into ... #164

merged 6 commits into from
Dec 16, 2014

Conversation

convexquad
Copy link

...the Hadoop configuration for HadoopJava, Pig, Hive and Java job types

…to the Hadoop configuration for HadoopJava, Pig, Hive and Java job types
@@ -109,6 +157,13 @@ public static String getDirName(Props jobProps) {
return "_link_" + dirSuffix;
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we should name this directory _resources_...?

Copy link
Author

Choose a reason for hiding this comment

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

I agree that resources would be better, but let's just leave it, so that we have a 0% chance of breaking anything that is already working.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, that's fine with me.

Choose a reason for hiding this comment

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

These are written out per execution, so unless people are running with crazy mixed classpaths, this should be fine to change.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed - changed to "resources" as suggested.

@erwa
Copy link
Contributor

erwa commented Dec 5, 2014

+1

This is great! I think it will make users' lives much easier!

@erwa
Copy link
Contributor

erwa commented Dec 8, 2014

@hluu, @wagnermarkd, @logiclord, any concerns before merging? See internal JIRA HADOOP-7962 for details.

@hluu
Copy link
Contributor

hluu commented Dec 9, 2014

Let me take a look.

public static void prepareConf(Props props, String workingDir) {
try {
Configuration conf = new Configuration(false);
String confPrefix = "hadoop-conf.";

Choose a reason for hiding this comment

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

Can we name it something other than hadoop-conf? Something that indicates that these are generated configurations coming from azkaban would be good.

Copy link
Author

Choose a reason for hiding this comment

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

Changed to "azkaban-inject"

public static void injectResources() {
Configuration.addDefaultResource(azkabanInjectFile);
Configuration.addDefaultResource(azkabanLinksFile);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like there's an extra space in front of the }.

Copy link
Author

Choose a reason for hiding this comment

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

Now fixed

@erwa
Copy link
Contributor

erwa commented Dec 12, 2014

LGTM. @hluu, @wagnermarkd -- any final comments before we merge?

@hluu
Copy link
Contributor

hluu commented Dec 14, 2014

The code looks good.
One question is has anyone done any testing?

@hluu
Copy link
Contributor

hluu commented Dec 15, 2014

Now that we can a generic way of injecting Azkaban properties with "azkaban-inject" prefix into Hadoop configurations, it will be more clean to combine "azkaban-inject.xml" and "azkaban-links.xml" into a single file.

Method prepareLinks() can just populate those properties with "azkaban-inject" prefix and let method prepareConf() write them out.

…ies into one single code path for the HadoopConfigurationInjector, based on Hien's pull request feedback
@convexquad
Copy link
Author

@hluu I have tested locally to make sure the resource file is being written correctly and that all the properties are being injected into the Hadoop configuration. Since I don't have a local cluster up, I can't check that the Hadoop conf that's actually being sent to all the tasks actually looks right, but it should be good.

For your comments:
-- I consolidated prepareLinks() and prepareConf() into the single method prepareResourcesToInject() that injects everything. Take a look at the new version and let me know if you like it.
-- I changed the name of the injected file to hadoop-inject.xml and the prefix for user properties to "hadoop-inject". I think this is just a little bit more clear to users that this means that the properties is being injected into the Hadoop configuration.
-- I also moved the getPath() method from the top of the file to the bottom, so that's its there with the rest of the file-related helper methods.

* Writes out the XML configuration file that will be injected by the client
* as a configuration resource.
* <p>
* This will file include a series of links injected by Azkaban as well as
Copy link
Contributor

Choose a reason for hiding this comment

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

This will file --> This file will

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

@erwa
Copy link
Contributor

erwa commented Dec 16, 2014

LGTM. @hluu, if you're okay with this latest version, please go ahead and merge this pull request.

@hluu
Copy link
Contributor

hluu commented Dec 16, 2014

LGTM

hluu added a commit that referenced this pull request Dec 16, 2014
Automatically inject Azkaban properties beginning with hadoop-conf into ...
@hluu hluu merged commit 09046e1 into azkaban:master Dec 16, 2014
@erwa erwa changed the title Automatically inject Azkaban properties beginning with hadoop-conf into ... Automatically inject Azkaban properties prefixed with hadoop-inject. into ... Dec 24, 2014
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