Examples of HDFSLocationFactory


Examples of org.apache.twill.filesystem.HDFSLocationFactory

        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);
View Full Code Here

Examples of org.apache.twill.filesystem.HDFSLocationFactory

  }

  private static LocationFactory createDefaultLocationFactory(Configuration configuration) {
    try {
      FileSystem fs = FileSystem.get(configuration);
      return new HDFSLocationFactory(fs, fs.getHomeDirectory().toUri().getPath());
    } catch (IOException e) {
      throw Throwables.propagate(e);
    }
  }
View Full Code Here

Examples of org.apache.twill.filesystem.HDFSLocationFactory

          }
          fileSystem = FileSystem.get(FileSystem.getDefaultUri(hConf), hConf);
        } else {
          fileSystem = FileSystem.get(FileSystem.getDefaultUri(hConf), hConf, hdfsUser);
        }
        return new HDFSLocationFactory(fileSystem, namespace);
      } catch (Exception e) {
        throw Throwables.propagate(e);
      }
    }
View Full Code Here

Examples of org.apache.twill.filesystem.HDFSLocationFactory

      Application app;
      try {
        if ("LOCAL".equals(locationFactory)) {
          lf = new LocalLocationFactory();
        } else if ("DISTRIBUTED".equals(locationFactory)) {
          lf = new HDFSLocationFactory(new Configuration());
        } else {
          LOG.error("Unknown location factory specified");
          return -1;
        }
View Full Code Here

Examples of org.apache.twill.filesystem.HDFSLocationFactory

  private Iterable<LiveInfo> liveInfos;
  private Cancellable watchCancellable;
  private volatile String jvmOptions = "";

  public YarnTwillRunnerService(YarnConfiguration config, String zkConnect) {
    this(config, zkConnect, new HDFSLocationFactory(getFileSystem(config), "/twill"));
  }
View Full Code Here

Examples of org.apache.twill.filesystem.HDFSLocationFactory

        return new LocalLocationFactory().create(appDir);
      }

      if ("hdfs".equals(appDir.getScheme())) {
        if (UserGroupInformation.isSecurityEnabled()) {
          return new HDFSLocationFactory(FileSystem.get(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(FileSystem.getDefaultUri(conf), conf, fsUser)).create(appDir);
      }

      LOG.warn("Unsupported location type {}.", appDir);
      throw new IllegalArgumentException("Unsupported location type " + appDir);
View Full Code Here

Examples of org.apache.twill.filesystem.HDFSLocationFactory

        return new LocalLocationFactory().create(appDir);
      }

      if ("hdfs".equals(appDir.getScheme())) {
        if (UserGroupInformation.isSecurityEnabled()) {
          return new HDFSLocationFactory(FileSystem.get(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(FileSystem.getDefaultUri(conf), conf, fsUser)).create(appDir);
      }

      LOG.warn("Unsupported location type {}.", appDir);
      throw new IllegalArgumentException("Unsupported location type " + appDir);
View Full Code Here

Examples of org.apache.twill.filesystem.HDFSLocationFactory

  private Iterable<LiveInfo> liveInfos;
  private Cancellable watchCancellable;
  private volatile String jvmOptions = "";

  public YarnTwillRunnerService(YarnConfiguration config, String zkConnect) {
    this(config, zkConnect, new HDFSLocationFactory(getFileSystem(config), "/twill"));
  }
View Full Code Here

Examples of org.apache.twill.filesystem.HDFSLocationFactory

          }
          fileSystem = FileSystem.get(FileSystem.getDefaultUri(hConf), hConf);
        } else {
          fileSystem = FileSystem.get(FileSystem.getDefaultUri(hConf), hConf, hdfsUser);
        }
        return new HDFSLocationFactory(fileSystem, namespace);
      } catch (Exception e) {
        throw Throwables.propagate(e);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.