You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2014/03/12 17:58:43 UTC

[1/2] git commit: Restore expiring->deleted (cell) compaction optimization

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 2e00ba8bf -> cf9ae5f9c


Restore expiring->deleted (cell) compaction optimization

patch by Aleksey Yeschenko; reviewed by Sylvain Lebresne for
CASSANDRA-6844


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

Branch: refs/heads/cassandra-2.1
Commit: 19444ea1655d76db11a8048c4ecde81f305018c9
Parents: ed93ad4
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Mar 12 19:37:40 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Mar 12 19:37:40 2014 +0300

----------------------------------------------------------------------
 CHANGES.txt                                                        | 1 +
 .../org/apache/cassandra/io/sstable/SSTableIdentityIterator.java   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/19444ea1/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 906f91f..42dc4ee 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,6 +3,7 @@
  * Fix trigger mutations when base mutation list is immutable (CASSANDRA-6790)
  * Fix accounting in FileCacheService to allow re-using RAR (CASSANDRA-6838)
  * Fix static counter columns (CASSANDRA-6827)
+ * Restore expiring->deleted (cell) compaction optimization (CASSANDRA-6844)
 
 
 2.0.6

http://git-wip-us.apache.org/repos/asf/cassandra/blob/19444ea1/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java b/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
index 4e23ac2..52da9bb 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
@@ -102,7 +102,7 @@ public class SSTableIdentityIterator implements Comparable<SSTableIdentityIterat
             columnFamily = EmptyColumns.factory.create(metadata);
             columnFamily.delete(DeletionTime.serializer.deserialize(in));
             columnCount = dataVersion.hasRowSizeAndColumnCount ? in.readInt() : Integer.MAX_VALUE;
-            atomIterator = columnFamily.metadata().getOnDiskIterator(in, columnCount, dataVersion);
+            atomIterator = columnFamily.metadata().getOnDiskIterator(in, columnCount, flag, expireBefore, dataVersion);
         }
         catch (IOException e)
         {


[2/2] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

Posted by al...@apache.org.
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
	CHANGES.txt


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

Branch: refs/heads/cassandra-2.1
Commit: cf9ae5f9cddd81de6e153eae48357ca0842bf499
Parents: 2e00ba8 19444ea
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Mar 12 19:58:35 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Mar 12 19:58:35 2014 +0300

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../io/sstable/SSTableIdentityIterator.java     | 49 +++-----------------
 2 files changed, 8 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf9ae5f9/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 7a1fc60,42dc4ee..cb51c12
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -19,6 -3,10 +19,7 @@@ Merged from 2.0
   * Fix trigger mutations when base mutation list is immutable (CASSANDRA-6790)
   * Fix accounting in FileCacheService to allow re-using RAR (CASSANDRA-6838)
   * Fix static counter columns (CASSANDRA-6827)
+  * Restore expiring->deleted (cell) compaction optimization (CASSANDRA-6844)
 -
 -
 -2.0.6
   * Avoid race-prone second "scrub" of system keyspace (CASSANDRA-6797)
   * Pool CqlRecordWriter clients by inetaddress rather than Range 
     (CASSANDRA-6665)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf9ae5f9/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
index 11f2f71,52da9bb..ce4b670
--- a/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
@@@ -20,33 -20,33 +20,21 @@@ package org.apache.cassandra.io.sstable
  import java.io.*;
  import java.util.Iterator;
  
--import org.apache.cassandra.serializers.MarshalException;
--import org.slf4j.Logger;
--import org.slf4j.LoggerFactory;
--
  import org.apache.cassandra.config.CFMetaData;
  import org.apache.cassandra.db.*;
  import org.apache.cassandra.db.columniterator.OnDiskAtomIterator;
  import org.apache.cassandra.io.util.RandomAccessReader;
++import org.apache.cassandra.serializers.MarshalException;
  
  public class SSTableIdentityIterator implements Comparable<SSTableIdentityIterator>, OnDiskAtomIterator
  {
--    private static final Logger logger = LoggerFactory.getLogger(SSTableIdentityIterator.class);
--
      private final DecoratedKey key;
      private final DataInput in;
      public final long dataSize; // we [still] require this so compaction can tell if it's safe to read the row into memory
      public final ColumnSerializer.Flag flag;
  
      private final ColumnFamily columnFamily;
--    private final int columnCount;
--
      private final Iterator<OnDiskAtom> atomIterator;
--    private final Descriptor.Version dataVersion;
--
--    // Used by lazilyCompactedRow, so that we see the same things when deserializing the first and second time
--    private final int expireBefore;
--
      private final boolean validateColumns;
      private final String filename;
  
@@@ -56,7 -56,7 +44,6 @@@
       * @param file Reading using this file.
       * @param key Key of this row.
       * @param dataSize length of row data
--     * @throws IOException
       */
      public SSTableIdentityIterator(SSTableReader sstable, RandomAccessReader file, DecoratedKey key, long dataSize)
      {
@@@ -92,17 -92,17 +79,18 @@@
          this.filename = filename;
          this.key = key;
          this.dataSize = dataSize;
--        this.expireBefore = (int)(System.currentTimeMillis() / 1000);
          this.flag = flag;
          this.validateColumns = checkData;
--        this.dataVersion = sstable == null ? Descriptor.Version.CURRENT : sstable.descriptor.version;
++
++        Descriptor.Version dataVersion = sstable == null ? Descriptor.Version.CURRENT : sstable.descriptor.version;
++        int expireBefore = (int) (System.currentTimeMillis() / 1000);
++        columnFamily = ArrayBackedSortedColumns.factory.create(metadata);
  
          try
          {
-             columnFamily = ArrayBackedSortedColumns.factory.create(metadata);
 -            columnFamily = EmptyColumns.factory.create(metadata);
              columnFamily.delete(DeletionTime.serializer.deserialize(in));
--            columnCount = dataVersion.hasRowSizeAndColumnCount ? in.readInt() : Integer.MAX_VALUE;
-             atomIterator = columnFamily.metadata().getOnDiskIterator(in, columnCount, dataVersion);
++            int columnCount = dataVersion.hasRowSizeAndColumnCount ? in.readInt() : Integer.MAX_VALUE;
+             atomIterator = columnFamily.metadata().getOnDiskIterator(in, columnCount, flag, expireBefore, dataVersion);
          }
          catch (IOException e)
          {
@@@ -177,31 -177,31 +165,8 @@@
          }
      }
  
--    public ColumnFamily getColumnFamilyWithColumns(ColumnFamily.Factory containerFactory)
--    {
--        ColumnFamily cf = columnFamily.cloneMeShallow(containerFactory, false);
--        // since we already read column count, just pass that value and continue deserialization
--        Iterator<OnDiskAtom> iter = cf.metadata().getOnDiskIterator(in, columnCount, flag, expireBefore, dataVersion);
--        while (iter.hasNext())
--            cf.addAtom(iter.next());
--
--        if (validateColumns)
--        {
--            try
--            {
--                cf.metadata().validateColumns(cf);
--            }
--            catch (MarshalException e)
--            {
--                throw new RuntimeException("Error validating row " + key, e);
--            }
--        }
--        return cf;
--    }
--
      public int compareTo(SSTableIdentityIterator o)
      {
          return key.compareTo(o.key);
      }
--
  }