cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1101946 - in /cassandra/branches/cassandra-0.8.1: ./ contrib/ debian/ drivers/java/src/org/apache/cassandra/cql/jdbc/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/db/commitlog/ src/java/org/apache/ca...
Date Wed, 11 May 2011 16:15:43 GMT
Author: jbellis
Date: Wed May 11 16:15:43 2011
New Revision: 1101946

URL: http://svn.apache.org/viewvc?rev=1101946&view=rev
Log:
merge from 0.8

Modified:
    cassandra/branches/cassandra-0.8.1/   (props changed)
    cassandra/branches/cassandra-0.8.1/CHANGES.txt
    cassandra/branches/cassandra-0.8.1/build.xml
    cassandra/branches/cassandra-0.8.1/contrib/   (props changed)
    cassandra/branches/cassandra-0.8.1/debian/cassandra.install
    cassandra/branches/cassandra-0.8.1/debian/changelog
    cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/AbstractResultSet.java
    cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java
    cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraResultSet.java
    cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
  (props changed)
    cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
  (props changed)
    cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
  (props changed)
    cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
  (props changed)
    cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
  (props changed)
    cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
    cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java
    cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/marshal/AbstractUUIDType.java
    cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
    cassandra/branches/cassandra-0.8.1/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java

Propchange: cassandra/branches/cassandra-0.8.1/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 11 16:15:43 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7:1026516-1100900,1101021,1101772,1101792
+/cassandra/branches/cassandra-0.7:1026516-1101940
 /cassandra/branches/cassandra-0.7.0:1053690-1055654
-/cassandra/branches/cassandra-0.8:1090935-1101597,1101773,1101794
+/cassandra/branches/cassandra-0.8:1090935-1101945
 /cassandra/tags/cassandra-0.7.0-rc3:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3:774578-796573
 /incubator/cassandra/branches/cassandra-0.4:810145-834239,834349-834350

Modified: cassandra/branches/cassandra-0.8.1/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.1/CHANGES.txt?rev=1101946&r1=1101945&r2=1101946&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.1/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8.1/CHANGES.txt Wed May 11 16:15:43 2011
@@ -1,6 +1,3 @@
-1.0-dev
-
-
 0.8.1
  * add support for insert, delete in cql BATCH (CASSANDRA-2537)
  * add support for IN to cql SELECT, UPDATE (CASSANDRA-2553)
@@ -14,13 +11,22 @@
 
 
 0.8.0-?
+=======
+ * Fix regression where bootstrapping a node with no schema fails
+   (CASSANDRA-2625)
+ * Allow removing LocationInfo sstables (CASSANDRA-2632)
+ * avoid attempting to replay mutations from dropped keyspaces (CASSANDRA-2631)
+ * avoid using cached position of a key when GT is requested (CASSANDRA-2633)
+ * fix counting bloom filter true positives (CASSANDRA-2637)
+
+
+0.8.0-rc1
  * faster flushes and compaction from fixing excessively pessimistic 
    rebuffering in BRAF (CASSANDRA-2581)
- * fix merkle tree splitting exiting early (CASSANDRA-2605)
- * Disable compaction throttling during bootstrap (CASSANDRA-2612) 
  * fix returning null column values in the python cql driver (CASSANDRA-2593)
+ * fix merkle tree splitting exiting early (CASSANDRA-2605)
  * snapshot_before_compaction directory name fix (CASSANDRA-2598)
- 
+ * Disable compaction throttling during bootstrap (CASSANDRA-2612) 
  * fix CQL treatment of > and < operators in range slices (CASSANDRA-2592)
  * fix potential double-application of counter updates on commitlog replay
    (CASSANDRA-2419)
@@ -58,9 +64,6 @@
  * improve ignoring of obsolete mutations in index maintenance (CASSANDRA-2401)
  * recognize attempt to drop just the index while leaving the column
    definition alone (CASSANDRA-2619)
- * Fix regression where bootstrapping a node with no schema fails
-   (CASSANDRA-2625)
- * Allow removing LocationInfo sstables (CASSANDRA-2632)
 
 
 0.8.0-beta1

