cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [3/4] git commit: reset callbacks map in MS.listen to allow RemoveTest to restart it
Date Thu, 12 Jan 2012 02:49:20 GMT
reset callbacks map in MS.listen to allow RemoveTest to restart it


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

Branch: refs/heads/trunk
Commit: 1e750138177e9cd9cbd6537451a4b5cd301dab3a
Parents: 452ddf6
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Wed Jan 11 20:26:44 2012 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Wed Jan 11 20:26:44 2012 -0600

----------------------------------------------------------------------
 .../org/apache/cassandra/net/MessagingService.java |    4 ++--
 .../org/apache/cassandra/utils/ExpiringMap.java    |    3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1e750138/src/java/org/apache/cassandra/net/MessagingService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/MessagingService.java b/src/java/org/apache/cassandra/net/MessagingService.java
index 99037a1..e12f9ee 100644
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@ -228,6 +228,7 @@ public final class MessagingService implements MessagingServiceMBean
      */
     public void listen(InetAddress localEp) throws IOException, ConfigurationException
     {
+        callbacks.reset(); // hack to allow tests to stop/restart MS
         for (ServerSocket ss: getServerSocket(localEp))
         {
             SocketThread th = new SocketThread(ss, "ACCEPT-" + localEp);
@@ -471,7 +472,7 @@ public final class MessagingService implements MessagingServiceMBean
 
     public void clearCallbacksUnsafe()
     {
-        callbacks.clear();
+        callbacks.reset();
     }
 
     /**
@@ -496,7 +497,6 @@ public final class MessagingService implements MessagingServiceMBean
         {
             throw new IOError(e);
         }
-
     }
 
     public void receive(Message message, String id)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1e750138/src/java/org/apache/cassandra/utils/ExpiringMap.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/ExpiringMap.java b/src/java/org/apache/cassandra/utils/ExpiringMap.java
index 0672259..000af72 100644
--- a/src/java/org/apache/cassandra/utils/ExpiringMap.java
+++ b/src/java/org/apache/cassandra/utils/ExpiringMap.java
@@ -121,8 +121,9 @@ public class ExpiringMap<K, V>
         timer.cancel();
     }
 
-    public void clear()
+    public void reset()
     {
+        shutdown = false;
         cache.clear();
     }
 


Mime
View raw message