cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject [4/7] git commit: Make sure we clear out repair sessions from netstats
Date Tue, 03 Jun 2014 06:14:43 GMT
Make sure we clear out repair sessions from netstats

Patch by JoshuaMcKenzie; reviewed by marcuse for CASSANDRA-7329


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

Branch: refs/heads/trunk
Commit: 878990cde853d2e43f1d1da107878ddafcef6262
Parents: d0c90e0
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Tue Jun 3 08:04:52 2014 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Tue Jun 3 08:04:52 2014 +0200

----------------------------------------------------------------------
 CHANGES.txt                                                     | 1 +
 src/java/org/apache/cassandra/streaming/StreamCoordinator.java  | 5 +++++
 src/java/org/apache/cassandra/streaming/StreamResultFuture.java | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/878990cd/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 188326d..333606a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,6 @@
 2.1.0
  * Upgrade to Pig 0.12.1 (CASSANDRA-6556)
+ * Make sure we clear out repair sessions from netstats (CASSANDRA-7329)
 Merged from 2.0:
  * Fix NPE in StreamTransferTask.createMessageForRetry() (CASSANDRA-7323)
  * Make StreamSession#closeSession() idempotent (CASSANDRA-7262)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/878990cd/src/java/org/apache/cassandra/streaming/StreamCoordinator.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/streaming/StreamCoordinator.java b/src/java/org/apache/cassandra/streaming/StreamCoordinator.java
index ed94f89..4a6b193 100644
--- a/src/java/org/apache/cassandra/streaming/StreamCoordinator.java
+++ b/src/java/org/apache/cassandra/streaming/StreamCoordinator.java
@@ -73,6 +73,11 @@ public class StreamCoordinator
         return results;
     }
 
+    public boolean isReceiving()
+    {
+        return connectionsPerHost == 0;
+    }
+
     public void connectAllStreamSessions()
     {
         for (HostStreamingData data : peerSessions.values())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/878990cd/src/java/org/apache/cassandra/streaming/StreamResultFuture.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/streaming/StreamResultFuture.java b/src/java/org/apache/cassandra/streaming/StreamResultFuture.java
index cc7abbb..6a143d1 100644
--- a/src/java/org/apache/cassandra/streaming/StreamResultFuture.java
+++ b/src/java/org/apache/cassandra/streaming/StreamResultFuture.java
@@ -65,7 +65,7 @@ public final class StreamResultFuture extends AbstractFuture<StreamState>
         this.coordinator = coordinator;
 
         // if there is no session to listen to, we immediately set result for returning
-        if (!coordinator.hasActiveSessions())
+        if (!coordinator.isReceiving() && !coordinator.hasActiveSessions())
             set(getCurrentState());
     }
 


Mime
View raw message