Skip to content

Commit

Permalink
#190 fix namespaceIsCorrect, check exists for $SaturnExecutors, $Jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaopeng-he committed Aug 16, 2017
1 parent 48d1bc5 commit 5ce9fe0
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,20 @@ public boolean namespaceIsCorrect(String namespace, CuratorFramework curatorFram
if (SaturnSelfNodePath.ROOT_NAME.equals(namespace)) {
return false;
}
return true;
try {
String executorsPath = "/" + namespace + ExecutorNodePath.getExecutorNodePath();
if (curatorFramework.checkExists().forPath(executorsPath) != null) {
return true;
}
String jobsPath = "/" + namespace + JobNodePath.get$JobsNodePath();
if (curatorFramework.checkExists().forPath(jobsPath) != null) {
return true;
}
return false;
} catch (Exception e) {
log.error(e.getMessage(), e);
return false;
}
}

@Override
Expand Down

0 comments on commit 5ce9fe0

Please sign in to comment.