Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.DF


   */
  long getDiskSpace(boolean free) throws IOException {
    long biggestSeenSoFar = 0;
    String[] localDirs = getLocalDirsFromConf(fConf);
    for (int i = 0; i < localDirs.length; i++) {
      DF df = null;
      if (localDirsDf.containsKey(localDirs[i])) {
        df = localDirsDf.get(localDirs[i]);
      } else {
        df = new DF(new File(localDirs[i]), fConf);
        localDirsDf.put(localDirs[i], df);
      }
      long onThisVol = free ? df.getAvailable() : df.getCapacity();
      if (onThisVol > biggestSeenSoFar) {
        biggestSeenSoFar = onThisVol;
      }
    }

View Full Code Here


    String logDir = fConf.getLogDir();
    // If the log disk is not specified we assume it is usable.
    if (logDir == null) {
      return Long.MAX_VALUE;
    }
    DF df = localDirsDf.get(logDir);
    if (df == null) {
      df = new DF(new File(logDir), fConf);
      localDirsDf.put(logDir, df);
    }
    return df.getAvailable();
  }
View Full Code Here

    private final ExecutorService nativeIOExecutor;
   
    FSVolume(FSDataset dataset, File currentDir, Configuration conf) throws IOException {
      this.currentDir = currentDir;
      File parent = currentDir.getParentFile();
      this.usage = new DF(parent, conf);
      this.reserved = usage.getReserved();
      this.dataset = dataset;
      this.namespaceMap = new NamespaceMap();
      this.dfsUsage = new DU(currentDir, conf);
      this.dfsUsage.start();
View Full Code Here

  public void testVolumeSizeWithBytes() throws Exception {
    Configuration conf = new Configuration();
    File data_dir = MiniDFSCluster.getDataDirectory(conf);
    // Need to create data_dir, otherwise DF doesn't work on non-existent dir.
    data_dir.mkdirs();
    DF df = new DF(data_dir, conf);
    long reserved = 10000;
    conf.setLong("dfs.datanode.du.reserved", reserved);
    verifyVolumeSize(conf, reserved, df);
  }
View Full Code Here

  public void testVolumeSizeWithPercent() throws Exception {
    Configuration conf = new Configuration();
    File data_dir = MiniDFSCluster.getDataDirectory(conf);
    // Need to create data_dir, otherwise DF doesn't work on non-existent dir.
    data_dir.mkdirs();
    DF df = new DF(data_dir, conf);
    long reserved = (long) (df.getCapacity() * 0.215);
    conf.setFloat("dfs.datanode.du.reserved.percent", 21.5f);
    verifyVolumeSize(conf, reserved, df);
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.fs.DF

Copyright © 2018 www.massapicom. 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.