Modified: cassandra/branches/cassandra-0.8.1/build.xml
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.1/build.xml?rev=1101946&r1=1101945&r2=1101946&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.1/build.xml (original)
+++ cassandra/branches/cassandra-0.8.1/build.xml Wed May 11 16:15:43 2011
@@ -25,7 +25,7 @@
     <property name="debuglevel" value="source,lines,vars"/>
 
     <!-- default version and SCM information (we need the default SCM info as people may
checkout with git-svn) -->
-    <property name="base.version" value="0.8.0-beta2"/>
+    <property name="base.version" value="0.8.0-rc1"/>
     <property name="scm.default.path" value="cassandra/branches/cassandra-0.7"/>
     <property name="scm.default.connection" value="scm:svn:http://svn.apache.org/repos/asf/${scm.default.path}"/>
     <property name="scm.default.developerConnection" value="scm:svn:https://svn.apache.org/repos/asf/${scm.default.path}"/>
@@ -64,7 +64,7 @@
     <property name="test.long.src" value="${test.dir}/long"/>
     <property name="test.distributed.src" value="${test.dir}/distributed"/>
     <property name="dist.dir" value="${build.dir}/dist"/>
-    <property name="cql.driver.version" value="1.0.1" />
+    <property name="cql.driver.version" value="1.0.2" />
     <condition property="version" value="${base.version}">
       <isset property="release"/>
     </condition>

Propchange: cassandra/branches/cassandra-0.8.1/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 11 16:15:43 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/contrib:922689-1052356,1052358-1053452,1053454,1053456-1068009
-/cassandra/branches/cassandra-0.7/contrib:1026516-1100900,1101021,1101772,1101792
+/cassandra/branches/cassandra-0.7/contrib:1026516-1101940
 /cassandra/branches/cassandra-0.7.0/contrib:1053690-1055654
-/cassandra/branches/cassandra-0.8/contrib:1090935-1101597,1101773,1101794
+/cassandra/branches/cassandra-0.8/contrib:1090935-1101945
 /cassandra/tags/cassandra-0.7.0-rc3/contrib:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/contrib:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/contrib:810145-810987,810994-834239,834349-834350

Modified: cassandra/branches/cassandra-0.8.1/debian/cassandra.install
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.1/debian/cassandra.install?rev=1101946&r1=1101945&r2=1101946&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.1/debian/cassandra.install (original)
+++ cassandra/branches/cassandra-0.8.1/debian/cassandra.install Wed May 11 16:15:43 2011
@@ -6,7 +6,6 @@ debian/cassandra.conf etc/security/limit
 bin/cassandra usr/sbin
 bin/cassandra-cli usr/bin
 bin/nodetool usr/bin
-bin/clustertool usr/bin
 bin/json2sstable usr/bin
 bin/sstable2json usr/bin
 bin/sstablekeys usr/bin

Modified: cassandra/branches/cassandra-0.8.1/debian/changelog
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.1/debian/changelog?rev=1101946&r1=1101945&r2=1101946&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.1/debian/changelog (original)
+++ cassandra/branches/cassandra-0.8.1/debian/changelog Wed May 11 16:15:43 2011
@@ -1,3 +1,9 @@
+cassandra (0.8.0~rc1) unstable; urgency=low
+
+  * Release candidate
+
+ -- Eric Evans <eevans@apache.org>  Tue, 10 May 2011 19:09:27 -0500
+
 cassandra (0.8.0~beta2) unstable; urgency=low
 
   * New beta release.

Modified: cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/AbstractResultSet.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/AbstractResultSet.java?rev=1101946&r1=1101945&r2=1101946&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/AbstractResultSet.java
(original)
+++ cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/AbstractResultSet.java
Wed May 11 16:15:43 2011
@@ -1,4 +1,25 @@
 package org.apache.cassandra.cql.jdbc;
