zuston commented on code in PR #17958:
URL: https://github.com/apache/flink/pull/17958#discussion_r844622564


##########
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java:
##########
@@ -432,6 +434,19 @@ public Task(
 
         // finally, create the executing thread, but do not start it
         executingThread = new Thread(TASK_THREADS_GROUP, this, 
taskNameWithSubtask);
+
+        // Add CallerContext.
+        String callerContext =
+                "Flink_Task_"
+                        + "JobID_"
+                        + jobId
+                        + "_TaskName_"
+                        + taskInfo.getTaskName()
+                        + "_"
+                        + taskInfo.getAttemptNumber();
+
+        HadoopFsFactory.setCurrent(
+                
tmConfig.getOptional(HadoopOptions.CALLER_CONTEXT_APP_ID).orElse(callerContext));

Review Comment:
   Using `orElseGet` directly maybe better? 
   
   If `CALLER_CONTEXT_APP_ID` exist, there's no need to construct the 
`callContext` var.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to