Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.Trash


         
          rename(fs, tmpDatafile, newDatafile);
         
          // start deleting files, if we do not finish they will be cleaned
          // up later
          Trash trash = new Trash(fs, fs.getConf());
          for (Path path : oldDatafiles) {
            Path deleteFile = new Path(location + "/delete+" + compactName + "+" + path.getName());
            if (!trash.moveToTrash(deleteFile))
              fs.delete(deleteFile, true);
          }
        }
       
        // atomically remove old files and add new file
View Full Code Here


          @Override
          public FileSystem run() throws IOException {
            return FileSystem.get(conf);
          }
        });
    this.emptier = new Thread(new Trash(fs, conf).getEmptier(), "Trash Emptier");
    this.emptier.setDaemon(true);
    this.emptier.start();
  }
View Full Code Here

    myMetrics = new NameNodeMetrics(conf, this);

    this.namesystem = new FSNamesystem(this, conf);
    this.server.start()//start RPC server  

    this.emptier = new Thread(new Trash(conf).getEmptier(), "Trash Emptier");
    this.emptier.setDaemon(true);
    this.emptier.start();
  }
View Full Code Here

    log.info("offline: " + offline);
    log.info("verbose: " + verbose);
    log.info("memory threshold: " + CANDIDATE_MEMORY_PERCENTAGE + " of " + Runtime.getRuntime().maxMemory() + " bytes");
    log.info("delete threads: " + numDeleteThreads);
    if (!noTrash) {
      this.trash = new Trash(fs, fs.getConf());
    }
  }
View Full Code Here

 
  GarbageCollectWriteAheadLogs(Instance instance, FileSystem fs, boolean noTrash) throws IOException {
    this.instance = instance;
    this.fs = fs;
    if (!noTrash)
      this.trash = new Trash(fs, fs.getConf());
  }
View Full Code Here

            log.info("Archiving walog " + source + " to " + dest);
            if (!fs.rename(new Path(source), new Path(dest)))
              log.error("rename is unsuccessful");
          } else {
            log.info("Deleting walog " + filename);
            Trash trash = new Trash(fs, fs.getConf());
            Path sourcePath = new Path(source);
            if (!trash.moveToTrash(sourcePath) && !fs.delete(sourcePath, true))
              log.warn("Failed to delete walog " + source);
            Path recoveryPath = new Path(Constants.getRecoveryDir(acuConf), filename);
            try {
              if (trash.moveToTrash(recoveryPath) || fs.delete(recoveryPath, true))
                log.info("Deleted any recovery log " + filename);
            } catch (FileNotFoundException ex) {
              // ignore
            }
           
View Full Code Here

          if (!fs.rename(tmpDatafile, newDatafile))
            log.warn("Rename of " + tmpDatafile + " to " + newDatafile + " returned false");
         
          // start deleting files, if we do not finish they will be cleaned
          // up later
          Trash trash = new Trash(fs, fs.getConf());
          for (Path path : oldDatafiles) {
            Path deleteFile = new Path(location + "/delete+" + compactName + "+" + path.getName());
            if (!trash.moveToTrash(deleteFile))
              fs.delete(deleteFile, true);
          }
        }
       
        // atomically remove old files and add new file
View Full Code Here

  }

  @Override
  public boolean moveToTrash(Path path) throws IOException {
    FileSystem fs = getVolumeByPath(path).getFileSystem();
    Trash trash = new Trash(fs, fs.getConf());
    return trash.moveToTrash(path);
  }
View Full Code Here

    myMetrics = new NameNodeMetrics(conf, this);

    this.namesystem = new FSNamesystem(this, conf);
    this.server.start()//start RPC server  

    this.emptier = new Thread(new Trash(conf).getEmptier(), "Trash Emptier");
    this.emptier.setDaemon(true);
    this.emptier.start();
  }
View Full Code Here

    // Path or FileSystem. So need to achieve this by creating a dummy conf.
    // this needs to be filtered out based on version

    Configuration dupConf = new Configuration(conf);
    FileSystem.setDefaultUri(dupConf, fs.getUri());
    Trash trash = new Trash(dupConf);
    return trash.moveToTrash(path);
  }
View Full Code Here

TOP

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

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.