code: public static void proxyUserKillAllSpawnedHadoopJobs(final String logFilePath, Props jobProps,
        File tokenFile, final Logger log) {
      Properties properties = new Properties();
      properties.putAll(jobProps.getFlattened());
  
      try {
        if (HadoopSecureWrapperUtils.shouldProxy(properties)) {
          UserGroupInformation proxyUser =
              HadoopSecureWrapperUtils.setupProxyUser(properties,
                  tokenFile.getAbsolutePath(), log);
          proxyUser.doAs(new PrivilegedExceptionAction<Void>() {
            @Override
            public Void run() throws Exception {
              HadoopJobUtils.killAllSpawnedHadoopJobs(logFilePath, log);
              return null;
            }
          });
        } else {
          HadoopJobUtils.killAllSpawnedHadoopJobs(logFilePath, log);
        }
      } catch (Throwable t) {
        log.warn("something happened while trying to kill all spawned jobs", t);
      }
    }
docs: This method is a decorator around the KillAllSpawnedHadoopJobs method.
  This method takes additional parameters to determine whether KillAllSpawnedHadoopJobs needs to
  be executed
  using doAs as a different user
  
  @param logFilePath Azkaban log file path
  @param jobProps Azkaban job props
  @param tokenFile Pass in the tokenFile if value is known.  It is ok to skip if the token file
  is in the environmental variable
  @param log a usable logger