-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inject azkaban configurations into hadoop application tags (#1904)
Hadoop/YARN has support for application tags, which MR/Spark can include in its job submission. This PR will add some azkaban metadata into MR config so MR can include them in the YARN application tags when it submits to YARN.
- Loading branch information
1 parent
d2db592
commit 2be255d
Showing
5 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...p-jobtype-plugin/src/test/java/azkaban/jobtype/TestHadoopJobUtilsConstructHadoopTags.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package azkaban.jobtype; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import azkaban.utils.Props; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Test class for constructHadoopTags method in HadoopJobUtils | ||
*/ | ||
public class TestHadoopJobUtilsConstructHadoopTags { | ||
|
||
private Props props; | ||
|
||
@Before | ||
public void beforeMethod() { | ||
props = new Props(); | ||
} | ||
|
||
@Test | ||
public void testNoTags() { | ||
String[] tags = new String[0]; | ||
assertThat(HadoopJobUtils.constructHadoopTags(props, tags)).isEqualTo(""); | ||
} | ||
|
||
@Test | ||
public void testWithTags() { | ||
String tag0 = "tag0"; | ||
String tag1 = "tag1"; | ||
props.put(tag0, "val0"); | ||
props.put(tag1, "val1"); | ||
String[] tags = new String[] { tag0, tag1 }; | ||
assertThat(HadoopJobUtils.constructHadoopTags(props, tags)) | ||
.isEqualTo("tag0:val0,tag1:val1"); | ||
} | ||
|
||
@Test | ||
public void testWithNonExistentTags() { | ||
String tag0 = "tag0"; | ||
String tag1 = "tag1"; | ||
String tag2 = "tag2"; | ||
props.put(tag0, "val0"); | ||
props.put(tag2, "val2"); | ||
String[] tags = new String[] { tag0, tag1, tag2 }; | ||
assertThat(HadoopJobUtils.constructHadoopTags(props, tags)) | ||
.isEqualTo("tag0:val0,tag2:val2"); | ||
} | ||
} |