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/trunk@1607473 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Karthik Kambatla 2014-07-02 20:33:26 +00:00
parent 297e3c72fb
commit 447c1c233b
2 changed files with 15 additions and 11 deletions

View File

@ -215,6 +215,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 synchronized void startInternal() throws Exception {
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 {