+/*
+ * 
+ * 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.io.InputStream;
 import java.io.Reader;

Modified: cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java?rev=1101946&r1=1101945&r2=1101946&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java
(original)
+++ cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java
Wed May 11 16:15:43 2011
@@ -182,11 +182,21 @@ public class CResultSet extends Abstract
     {
         // bit of a hack, this, but asking for getInt seems so common that we should accomodate
it
         if (column.getValue() instanceof BigInteger)
+        {
+            wasNull = false;
             return getBigInteger(column).intValue();
+        }
         else if (column.getValue() instanceof Long)
+        {
+            wasNull = false;
             return getLong(column).intValue();
-        else
-            throw new SQLException("Non-integer value " + column.getValue());
+        }
+        else if (column.getValue() == null)
+        {
+            wasNull = true;
+            return 0;
+        }
+        throw new SQLException("Non-integer value " + column.getValue());
     }
 
     public int getInt(int index) throws SQLException

Modified: cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraResultSet.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraResultSet.java?rev=1101946&r1=1101945&r2=1101946&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraResultSet.java
(original)
+++ cassandra/branches/cassandra-0.8.1/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraResultSet.java
Wed May 11 16:15:43 2011
@@ -1,4 +1,25 @@
 package org.apache.cassandra.cql.jdbc;
+/*
+ * 
+ * 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.math.BigInteger;
 import java.sql.ResultSet;

Propchange: cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 11 16:15:43 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1100900,1101021,1101772,1101792
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1101940
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090935-1101597,1101773,1101794
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090935-1101945
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1051699-1053689
 /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

Propchange: cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 11 16:15:43 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1100900,1101021,1101772,1101792
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1101940
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090935-1101597,1101773,1101794
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090935-1101945
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1051699-1053689
 /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

Propchange: cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 11 16:15:43 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1100900,1101021,1101772,1101792
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1101940
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090935-1101597,1101773,1101794
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090935-1101945
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1051699-1053689
 /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

Propchange: cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 11 16:15:43 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1100900,1101021,1101772,1101792
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1101940
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090935-1101597,1101773,1101794
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090935-1101945
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1051699-1053689
 /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

Propchange: cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 11 16:15:43 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1100900,1101021,1101772,1101792
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1101940
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090935-1101597,1101773,1101794
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090935-1101945
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1051699-1053689
 /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

Modified: cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/commitlog/CommitLog.java?rev=1101946&r1=1101945&r2=1101946&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
(original)
+++ cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
Wed May 11 16:15:43 2011
@@ -168,7 +168,7 @@ public class CommitLog
     // returns the number of replayed mutation (useful for tests in particular)
     public static int recover(File[] clogs) throws IOException
     {
-        Set<Table> tablesRecovered = new HashSet<Table>();
+        final Set<Table> tablesRecovered = new HashSet<Table>();
         List<Future<?>> futures = new ArrayList<Future<?>>();
         byte[] bytes = new byte[4096];
         Map<Integer, AtomicInteger> invalidMutations = new HashMap<Integer, AtomicInteger>();
@@ -288,21 +288,22 @@ public class CommitLog
                                                     rm.getTable(),
                                                     ByteBufferUtil.bytesToHex(rm.key()),
                                                     "{" + StringUtils.join(rm.getColumnFamilies(),
", ") + "}"));
-                    final Table table = Table.open(rm.getTable());
-                    tablesRecovered.add(table);
-                    final Collection<ColumnFamily> columnFamilies = new ArrayList<ColumnFamily>(rm.getColumnFamilies());
+
                     final long entryLocation = reader.getFilePointer();
                     final RowMutation frm = rm;
                     Runnable runnable = new WrappedRunnable()
                     {
                         public void runMayThrow() throws IOException
                         {
+                            if (DatabaseDescriptor.getKSMetaData(frm.getTable()) == null)
+                                return;
+                            final Table table = Table.open(frm.getTable());
                             RowMutation newRm = new RowMutation(frm.getTable(), frm.key());
 
                             // Rebuild the row mutation, omitting column families that a)
have already been flushed,
                             // b) are part of a cf that was dropped. Keep in mind that the
cf.name() is suspect. do every
                             // thing based on the cfid instead.
-                            for (ColumnFamily columnFamily : columnFamilies)
+                            for (ColumnFamily columnFamily : frm.getColumnFamilies())
                             {
                                 if (CFMetaData.getCF(columnFamily.id()) == null)
                                     // null means the cf has been dropped
@@ -321,6 +322,7 @@ public class CommitLog
                             if (!newRm.isEmpty())
                             {
                                 Table.open(newRm.getTable()).apply(newRm, false);
+                                tablesRecovered.add(table);
                             }
                         }
                     };

Modified: cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java?rev=1101946&r1=1101945&r2=1101946&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java
(original)
+++ cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java
Wed May 11 16:15:43 2011
@@ -1,4 +1,25 @@
 package org.apache.cassandra.db.commitlog;
+/*
+ * 
+ * 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.io.DataInput;
 import java.io.DataOutput;

Modified: cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/marshal/AbstractUUIDType.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/marshal/AbstractUUIDType.java?rev=1101946&r1=1101945&r2=1101946&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/marshal/AbstractUUIDType.java
(original)
+++ cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/db/marshal/AbstractUUIDType.java
Wed May 11 16:15:43 2011
@@ -1,4 +1,25 @@
 package org.apache.cassandra.db.marshal;
+/*
+ * 
+ * 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.sql.Types;
 import java.util.UUID;

Modified: cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/io/sstable/SSTableReader.java?rev=1101946&r1=1101945&r2=1101946&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
(original)
+++ cassandra/branches/cassandra-0.8.1/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
Wed May 11 16:15:43 2011
@@ -539,10 +539,13 @@ public class SSTableReader extends SSTab
         }
 
         // next, the key cache
-        Pair<Descriptor, DecoratedKey> unifiedKey = new Pair<Descriptor, DecoratedKey>(descriptor,
decoratedKey);
-        Long cachedPosition = getCachedPosition(unifiedKey);
-        if (cachedPosition != null)
-            return cachedPosition;
+        if (op == Operator.EQ || op == Operator.GE)
+        {
+            Pair<Descriptor, DecoratedKey> unifiedKey = new Pair<Descriptor, DecoratedKey>(descriptor,
decoratedKey);
+            Long cachedPosition = getCachedPosition(unifiedKey);
+            if (cachedPosition != null)
+                return cachedPosition;
+        }
 
         // next, see if the sampled index says it's impossible for the key to be present
         IndexSummary.KeyPosition sampledPosition = getIndexScanPosition(decoratedKey);
@@ -573,12 +576,12 @@ public class SSTableReader extends SSTab
                     {
                         if (comparison == 0 && keyCache != null && keyCache.getCapacity()
> 0)
                         {
-                            if (op == Operator.EQ)
-                                bloomFilterTracker.addTruePositive();
                             // store exact match for the key
                             if (decoratedKey.key != null)
                                 cacheKey(decoratedKey, dataPosition);
                         }
+                        if (op == Operator.EQ)
+                            bloomFilterTracker.addTruePositive();
                         return dataPosition;
                     }
                     if (v < 0)

Modified: cassandra/branches/cassandra-0.8.1/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.1/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java?rev=1101946&r1=1101945&r2=1101946&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.1/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
(original)
+++ cassandra/branches/cassandra-0.8.1/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
Wed May 11 16:15:43 2011
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.concurrent.ExecutionException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 import org.junit.Test;
@@ -148,4 +149,48 @@ public class SSTableReaderTest extends C
         store.forceBlockingFlush();
         assert store.getMaxRowSize() != 0;
     }
+
+    @Test
+    public void testGetPositionsForRangesWithKeyCache() throws IOException, ExecutionException,
InterruptedException
+    {
+        Table table = Table.open("Keyspace1");
+        ColumnFamilyStore store = table.getColumnFamilyStore("Standard2");
+        store.getKeyCache().setCapacity(100);
+
+        // insert data and compact to a single sstable
+        CompactionManager.instance.disableAutoCompaction();
+        for (int j = 0; j < 10; j++)
+        {
+            ByteBuffer key = ByteBufferUtil.bytes(String.valueOf(j));
+            RowMutation rm = new RowMutation("Keyspace1", key);
+            rm.add(new QueryPath("Standard2", null, ByteBufferUtil.bytes("0")), ByteBufferUtil.EMPTY_BYTE_BUFFER,
j);
+            rm.apply();
+        }
+        store.forceBlockingFlush();
+        CompactionManager.instance.performMajor(store);
+
+        SSTableReader sstable = store.getSSTables().iterator().next();
+        long p2 = sstable.getPosition(k(2), SSTableReader.Operator.EQ);
+        long p3 = sstable.getPosition(k(3), SSTableReader.Operator.EQ);
+        long p6 = sstable.getPosition(k(6), SSTableReader.Operator.EQ);
+        long p7 = sstable.getPosition(k(7), SSTableReader.Operator.EQ);
+
+        Pair<Long, Long> p = sstable.getPositionsForRanges(makeRanges(t(2), t(6))).iterator().next();
+
+        // range are start exclusive so we should start at 3
+        assert p.left == p3;
+
+        // to capture 6 we have to stop at the start of 7
+        assert p.right == p7;
+    }
+
+    private List<Range> makeRanges(Token left, Token right)
+    {
+        return Arrays.asList(new Range[]{ new Range(left, right) });
+    }
+
+    private DecoratedKey k(int i)
+    {
+        return new DecoratedKey(t(i), ByteBufferUtil.bytes(String.valueOf(i)));
+    }
 }



Mime
View raw message