cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ble...@apache.org
Subject [5/5] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0
Date Sun, 09 Aug 2015 20:47:56 GMT
Merge branch 'cassandra-2.2' into cassandra-3.0

Conflicts:
	src/java/org/apache/cassandra/cql3/restrictions/MultiColumnRestriction.java
	src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java


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

Branch: refs/heads/cassandra-3.0
Commit: e389dc421c0a4892388e99c1ada0b4c37f106b7b
Parents: f568a5d 6d0cf7d
Author: blerer <benjamin.lerer@datastax.com>
Authored: Sun Aug 9 22:46:52 2015 +0200
Committer: blerer <benjamin.lerer@datastax.com>
Committed: Sun Aug 9 22:46:52 2015 +0200

----------------------------------------------------------------------
 .../restrictions/MultiColumnRestriction.java    | 37 +++++++----
 .../restrictions/SingleColumnRestriction.java   | 68 ++++++++++++++++++--
 .../SelectMultiColumnRelationTest.java          | 45 +++++++++----
 .../SelectSingleColumnRelationTest.java         | 28 ++++++++
 4 files changed, 149 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e389dc42/src/java/org/apache/cassandra/cql3/restrictions/MultiColumnRestriction.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/restrictions/MultiColumnRestriction.java
index e48a22b,84a3952..b0f592c
--- a/src/java/org/apache/cassandra/cql3/restrictions/MultiColumnRestriction.java
+++ b/src/java/org/apache/cassandra/cql3/restrictions/MultiColumnRestriction.java
@@@ -329,7 -340,7 +336,7 @@@ public abstract class MultiColumnRestri
              this(columnDefs, TermSlice.newInstance(bound, inclusive, term));
          }
  
-         private SliceRestriction(List<ColumnDefinition> columnDefs, TermSlice slice)
 -        Slice(List<ColumnDefinition> columnDefs, TermSlice slice)
++        SliceRestriction(List<ColumnDefinition> columnDefs, TermSlice slice)
          {
              super(columnDefs);
              this.slice = slice;
@@@ -409,8 -418,10 +414,10 @@@
                         "More than one restriction was found for the end bound on %s",
                         getColumnsInCommons(otherRestriction));
  
 -            Slice otherSlice = (Slice) otherRestriction;
++            SliceRestriction otherSlice = (SliceRestriction) otherRestriction;
              List<ColumnDefinition> newColumnDefs = columnDefs.size() >= otherSlice.columnDefs.size()
?  columnDefs : otherSlice.columnDefs;
+ 
 -            return new Slice(newColumnDefs, slice.merge(otherSlice.slice));
 +            return new SliceRestriction(newColumnDefs, slice.merge(otherSlice.slice));
          }
  
          @Override

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e389dc42/src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java
index f96b7a0,afa0419..a6ed4b4
--- a/src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java
+++ b/src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java
@@@ -27,12 -27,12 +27,11 @@@ import org.apache.cassandra.cql3.*
  import org.apache.cassandra.cql3.Term.Terminal;
  import org.apache.cassandra.cql3.functions.Function;
  import org.apache.cassandra.cql3.statements.Bound;
 -import org.apache.cassandra.db.IndexExpression;
 -import org.apache.cassandra.db.composites.CompositesBuilder;
 +import org.apache.cassandra.db.MultiCBuilder;
 +import org.apache.cassandra.db.filter.RowFilter;
  import org.apache.cassandra.db.index.SecondaryIndex;
  import org.apache.cassandra.db.index.SecondaryIndexManager;
 -import org.apache.cassandra.db.marshal.CompositeType;
  import org.apache.cassandra.exceptions.InvalidRequestException;
- 
  import static org.apache.cassandra.cql3.statements.RequestValidations.checkBindValueSet;
  import static org.apache.cassandra.cql3.statements.RequestValidations.checkFalse;
  import static org.apache.cassandra.cql3.statements.RequestValidations.checkNotNull;
@@@ -119,11 -140,18 +139,17 @@@ public abstract class SingleColumnRestr
          }
  
          @Override
+         MultiColumnRestriction toMultiColumnRestriction()
+         {
 -            return new MultiColumnRestriction.EQ(Collections.singletonList(columnDef), value);
++            return new MultiColumnRestriction.EQRestriction(Collections.singletonList(columnDef),
value);
+         }
+ 
+         @Override
 -        public void addIndexExpressionTo(List<IndexExpression> expressions,
 -                                         SecondaryIndexManager indexManager,
 -                                         QueryOptions options) throws InvalidRequestException
 +        public void addRowFilterTo(RowFilter filter,
 +                                   SecondaryIndexManager indexManager,
-                                    QueryOptions options) throws InvalidRequestException
++                                   QueryOptions options)
          {
 -            ByteBuffer buffer = validateIndexedValue(columnDef, value.bindAndGet(options));
 -            expressions.add(new IndexExpression(columnDef.name.bytes, Operator.EQ, buffer));
 +            filter.add(columnDef, Operator.EQ, value.bindAndGet(options));
          }
  
          @Override
@@@ -213,6 -242,12 +239,12 @@@
          }
  
          @Override
+         MultiColumnRestriction toMultiColumnRestriction()
+         {
 -            return new MultiColumnRestriction.InWithValues(Collections.singletonList(columnDef),
values);
++            return new MultiColumnRestriction.InRestrictionWithValues(Collections.singletonList(columnDef),
values);
+         }
+ 
+         @Override
          public Iterable<Function> getFunctions()
          {
              return Terms.getFunctions(values);
@@@ -251,6 -286,12 +283,12 @@@
          }
  
          @Override
+         MultiColumnRestriction toMultiColumnRestriction()
+         {
 -            return new MultiColumnRestriction.InWithMarker(Collections.singletonList(columnDef),
marker);
++            return new MultiColumnRestriction.InRestrictionWithMarker(Collections.singletonList(columnDef),
marker);
+         }
+ 
+         @Override
          protected List<ByteBuffer> getValues(QueryOptions options) throws InvalidRequestException
          {
              Terminal term = marker.bind(options);
@@@ -284,6 -325,12 +322,12 @@@
          }
  
          @Override
+         MultiColumnRestriction toMultiColumnRestriction()
+         {
 -            return new MultiColumnRestriction.Slice(Collections.singletonList(columnDef),
slice);
++            return new MultiColumnRestriction.SliceRestriction(Collections.singletonList(columnDef),
slice);
+         }
+ 
+         @Override
          public boolean isSlice()
          {
              return true;
@@@ -386,7 -445,19 +430,19 @@@
          }
  
          @Override
+         MultiColumnRestriction toMultiColumnRestriction()
+         {
+             throw new UnsupportedOperationException();
+         }
+ 
+         @Override
+         boolean canBeConvertedToMultiColumnRestriction()
+         {
+             return false;
+         }
+ 
+         @Override
 -        public CompositesBuilder appendTo(CompositesBuilder builder, QueryOptions options)
 +        public MultiCBuilder appendTo(MultiCBuilder builder, QueryOptions options)
          {
              throw new UnsupportedOperationException();
          }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e389dc42/test/unit/org/apache/cassandra/cql3/validation/operations/SelectSingleColumnRelationTest.java
----------------------------------------------------------------------


Mime
View raw message