hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1458102 - /hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
Date Tue, 19 Mar 2013 03:10:54 GMT
Author: stack
Date: Tue Mar 19 03:10:54 2013
New Revision: 1458102

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

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

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java?rev=1458102&r1=1458101&r2=1458102&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java (original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java Tue
Mar 19 03:10:54 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);
   }
 
   /**



Mime
View raw message