org.apache.hadoop.hive.ql.metadata.Hive.trashFiles()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(542)

本文整理了Java中org.apache.hadoop.hive.ql.metadata.Hive.trashFiles()方法的一些代码示例,展示了Hive.trashFiles()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hive.trashFiles()方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.metadata.Hive
类名称:Hive
方法名:trashFiles

Hive.trashFiles介绍

[英]Trashes or deletes all files under a directory. Leaves the directory as is.
[中]刷新或删除目录下的所有文件。使目录保持原样。

代码示例

代码示例来源:origin: apache/hive

  1. public void cleanUpOneDirectoryForReplace(Path path, FileSystem fs,
  2. PathFilter pathFilter, HiveConf conf, boolean purge, boolean isNeedRecycle) throws IOException, HiveException {
  3. if (isNeedRecycle && conf.getBoolVar(HiveConf.ConfVars.REPLCMENABLED)) {
  4. recycleDirToCmPath(path, purge);
  5. }
  6. FileStatus[] statuses = fs.listStatus(path, pathFilter);
  7. if (statuses == null || statuses.length == 0) {
  8. return;
  9. }
  10. if (Utilities.FILE_OP_LOGGER.isTraceEnabled()) {
  11. String s = "Deleting files under " + path + " for replace: ";
  12. for (FileStatus file : statuses) {
  13. s += file.getPath().getName() + ", ";
  14. }
  15. Utilities.FILE_OP_LOGGER.trace(s);
  16. }
  17. if (!trashFiles(fs, statuses, conf, purge)) {
  18. throw new HiveException("Old path " + path + " has not been cleaned up.");
  19. }
  20. }

代码示例来源:origin: apache/hive

  1. boolean isAutoPurge = "true".equalsIgnoreCase(tbl.getProperty("auto.purge"));
  2. final FileStatus status = newPathFileSystem.getFileStatus(partition.getPartitionPath());
  3. Hive.trashFiles(newPathFileSystem, new FileStatus[]{status}, this.getConf(), isAutoPurge);

代码示例来源:origin: apache/drill

  1. oldPathDeleted = trashFiles(oldFs, statuses, conf, purge);

代码示例来源:origin: apache/hive

  1. boolean isAutoPurge = "true".equalsIgnoreCase(tbl.getProperty("auto.purge"));
  2. final FileStatus status = newPathFileSystem.getFileStatus(newTPart.getPartitionPath());
  3. Hive.trashFiles(newPathFileSystem, new FileStatus[]{status}, this.getConf(), isAutoPurge);
  4. } catch (IOException io) {
  5. LOG.error("Could not delete partition directory contents after failed partition creation: ", io);

代码示例来源:origin: apache/hive

  1. FileStatus[] statuses = fs.listStatus(location, FileUtils.HIDDEN_FILES_PATH_FILTER);
  2. if ((statuses != null) && (statuses.length > 0)) {
  3. boolean success = Hive.trashFiles(fs, statuses, conf, isAutopurge);
  4. if (!success) {
  5. throw new HiveException("Error in deleting the contents of " + location.toString());

代码示例来源:origin: apache/drill

  1. continue;
  2. boolean success = Hive.trashFiles(fs, statuses, conf, isAutopurge);
  3. if (!success) {
  4. throw new HiveException("Error in deleting the contents of " + location.toString());

相关文章

Hive类方法