You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2010/10/25 18:00:57 UTC

svn commit: r1027174 - in /cassandra/branches/cassandra-0.7: ./ interface/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/avro/ src/java/org/apache/cassandra/locator/ src/java/org/apache/cassandra/service/

Author: jbellis
Date: Mon Oct 25 16:00:56 2010
New Revision: 1027174

URL: http://svn.apache.org/viewvc?rev=1027174&view=rev
Log:
renamed CL.DCQUORUM to LOCAL_QUORUM and DCQUORUMSYNCto EACH_QUORUM.  patch by jbellis

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/interface/cassandra.genavro
    cassandra/branches/cassandra-0.7/interface/cassandra.thrift
    cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/ConsistencyLevel.java
    cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/avro/CassandraServer.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/DatacenterSyncWriteResponseHandler.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/DatacenterWriteResponseHandler.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1027174&r1=1027173&r2=1027174&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Mon Oct 25 16:00:56 2010
@@ -58,6 +58,7 @@
  * fix commitlog recovery deleting the newly-created segment as well as
    the old ones (CASSANDRA-1644)
  * upgrade to Thrift 0.5 (CASSANDRA-1367)
+ * renamed CL.DCQUORUM to LOCAL_QUORUM and DCQUORUMSYNC to EACH_QUORUM
 
 
 0.7-beta2

