cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1095747 - in /cassandra/branches/cassandra-0.7: CHANGES.txt src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
Date Thu, 21 Apr 2011 15:18:30 GMT
Author: jbellis
Date: Thu Apr 21 15:18:30 2011
New Revision: 1095747

URL: http://svn.apache.org/viewvc?rev=1095747&view=rev
Log:
support LOCAL_QUORUM, EACH_QUORUM CLs outside of NTS
patch by jbellis; reviewed by slebresne for CASSANDRA-2516

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1095747&r1=1095746&r2=1095747&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Thu Apr 21 15:18:30 2011
@@ -36,6 +36,7 @@
    (CASSANDRA-2519)
  * fixes for verifying destination availability under hinted conditions
    so UE can be thrown intead of timing out (CASSANDRA-2514)
+ * support LOCAL_QUORUM, EACH_QUORUM CLs outside of NTS (CASSANDRA-2516)
 
 
 0.7.4

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java?rev=1095747&r1=1095746&r2=1095747&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
Thu Apr 21 15:18:30 2011
@@ -122,9 +122,18 @@ public abstract class AbstractReplicatio
 
     public IWriteResponseHandler getWriteResponseHandler(Collection<InetAddress> writeEndpoints,
                                                          Multimap<InetAddress, InetAddress>
hintedEndpoints,
-                                                         ConsistencyLevel consistencyLevel)
+                                                         ConsistencyLevel consistency_level)
     {
-        return WriteResponseHandler.create(writeEndpoints, hintedEndpoints, consistencyLevel,
table);
+        if (consistency_level == ConsistencyLevel.LOCAL_QUORUM)
+        {
+            // block for in this context will be localnodes block.
+            return DatacenterWriteResponseHandler.create(writeEndpoints, hintedEndpoints,
consistency_level, table);
+        }
+        else if (consistency_level == ConsistencyLevel.EACH_QUORUM)
+        {
+            return DatacenterSyncWriteResponseHandler.create(writeEndpoints, hintedEndpoints,
consistency_level, table);
+        }
+        return WriteResponseHandler.create(writeEndpoints, hintedEndpoints, consistency_level,
table);
     }
 
     public int getReplicationFactor()

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java?rev=1095747&r1=1095746&r2=1095747&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
Thu Apr 21 15:18:30 2011
@@ -143,25 +143,4 @@ public class NetworkTopologyStrategy ext
     {
         return datacenters.keySet();
     }
-
-    /**
-     * This method will generate the QRH object and returns. If the Consistency
-     * level is LOCAL_QUORUM then it will return a DCQRH with a map of local rep
-     * factor alone. If the consistency level is EACH_QUORUM then it will
-     * return a DCQRH with a map of all the DC rep factor.
-     */
-    @Override
-    public IWriteResponseHandler getWriteResponseHandler(Collection<InetAddress> writeEndpoints,
Multimap<InetAddress, InetAddress> hintedEndpoints, ConsistencyLevel consistency_level)
-    {
-        if (consistency_level == ConsistencyLevel.LOCAL_QUORUM)
-        {
-            // block for in this context will be localnodes block.
-            return DatacenterWriteResponseHandler.create(writeEndpoints, hintedEndpoints,
consistency_level, table);
-        }
-        else if (consistency_level == ConsistencyLevel.EACH_QUORUM)
-        {
-            return DatacenterSyncWriteResponseHandler.create(writeEndpoints, hintedEndpoints,
consistency_level, table);
-        }
-        return super.getWriteResponseHandler(writeEndpoints, hintedEndpoints, consistency_level);
-    }
 }



Mime
View raw message