hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r916005 - in /hadoop/hbase/branches/0.20: CHANGES.txt src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
Date Wed, 24 Feb 2010 22:27:42 GMT
Author: jdcryans
Date: Wed Feb 24 22:27:42 2010
New Revision: 916005

URL: http://svn.apache.org/viewvc?rev=916005&view=rev
Log:
HBASE-2262  ZKW.ensureExists should check for existence

Modified:
    hadoop/hbase/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=916005&r1=916004&r2=916005&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Wed Feb 24 22:27:42 2010
@@ -33,6 +33,7 @@
    HBASE-2220  Add a binary comparator that only compares up to the length
                of the supplied byte array (Bruno Dumon via Stack)
    HBASE-2241  Change balancer sloppyness from 0.1 to 0.3
+   HBASE-2262  ZKW.ensureExists should check for existence
 
   NEW FEATURES
    HBASE-2257  [stargate] multiuser mode

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java?rev=916005&r1=916004&r2=916005&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
Wed Feb 24 22:27:42 2010
@@ -402,6 +402,10 @@
 
   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);



Mime
View raw message