Author: stack
Date: Thu Apr 14 04:39:48 2011
New Revision: 1092001

URL: http://svn.apache.org/viewvc?rev=1092001&view=rev
Log:
 HBASE-3708  createAndFailSilent is not so silent; leaves lots of logging in  
ensemble logs 

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java

Modified: hbase/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1092001&r1=1092000&r2=1092001&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Thu Apr 14 04:39:48 2011
@@ -206,6 +206,8 @@ Release 0.90.3 - Unreleased
    HBASE-3771  All jsp pages don't clean their HBA
    HBASE-3685  when multiple columns are combined with TimestampFilter, only
                one column is returned (Jerry Chen)
+   HBASE-3708  createAndFailSilent is not so silent; leaves lots of logging
+               in ensemble logs (Dmitriy Ryaboy)
 
   IMPROVEMENTS
    HBASE-3747  ReplicationSource should differanciate remote and local 
exceptions

Modified: 
hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
URL: 
http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java?rev=1092001&r1=1092000&r2=1092001&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java 
(original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java Thu 
Apr 14 04:39:48 2011
@@ -320,7 +320,7 @@ public class ZKUtil {
    * @return list of znode names, null if the node doesn't exist
    * @throws KeeperException
    */
-  public static List<String> listChildrenAndWatchThem(ZooKeeperWatcher zkw, 
+  public static List<String> listChildrenAndWatchThem(ZooKeeperWatcher zkw,
       String znode) throws KeeperException {
     List<String> children = listChildrenAndWatchForNewChildren(zkw, znode);
     if (children == null) {
@@ -718,7 +718,7 @@ public class ZKUtil {
    * @param zkw zk reference
    * @param znode path of node
    * @param data data to set for node
-   * @throws KeeperException 
+   * @throws KeeperException
    */
   public static void createSetData(final ZooKeeperWatcher zkw, final String 
znode,
       final byte [] data)
@@ -899,8 +899,11 @@ public class ZKUtil {
       String znode)
   throws KeeperException {
     try {
-      zkw.getZooKeeper().create(znode, new byte[0], Ids.OPEN_ACL_UNSAFE,
-          CreateMode.PERSISTENT);
+      ZooKeeper zk = zkw.getZooKeeper();
+      if (zk.exists(znode, false) != null) {
+        zk.create(znode, new byte[0], Ids.OPEN_ACL_UNSAFE,
+            CreateMode.PERSISTENT);
+      }
     } catch(KeeperException.NodeExistsException nee) {
     } catch(KeeperException.NoAuthException nee){
       try {


Reply via email to