cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r989190 - in /cassandra/trunk: ./ src/java/org/apache/cassandra/locator/ src/java/org/apache/cassandra/service/
Date Wed, 25 Aug 2010 16:02:30 GMT
Author: jbellis
Date: Wed Aug 25 16:02:30 2010
New Revision: 989190

URL: http://svn.apache.org/viewvc?rev=989190&view=rev
Log:
replace casts to ANTS with IEndpointSnitch, which incorporates all the rack/dc methods now.
 patch by jbellis; reviewed by Sylvain Lebresne for CASSANDRA-1429

Modified:
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
    cassandra/trunk/src/java/org/apache/cassandra/locator/OldNetworkTopologyStrategy.java
    cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterQuorumResponseHandler.java
    cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterSyncWriteResponseHandler.java
    cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterWriteResponseHandler.java

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=989190&r1=989189&r2=989190&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Wed Aug 25 16:02:30 2010
@@ -32,6 +32,8 @@ dev
  * allow specifying cassandra.yaml location as (local or remote) URL
    (CASSANDRA-1126)
  * added CMSInitiatingOccupancyFraction=80 to default GC options
+ * fix using DynamicEndpointSnitch with NetworkTopologyStrategy
+   (CASSANDRA-1429)
 
 
 0.7-beta1

Modified: cassandra/trunk/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java?rev=989190&r1=989189&r2=989190&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java Wed
Aug 25 16:02:30 2010
@@ -49,14 +49,14 @@ import org.apache.cassandra.thrift.Consi
  */
 public class NetworkTopologyStrategy extends AbstractReplicationStrategy
 {
-    private AbstractNetworkTopologySnitch snitch;
+    private IEndpointSnitch snitch;
     private Map<String, Integer> datacenters;
     private static final Logger logger = LoggerFactory.getLogger(NetworkTopologyStrategy.class);
 
     public NetworkTopologyStrategy(String table, TokenMetadata tokenMetadata, IEndpointSnitch
snitch, Map<String, String> configOptions) throws ConfigurationException
     {
         super(table, tokenMetadata, snitch, configOptions);
-        this.snitch = (AbstractNetworkTopologySnitch)snitch;
+        this.snitch = snitch;
 
         Map<String, Integer> newDatacenters = new HashMap<String, Integer>();
         for (Entry entry : configOptions.entrySet())

Modified: cassandra/trunk/src/java/org/apache/cassandra/locator/OldNetworkTopologyStrategy.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/locator/OldNetworkTopologyStrategy.java?rev=989190&r1=989189&r2=989190&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/locator/OldNetworkTopologyStrategy.java
(original)
+++ cassandra/trunk/src/java/org/apache/cassandra/locator/OldNetworkTopologyStrategy.java
Wed Aug 25 16:02:30 2010
@@ -55,8 +55,6 @@ public class OldNetworkTopologyStrategy 
         boolean bOtherRack = false;
         while (endpoints.size() < replicas && iter.hasNext())
         {
-            AbstractNetworkTopologySnitch snitch = (AbstractNetworkTopologySnitch) this.snitch;
-
             // First try to find one in a different data center
             Token t = iter.next();
             if (!snitch.getDatacenter(metadata.getEndpoint(primaryToken)).equals(snitch.getDatacenter(metadata.getEndpoint(t))))

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterQuorumResponseHandler.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterQuorumResponseHandler.java?rev=989190&r1=989189&r2=989190&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterQuorumResponseHandler.java
(original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterQuorumResponseHandler.java
Wed Aug 25 16:02:30 2010
@@ -25,6 +25,7 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.locator.AbstractNetworkTopologySnitch;
+import org.apache.cassandra.locator.IEndpointSnitch;
 import org.apache.cassandra.locator.NetworkTopologyStrategy;
 import org.apache.cassandra.net.Message;
 import org.apache.cassandra.thrift.ConsistencyLevel;
@@ -35,7 +36,7 @@ import org.apache.cassandra.utils.FBUtil
  */
 public class DatacenterQuorumResponseHandler<T> extends QuorumResponseHandler<T>
 {
-    private static final AbstractNetworkTopologySnitch snitch = (AbstractNetworkTopologySnitch)
DatabaseDescriptor.getEndpointSnitch();
+    private static final IEndpointSnitch snitch = DatabaseDescriptor.getEndpointSnitch();
 	private static final String localdc = snitch.getDatacenter(FBUtilities.getLocalAddress());
     private AtomicInteger localResponses;
     

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterSyncWriteResponseHandler.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterSyncWriteResponseHandler.java?rev=989190&r1=989189&r2=989190&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterSyncWriteResponseHandler.java
(original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterSyncWriteResponseHandler.java
Wed Aug 25 16:02:30 2010
@@ -32,6 +32,7 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.locator.AbstractNetworkTopologySnitch;
+import org.apache.cassandra.locator.IEndpointSnitch;
 import org.apache.cassandra.locator.NetworkTopologyStrategy;
 import org.apache.cassandra.net.Message;
 import org.apache.cassandra.thrift.ConsistencyLevel;
@@ -45,7 +46,7 @@ import org.apache.cassandra.utils.FBUtil
  */
 public class DatacenterSyncWriteResponseHandler extends AbstractWriteResponseHandler
 {
-    private static final AbstractNetworkTopologySnitch snitch = (AbstractNetworkTopologySnitch)
DatabaseDescriptor.getEndpointSnitch();
+    private static final IEndpointSnitch snitch = DatabaseDescriptor.getEndpointSnitch();
 
     private static final String localdc;
     static

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterWriteResponseHandler.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterWriteResponseHandler.java?rev=989190&r1=989189&r2=989190&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterWriteResponseHandler.java
(original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/DatacenterWriteResponseHandler.java
Wed Aug 25 16:02:30 2010
@@ -29,6 +29,7 @@ import java.util.Collection;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.locator.AbstractNetworkTopologySnitch;
+import org.apache.cassandra.locator.IEndpointSnitch;
 import org.apache.cassandra.locator.NetworkTopologyStrategy;
 import org.apache.cassandra.net.Message;
 import org.apache.cassandra.thrift.ConsistencyLevel;
@@ -42,7 +43,7 @@ import com.google.common.collect.Multima
  */
 public class DatacenterWriteResponseHandler extends WriteResponseHandler
 {
-    private static final AbstractNetworkTopologySnitch snitch = (AbstractNetworkTopologySnitch)
DatabaseDescriptor.getEndpointSnitch();
+    private static final IEndpointSnitch snitch = DatabaseDescriptor.getEndpointSnitch();
 
     private static final String localdc;
     static



Mime
View raw message