hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject svn commit: r1458582 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
Date Wed, 20 Mar 2013 00:15:39 GMT
Author: jmhsieh
Date: Wed Mar 20 00:15:39 2013
New Revision: 1458582

URL: http://svn.apache.org/r1458582
Log:
HBASE-8142 Sporadic TestZKProcedureController failures (Jeffrey Zhong)


Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java?rev=1458582&r1=1458581&r2=1458582&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java Wed Mar
20 00:15:39 2013
@@ -856,9 +856,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
@@ -868,9 +865,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