cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject cassandra git commit: ninja: Update QueryOptions.DEFAULT to match latest protocol version
Date Tue, 24 Mar 2015 18:54:58 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 507a36305 -> 469764412


ninja: Update QueryOptions.DEFAULT to match latest protocol version


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/46976441
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/46976441
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/46976441

Branch: refs/heads/trunk
Commit: 469764412706af185d8b2bece5c6d985d67c3ef7
Parents: 507a363
Author: Tyler Hobbs <tyler@datastax.com>
Authored: Tue Mar 24 13:54:34 2015 -0500
Committer: Tyler Hobbs <tyler@datastax.com>
Committed: Tue Mar 24 13:54:34 2015 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/cql3/QueryOptions.java | 13 +++++++------
 src/java/org/apache/cassandra/transport/Server.java  |  1 +
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/46976441/src/java/org/apache/cassandra/cql3/QueryOptions.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/QueryOptions.java b/src/java/org/apache/cassandra/cql3/QueryOptions.java
index b2569e7..60fd339 100644
--- a/src/java/org/apache/cassandra/cql3/QueryOptions.java
+++ b/src/java/org/apache/cassandra/cql3/QueryOptions.java
@@ -31,6 +31,7 @@ import org.apache.cassandra.service.pager.PagingState;
 import org.apache.cassandra.transport.CBCodec;
 import org.apache.cassandra.transport.CBUtil;
 import org.apache.cassandra.transport.ProtocolException;
+import org.apache.cassandra.transport.Server;
 import org.apache.cassandra.utils.Pair;
 
 /**
@@ -42,33 +43,33 @@ public abstract class QueryOptions
                                                                        Collections.<ByteBuffer>emptyList(),
                                                                        false,
                                                                        SpecificOptions.DEFAULT,
-                                                                       3);
+                                                                       Server.CURRENT_VERSION);
 
     public static final CBCodec<QueryOptions> codec = new Codec();
 
     public static QueryOptions fromProtocolV1(ConsistencyLevel consistency, List<ByteBuffer>
values)
     {
-        return new DefaultQueryOptions(consistency, values, false, SpecificOptions.DEFAULT,
1);
+        return new DefaultQueryOptions(consistency, values, false, SpecificOptions.DEFAULT,
Server.VERSION_1);
     }
 
     public static QueryOptions fromProtocolV2(ConsistencyLevel consistency, List<ByteBuffer>
values)
     {
-        return new DefaultQueryOptions(consistency, values, false, SpecificOptions.DEFAULT,
2);
+        return new DefaultQueryOptions(consistency, values, false, SpecificOptions.DEFAULT,
Server.VERSION_2);
     }
 
     public static QueryOptions forInternalCalls(ConsistencyLevel consistency, List<ByteBuffer>
values)
     {
-        return new DefaultQueryOptions(consistency, values, false, SpecificOptions.DEFAULT,
3);
+        return new DefaultQueryOptions(consistency, values, false, SpecificOptions.DEFAULT,
Server.VERSION_3);
     }
 
     public static QueryOptions forInternalCalls(List<ByteBuffer> values)
     {
-        return new DefaultQueryOptions(ConsistencyLevel.ONE, values, false, SpecificOptions.DEFAULT,
3);
+        return new DefaultQueryOptions(ConsistencyLevel.ONE, values, false, SpecificOptions.DEFAULT,
Server.VERSION_3);
     }
 
     public static QueryOptions fromPreV3Batch(ConsistencyLevel consistency)
     {
-        return new DefaultQueryOptions(consistency, Collections.<ByteBuffer>emptyList(),
false, SpecificOptions.DEFAULT, 2);
+        return new DefaultQueryOptions(consistency, Collections.<ByteBuffer>emptyList(),
false, SpecificOptions.DEFAULT, Server.VERSION_2);
     }
 
     public static QueryOptions create(ConsistencyLevel consistency, List<ByteBuffer>
values, boolean skipMetadata, int pageSize, PagingState pagingState, ConsistencyLevel serialConsistency)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/46976441/src/java/org/apache/cassandra/transport/Server.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/transport/Server.java b/src/java/org/apache/cassandra/transport/Server.java
index e6e0a8f..3ef7162 100644
--- a/src/java/org/apache/cassandra/transport/Server.java
+++ b/src/java/org/apache/cassandra/transport/Server.java
@@ -66,6 +66,7 @@ public class Server implements CassandraDaemon.Server
     private static final Logger logger = LoggerFactory.getLogger(Server.class);
     private static final boolean enableEpoll = Boolean.valueOf(System.getProperty("cassandra.native.epoll.enabled",
"true"));
 
+    public static final int VERSION_1 = 1;
     public static final int VERSION_2 = 2;
     public static final int VERSION_3 = 3;
     public static final int VERSION_4 = 4;


Mime
View raw message