-
Notifications
You must be signed in to change notification settings - Fork 424
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
TEZ-4547: Add Tez AM JobID to the JobConf #339
Merged
abstractdog
merged 8 commits into
apache:master
from
VenkatSNarayanan:vnarayanan/TEZ-4547
Aug 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9040a2f
TEZ-4547: Add Tez AM JobID to the JobConf
452241a
Addressing PR comments
f9e3b45
Addressing PR comments #2
e13d6f4
Rename UUID property
5cef95a
Refactor createJobUUID to getDAGID
83cd25f
Address review comments
c0c29b4
Refactor to address more review comments
c56e926
Address checkstyle report
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ | |
import org.apache.hadoop.mapred.FileOutputFormat; | ||
import org.apache.hadoop.mapred.JobConf; | ||
import org.apache.hadoop.mapred.JobContext; | ||
import org.apache.hadoop.mapred.JobID; | ||
import org.apache.hadoop.mapred.TaskAttemptID; | ||
import org.apache.hadoop.mapreduce.OutputCommitter; | ||
import org.apache.hadoop.mapreduce.OutputFormat; | ||
|
@@ -417,6 +418,7 @@ protected List<Event> initializeBase() throws IOException, InterruptedException | |
.createMockTaskAttemptID(getContext().getApplicationId().getClusterTimestamp(), | ||
getContext().getTaskVertexIndex(), getContext().getApplicationId().getId(), | ||
getContext().getTaskIndex(), getContext().getTaskAttemptNumber(), isMapperOutput); | ||
jobConf.set(MRJobConfig.MR_PARENT_JOB_ID, new JobID(String.valueOf(getContext().getApplicationId().getClusterTimestamp()), getContext().getApplicationId().getId()).toString()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move this to line above TaskAttemptID taskAttemptId = |
||
jobConf.set(JobContext.TASK_ATTEMPT_ID, taskAttemptId.toString()); | ||
jobConf.set(JobContext.TASK_ID, taskAttemptId.getTaskID().toString()); | ||
jobConf.setBoolean(JobContext.TASK_ISMAP, isMapperOutput); | ||
|
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 |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
import org.apache.hadoop.io.NullWritable; | ||
import org.apache.hadoop.io.Text; | ||
import org.apache.hadoop.mapred.JobConf; | ||
import org.apache.hadoop.mapred.JobID; | ||
import org.apache.hadoop.mapred.Reporter; | ||
import org.apache.hadoop.mapreduce.JobContext; | ||
import org.apache.hadoop.mapreduce.OutputCommitter; | ||
|
@@ -57,6 +58,7 @@ | |
import org.apache.tez.mapreduce.TestUmbilical; | ||
import org.apache.tez.mapreduce.TezTestUtils; | ||
import org.apache.tez.mapreduce.hadoop.MRConfig; | ||
import org.apache.tez.mapreduce.hadoop.MRJobConfig; | ||
import org.apache.tez.runtime.LogicalIOProcessorRuntimeTask; | ||
import org.apache.tez.runtime.api.OutputContext; | ||
import org.apache.tez.runtime.api.ProcessorContext; | ||
|
@@ -131,6 +133,26 @@ public void testMergeConfig() throws Exception { | |
assertEquals("base-value", mergedConf.get("base-key")); | ||
} | ||
|
||
@Test | ||
public void testParentJobIDSet() throws Exception { | ||
Configuration conf = new Configuration(); | ||
conf.setBoolean(MRConfig.IS_MAP_PROCESSOR, true); | ||
DataSinkDescriptor dataSink = MROutput | ||
.createConfigBuilder(conf, TextOutputFormat.class, | ||
tmpDir.getPath()) | ||
.build(); | ||
|
||
OutputContext outputContext = createMockOutputContext(dataSink.getOutputDescriptor().getUserPayload(), | ||
new Configuration(false)); | ||
MROutput output = new MROutput(outputContext, 2); | ||
output.initialize(); | ||
String invalidJobID = "invalid default"; | ||
String parentJobID = output.jobConf.get(MRJobConfig.MR_PARENT_JOB_ID, invalidJobID); | ||
assertNotEquals(parentJobID,invalidJobID); | ||
assertNotEquals(output.jobConf.get(org.apache.hadoop.mapred.JobContext.TASK_ATTEMPT_ID),parentJobID); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix code formatting. space after , |
||
assertEquals(parentJobID, new JobID(String.valueOf(outputContext.getApplicationId().getClusterTimestamp()),outputContext.getApplicationId().getId()).toString()); | ||
} | ||
|
||
@Test(timeout = 5000) | ||
public void testOldAPI_TextOutputFormat() throws Exception { | ||
Configuration conf = new Configuration(); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can we have
String.valueOf(getContext().getApplicationId().getClusterTimestamp()), getContext().getApplicationId().getId()).toString(
inside a method and re-use it in MROutput.java as well ?