cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r893836 - in /incubator/cassandra/trunk: ./ interface/ interface/gen-java/org/apache/cassandra/service/ src/java/org/ src/java/org/apache/cassandra/locator/ src/java/org/apache/cassandra/service/ test/system/ test/unit/org/
Date Fri, 25 Dec 2009 03:03:07 GMT
Author: jbellis
Date: Fri Dec 25 03:03:07 2009
New Revision: 893836

URL: http://svn.apache.org/viewvc?rev=893836&view=rev
Log:
merge from 0.5 branch

Modified:
    incubator/cassandra/trunk/   (props changed)
    incubator/cassandra/trunk/CHANGES.txt
    incubator/cassandra/trunk/build.xml
    incubator/cassandra/trunk/interface/cassandra.thrift
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Column.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Constants.java
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/NotFoundException.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/SuperColumn.java
  (props changed)
    incubator/cassandra/trunk/src/java/org/   (props changed)
    incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java
    incubator/cassandra/trunk/test/system/test_server.py
    incubator/cassandra/trunk/test/unit/org/   (props changed)

Propchange: incubator/cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 25 03:03:07 2009
@@ -1,3 +1,3 @@
 /incubator/cassandra/branches/cassandra-0.3:774578-796573
 /incubator/cassandra/branches/cassandra-0.4:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5:888872-893619
+/incubator/cassandra/branches/cassandra-0.5:888872-893835

Modified: incubator/cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/CHANGES.txt?rev=893836&r1=893835&r2=893836&view=diff
==============================================================================
--- incubator/cassandra/trunk/CHANGES.txt (original)
+++ incubator/cassandra/trunk/CHANGES.txt Fri Dec 25 03:03:07 2009
@@ -2,6 +2,10 @@
  * add batch_mutate thrift command, deprecating batch_insert (CASSANDRA-336)
 
 
+0.5.0 RC2
+ * fix bugs in converting get_slice_range results to Thrift (CASSANDRA-647)
+
+
 0.5.0 RC1
  * Fix potential NPE in get_range_slice (CASSANDRA-623)
  * add CRC32 to commitlog entries (CASSANDRA-605)

Modified: incubator/cassandra/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/build.xml?rev=893836&r1=893835&r2=893836&view=diff
==============================================================================
--- incubator/cassandra/trunk/build.xml (original)
+++ incubator/cassandra/trunk/build.xml Fri Dec 25 03:03:07 2009
@@ -39,7 +39,7 @@
     <property name="test.name" value="*Test"/>
     <property name="test.unit.src" value="${test.dir}/unit"/>
     <property name="dist.dir" value="${build.dir}/dist"/>
-    <property name="version" value="0.5.0-beta2"/>
+    <property name="version" value="0.5.0-rc1"/>
     <property name="final.name" value="${ant.project.name}-${version}"/>
 
     <!-- http://cobertura.sourceforge.net/ -->

Modified: incubator/cassandra/trunk/interface/cassandra.thrift
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/interface/cassandra.thrift?rev=893836&r1=893835&r2=893836&view=diff
==============================================================================
--- incubator/cassandra/trunk/interface/cassandra.thrift (original)
+++ incubator/cassandra/trunk/interface/cassandra.thrift Fri Dec 25 03:03:07 2009
@@ -40,7 +40,7 @@
 # no promises are made other than "if both are equal, you're good."
 # in particular, don't try to parse numeric information out and assume
 # that a "greater" version is a superset of a "smaller" one.
-const string VERSION = "0.5-beta2"
+const string VERSION = "0.5.0-rc1"
 
 
 #

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 25 03:03:07 2009
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Cassandra.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Cassandra.java:888872-893619
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Cassandra.java:888872-893835
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 25 03:03:07 2009
@@ -1,5 +1,5 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Column.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Column.java:888872-893619
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Column.java:888872-893835
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Column.java:749219-794428
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/column_t.java:749219-768588

Modified: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Constants.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Constants.java?rev=893836&r1=893835&r2=893836&view=diff
==============================================================================
--- incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Constants.java
(original)
+++ incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Constants.java
Fri Dec 25 03:03:07 2009
@@ -40,6 +40,6 @@
 
 public class Constants {
 
-  public static final String VERSION = "0.5-beta2";
+  public static final String VERSION = "0.5.0-rc1";
 
 }

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 25 03:03:07 2009
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:888872-893619
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:888872-893835
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 25 03:03:07 2009
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:888872-893619
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:888872-893835
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 25 03:03:07 2009
@@ -1,5 +1,5 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:888872-893619
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:888872-893835
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:749219-794428
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:749219-768588

