code: public static ContainerLaunchContext getContainerLaunchContext(
        final List<String> commands,
        final Map<String, LocalResource> localResources,
        final byte[] securityTokenBuffer,
        final Map<String, String> envMap,
        final ApplicationId applicationId) {
      final ContainerLaunchContext context = Records.newRecord(ContainerLaunchContext.class);
      context.setLocalResources(localResources);
      context.setCommands(commands);
      if (applicationId != null) {
        envMap.put(YarnUtilities.REEF_YARN_APPLICATION_ID_ENV_VAR, applicationId.toString());
      }
  
      for (final Map.Entry entry : envMap.entrySet()) {
        LOG.log(Level.FINE, "Key : {0}, Value : {1}", new Object[] {entry.getKey(), entry.getValue()});
      }
      context.setEnvironment(envMap);
      if (securityTokenBuffer != null) {
        context.setTokens(ByteBuffer.wrap(securityTokenBuffer));
        LOG.log(Level.INFO, "Added tokens to container launch context");
      }
      return context;
    }
docs: Gets a LaunchContext and sets the environment variable
  {@link YarnUtilities#REEF_YARN_APPLICATION_ID_ENV_VAR} for REEF Evaluators.
  @return a ContainerLaunchContext with the given commands, LocalResources and environment map.