You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2016/11/10 01:24:20 UTC

[1/2] curator git commit: keep consistent with the default session id defined in ZooKeeper

Repository: curator
Updated Branches:
  refs/heads/CURATOR-3.0 d8798c21d -> 905b062b3


keep consistent with the default session id defined in ZooKeeper


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/e9bfb435
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/e9bfb435
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/e9bfb435

Branch: refs/heads/CURATOR-3.0
Commit: e9bfb4353ae75dd5aa369ae4aa76b9d8cadb7e50
Parents: dd20f1d
Author: Fangmin Lyu <al...@fb.com>
Authored: Tue Nov 1 16:05:39 2016 -0700
Committer: Fangmin Lyu <al...@fb.com>
Committed: Tue Nov 1 16:05:39 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/curator/ConnectionState.java  | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/e9bfb435/curator-client/src/main/java/org/apache/curator/ConnectionState.java
----------------------------------------------------------------------
diff --git a/curator-client/src/main/java/org/apache/curator/ConnectionState.java b/curator-client/src/main/java/org/apache/curator/ConnectionState.java
index 9712899..7044ddf 100644
--- a/curator-client/src/main/java/org/apache/curator/ConnectionState.java
+++ b/curator-client/src/main/java/org/apache/curator/ConnectionState.java
@@ -163,7 +163,7 @@ class ConnectionState implements Watcher, Closeable
         for ( Watcher parentWatcher : parentWatchers )
         {
 
-            OperationTrace trace = new OperationTrace("connection-state-parent-process", tracer.get());
+            OperationTrace trace = new OperationTrace("connection-state-parent-process", tracer.get(), getSessionId());
             parentWatcher.process(event);
             trace.commit();
         }
@@ -213,16 +213,14 @@ class ConnectionState implements Watcher, Closeable
      * Return the current session id
      */
     public long getSessionId() {
-        long sessionId = -1;
-        if (isConnected()) {
-            try {
-                ZooKeeper zk = zooKeeper.getZooKeeper();
-                if (zk != null) {
-                    sessionId = zk.getSessionId();
-                }
-            } catch (Exception e) {
-                // Ignore the exception
+        long sessionId = 0;
+        try {
+            ZooKeeper zk = zooKeeper.getZooKeeper();
+            if (zk != null) {
+                sessionId = zk.getSessionId();
             }
+        } catch (Exception e) {
+            // Ignore the exception
         }
         return sessionId;
     }


[2/2] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by ra...@apache.org.
Merge branch 'master' into CURATOR-3.0


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/905b062b
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/905b062b
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/905b062b

Branch: refs/heads/CURATOR-3.0
Commit: 905b062b370c3cff399f3f726a6d74ab44d7618e
Parents: d8798c2 e9bfb43
Author: randgalt <ra...@apache.org>
Authored: Wed Nov 9 20:24:11 2016 -0500
Committer: randgalt <ra...@apache.org>
Committed: Wed Nov 9 20:24:11 2016 -0500

----------------------------------------------------------------------
 .../java/org/apache/curator/ConnectionState.java  | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/905b062b/curator-client/src/main/java/org/apache/curator/ConnectionState.java
----------------------------------------------------------------------
diff --cc curator-client/src/main/java/org/apache/curator/ConnectionState.java
index 4191778,7044ddf..b5af9f2
--- a/curator-client/src/main/java/org/apache/curator/ConnectionState.java
+++ b/curator-client/src/main/java/org/apache/curator/ConnectionState.java
@@@ -178,7 -162,8 +178,7 @@@ class ConnectionState implements Watche
  
          for ( Watcher parentWatcher : parentWatchers )
          {
-             OperationTrace trace = new OperationTrace("connection-state-parent-process", tracer.get());
 -
+             OperationTrace trace = new OperationTrace("connection-state-parent-process", tracer.get(), getSessionId());
              parentWatcher.process(event);
              trace.commit();
          }