cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r942217 - in /cassandra/trunk: ./ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/db/filter/ test/unit/org/apache/cassandra/db/
Date Fri, 07 May 2010 20:55:33 GMT
Author: jbellis
Date: Fri May  7 20:55:33 2010
New Revision: 942217

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

Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/README.txt
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java 
 (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java   (props
changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
  (props changed)
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/trunk/src/java/org/apache/cassandra/db/filter/SSTableNamesIterator.java
    cassandra/trunk/src/java/org/apache/cassandra/db/filter/SSTableSliceIterator.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May  7 20:55:33 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6:922689-942119
+/cassandra/branches/cassandra-0.6:922689-942206
 /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-915439

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=942217&r1=942216&r2=942217&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Fri May  7 20:55:33 2010
@@ -35,6 +35,7 @@ dev
  * make concurrent_reads, concurrent_writes configurable at runtime via JMX
    (CASSANDRA-1060)
  * disable GCInspector on non-Sun JVMs (CASSANDRA-1061)
+ * fix tombstone handling in sstable rows with no other data (CASSANDRA-1063)
 
 
 0.6.1

Modified: cassandra/trunk/README.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/README.txt?rev=942217&r1=942216&r2=942217&view=diff
==============================================================================
--- cassandra/trunk/README.txt (original)
+++ cassandra/trunk/README.txt Fri May  7 20:55:33 2010
@@ -10,7 +10,7 @@ and the data model from Google's BigTabl
 eventually consistent. Like BigTable, Cassandra provides a ColumnFamily-based
 data model richer than typical key/value systems.
 
-For more information see http://incubator.apache.org/cassandra
+For more information see http://cassandra.apache.org/
 
 Requirements
 ------------
@@ -22,8 +22,8 @@ Getting started
 This short guide will walk you through getting a basic one node cluster up
 and running, and demonstrate some simple reads and writes.
 
-  * tar -zxvf cassandra-$VERSION.tgz
-  * cd cassandra-$VERSION
+  * tar -zxvf apache-cassandra-$VERSION.tar.gz
+  * cd apache-cassandra-$VERSION
   * sudo mkdir -p /var/log/cassandra
   * sudo chown -R `whoami` /var/log/cassandra
   * sudo mkdir -p /var/lib/cassandra
@@ -94,7 +94,7 @@ Wondering where to go from here? 
     best source for additional information.
   * Join us in #cassandra on irc.freenode.net and ask questions.
   * Subscribe to the Users mailing list by sending a mail to
-    cassandra-user-subscribe@incubator.apache.org
+    user-subscribe@cassandra.apache.org
 
 
 

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May  7 20:55:33 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-942119
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-942206
 /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-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May  7 20:55:33 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-942119
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-942206
 /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-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May  7 20:55:33 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-942119
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-942206
 /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-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May  7 20:55:33 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-942119
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-942206
 /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-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May  7 20:55:33 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-942119
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-942206
 /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-903502

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=942217&r1=942216&r2=942217&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Fri May  7 20:55:33
2010
@@ -808,18 +808,15 @@ public class ColumnFamilyStore implement
             for (SSTableReader sstable : ssTables_)
             {
                 iter = filter.getSSTableColumnIterator(sstable);
-                if (iter.hasNext()) // initializes iter.CF
+                if (iter.getColumnFamily() != null)
                 {
                     returnCF.delete(iter.getColumnFamily());
+                    iterators.add(iter);
                 }
-                iterators.add(iter);
             }
 
             Comparator<IColumn> comparator = QueryFilter.getColumnComparator(getComparator());
             Iterator collated = IteratorUtils.collatedIterator(comparator, iterators);
-            if (!collated.hasNext())
-                return null;
-
             filter.collectCollatedColumns(returnCF, collated, gcBefore);
             return returnCF; // caller is responsible for final removeDeleted
         }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/filter/SSTableNamesIterator.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/filter/SSTableNamesIterator.java?rev=942217&r1=942216&r2=942217&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/filter/SSTableNamesIterator.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/filter/SSTableNamesIterator.java Fri
May  7 20:55:33 2010
@@ -60,6 +60,7 @@ public class SSTableNamesIterator extend
         this.columns = columnNames;
         this.decoratedKey = key;
 
+        // open the sstable file, if we don't have one passed to use from range scan
         if (file == null)
         {
             try
@@ -78,19 +79,69 @@ public class SSTableNamesIterator extend
             }
         }
 
