Skip to content

Commit

Permalink
delete /execute_output metadata when deleting a job
Browse files Browse the repository at this point in the history
  • Loading branch information
ChangjiGuo authored and nichunen committed Jan 3, 2020
1 parent 1aa20f9 commit 7d87032
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions core-job/src/main/java/org/apache/kylin/job/dao/ExecutableDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,31 @@ public ExecutablePO updateJob(ExecutablePO job) throws PersistentException {

public void deleteJob(String uuid) throws PersistentException {
try {
ExecutablePO executablePO = getJob(uuid);
store.deleteResource(pathOfJob(uuid));
executableDigestMap.remove(uuid);
removeJobOutput(executablePO);
} catch (IOException e) {
logger.error("error delete job:" + uuid, e);
throw new PersistentException(e);
}
}

private void removeJobOutput(ExecutablePO executablePO) {
List<String> toDeletePaths = Lists.newArrayList();
try {
toDeletePaths.add(pathOfJobOutput(executablePO.getUuid()));
for (ExecutablePO task : executablePO.getTasks()) {
toDeletePaths.add(pathOfJobOutput(task.getUuid()));
}
for (String path : toDeletePaths) {
store.deleteResource(path);
}
} catch (Exception e) {
logger.warn("error delete job output:" + executablePO.getUuid(), e);
}
}

public ExecutableOutputPO getJobOutput(String uuid) throws PersistentException {
ExecutableOutputPO result = null;
try {
Expand Down

0 comments on commit 7d87032

Please sign in to comment.