YARN-11670. Add CallerContext in NodeManager (#6688)

This commit is contained in:
Yang Jiandan 2024-04-09 10:50:41 +08:00 committed by GitHub
parent 8c378d1ea1
commit 3f8af73913
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,8 +24,10 @@
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.ipc.CallerContext;
import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem; import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
import org.apache.hadoop.metrics2.util.MBeans; import org.apache.hadoop.metrics2.util.MBeans;
import org.apache.hadoop.net.NetUtils;
import org.apache.hadoop.security.Credentials; import org.apache.hadoop.security.Credentials;
import org.apache.hadoop.security.SecurityUtil; import org.apache.hadoop.security.SecurityUtil;
import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.UserGroupInformation;
@ -1055,6 +1057,8 @@ public static void main(String[] args) throws IOException {
NodeManager nodeManager = new NodeManager(); NodeManager nodeManager = new NodeManager();
Configuration conf = new YarnConfiguration(); Configuration conf = new YarnConfiguration();
new GenericOptionsParser(conf, args); new GenericOptionsParser(conf, args);
CallerContext.setCurrent(new CallerContext.Builder(
"nodemanager_" + NetUtils.getLocalHostname()).build());
nodeManager.initAndStartNodeManager(conf, false); nodeManager.initAndStartNodeManager(conf, false);
} }