PrabhuJoseph commented on code in PR #4742:
URL: https://github.com/apache/hadoop/pull/4742#discussion_r954556722
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DefaultContainerExecutor.java:
##########
@@ -1040,4 +1080,92 @@ public void updateYarnSysFS(Context ctx, String user,
String appId, String spec) throws IOException {
throw new ServiceStateException("Implementation unavailable");
}
+
+ @Override
+ public int reacquireContainer(ContainerReacquisitionContext ctx)
+ throws IOException, InterruptedException {
+ try {
+ if (numaResourceAllocator != null) {
+ numaResourceAllocator.recoverNumaResource(ctx.getContainerId());
+ }
+ return super.reacquireContainer(ctx);
+ } finally {
+ postComplete(ctx.getContainerId());
+ }
+ }
+
+ /**
+ * clean up and release of resources.
+ *
+ * @param containerId containerId of running container
+ */
+ public void postComplete(final ContainerId containerId) {
+ if (numaResourceAllocator != null) {
+ try {
+ numaResourceAllocator.releaseNumaResource(containerId);
+ } catch (ResourceHandlerException e) {
+ LOG.warn("NumaResource release failed for " +
+ "containerId: {}. Exception: ", containerId, e);
+ }
+ }
+ }
+
+ /**
+ * @param resourceAllocation NonNull NumaResourceAllocation object reference
+ * @return Array of numa specific commands
+ */
+ String[] getNumaCommands(NumaResourceAllocation resourceAllocation) {
+ String[] numaCommand = new String[3];
+ numaCommand[0] =
this.getConf().get(YarnConfiguration.NM_NUMA_AWARENESS_NUMACTL_CMD,
Review Comment:
Better to read this config and initialize in the init.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]