cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [3/4] git commit: explicitly set known command list size
Date Mon, 14 May 2012 23:10:15 GMT
explicitly set known command list size


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

Branch: refs/heads/trunk
Commit: 68bae31313161848116d13b10f78639f4252f71a
Parents: f58a51b
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Mon May 14 15:23:27 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Mon May 14 18:09:55 2012 -0500

----------------------------------------------------------------------
 .../cassandra/cql3/statements/SelectStatement.java |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/68bae313/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 04f16cc..1878949 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -190,7 +190,8 @@ public class SelectStatement implements CQLStatement
     private List<Row> getSlice(List<ByteBuffer> variables) throws InvalidRequestException,
TimedOutException, UnavailableException
     {
         QueryPath queryPath = new QueryPath(columnFamily());
-        List<ReadCommand> commands = new ArrayList<ReadCommand>();
+        Collection<ByteBuffer> keys = getKeys(variables);
+        List<ReadCommand> commands = new ArrayList<ReadCommand>(keys.size());
 
         // ...a range (slice) of column names
         if (isColumnRange())
@@ -201,7 +202,7 @@ public class SelectStatement implements CQLStatement
             // Note that we use the total limit for every key. This is
             // potentially inefficient, but then again, IN + LIMIT is not a
             // very sensible choice
-            for (ByteBuffer key : getKeys(variables))
+            for (ByteBuffer key : keys)
             {
                 QueryProcessor.validateKey(key);
                 QueryProcessor.validateSliceRange(cfDef.cfm, start, finish, isReversed);
@@ -220,7 +221,7 @@ public class SelectStatement implements CQLStatement
             Collection<ByteBuffer> columnNames = getRequestedColumns(variables);
             QueryProcessor.validateColumnNames(columnNames);
 
-            for (ByteBuffer key: getKeys(variables))
+            for (ByteBuffer key: keys)
             {
                 QueryProcessor.validateKey(key);
                 commands.add(new SliceByNamesReadCommand(keyspace(), key, queryPath, columnNames));


Mime
View raw message