Modified: cassandra/branches/cassandra-0.7/interface/cassandra.genavro
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/interface/cassandra.genavro?rev=1027174&r1=1027173&r2=1027174&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/interface/cassandra.genavro (original)
+++ cassandra/branches/cassandra-0.7/interface/cassandra.genavro Mon Oct 25 16:00:56 2010
@@ -194,7 +194,7 @@ protocol Cassandra {
     }
 
     enum ConsistencyLevel {
-        ONE, QUORUM, DCQUORUM, DCQUORUMSYNC, ALL
+        ONE, QUORUM, LOCAL_QUORUM, EACH_QUORUM, ALL
     }
 
     error InvalidRequestException {

Modified: cassandra/branches/cassandra-0.7/interface/cassandra.thrift
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/interface/cassandra.thrift?rev=1027174&r1=1027173&r2=1027174&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/interface/cassandra.thrift (original)
+++ cassandra/branches/cassandra-0.7/interface/cassandra.thrift Mon Oct 25 16:00:56 2010
@@ -46,7 +46,7 @@ namespace rb CassandraThrift
 #           for every edit that doesn't result in a change to major/minor.
 #
 # See the Semantic Versioning Specification (SemVer) http://semver.org.
-const string VERSION = "19.3.0"
+const string VERSION = "19.4.0"
 
 
 #
@@ -142,23 +142,23 @@ exception AuthorizationException {
  *   ANY          Ensure that the write has been written once somewhere, including possibly being hinted in a non-target node.
  *   ONE          Ensure that the write has been written to at least 1 node's commit log and memory table
  *   QUORUM       Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes
- *   DCQUORUM     Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes, within the local datacenter (requires NetworkTopologyStrategy)
- *   DCQUORUMSYNC Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes in each datacenter (requires NetworkTopologyStrategy)
+ *   LOCAL_QUORUM Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes, within the local datacenter (requires NetworkTopologyStrategy)
+ *   EACH_QUORUM  Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes in each datacenter (requires NetworkTopologyStrategy)
  *   ALL          Ensure that the write is written to <code>&lt;ReplicationFactor&gt;</code> nodes before responding to the client.
  *
  * Read:
  *   ANY          Not supported. You probably want ONE instead.
  *   ONE          Will return the record returned by the first node to respond. A consistency check is always done in a background thread to fix any consistency issues when ConsistencyLevel.ONE is used. This means subsequent calls will have correct data even if the initial read gets an older value. (This is called 'read repair'.)
  *   QUORUM       Will query all storage nodes and return the record with the most recent timestamp once it has at least a majority of replicas reported. Again, the remaining replicas will be checked in the background.
- *   DCQUORUM     Returns the record with the most recent timestamp once a majority of replicas within the local datacenter have replied.
- *   DCQUORUMSYNC Returns the record with the most recent timestamp once a majority of replicas within each datacenter have replied.
+ *   LOCAL_QUORUM Returns the record with the most recent timestamp once a majority of replicas within the local datacenter have replied.
+ *   EACH_QUORUM  Returns the record with the most recent timestamp once a majority of replicas within each datacenter have replied.
  *   ALL          Queries all storage nodes and returns the record with the most recent timestamp.
 */
 enum ConsistencyLevel {
     ONE = 1,
     QUORUM = 2,
-    DCQUORUM = 3,
-    DCQUORUMSYNC = 4,
+    LOCAL_QUORUM = 3,
+    EACH_QUORUM = 4,
     ALL = 5,
     ANY = 6,
 }

Modified: cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/ConsistencyLevel.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/ConsistencyLevel.java?rev=1027174&r1=1027173&r2=1027174&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/ConsistencyLevel.java (original)
+++ cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/ConsistencyLevel.java Mon Oct 25 16:00:56 2010
@@ -44,23 +44,23 @@ import org.apache.thrift.TEnum;
  *   ANY          Ensure that the write has been written once somewhere, including possibly being hinted in a non-target node.
  *   ONE          Ensure that the write has been written to at least 1 node's commit log and memory table
  *   QUORUM       Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes
- *   DCQUORUM     Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes, within the local datacenter (requires NetworkTopologyStrategy)
- *   DCQUORUMSYNC Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes in each datacenter (requires NetworkTopologyStrategy)
+ *   LOCAL_QUORUM Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes, within the local datacenter (requires NetworkTopologyStrategy)
+ *   EACH_QUORUM  Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes in each datacenter (requires NetworkTopologyStrategy)
  *   ALL          Ensure that the write is written to <code>&lt;ReplicationFactor&gt;</code> nodes before responding to the client.
  * 
  * Read:
  *   ANY          Not supported. You probably want ONE instead.
  *   ONE          Will return the record returned by the first node to respond. A consistency check is always done in a background thread to fix any consistency issues when ConsistencyLevel.ONE is used. This means subsequent calls will have correct data even if the initial read gets an older value. (This is called 'read repair'.)
  *   QUORUM       Will query all storage nodes and return the record with the most recent timestamp once it has at least a majority of replicas reported. Again, the remaining replicas will be checked in the background.
- *   DCQUORUM     Returns the record with the most recent timestamp once a majority of replicas within the local datacenter have replied.
- *   DCQUORUMSYNC Returns the record with the most recent timestamp once a majority of replicas within each datacenter have replied.
+ *   LOCAL_QUORUM Returns the record with the most recent timestamp once a majority of replicas within the local datacenter have replied.
+ *   EACH_QUORUM  Returns the record with the most recent timestamp once a majority of replicas within each datacenter have replied.
  *   ALL          Queries all storage nodes and returns the record with the most recent timestamp.
  */
 public enum ConsistencyLevel implements TEnum {
   ONE(1),
   QUORUM(2),
-  DCQUORUM(3),
-  DCQUORUMSYNC(4),
+  LOCAL_QUORUM(3),
+  EACH_QUORUM(4),
   ALL(5),
   ANY(6);
 
@@ -88,9 +88,9 @@ public enum ConsistencyLevel implements 
       case 2:
         return QUORUM;
       case 3:
-        return DCQUORUM;
+        return LOCAL_QUORUM;
       case 4:
-        return DCQUORUMSYNC;
+        return EACH_QUORUM;
       case 5:
         return ALL;
       case 6:

Modified: cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java?rev=1027174&r1=1027173&r2=1027174&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java (original)
+++ cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java Mon Oct 25 16:00:56 2010
@@ -44,6 +44,6 @@ import org.slf4j.LoggerFactory;
 
 public class Constants {
 
-  public static final String VERSION = "19.3.0";
+  public static final String VERSION = "19.4.0";
 
 }

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/avro/CassandraServer.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/avro/CassandraServer.java?rev=1027174&r1=1027173&r2=1027174&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/avro/CassandraServer.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/avro/CassandraServer.java Mon Oct 25 16:00:56 2010
@@ -591,8 +591,8 @@ public class CassandraServer implements 
         {
             case ONE: return org.apache.cassandra.thrift.ConsistencyLevel.ONE;
             case QUORUM: return org.apache.cassandra.thrift.ConsistencyLevel.QUORUM;
-            case DCQUORUM: return org.apache.cassandra.thrift.ConsistencyLevel.DCQUORUM;
-            case DCQUORUMSYNC: return org.apache.cassandra.thrift.ConsistencyLevel.DCQUORUMSYNC;
+            case LOCAL_QUORUM: return org.apache.cassandra.thrift.ConsistencyLevel.LOCAL_QUORUM;
+            case EACH_QUORUM: return org.apache.cassandra.thrift.ConsistencyLevel.EACH_QUORUM;
             case ALL: return org.apache.cassandra.thrift.ConsistencyLevel.ALL;
         }
         return null;

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=1027174&r1=1027173&r2=1027174&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 Mon Oct 25 16:00:56 2010
@@ -142,19 +142,19 @@ public class NetworkTopologyStrategy ext
 
     /**
      * This method will generate the QRH object and returns. If the Consistency
-     * level is DCQUORUM then it will return a DCQRH with a map of local rep
-     * factor alone. If the consistency level is DCQUORUMSYNC then it will
+     * 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.DCQUORUM)
+        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.DCQUORUMSYNC)
+        else if (consistency_level == ConsistencyLevel.EACH_QUORUM)
         {
             return DatacenterSyncWriteResponseHandler.create(writeEndpoints, hintedEndpoints, consistency_level, table);
         }
@@ -163,12 +163,12 @@ public class NetworkTopologyStrategy ext
 
     /**
      * This method will generate the WRH object and returns. If the Consistency
-     * level is DCQUORUM/DCQUORUMSYNC then it will return a DCQRH.
+     * level is LOCAL_QUORUM/EACH_QUORUM then it will return a DCQRH.
      */
     @Override
     public QuorumResponseHandler getQuorumResponseHandler(IResponseResolver responseResolver, ConsistencyLevel consistencyLevel)
     {
-        if (consistencyLevel.equals(ConsistencyLevel.DCQUORUM) || consistencyLevel.equals(ConsistencyLevel.DCQUORUMSYNC))
+        if (consistencyLevel.equals(ConsistencyLevel.LOCAL_QUORUM) || consistencyLevel.equals(ConsistencyLevel.EACH_QUORUM))
         {
             return new DatacenterQuorumResponseHandler(responseResolver, consistencyLevel, table);
         }

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/DatacenterSyncWriteResponseHandler.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/DatacenterSyncWriteResponseHandler.java?rev=1027174&r1=1027173&r2=1027174&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/DatacenterSyncWriteResponseHandler.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/DatacenterSyncWriteResponseHandler.java Mon Oct 25 16:00:56 2010
@@ -42,7 +42,7 @@ import com.google.common.collect.Multima
 import org.apache.cassandra.utils.FBUtilities;
 
 /**
- * This class blocks for a quorum of responses _in all datacenters_ (CL.DCQUORUMSYNC).
+ * This class blocks for a quorum of responses _in all datacenters_ (CL.EACH_QUORUM).
  */
 public class DatacenterSyncWriteResponseHandler extends AbstractWriteResponseHandler
 {
@@ -61,7 +61,7 @@ public class DatacenterSyncWriteResponse
     {
         // Response is been managed by the map so make it 1 for the superclass.
         super(writeEndpoints, hintedEndpoints, consistencyLevel);
-        assert consistencyLevel == ConsistencyLevel.DCQUORUM;
+        assert consistencyLevel == ConsistencyLevel.LOCAL_QUORUM;
 
         strategy = (NetworkTopologyStrategy) Table.open(table).replicationStrategy;
 

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/DatacenterWriteResponseHandler.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/DatacenterWriteResponseHandler.java?rev=1027174&r1=1027173&r2=1027174&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/DatacenterWriteResponseHandler.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/DatacenterWriteResponseHandler.java Mon Oct 25 16:00:56 2010
@@ -39,7 +39,7 @@ import org.apache.cassandra.utils.FBUtil
 import com.google.common.collect.Multimap;
 
 /**
- * This class blocks for a quorum of responses _in the local datacenter only_ (CL.DCQUORUM).
+ * This class blocks for a quorum of responses _in the local datacenter only_ (CL.LOCAL_QUORUM).
  */
 public class DatacenterWriteResponseHandler extends WriteResponseHandler
 {
@@ -54,7 +54,7 @@ public class DatacenterWriteResponseHand
     protected DatacenterWriteResponseHandler(Collection<InetAddress> writeEndpoints, Multimap<InetAddress, InetAddress> hintedEndpoints, ConsistencyLevel consistencyLevel, String table)
     {
         super(writeEndpoints, hintedEndpoints, consistencyLevel, table);
-        assert consistencyLevel == ConsistencyLevel.DCQUORUM;
+        assert consistencyLevel == ConsistencyLevel.LOCAL_QUORUM;
     }
 
     public static IWriteResponseHandler create(Collection<InetAddress> writeEndpoints, Multimap<InetAddress, InetAddress> hintedEndpoints, ConsistencyLevel consistencyLevel, String table)