return new LocalLocationFactory().create(appDir);
}
if ("hdfs".equals(appDir.getScheme())) {
if (UserGroupInformation.isSecurityEnabled()) {
return new HDFSLocationFactory(FileSystem.get(appDir, conf)).create(appDir);
}
String fsUser = System.getenv(EnvKeys.TWILL_FS_USER);
if (fsUser == null) {
throw new IllegalStateException("Missing environment variable " + EnvKeys.TWILL_FS_USER);
}
return new HDFSLocationFactory(FileSystem.get(appDir, conf, fsUser)).create(appDir);
}
LOG.warn("Unsupported location type {}.", appDir);
throw new IllegalArgumentException("Unsupported location type " + appDir);