YARN-2241. ZKRMStateStore: On startup, show nicer messages if znodes already exist. (Robert Kanter via kasha)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1607475 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Karthik Kambatla 2014-07-02 20:36:09 +00:00
parent a9cf4e7a98
commit 99bced167b
2 changed files with 15 additions and 11 deletions

View File

@ -193,6 +193,9 @@ Release 2.5.0 - UNRELEASED
TestContainersMonitor#testContainerKillOnMemoryOverflow.
(Anubhav Dhoot via kasha)
YARN-2241. ZKRMStateStore: On startup, show nicer messages if znodes already
exist. (Robert Kanter via kasha)
OPTIMIZATIONS
BUG FIXES

View File

@ -279,20 +279,21 @@ public class ZKRMStateStore extends RMStateStore {
private void createRootDir(final String rootPath) throws Exception {
// For root dirs, we shouldn't use the doMulti helper methods
try {
new ZKAction<String>() {
@Override
public String run() throws KeeperException, InterruptedException {
new ZKAction<String>() {
@Override
public String run() throws KeeperException, InterruptedException {
try {
return zkClient.create(rootPath, null, zkAcl, CreateMode.PERSISTENT);
} catch (KeeperException ke) {
if (ke.code() == Code.NODEEXISTS) {
LOG.debug(rootPath + "znode already exists!");
return null;
} else {
throw ke;
}
}
}.runWithRetries();
} catch (KeeperException ke) {
if (ke.code() == Code.NODEEXISTS) {
LOG.debug(rootPath + "znode already exists!");
} else {
throw ke;
}
}
}.runWithRetries();
}
private void logRootNodeAcls(String prefix) throws Exception {