Java 类org.apache.hadoop.fs.Trash 实例源码

项目:hadoop-oss    文件:Delete.java   
private boolean moveToTrash(PathData item) throws IOException {
  boolean success = false;
  if (!skipTrash) {
    try {
      success = Trash.moveToAppropriateTrash(item.fs, item.path, getConf());
    } catch(FileNotFoundException fnfe) {
      throw fnfe;
    } catch (IOException ioe) {
      String msg = ioe.getMessage();
      if (ioe.getCause() != null) {
        msg += ": " + ioe.getCause().getMessage();
      }
      throw new IOException(msg + ". Consider using -skipTrash option", ioe);
    }
  }
  return success;
}
项目:hadoop    文件:NameNode.java   
private void startTrashEmptier(final Configuration conf) throws IOException {
  long trashInterval =
      conf.getLong(FS_TRASH_INTERVAL_KEY, FS_TRASH_INTERVAL_DEFAULT);
  if (trashInterval == 0) {
    return;
  } else if (trashInterval < 0) {
    throw new IOException("Cannot start trash emptier with negative interval."
        + " Set " + FS_TRASH_INTERVAL_KEY + " to a positive value.");
  }

  // This may be called from the transitionToActive code path, in which
  // case the current user is the administrator, not the NN. The trash
  // emptier needs to run as the NN. See HDFS-3972.
  FileSystem fs = SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<FileSystem>() {
        @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();
}
项目:hadoop    文件:Delete.java   
private boolean moveToTrash(PathData item) throws IOException {
   boolean success = false;
   if (!skipTrash) {
     try {
       success = Trash.moveToAppropriateTrash(item.fs, item.path, getConf());
     } catch(FileNotFoundException fnfe) {
       throw fnfe;
     } catch (IOException ioe) {
       String msg = ioe.getMessage();
       if (ioe.getCause() != null) {
         msg += ": " + ioe.getCause().getMessage();
}
       throw new IOException(msg + ". Consider using -skipTrash option", ioe);
     }
   }
   return success;
 }
项目:aliyun-oss-hadoop-fs    文件:NameNode.java   
private void startTrashEmptier(final Configuration conf) throws IOException {
  long trashInterval =
      conf.getLong(FS_TRASH_INTERVAL_KEY, FS_TRASH_INTERVAL_DEFAULT);
  if (trashInterval == 0) {
    return;
  } else if (trashInterval < 0) {
    throw new IOException("Cannot start trash emptier with negative interval."
        + " Set " + FS_TRASH_INTERVAL_KEY + " to a positive value.");
  }

  // This may be called from the transitionToActive code path, in which
  // case the current user is the administrator, not the NN. The trash
  // emptier needs to run as the NN. See HDFS-3972.
  FileSystem fs = SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<FileSystem>() {
        @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();
}
项目:aliyun-oss-hadoop-fs    文件:Delete.java   
private boolean moveToTrash(PathData item) throws IOException {
  boolean success = false;
  if (!skipTrash) {
    try {
      success = Trash.moveToAppropriateTrash(item.fs, item.path, getConf());
    } catch(FileNotFoundException fnfe) {
      throw fnfe;
    } catch (IOException ioe) {
      String msg = ioe.getMessage();
      if (ioe.getCause() != null) {
        msg += ": " + ioe.getCause().getMessage();
      }
      throw new IOException(msg + ". Consider using -skipTrash option", ioe);
    }
  }
  return success;
}
项目:big-c    文件:NameNode.java   
private void startTrashEmptier(final Configuration conf) throws IOException {
  long trashInterval =
      conf.getLong(FS_TRASH_INTERVAL_KEY, FS_TRASH_INTERVAL_DEFAULT);
  if (trashInterval == 0) {
    return;
  } else if (trashInterval < 0) {
    throw new IOException("Cannot start trash emptier with negative interval."
        + " Set " + FS_TRASH_INTERVAL_KEY + " to a positive value.");
  }

  // This may be called from the transitionToActive code path, in which
  // case the current user is the administrator, not the NN. The trash
  // emptier needs to run as the NN. See HDFS-3972.
  FileSystem fs = SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<FileSystem>() {
        @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();
}
项目:big-c    文件:Delete.java   
private boolean moveToTrash(PathData item) throws IOException {
   boolean success = false;
   if (!skipTrash) {
     try {
       success = Trash.moveToAppropriateTrash(item.fs, item.path, getConf());
     } catch(FileNotFoundException fnfe) {
       throw fnfe;
     } catch (IOException ioe) {
       String msg = ioe.getMessage();
       if (ioe.getCause() != null) {
         msg += ": " + ioe.getCause().getMessage();
}
       throw new IOException(msg + ". Consider using -skipTrash option", ioe);
     }
   }
   return success;
 }
项目:reair    文件:FsUtils.java   
/**
 * Delete the specified directory, using the trash as available.
 *
 * @param conf configuration object
 * @param path path to delete
 *
 * @throws IOException if there's an error deleting the directory.
 */
public static void deleteDirectory(Configuration conf, Path path) throws IOException {

  Trash trash = new Trash(path.getFileSystem(conf), conf);
  try {
    if (!trash.isEnabled()) {
      LOG.debug("Trash is not enabled for " + path + " so deleting instead");
      FileSystem fs = path.getFileSystem(conf);
      fs.delete(path, true);
    } else {
      boolean removed = trash.moveToTrash(path);
      if (removed) {
        LOG.debug("Moved to trash: " + path);
      } else {
        LOG.error("Item already in trash: " + path);
      }
    }
  } catch (FileNotFoundException e) {
    LOG.debug("Attempting to delete non-existent directory " + path);
    return;
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:NameNode.java   
private void startTrashEmptier(final Configuration conf) throws IOException {
  long trashInterval =
      conf.getLong(FS_TRASH_INTERVAL_KEY, FS_TRASH_INTERVAL_DEFAULT);
  if (trashInterval == 0) {
    return;
  } else if (trashInterval < 0) {
    throw new IOException("Cannot start trash emptier with negative interval."
        + " Set " + FS_TRASH_INTERVAL_KEY + " to a positive value.");
  }

  // This may be called from the transitionToActive code path, in which
  // case the current user is the administrator, not the NN. The trash
  // emptier needs to run as the NN. See HDFS-3972.
  FileSystem fs = SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<FileSystem>() {
        @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();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:Delete.java   
private boolean moveToTrash(PathData item) throws IOException {
   boolean success = false;
   if (!skipTrash) {
     try {
       success = Trash.moveToAppropriateTrash(item.fs, item.path, getConf());
     } catch(FileNotFoundException fnfe) {
       throw fnfe;
     } catch (IOException ioe) {
       String msg = ioe.getMessage();
       if (ioe.getCause() != null) {
         msg += ": " + ioe.getCause().getMessage();
}
       throw new IOException(msg + ". Consider using -skipTrash option", ioe);
     }
   }
   return success;
 }
项目:hadoop-EAR    文件:TestTrash.java   
public static void trashNonDefaultFS(Configuration conf) throws IOException {
  conf.set("fs.trash.interval", "10"); // 10 minute
  // attempt non-default FileSystem trash
  {
    final FileSystem lfs = FileSystem.getLocal(conf);
    Path p = TEST_DIR;
    Path f = new Path(p, "foo/bar");
    if (lfs.exists(p)) {
      lfs.delete(p, true);
    }
    try {
      f = writeFile(lfs, f);

      FileSystem.closeAll();
      FileSystem localFs = FileSystem.get(URI.create("file:///"), conf);
      Trash lTrash = new Trash(localFs, conf);
      lTrash.moveToTrash(f.getParent());
      checkTrash(localFs, lTrash.getCurrentTrashDir(), f);
    } finally {
      if (lfs.exists(p)) {
        lfs.delete(p, true);
      }
    }
  }
}
项目:hadoop-plus    文件:NameNode.java   
private void startTrashEmptier(final Configuration conf) throws IOException {
  long trashInterval =
      conf.getLong(FS_TRASH_INTERVAL_KEY, FS_TRASH_INTERVAL_DEFAULT);
  if (trashInterval == 0) {
    return;
  } else if (trashInterval < 0) {
    throw new IOException("Cannot start trash emptier with negative interval."
        + " Set " + FS_TRASH_INTERVAL_KEY + " to a positive value.");
  }

  // This may be called from the transitionToActive code path, in which
  // case the current user is the administrator, not the NN. The trash
  // emptier needs to run as the NN. See HDFS-3972.
  FileSystem fs = SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<FileSystem>() {
        @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();
}
项目:PDHC    文件:TrueDelete.java   
private boolean moveToTrash(PathData item) throws IOException {
   boolean success = false;
   if (!skipTrash) {
     try {
       success = Trash.moveToAppropriateTrash(item.fs, item.path, getConf());
     } catch(FileNotFoundException fnfe) {
       throw fnfe;
     } catch (IOException ioe) {
       String msg = ioe.getMessage();
       if (ioe.getCause() != null) {
         msg += ": " + ioe.getCause().getMessage();
}
       throw new IOException(msg + ". Consider using -skipTrash option", ioe);
     }
   }
   return success;
 }
项目:FlexMap    文件:NameNode.java   
private void startTrashEmptier(final Configuration conf) throws IOException {
  long trashInterval =
      conf.getLong(FS_TRASH_INTERVAL_KEY, FS_TRASH_INTERVAL_DEFAULT);
  if (trashInterval == 0) {
    return;
  } else if (trashInterval < 0) {
    throw new IOException("Cannot start trash emptier with negative interval."
        + " Set " + FS_TRASH_INTERVAL_KEY + " to a positive value.");
  }

  // This may be called from the transitionToActive code path, in which
  // case the current user is the administrator, not the NN. The trash
  // emptier needs to run as the NN. See HDFS-3972.
  FileSystem fs = SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<FileSystem>() {
        @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();
}
项目:hops    文件:NameNode.java   
private void startTrashEmptier(final Configuration conf) throws IOException {
  long trashInterval =
      conf.getLong(FS_TRASH_INTERVAL_KEY, FS_TRASH_INTERVAL_DEFAULT);
  if (trashInterval == 0) {
    return;
  } else if (trashInterval < 0) {
    throw new IOException(
        "Cannot start tresh emptier with negative interval." + " Set " +
            FS_TRASH_INTERVAL_KEY + " to a positive value.");
  }

  // This may be called from the transitionToActive code path, in which
  // case the current user is the administrator, not the NN. The trash
  // emptier needs to run as the NN. See HDFS-3972.
  FileSystem fs =
      SecurityUtil.doAsLoginUser(new PrivilegedExceptionAction<FileSystem>() {
            @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();
}
项目:hops    文件:Delete.java   
private boolean moveToTrash(PathData item) throws IOException {
  boolean success = false;
  if (!skipTrash) {
    try {
      success = Trash.moveToAppropriateTrash(item.fs, item.path, getConf());
    } catch(FileNotFoundException fnfe) {
      throw fnfe;
    } catch (IOException ioe) {
      String msg = ioe.getMessage();
      if (ioe.getCause() != null) {
        msg += ": " + ioe.getCause().getMessage();
      }
      throw new IOException(msg + ". Consider using -skipTrash option", ioe);
    }
  }
  return success;
}
项目:incubator-gobblin    文件:HadoopUtilsTest.java   
@Test
public void testMoveToTrash() throws IOException {
  Path hadoopUtilsTestDir = new Path(Files.createTempDir().getAbsolutePath(), "HadoopUtilsTestDir");
  Configuration conf = new Configuration();
  // Set the time to keep it in trash to 10 minutes.
  // 0 means object will be deleted instantly.
  conf.set("fs.trash.interval", "10");
  FileSystem fs = FileSystem.getLocal(conf);
  Trash trash = new Trash(fs, conf);
  TrashPolicy trashPolicy = TrashPolicy.getInstance(conf, fs, fs.getHomeDirectory());
  Path trashPath = trashPolicy.getCurrentTrashDir();

  fs.mkdirs(hadoopUtilsTestDir);
  Assert.assertTrue(fs.exists(hadoopUtilsTestDir));
  trash.moveToTrash(hadoopUtilsTestDir.getParent());
  Assert.assertFalse(fs.exists(hadoopUtilsTestDir));
  Assert.assertTrue(fs.exists(trashPath));
}
项目:hadoop-TCP    文件:NameNode.java   
private void startTrashEmptier(final Configuration conf) throws IOException {
  long trashInterval =
      conf.getLong(FS_TRASH_INTERVAL_KEY, FS_TRASH_INTERVAL_DEFAULT);
  if (trashInterval == 0) {
    return;
  } else if (trashInterval < 0) {
    throw new IOException("Cannot start trash emptier with negative interval."
        + " Set " + FS_TRASH_INTERVAL_KEY + " to a positive value.");
  }

  // This may be called from the transitionToActive code path, in which
  // case the current user is the administrator, not the NN. The trash
  // emptier needs to run as the NN. See HDFS-3972.
  FileSystem fs = SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<FileSystem>() {
        @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();
}
项目:hadoop-on-lustre    文件:TestTrash.java   
public static void trashNonDefaultFS(Configuration conf) throws IOException {
  conf.set("fs.trash.interval", "10"); // 10 minute
  // attempt non-default FileSystem trash
  {
    final FileSystem lfs = FileSystem.getLocal(conf);
    Path p = TEST_DIR;
    Path f = new Path(p, "foo/bar");
    if (lfs.exists(p)) {
      lfs.delete(p, true);
    }
    try {
      f = writeFile(lfs, f);

      FileSystem.closeAll();
      FileSystem localFs = FileSystem.get(URI.create("file:///"), conf);
      Trash lTrash = new Trash(localFs, conf);
      lTrash.moveToTrash(f.getParent());
      checkTrash(localFs, lTrash.getCurrentTrashDir(), f);
    } finally {
      if (lfs.exists(p)) {
        lfs.delete(p, true);
      }
    }
  }
}
项目:hardfs    文件:NameNode.java   
private void startTrashEmptier(final Configuration conf) throws IOException {
  long trashInterval =
      conf.getLong(FS_TRASH_INTERVAL_KEY, FS_TRASH_INTERVAL_DEFAULT);
  if (trashInterval == 0) {
    return;
  } else if (trashInterval < 0) {
    throw new IOException("Cannot start trash emptier with negative interval."
        + " Set " + FS_TRASH_INTERVAL_KEY + " to a positive value.");
  }

  // This may be called from the transitionToActive code path, in which
  // case the current user is the administrator, not the NN. The trash
  // emptier needs to run as the NN. See HDFS-3972.
  FileSystem fs = SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<FileSystem>() {
        @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();
}
项目:hadoop-on-lustre2    文件:NameNode.java   
private void startTrashEmptier(final Configuration conf) throws IOException {
  long trashInterval =
      conf.getLong(FS_TRASH_INTERVAL_KEY, FS_TRASH_INTERVAL_DEFAULT);
  if (trashInterval == 0) {
    return;
  } else if (trashInterval < 0) {
    throw new IOException("Cannot start trash emptier with negative interval."
        + " Set " + FS_TRASH_INTERVAL_KEY + " to a positive value.");
  }

  // This may be called from the transitionToActive code path, in which
  // case the current user is the administrator, not the NN. The trash
  // emptier needs to run as the NN. See HDFS-3972.
  FileSystem fs = SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<FileSystem>() {
        @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();
}
项目:RDFS    文件:TestTrash.java   
public static void trashNonDefaultFS(Configuration conf) throws IOException {
  conf.set("fs.trash.interval", "10"); // 10 minute
  // attempt non-default FileSystem trash
  {
    final FileSystem lfs = FileSystem.getLocal(conf);
    Path p = TEST_DIR;
    Path f = new Path(p, "foo/bar");
    if (lfs.exists(p)) {
      lfs.delete(p, true);
    }
    try {
      f = writeFile(lfs, f);

      FileSystem.closeAll();
      FileSystem localFs = FileSystem.get(URI.create("file:///"), conf);
      Trash lTrash = new Trash(localFs, conf);
      lTrash.moveToTrash(f.getParent());
      checkTrash(localFs, lTrash.getCurrentTrashDir(), f);
    } finally {
      if (lfs.exists(p)) {
        lfs.delete(p, true);
      }
    }
  }
}
项目:hadoop-0.20    文件:TestTrash.java   
public static void trashNonDefaultFS(Configuration conf) throws IOException {
  conf.set("fs.trash.interval", "10"); // 10 minute
  // attempt non-default FileSystem trash
  {
    final FileSystem lfs = FileSystem.getLocal(conf);
    Path p = TEST_DIR;
    Path f = new Path(p, "foo/bar");
    if (lfs.exists(p)) {
      lfs.delete(p, true);
    }
    try {
      f = writeFile(lfs, f);

      FileSystem.closeAll();
      FileSystem localFs = FileSystem.get(URI.create("file:///"), conf);
      Trash lTrash = new Trash(localFs, conf);
      lTrash.moveToTrash(f.getParent());
      checkTrash(localFs, lTrash.getCurrentTrashDir(), f);
    } finally {
      if (lfs.exists(p)) {
        lfs.delete(p, true);
      }
    }
  }
}
项目:hortonworks-extension    文件:TestTrash.java   
public static void trashNonDefaultFS(Configuration conf) throws IOException {
  conf.set("fs.trash.interval", "10"); // 10 minute
  // attempt non-default FileSystem trash
  {
    final FileSystem lfs = FileSystem.getLocal(conf);
    Path p = TEST_DIR;
    Path f = new Path(p, "foo/bar");
    if (lfs.exists(p)) {
      lfs.delete(p, true);
    }
    try {
      f = writeFile(lfs, f);

      FileSystem.closeAll();
      FileSystem localFs = FileSystem.get(URI.create("file:///"), conf);
      Trash lTrash = new Trash(localFs, conf);
      lTrash.moveToTrash(f.getParent());
      checkTrash(localFs, lTrash.getCurrentTrashDir(), f);
    } finally {
      if (lfs.exists(p)) {
        lfs.delete(p, true);
      }
    }
  }
}
项目:hortonworks-extension    文件:TestTrash.java   
public static void trashNonDefaultFS(Configuration conf) throws IOException {
  conf.set("fs.trash.interval", "10"); // 10 minute
  // attempt non-default FileSystem trash
  {
    final FileSystem lfs = FileSystem.getLocal(conf);
    Path p = TEST_DIR;
    Path f = new Path(p, "foo/bar");
    if (lfs.exists(p)) {
      lfs.delete(p, true);
    }
    try {
      f = writeFile(lfs, f);

      FileSystem.closeAll();
      FileSystem localFs = FileSystem.get(URI.create("file:///"), conf);
      Trash lTrash = new Trash(localFs, conf);
      lTrash.moveToTrash(f.getParent());
      checkTrash(localFs, lTrash.getCurrentTrashDir(), f);
    } finally {
      if (lfs.exists(p)) {
        lfs.delete(p, true);
      }
    }
  }
}
项目:hadoop-gpu    文件:TestTrash.java   
public static void trashNonDefaultFS(Configuration conf) throws IOException {
  conf.set("fs.trash.interval", "10"); // 10 minute
  // attempt non-default FileSystem trash
  {
    final FileSystem lfs = FileSystem.getLocal(conf);
    Path p = TEST_DIR;
    Path f = new Path(p, "foo/bar");
    if (lfs.exists(p)) {
      lfs.delete(p, true);
    }
    try {
      f = writeFile(lfs, f);

      FileSystem.closeAll();
      FileSystem localFs = FileSystem.get(URI.create("file:///"), conf);
      Trash lTrash = new Trash(localFs, conf);
      lTrash.moveToTrash(f.getParent());
      checkTrash(localFs, lTrash.getCurrentTrashDir(), f);
    } finally {
      if (lfs.exists(p)) {
        lfs.delete(p, true);
      }
    }
  }
}
项目:hadoop    文件:Delete.java   
@Override
protected void processArguments(LinkedList<PathData> args)
throws IOException {
  Trash trash = new Trash(getConf());
  trash.expunge();
  trash.checkpoint();    
}
项目:linden    文件:ShardWriter.java   
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.");
  }
}
项目:big-c    文件:Delete.java   
@Override
protected void processArguments(LinkedList<PathData> args)
throws IOException {
  Trash trash = new Trash(getConf());
  trash.expunge();
  trash.checkpoint();    
}
项目:hadoop-2.6.0-cdh5.4.3    文件:Delete.java   
@Override
protected void processArguments(LinkedList<PathData> args)
throws IOException {
  Trash trash = new Trash(getConf());
  trash.expunge();
  trash.checkpoint();    
}
项目:hadoop-EAR    文件:TestTrash.java   
@Test
public void testPluggableTrash() throws IOException {
  Configuration conf = new Configuration();

  // Test plugged TrashPolicy
  conf.setClass("fs.trash.classname", TestTrashPolicy.class, TrashPolicy.class);
  Trash trash = new Trash(conf);
  assertTrue(trash.getTrashPolicy().getClass().equals(TestTrashPolicy.class));
}
项目:hadoop-EAR    文件:NameNode.java   
private void startTrashEmptier(Configuration conf) throws IOException {
  if (conf.getInt("fs.trash.interval", 0) == 0) {
    return;
  }
  FileSystem fs = NameNode.getTrashFileSystem(conf);
  this.trash = new Trash(fs, conf);
  this.emptier = new Thread(trash.getEmptier(), "Trash Emptier");
  this.emptier.setDaemon(true);
  this.emptier.start();
}
项目:hadoop-plus    文件:Delete.java   
private boolean moveToTrash(PathData item) throws IOException {
  boolean success = false;
  if (!skipTrash) {
    try {
      success = Trash.moveToAppropriateTrash(item.fs, item.path, getConf());
    } catch(FileNotFoundException fnfe) {
      throw fnfe;
    } catch (IOException ioe) {
        throw new IOException(ioe.getMessage() + ". Consider using -skipTrash option", ioe);
    }
  }
  return success;
}
项目:hadoop-plus    文件:Delete.java   
@Override
protected void processArguments(LinkedList<PathData> args)
throws IOException {
  Trash trash = new Trash(getConf());
  trash.expunge();
  trash.checkpoint();    
}
项目:PDHC    文件:TrueDelete.java   
@Override
protected void processArguments(LinkedList<PathData> args)
throws IOException {
  Trash trash = new Trash(getConf());
  trash.expunge();
  trash.checkpoint();    
}
项目:embulk-output-hdfs    文件:HdfsClient.java   
public boolean trash(final Path path)
{
    return run(new Retryable<Boolean>()
    {
        @Override
        public Boolean call()
                throws Exception
        {
            return Trash.moveToAppropriateTrash(fs, path, conf);
        }
    });
}
项目:hadoop-TCP    文件:Delete.java   
private boolean moveToTrash(PathData item) throws IOException {
  boolean success = false;
  if (!skipTrash) {
    try {
      success = Trash.moveToAppropriateTrash(item.fs, item.path, getConf());
    } catch(FileNotFoundException fnfe) {
      throw fnfe;
    } catch (IOException ioe) {
        throw new IOException(ioe.getMessage() + ". Consider using -skipTrash option", ioe);
    }
  }
  return success;
}
项目:hadoop-TCP    文件:Delete.java   
@Override
protected void processArguments(LinkedList<PathData> args)
throws IOException {
  Trash trash = new Trash(getConf());
  trash.expunge();
  trash.checkpoint();    
}
项目:hardfs    文件:Delete.java   
private boolean moveToTrash(PathData item) throws IOException {
  boolean success = false;
  if (!skipTrash) {
    try {
      success = Trash.moveToAppropriateTrash(item.fs, item.path, getConf());
    } catch(FileNotFoundException fnfe) {
      throw fnfe;
    } catch (IOException ioe) {
        throw new IOException(ioe.getMessage() + ". Consider using -skipTrash option", ioe);
    }
  }
  return success;
}
项目:hardfs    文件:Delete.java   
@Override
protected void processArguments(LinkedList<PathData> args)
throws IOException {
  Trash trash = new Trash(getConf());
  trash.expunge();
  trash.checkpoint();    
}