2020
2121import static org .apache .hadoop .fs .CreateFlag .CREATE ;
2222import static org .apache .hadoop .fs .CreateFlag .OVERWRITE ;
23- import static org .apache .hadoop .yarn .conf .YarnConfiguration .numaAwarenessEnabled ;
2423
25- import org .apache .commons .lang3 .ArrayUtils ;
2624import org .apache .hadoop .classification .VisibleForTesting ;
2725import java .io .DataOutputStream ;
2826import java .io .File ;
5755import org .apache .hadoop .yarn .server .nodemanager .containermanager .container .Container ;
5856import org .apache .hadoop .yarn .server .nodemanager .containermanager .container .ContainerDiagnosticsUpdateEvent ;
5957import org .apache .hadoop .yarn .server .nodemanager .containermanager .launcher .ContainerLaunch ;
60- import org .apache .hadoop .yarn .server .nodemanager .containermanager .linux .resources .ResourceHandlerException ;
61- import org .apache .hadoop .yarn .server .nodemanager .containermanager .linux .resources .numa .NumaResourceAllocation ;
62- import org .apache .hadoop .yarn .server .nodemanager .containermanager .linux .resources .numa .NumaResourceAllocator ;
6358import org .apache .hadoop .yarn .server .nodemanager .containermanager .localizer .ContainerLocalizer ;
6459import org .apache .hadoop .yarn .server .nodemanager .containermanager .runtime .ContainerExecutionException ;
6560import org .apache .hadoop .yarn .server .nodemanager .executor .ContainerExecContext ;
@@ -140,10 +135,9 @@ protected void setScriptExecutable(Path script, String owner)
140135 lfs .setPermission (script , ContainerExecutor .TASK_LAUNCH_SCRIPT_PERMISSION );
141136 }
142137
143- private NumaResourceAllocator numaResourceAllocator ;
144138 @ Override
145139 public void init (Context nmContext ) throws IOException {
146- numaResourceAllocator = new NumaResourceAllocator ( nmContext );
140+ // nothing to do or verify here
147141 }
148142
149143 @ Override
@@ -215,11 +209,10 @@ protected ContainerLocalizer createContainerLocalizer(String user,
215209 return localizer ;
216210 }
217211
218- private volatile Container container ;
219212 @ Override
220213 public int launchContainer (ContainerStartContext ctx )
221214 throws IOException , ConfigurationException {
222- container = ctx .getContainer ();
215+ Container container = ctx .getContainer ();
223216 Path nmPrivateContainerScriptPath = ctx .getNmPrivateContainerScriptPath ();
224217 Path nmPrivateTokensPath = ctx .getNmPrivateTokensPath ();
225218 Path nmPrivateKeystorePath = ctx .getNmPrivateKeystorePath ();
@@ -389,9 +382,6 @@ protected CommandExecutor buildCommandExecutor(String wrapperScriptPath,
389382 String [] command = getRunCommand (wrapperScriptPath ,
390383 containerIdStr , user , pidFile , this .getConf (), resource );
391384
392- if (numaAwarenessEnabled (this .getConf ())) {
393- addNumaCommands (command , container );
394- }
395385 LOG .info ("launchContainer: {}" , Arrays .toString (command ));
396386 return new ShellCommandExecutor (
397387 command ,
@@ -401,26 +391,6 @@ protected CommandExecutor buildCommandExecutor(String wrapperScriptPath,
401391 false );
402392 }
403393
404-
405- private void addNumaCommands (String [] commands , Container container ){
406- try {
407- NumaResourceAllocation numaAllocation = numaResourceAllocator .allocateNumaNodes (container );
408- if (numaAllocation != null ){
409- String [] numaCommand = new String [3 ];
410- numaCommand [0 ] = this .getConf ().get (YarnConfiguration .NM_NUMA_AWARENESS_NUMACTL_CMD ,
411- YarnConfiguration .DEFAULT_NM_NUMA_AWARENESS_NUMACTL_CMD );;
412- numaCommand [1 ] = "--interleave=" + String .join ("," , numaAllocation .getMemNodes ());
413- numaCommand [2 ] = "--cpunodebind=" + String .join ("," , numaAllocation .getCpuNodes ());
414- ArrayUtils .add (commands , numaCommand );
415- }
416- } catch (ResourceHandlerException e ){
417- LOG .warn ("Exception assigning numa :- " , e );
418- }
419-
420-
421-
422- }
423-
424394 /**
425395 * Create a {@link LocalWrapperScriptBuilder} for the given container ID
426396 * and path that is appropriate to the current platform.
0 commit comments