+        // read the requested columns into `cf`
         try
         {
-            List<byte[]> filteredColumnNames = getFilteredColumns(file, columnNames);
+            /* Read the bloom filter summarizing the columns */
+            BloomFilter bf = IndexHelper.defreezeBloomFilter(file);
+            List<IndexHelper.IndexInfo> indexList = IndexHelper.deserializeIndex(file);
+
+            // we can stop early if bloom filter says none of the columns actually exist
-- but,
+            // we can't stop before initializing the cf above, in case there's a relevant
tombstone
+            cf = ColumnFamily.serializer().deserializeFromSSTableNoColumns(ssTable.makeColumnFamily(),
file);
+
+            List<byte[]> filteredColumnNames1 = new ArrayList<byte[]>(columnNames.size());
+            for (byte[] name : columnNames)
+            {
+                if (bf.isPresent(name))
+                {
+                    filteredColumnNames1.add(name);
+                }
+            }
+            List<byte[]> filteredColumnNames = filteredColumnNames1;
             if (filteredColumnNames.isEmpty())
                 return;
 
-            getColumns(ssTable, file, columnNames, filteredColumnNames);
+            file.readInt(); // column count
+
+            /* get the various column ranges we have to read */
+            AbstractType comparator = ssTable.getColumnComparator();
+            SortedSet<IndexHelper.IndexInfo> ranges = new TreeSet<IndexHelper.IndexInfo>(IndexHelper.getComparator(comparator));
+            for (byte[] name : filteredColumnNames)
+            {
+                int index = IndexHelper.indexFor(name, indexList, comparator, false);
+                if (index == indexList.size())
+                    continue;
+                IndexHelper.IndexInfo indexInfo = indexList.get(index);
+                if (comparator.compare(name, indexInfo.firstName) < 0)
+                    continue;
+                ranges.add(indexInfo);
+            }
+
+            file.mark();
+            for (IndexHelper.IndexInfo indexInfo : ranges)
+            {
+                file.reset();
+                long curOffsert = file.skipBytes((int)indexInfo.offset);
+                assert curOffsert == indexInfo.offset;
+                // TODO only completely deserialize columns we are interested in
+                while (file.bytesPastMark() < indexInfo.offset + indexInfo.width)
+                {
+                    final IColumn column = cf.getColumnSerializer().deserialize(file);
+                    // we check vs the original Set, not the filtered List, for efficiency
+                    if (columnNames.contains(column.name()))
+                    {
+                        cf.addColumn(column);
+                    }
+                }
+            }
         }
         catch (IOException e)
         {
            throw new IOError(e); 
         }
-        
+
+        // create an iterator view of the columns we read
         iter = cf.getSortedColumns().iterator();
     }
      
@@ -99,76 +150,6 @@ public class SSTableNamesIterator extend
         return decoratedKey;
     }
 
