manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1625863 - in /manifoldcf/branches/release-1.7-branch: ./ framework/core/src/main/java/org/apache/manifoldcf/core/lockmanager/ZooKeeperConnection.java
Date Thu, 18 Sep 2014 00:21:10 GMT
Author: kwright
Date: Thu Sep 18 00:21:09 2014
New Revision: 1625863

URL: http://svn.apache.org/r1625863
Log:
Pull up another change for CONNECTORS-1036 from dev_1x branch

Modified:
    manifoldcf/branches/release-1.7-branch/   (props changed)
    manifoldcf/branches/release-1.7-branch/framework/core/src/main/java/org/apache/manifoldcf/core/lockmanager/ZooKeeperConnection.java

Propchange: manifoldcf/branches/release-1.7-branch/
------------------------------------------------------------------------------
  Merged /manifoldcf/branches/dev_1x:r1625862
  Merged /manifoldcf/trunk:r1625861

Modified: manifoldcf/branches/release-1.7-branch/framework/core/src/main/java/org/apache/manifoldcf/core/lockmanager/ZooKeeperConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-1.7-branch/framework/core/src/main/java/org/apache/manifoldcf/core/lockmanager/ZooKeeperConnection.java?rev=1625863&r1=1625862&r2=1625863&view=diff
==============================================================================
--- manifoldcf/branches/release-1.7-branch/framework/core/src/main/java/org/apache/manifoldcf/core/lockmanager/ZooKeeperConnection.java
(original)
+++ manifoldcf/branches/release-1.7-branch/framework/core/src/main/java/org/apache/manifoldcf/core/lockmanager/ZooKeeperConnection.java
Thu Sep 18 00:21:09 2014
@@ -310,7 +310,6 @@ public class ZooKeeperConnection
       try
       {
         // Assert that we want a write lock
-        String lockNode = this.lockNode;
         if (lockNode == null)
           lockNode = createSequentialChild(lockPath,WRITE_PREFIX);
         String lockSequenceNumber = lockNode.substring(lockPath.length() + 1 + WRITE_PREFIX.length());
@@ -335,9 +334,13 @@ public class ZooKeeperConnection
           }
         }
         // We got it!
-        this.lockNode = lockNode;
         return true;
       }
+      catch (InterruptedException e)
+      {
+        lockNode = null;
+        throw e;
+      }
       catch (KeeperException e)
       {
         handleEphemeralNodeKeeperException(e,true);
@@ -359,7 +362,6 @@ public class ZooKeeperConnection
       try
       {
         // Assert that we want a write lock
-        String lockNode = this.lockNode;
         if (lockNode == null)
           lockNode = createSequentialChild(lockPath,WRITE_PREFIX);
         long lockSequenceNumber = new Long(lockNode.substring(lockPath.length() + 1 + WRITE_PREFIX.length())).longValue();
@@ -402,7 +404,6 @@ public class ZooKeeperConnection
           {
             // We got it!
             //System.out.println("Got write lock for '"+lockSequenceNumber+"'");
-            this.lockNode = lockNode;
             return;
           }
 
@@ -421,6 +422,11 @@ public class ZooKeeperConnection
           //  System.out.println(" Retrying for write lock '"+lockSequenceNumber+"'");
         }
       }
+      catch (InterruptedException e)
+      {
+        lockNode = null;
+        throw e;
+      }
       catch (KeeperException e)
       {
         handleEphemeralNodeKeeperException(e,true);
@@ -443,7 +449,6 @@ public class ZooKeeperConnection
       try
       {
         // Assert that we want a read lock
-        String lockNode = this.lockNode;
         if (lockNode == null)
           lockNode = createSequentialChild(lockPath,NONEXWRITE_PREFIX);
         String lockSequenceNumber = lockNode.substring(lockPath.length() + 1 + NONEXWRITE_PREFIX.length());
@@ -488,9 +493,13 @@ public class ZooKeeperConnection
           }
         }
         // We got it!
-        this.lockNode = lockNode;
         return true;
       }
+      catch (InterruptedException e)
+      {
+        lockNode = null;
+        throw e;
+      }
       catch (KeeperException e)
       {
         handleEphemeralNodeKeeperException(e,true);
@@ -512,7 +521,6 @@ public class ZooKeeperConnection
       try
       {
         // Assert that we want a read lock
-        String lockNode = this.lockNode;
         if (lockNode == null)
           lockNode = createSequentialChild(lockPath,NONEXWRITE_PREFIX);
         long lockSequenceNumber = new Long(lockNode.substring(lockPath.length() + 1 + NONEXWRITE_PREFIX.length())).longValue();
@@ -570,7 +578,6 @@ public class ZooKeeperConnection
           if (gotLock)
           {
             // We got it!
-            this.lockNode = lockNode;
             return;
           }
 
@@ -586,6 +593,11 @@ public class ZooKeeperConnection
           }
         }
       }
+      catch (InterruptedException e)
+      {
+        lockNode = null;
+        throw e;
+      }
       catch (KeeperException e)
       {
         handleEphemeralNodeKeeperException(e,true);
@@ -608,7 +620,6 @@ public class ZooKeeperConnection
       try
       {
         // Assert that we want a read lock
-        String lockNode = this.lockNode;
         if (lockNode == null)
           lockNode = createSequentialChild(lockPath,READ_PREFIX);
         String lockSequenceNumber = lockNode.substring(lockPath.length() + 1 + READ_PREFIX.length());
@@ -649,9 +660,13 @@ public class ZooKeeperConnection
           }
         }
         // We got it!
-        this.lockNode= lockNode;
         return true;
       }
+      catch (InterruptedException e)
+      {
+        lockNode = null;
+        throw e;
+      }
       catch (KeeperException e)
       {
         handleEphemeralNodeKeeperException(e,true);
@@ -673,7 +688,6 @@ public class ZooKeeperConnection
       try
       {
         // Assert that we want a read lock
-        String lockNode = this.lockNode;
         if (lockNode == null)
           lockNode = createSequentialChild(lockPath,READ_PREFIX);
         long lockSequenceNumber = new Long(lockNode.substring(lockPath.length() + 1 + READ_PREFIX.length())).longValue();
@@ -734,7 +748,6 @@ public class ZooKeeperConnection
           {
             // We got it!
             //System.out.println("Got read lock for '"+lockSequenceNumber+"'");
-            this.lockNode = lockNode;
             return;
           }
 
@@ -754,6 +767,11 @@ public class ZooKeeperConnection
 
         }
       }
+      catch (InterruptedException e)
+      {
+        lockNode = null;
+        throw e;
+      }
       catch (KeeperException e)
       {
         handleEphemeralNodeKeeperException(e,true);



Mime
View raw message