forked from github/dataease
fix: 执行问任务后删除文件
This commit is contained in:
parent
6c7f72f862
commit
532cdf67b4
@ -184,15 +184,15 @@ public class ExtractDataService {
|
|||||||
replaceTable(DorisTableUtils.dorisName(datasetTableId));
|
replaceTable(DorisTableUtils.dorisName(datasetTableId));
|
||||||
saveSucessLog(datasetTableTaskLog);
|
saveSucessLog(datasetTableTaskLog);
|
||||||
// sendWebMsg(datasetTable, null, true);
|
// sendWebMsg(datasetTable, null, true);
|
||||||
deleteFile("all_scope", datasetTableId);
|
|
||||||
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime);
|
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
saveErrorLog(datasetTableId, null, e);
|
saveErrorLog(datasetTableId, null, e);
|
||||||
// sendWebMsg(datasetTable, null, false);
|
// sendWebMsg(datasetTable, null, false);
|
||||||
updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null);
|
updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null);
|
||||||
dropDorisTable(DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTableId)));
|
dropDorisTable(DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTableId)));
|
||||||
deleteFile("all_scope", datasetTableId);
|
|
||||||
} finally {
|
} finally {
|
||||||
|
deleteFile("all_scope", datasetTableId);
|
||||||
|
deleteFile(new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class).getData());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -210,9 +210,9 @@ public class ExtractDataService {
|
|||||||
saveErrorLog(datasetTableId, null, e);
|
saveErrorLog(datasetTableId, null, e);
|
||||||
// sendWebMsg(datasetTable, null, false);
|
// sendWebMsg(datasetTable, null, false);
|
||||||
updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null);
|
updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null);
|
||||||
|
} finally {
|
||||||
deleteFile("incremental_add", datasetTableId);
|
deleteFile("incremental_add", datasetTableId);
|
||||||
deleteFile("incremental_delete", datasetTableId);
|
deleteFile("incremental_delete", datasetTableId);
|
||||||
} finally {
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -930,38 +930,36 @@ public class ExtractDataService {
|
|||||||
case "all_scope":
|
case "all_scope":
|
||||||
transName = "trans_" + DorisTableUtils.dorisName(dataSetTableId);
|
transName = "trans_" + DorisTableUtils.dorisName(dataSetTableId);
|
||||||
jobName = "job_" + DorisTableUtils.dorisName(dataSetTableId);
|
jobName = "job_" + DorisTableUtils.dorisName(dataSetTableId);
|
||||||
fileName = DorisTableUtils.dorisTmpName(dataSetTableId);
|
fileName = DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(dataSetTableId));
|
||||||
break;
|
break;
|
||||||
case "incremental_add":
|
case "incremental_add":
|
||||||
transName = "trans_add_" + DorisTableUtils.dorisName(dataSetTableId);
|
transName = "trans_add_" + DorisTableUtils.dorisName(dataSetTableId);
|
||||||
jobName = "job_add_" + DorisTableUtils.dorisName(dataSetTableId);
|
jobName = "job_add_" + DorisTableUtils.dorisName(dataSetTableId);
|
||||||
fileName = DorisTableUtils.dorisAddName(dataSetTableId);
|
fileName = DorisTableUtils.dorisAddName(DorisTableUtils.dorisName(dataSetTableId));
|
||||||
break;
|
break;
|
||||||
case "incremental_delete":
|
case "incremental_delete":
|
||||||
transName = "trans_delete_" + DorisTableUtils.dorisName(dataSetTableId);
|
transName = "trans_delete_" + DorisTableUtils.dorisName(dataSetTableId);
|
||||||
jobName = "job_delete_" + DorisTableUtils.dorisName(dataSetTableId);
|
jobName = "job_delete_" + DorisTableUtils.dorisName(dataSetTableId);
|
||||||
fileName = DorisTableUtils.dorisDeleteName(dataSetTableId);
|
fileName = DorisTableUtils.dorisDeleteName(DorisTableUtils.dorisName(dataSetTableId));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
try {
|
deleteFile(root_path + fileName + "." + extention);
|
||||||
File file = new File(root_path + fileName + "." + extention);
|
deleteFile(root_path + jobName + ".kjb");
|
||||||
FileUtils.forceDelete(file);
|
deleteFile(root_path + transName + ".ktr");
|
||||||
} catch (Exception e) {
|
}
|
||||||
|
|
||||||
|
private void deleteFile(String filePath){
|
||||||
|
if(StringUtils.isEmpty(filePath)){
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
File file = new File(root_path + jobName + ".kjb");
|
File file = new File(filePath);
|
||||||
FileUtils.forceDelete(file);
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
File file = new File(root_path + transName + ".ktr");
|
|
||||||
FileUtils.forceDelete(file);
|
FileUtils.forceDelete(file);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isKettleRunning() {
|
public boolean isKettleRunning() {
|
||||||
try {
|
try {
|
||||||
if (!InetAddress.getByName(carte).isReachable(1000)) {
|
if (!InetAddress.getByName(carte).isReachable(1000)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user