Propchange: incubator/cassandra/trunk/src/java/org/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 25 03:03:07 2009
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/src/java/org:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/src/java/org:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/src/java/org:888872-893619
+/incubator/cassandra/branches/cassandra-0.5/src/java/org:888872-893835
 /incubator/cassandra/trunk/src/java/org:749219-769885

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java?rev=893836&r1=893835&r2=893836&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java
(original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java
Fri Dec 25 03:03:07 2009
@@ -1,4 +1,25 @@
 package org.apache.cassandra.locator;
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ */
+
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java?rev=893836&r1=893835&r2=893836&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java Fri
Dec 25 03:03:07 2009
@@ -125,6 +125,7 @@
 
         // we have to do the reversing here, since internally we pass results around in ColumnFamily
         // objects, which always sort their columns in the "natural" order
+        // TODO this is inconvenient for direct users of StorageProxy
         if (reverseOrder)
             Collections.reverse(thriftColumns);
         return thriftColumns;
@@ -589,24 +590,16 @@
         }
 
         List<KeySlice> keySlices = new ArrayList<KeySlice>(rows.size());
+        boolean reversed = predicate.slice_range != null && predicate.slice_range.reversed;
         for (Pair<String, Collection<IColumn>> row : rows)
         {
             Collection<IColumn> columns = row.right;
-            List<ColumnOrSuperColumn> svcList = new ArrayList<ColumnOrSuperColumn>(columns.size());
-            for (org.apache.cassandra.db.IColumn col : columns)
-            {
-                if (col instanceof org.apache.cassandra.db.Column)
-                    svcList.add(new ColumnOrSuperColumn(new org.apache.cassandra.service.Column(col.name(),
col.value(), col.timestamp()), null));
-                else if (col instanceof org.apache.cassandra.db.SuperColumn)
-                {
-                    Collection<IColumn> subICols = col.getSubColumns();
-                    List<org.apache.cassandra.service.Column> subCols = new ArrayList<org.apache.cassandra.service.Column>(subICols.size());
-                    for (IColumn subCol : subICols)
-                        subCols.add(new org.apache.cassandra.service.Column(subCol.name(),
subCol.value(), subCol.timestamp()));
-                    svcList.add(new ColumnOrSuperColumn(null, new org.apache.cassandra.service.SuperColumn(col.name(),
subCols)));
-                }
-            }
-            keySlices.add(new KeySlice(row.left, svcList));
+            List<ColumnOrSuperColumn> thriftifiedColumns;
+            if (DatabaseDescriptor.getColumnFamilyType(keyspace, column_parent.column_family).equals("Standard"))
+                thriftifiedColumns = thriftifyColumns(columns, reversed);
+            else
+                thriftifiedColumns = thriftifySuperColumns(columns, reversed);
+            keySlices.add(new KeySlice(row.left, thriftifiedColumns));
         }
 
         return keySlices;

Modified: incubator/cassandra/trunk/test/system/test_server.py
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/system/test_server.py?rev=893836&r1=893835&r2=893836&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/system/test_server.py (original)
+++ incubator/cassandra/trunk/test/system/test_server.py Fri Dec 25 03:03:07 2009
@@ -778,12 +778,20 @@
 
         # and reversed 
         result = client.get_range_slice('Keyspace1', cp, SlicePredicate(slice_range=SliceRange(start='col4',
finish='col2', reversed=True, count=5)), 'key1', 'key2', 5, ConsistencyLevel.ONE)
-        assert result[0].columns[0].column.name == 'col2'
-        assert result[0].columns[2].column.name == 'col4'
+        assert result[0].columns[0].column.name == 'col4'
+        assert result[0].columns[2].column.name == 'col2'
 
         # row limiting via count
         result = client.get_range_slice('Keyspace1', cp, SlicePredicate(slice_range=SliceRange(start='col2',
finish='col4', reversed=False, count=5)), 'key1', 'key2', 1, ConsistencyLevel.ONE)
         assert len(result) == 1
+
+        # removed data
+        client.remove('Keyspace1', 'key1', ColumnPath('Standard1', column='col1'), 1, ConsistencyLevel.ONE)
+        result = client.get_range_slice('Keyspace1', cp, SlicePredicate(slice_range=SliceRange('',
'')), 'key1', 'key2', 5, ConsistencyLevel.ONE)
+        assert len(result) == 2, result
+        assert result[0].columns[0].column.name == 'col2', result[0].columns[0].column.name
+        assert result[1].columns[0].column.name == 'col1'
+        
     
     def test_get_slice_by_names(self):
         _insert_range()
@@ -843,5 +851,3 @@
         ks1 = client.describe_keyspace("Keyspace1")
         assert set(ks1.keys()) == set(['Super1', 'Standard1', 'Standard2', 'StandardLong1',
'StandardLong2', 'Super3', 'Super2', 'Super4'])
         sysks = client.describe_keyspace("system")
-
-

Propchange: incubator/cassandra/trunk/test/unit/org/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 25 03:03:07 2009
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/test/unit/org:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/test/unit/org:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/test/unit/org:888872-893619
+/incubator/cassandra/branches/cassandra-0.5/test/unit/org:888872-893835
 /incubator/cassandra/trunk/test/unit/org:749219-768583



Mime
View raw message