HBASE-2262 ZKW.ensureExists should check for existence
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@916004 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4ca0a97783
commit
c1333aa61c
|
@ -382,6 +382,7 @@ Release 0.21.0 - Unreleased
|
|||
HBASE-2241 Change balancer sloppyness from 0.1 to 0.3
|
||||
HBASE-2250 typo in the maven pom
|
||||
HBASE-2254 Improvements to the Maven POMs (Lars Francke via Stack)
|
||||
HBASE-2262 ZKW.ensureExists should check for existence
|
||||
|
||||
NEW FEATURES
|
||||
HBASE-1961 HBase EC2 scripts
|
||||
|
|
|
@ -398,6 +398,10 @@ public class ZooKeeperWrapper implements HConstants {
|
|||
|
||||
private boolean ensureExists(final String znode) {
|
||||
try {
|
||||
Stat stat = zooKeeper.exists(znode, false);
|
||||
if (stat != null) {
|
||||
return true;
|
||||
}
|
||||
zooKeeper.create(znode, new byte[0],
|
||||
Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
|
||||
LOG.debug("Created ZNode " + znode);
|
||||
|
|
Loading…
Reference in New Issue