cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdusba...@apache.org
Subject svn commit: r907816 - /incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
Date Mon, 08 Feb 2010 21:55:10 GMT
Author: gdusbabek
Date: Mon Feb  8 21:55:10 2010
New Revision: 907816

URL: http://svn.apache.org/viewvc?rev=907816&view=rev
Log:
improve the concurrency of bootstrapping. Patch by Gary Dusbabek, reviewed by Jonathan Ellis.
CASSANDRA-779

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=907816&r1=907815&r2=907816&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Mon
Feb  8 21:55:10 2010
@@ -33,6 +33,7 @@
 import java.net.InetAddress;
 import javax.management.*;
 
+import com.google.common.collect.Multimaps;
 import org.apache.cassandra.concurrent.*;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.*;
@@ -145,14 +146,14 @@
     private boolean isClientMode;
     private boolean initialized;
 
-    public synchronized void addBootstrapSource(InetAddress s, String table)
+    public void addBootstrapSource(InetAddress s, String table)
     {
         if (logger_.isDebugEnabled())
             logger_.debug(String.format("Added %s/%s as a bootstrap source", s, table));
         bootstrapSet.put(s, table);
     }
 
-    public synchronized void removeBootstrapSource(InetAddress s, String table)
+    public void removeBootstrapSource(InetAddress s, String table)
     {
         if (table == null)
             bootstrapSet.removeAll(s);
@@ -197,7 +198,7 @@
             throw new RuntimeException(e);
         }
 
-        bootstrapSet = HashMultimap.create();
+        bootstrapSet = Multimaps.synchronizedSetMultimap(HashMultimap.<InetAddress, String>create());
 
         /* register the verb handlers */
         MessagingService.instance.registerVerbHandlers(Verb.BINARY, new BinaryVerbHandler());



Mime
View raw message