本文整理了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
[英]Trashes or deletes all files under a directory. Leaves the directory as is.
[中]刷新或删除目录下的所有文件。使目录保持原样。
代码示例来源:origin: apache/hive
public void cleanUpOneDirectoryForReplace(Path path, FileSystem fs,
PathFilter pathFilter, HiveConf conf, boolean purge, boolean isNeedRecycle) throws IOException, HiveException {
if (isNeedRecycle && conf.getBoolVar(HiveConf.ConfVars.REPLCMENABLED)) {
recycleDirToCmPath(path, purge);
}
FileStatus[] statuses = fs.listStatus(path, pathFilter);
if (statuses == null || statuses.length == 0) {
return;
}
if (Utilities.FILE_OP_LOGGER.isTraceEnabled()) {
String s = "Deleting files under " + path + " for replace: ";
for (FileStatus file : statuses) {
s += file.getPath().getName() + ", ";
}
Utilities.FILE_OP_LOGGER.trace(s);
}
if (!trashFiles(fs, statuses, conf, purge)) {
throw new HiveException("Old path " + path + " has not been cleaned up.");
}
}
代码示例来源:origin: apache/hive
boolean isAutoPurge = "true".equalsIgnoreCase(tbl.getProperty("auto.purge"));
final FileStatus status = newPathFileSystem.getFileStatus(partition.getPartitionPath());
Hive.trashFiles(newPathFileSystem, new FileStatus[]{status}, this.getConf(), isAutoPurge);
代码示例来源:origin: apache/drill
oldPathDeleted = trashFiles(oldFs, statuses, conf, purge);
代码示例来源:origin: apache/hive
boolean isAutoPurge = "true".equalsIgnoreCase(tbl.getProperty("auto.purge"));
final FileStatus status = newPathFileSystem.getFileStatus(newTPart.getPartitionPath());
Hive.trashFiles(newPathFileSystem, new FileStatus[]{status}, this.getConf(), isAutoPurge);
} catch (IOException io) {
LOG.error("Could not delete partition directory contents after failed partition creation: ", io);
代码示例来源:origin: apache/hive
FileStatus[] statuses = fs.listStatus(location, FileUtils.HIDDEN_FILES_PATH_FILTER);
if ((statuses != null) && (statuses.length > 0)) {
boolean success = Hive.trashFiles(fs, statuses, conf, isAutopurge);
if (!success) {
throw new HiveException("Error in deleting the contents of " + location.toString());
代码示例来源:origin: apache/drill
continue;
boolean success = Hive.trashFiles(fs, statuses, conf, isAutopurge);
if (!success) {
throw new HiveException("Error in deleting the contents of " + location.toString());
内容来源于网络,如有侵权,请联系作者删除!