cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r981940 - in /cassandra/trunk/src/java/org/apache/cassandra/locator: DatacenterShardStrategy.java RackAwareStrategy.java
Date Tue, 03 Aug 2010 15:49:15 GMT
Author: jbellis
Date: Tue Aug  3 15:49:15 2010
New Revision: 981940

URL: http://svn.apache.org/viewvc?rev=981940&view=rev
Log:
remove instanceof checks for AbstractRackAwareSnitch.  patch by Sylvain Lebresne; reviewed
by jbellis for CASSANDRA-1349

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/locator/DatacenterShardStrategy.java
    cassandra/trunk/src/java/org/apache/cassandra/locator/RackAwareStrategy.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/locator/DatacenterShardStrategy.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/locator/DatacenterShardStrategy.java?rev=981940&r1=981939&r2=981940&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/locator/DatacenterShardStrategy.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/locator/DatacenterShardStrategy.java Tue
Aug  3 15:49:15 2010
@@ -58,8 +58,6 @@ public class DatacenterShardStrategy ext
     public DatacenterShardStrategy(String table, TokenMetadata tokenMetadata, IEndpointSnitch
snitch, Map<String, String> configOptions) throws ConfigurationException
     {
         super(table, tokenMetadata, snitch, configOptions);
-        if ((!(snitch instanceof AbstractRackAwareSnitch)))
-            throw new IllegalArgumentException("DatacenterShardStrategy requires a rack-aware
endpointsnitch");
         this.snitch = (AbstractRackAwareSnitch)snitch;
 
         Map<String, Integer> newDatacenters = new HashMap<String, Integer>();

Modified: cassandra/trunk/src/java/org/apache/cassandra/locator/RackAwareStrategy.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/locator/RackAwareStrategy.java?rev=981940&r1=981939&r2=981940&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/locator/RackAwareStrategy.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/locator/RackAwareStrategy.java Tue Aug 
3 15:49:15 2010
@@ -37,8 +37,6 @@ public class RackAwareStrategy extends A
     public RackAwareStrategy(String table, TokenMetadata tokenMetadata, IEndpointSnitch snitch,
Map<String, String> configOptions)
     {
         super(table, tokenMetadata, snitch, configOptions);
-        if (!(snitch instanceof AbstractRackAwareSnitch))
-            throw new IllegalArgumentException(("RackAwareStrategy requires AbstractRackAwareSnitch."));
     }
 
     public Set<InetAddress> calculateNaturalEndpoints(Token token, TokenMetadata metadata)



Mime
View raw message