-    /**
-     * Read in the columns we are looking for
-     * @param ssTable Table to read from
-     * @param file Read from this file
-     * @param columnNames Names of all columns we are looking for
-     * @param filteredColumnNames Names of columns that are thought to exist
-     * @throws IOException
-     */
-    private void getColumns(SSTableReader ssTable, FileDataInput file, SortedSet<byte[]>
columnNames, List<byte[]> filteredColumnNames) throws IOException
-    {
-        List<IndexHelper.IndexInfo> indexList = IndexHelper.deserializeIndex(file);
-     
-        cf = ColumnFamily.serializer().deserializeFromSSTableNoColumns(ssTable.makeColumnFamily(),
file);
-        file.readInt(); // column count
-     
-        /* get the various column ranges we have to read */
-        AbstractType comparator = ssTable.getColumnComparator();
-        SortedSet<IndexHelper.IndexInfo> ranges = new TreeSet<IndexHelper.IndexInfo>(IndexHelper.getComparator(comparator));
-        for (byte[] name : filteredColumnNames)
-        {
-            int index = IndexHelper.indexFor(name, indexList, comparator, false);
-            if (index == indexList.size())
-                continue;
-            IndexHelper.IndexInfo indexInfo = indexList.get(index);
-            if (comparator.compare(name, indexInfo.firstName) < 0)
-                continue;
-            ranges.add(indexInfo);
-        }
-     
-        file.mark();
-        for (IndexHelper.IndexInfo indexInfo : ranges)
-        {
-            file.reset();
-            long curOffsert = file.skipBytes((int)indexInfo.offset);
-            assert curOffsert == indexInfo.offset;
-            // TODO only completely deserialize columns we are interested in
-            while (file.bytesPastMark() < indexInfo.offset + indexInfo.width)
-            {
-                final IColumn column = cf.getColumnSerializer().deserialize(file);
-                // we check vs the original Set, not the filtered List, for efficiency
-                if (columnNames.contains(column.name()))
-                {
-                    cf.addColumn(column);
-                }
-            }
-        }
-    }
-     
-    /**
-     * Check the list of column names against the bloom filter
-     * @param file File to read bloom filter from
-     * @param columnNames Column names to filter
-     * @return List of columns that exist in the bloom filter
-     * @throws IOException
-     */
-    private List<byte[]> getFilteredColumns(FileDataInput file, SortedSet<byte[]>
columnNames) throws IOException
-    {
-        /* Read the bloom filter summarizing the columns */
-        BloomFilter bf = IndexHelper.defreezeBloomFilter(file);
-        List<byte[]> filteredColumnNames = new ArrayList<byte[]>(columnNames.size());
-        for (byte[] name : columnNames)
-        {
-            if (bf.isPresent(name))
-            {
-                filteredColumnNames.add(name);
-            }
-        }
-        return filteredColumnNames;
-    }
-    
     public ColumnFamily getColumnFamily()
     {
         return cf;

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/filter/SSTableSliceIterator.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/filter/SSTableSliceIterator.java?rev=942217&r1=942216&r2=942217&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/filter/SSTableSliceIterator.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/filter/SSTableSliceIterator.java Fri
May  7 20:55:33 2010
@@ -120,7 +120,7 @@ class SSTableSliceIterator extends Abstr
 
     public ColumnFamily getColumnFamily()
     {
-        return reader.getEmptyColumnFamily();
+        return reader == null ? null : reader.getEmptyColumnFamily();
     }
 
     protected IColumn computeNext()

Modified: cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java?rev=942217&r1=942216&r2=942217&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java Fri May 
7 20:55:33 2010
@@ -87,9 +87,14 @@ public class ColumnFamilyStoreTest exten
             public void runMayThrow() throws IOException
             {
                 QueryFilter sliceFilter = QueryFilter.getSliceFilter(Util.dk("key1"), new
QueryPath("Standard2", null, null), ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRAY,
null, false, 1);
-                assertNull(store.getColumnFamily(sliceFilter));
+                ColumnFamily cf = store.getColumnFamily(sliceFilter);
+                assert cf.isMarkedForDelete();
+                assert cf.getColumnsMap().isEmpty();
+
                 QueryFilter namesFilter = QueryFilter.getNamesFilter(Util.dk("key1"), new
QueryPath("Standard2", null, null), "a".getBytes());
-                assertNull(store.getColumnFamily(namesFilter));
+                cf = store.getColumnFamily(namesFilter);
+                assert cf.isMarkedForDelete();
+                assert cf.getColumnsMap().isEmpty();
             }
         };
 



Mime
View raw message