Skip to content

Commit e13cab3

Browse files
authored
TEZ-4605: Enable hadoop CallerContext in TezChild and DAGAppMaster (#394). (liang yu, Reviewed by Ayush Saxena)
1 parent 871866e commit e13cab3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -2390,7 +2390,9 @@ public static void main(String[] args) {
23902390
ContainerId containerId = ConverterUtils.toContainerId(containerIdStr);
23912391
ApplicationAttemptId applicationAttemptId =
23922392
containerId.getApplicationAttemptId();
2393-
2393+
org.apache.hadoop.ipc.CallerContext.setCurrent(new org.apache.hadoop.ipc.CallerContext
2394+
.Builder("tez_appmaster_" + containerId.getApplicationAttemptId()
2395+
).build());
23942396
long appSubmitTime = Long.parseLong(appSubmitTimeStr);
23952397

23962398
String jobUserName = System

tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TezChild.java

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import org.apache.hadoop.conf.Configuration;
4242
import org.apache.hadoop.fs.FileSystem;
4343
import org.apache.hadoop.ipc.RPC;
44+
import org.apache.hadoop.ipc.CallerContext;
4445
import org.apache.hadoop.net.NetUtils;
4546
import org.apache.hadoop.security.Credentials;
4647
import org.apache.hadoop.security.SecurityUtil;
@@ -533,6 +534,7 @@ public static void main(String[] args) throws IOException, InterruptedException,
533534
final int attemptNumber = Integer.parseInt(args[4]);
534535
final String[] localDirs = TezCommonUtils.getTrimmedStrings(System.getenv(Environment.LOCAL_DIRS
535536
.name()));
537+
CallerContext.setCurrent(new CallerContext.Builder("tez_"+tokenIdentifier).build());
536538
LOG.info("TezChild starting with PID=" + pid + ", containerIdentifier=" + containerIdentifier);
537539
if (LOG.isDebugEnabled()) {
538540
LOG.debug("Info from cmd line: AM-host: " + host + " AM-port: " + port

0 commit comments

Comments
 (0)