You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2013/03/19 04:11:14 UTC

svn commit: r1458103 - /hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java

Author: stack
Date: Tue Mar 19 03:11:14 2013
New Revision: 1458103

URL: http://svn.apache.org/r1458103
Log:
HBASE-8142 Sporadic TestZKProcedureControllers failures on trunk

Modified:
    hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java?rev=1458103&r1=1458102&r2=1458103&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java (original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java Tue Mar 19 03:11:14 2013
@@ -883,9 +883,6 @@ public class ZKUtil {
    * Set data into node creating node if it doesn't yet exist.
    * Does not set watch.
    *
-   * WARNING: this is not atomic -- it is possible to get a 0-byte data value in the znode before
-   * data is written
-   *
    * @param zkw zk reference
    * @param znode path of node
    * @param data data to set for node
@@ -895,9 +892,10 @@ public class ZKUtil {
       final byte [] data)
   throws KeeperException {
     if (checkExists(zkw, znode) == -1) {
-      ZKUtil.createWithParents(zkw, znode);
+      ZKUtil.createWithParents(zkw, znode, data);
+    } else {
+      ZKUtil.setData(zkw, znode, data);
     }
-    ZKUtil.setData(zkw, znode, data);
   }
 
   /**