Example usage for org.apache.hadoop.fs Trash expunge

List of usage examples for org.apache.hadoop.fs Trash expunge

Introduction

In this page you can find the example usage for org.apache.hadoop.fs Trash expunge.

Prototype

public void expunge() throws IOException 

Source Link

Document

Delete old checkpoint(s).

Usage

From source file:com.sensei.indexing.hadoop.reduce.ShardWriter.java

License:Apache License

public static void moveToTrash(Configuration conf, Path path) throws IOException {
    Trash t = new Trash(conf);
    boolean isMoved = t.moveToTrash(path);
    t.expunge();
    if (!isMoved) {
        logger.error("Trash is not enabled or file is already in the trash.");
    }//  w ww .j  a  v a 2s  . c  o m
}

From source file:org.apache.ambari.view.filebrowser.HdfsApi.java

License:Apache License

/**
 * Empty trash/*from   ww  w  .j a va  2  s  .  co m*/
 * @return
 * @throws Exception
 */
public Void emptyTrash() throws Exception {
    return ugi.doAs(new PrivilegedExceptionAction<Void>() {
        public Void run() throws IOException {
            Trash tr = new Trash(fs, conf);
            tr.expunge();
            return null;
        }
    });
}

From source file:org.apache.ambari.view.utils.hdfs.HdfsApi.java

License:Apache License

/**
 * Empty trash//w w w  .ja  v a 2  s  .c  om
 * @return
 * @throws Exception
 */
public Void emptyTrash() throws Exception {
    return execute(new PrivilegedExceptionAction<Void>() {
        public Void run() throws IOException {
            Trash tr = new Trash(fs, conf);
            tr.expunge();
            return null;
        }
    });
}