cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ble...@apache.org
Subject cassandra git commit: Fix multiget_slice
Date Mon, 24 Aug 2015 12:42:00 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 29d3d44d2 -> 706ba8767


Fix multiget_slice

patch by Benjamin Lerer; reviewed by Stefania Alborghetti and Sylvain Lebresne for CASSANDRA-9906


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

Branch: refs/heads/cassandra-3.0
Commit: 706ba8767e7339e0af5eebf84cc61bc21883f6e0
Parents: 29d3d44
Author: blerer <benjamin.lerer@datastax.com>
Authored: Mon Aug 24 14:38:15 2015 +0200
Committer: blerer <benjamin.lerer@datastax.com>
Committed: Mon Aug 24 14:38:15 2015 +0200

----------------------------------------------------------------------
 .../apache/cassandra/thrift/CassandraServer.java  | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/706ba876/src/java/org/apache/cassandra/thrift/CassandraServer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java
index fd391aa..e827e95 100644
--- a/src/java/org/apache/cassandra/thrift/CassandraServer.java
+++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java
@@ -30,9 +30,12 @@ import java.util.zip.Inflater;
 import com.google.common.base.Joiner;
 import com.google.common.collect.*;
 import com.google.common.primitives.Longs;
+
+import org.apache.cassandra.config.ColumnDefinition;
+import org.apache.cassandra.db.filter.ColumnFilter;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import org.apache.cassandra.auth.Permission;
 import org.apache.cassandra.config.*;
 import org.apache.cassandra.cql3.QueryOptions;
@@ -399,8 +402,13 @@ public class CassandraServer implements Cassandra.Iface
                     for (ByteBuffer bb : predicate.column_names)
                     {
                         LegacyLayout.LegacyCellName name = LegacyLayout.decodeCellName(metadata,
parent.bufferForSuper_column(), bb);
-                        clusterings.add(name.clustering);
+
+                        if (!name.clustering.equals(Clustering.STATIC_CLUSTERING))
+                            clusterings.add(name.clustering);
                     }
+
+                    // clusterings cannot include STATIC_CLUSTERING, so if the names filter
is for static columns, clusterings
+                    // will be empty.  However, by requesting the static columns in our ColumnFilter,
this will still work.
                     return new ClusteringIndexNamesFilter(clusterings, false);
                 }
             }
@@ -492,12 +500,16 @@ public class CassandraServer implements Cassandra.Iface
                 }
                 else
                 {
-                    PartitionColumns.Builder builder = new PartitionColumns.Builder();
+                    PartitionColumns.Builder builder = PartitionColumns.builder();
                     for (ByteBuffer bb : predicate.column_names)
                     {
                         LegacyLayout.LegacyCellName name = LegacyLayout.decodeCellName(metadata,
parent.bufferForSuper_column(), bb);
                         builder.add(name.column);
                     }
+
+                    if (metadata.isStaticCompactTable())
+                        builder.add(metadata.compactValueColumn());
+
                     return ColumnFilter.selection(builder.build());
                 }
             }


Mime
View raw message