APACHE-KYLIN-2905: Refine the process of submitting a job Signed-off-by: lidongsjtu <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/58005727 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/58005727 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/58005727 Branch: refs/heads/master Commit: 58005727ea7f0f9a35a83c737b1a6b9c6b342f6f Parents: 7ca66d4 Author: Zhong <[email protected]> Authored: Tue Sep 26 16:57:44 2017 +0800 Committer: lidongsjtu <[email protected]> Committed: Wed Dec 20 23:27:33 2017 +0800 ---------------------------------------------------------------------- .../java/org/apache/kylin/job/execution/ExecutableManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/58005727/core-job/src/main/java/org/apache/kylin/job/execution/ExecutableManager.java ---------------------------------------------------------------------- diff --git a/core-job/src/main/java/org/apache/kylin/job/execution/ExecutableManager.java b/core-job/src/main/java/org/apache/kylin/job/execution/ExecutableManager.java index bc38fff..c41c074 100644 --- a/core-job/src/main/java/org/apache/kylin/job/execution/ExecutableManager.java +++ b/core-job/src/main/java/org/apache/kylin/job/execution/ExecutableManager.java @@ -109,8 +109,11 @@ public class ExecutableManager { public void addJob(AbstractExecutable executable) { try { executable.initConfig(config); - executableDao.addJob(parse(executable)); + if (executableDao.getJob(executable.getId()) != null) { + throw new IllegalArgumentException("job id:" + executable.getId() + " already exists"); + } addJobOutput(executable); + executableDao.addJob(parse(executable)); } catch (PersistentException e) { logger.error("fail to submit job:" + executable.getId(), e); throw new RuntimeException(e);
