Commit 02eeafe1 by fudahua

feat: 删除文件

parent 0e338de7
......@@ -910,6 +910,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
logger.info("不存在");
return;
}
boolean delHiveFile=true;
Integer queryDataType = task.getQueryDataType();
FlatQueryTaskCondition condition = JSON.parseObject(task.getDownloadCondition(), FlatQueryTaskCondition.class);
if (!task.getStatus().equals(DownloadTaskStatus.BUILDING)) {
......@@ -921,8 +922,6 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
//下载文件
String dirName=HDFSUtil.getInstance().getHdfsName(task.getId());
String path=HDFSUtil.getInstance().getHdfsPath(task.getId());
HDFSUtil.getInstance().getHdfsName(task.getId());
try {
StopWatch stopWatch = StopWatch.create("down");
stopWatch.start();
......@@ -958,6 +957,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
if (task.getAmount()!=total.intValue()) {
String msg="取数任务:"+task.getId()+"下载数量对不上: 数量: "+task.getAmount()+"->"+total;
DingWarningUtil.sendCountWarning(msg);
delHiveFile=false;
}
stopWatch.start();
//是否压缩
......@@ -993,6 +993,9 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
DownloadTaskServiceImpl.getInstance().updateDownloadTask(task);
//删除文件
delFileOrDirByTaskId(task.getId());
if (delHiveFile) {
HDFSUtil.getInstance().deleteFile(path);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment