cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [1/10] git commit: merge from 1.1
Date Thu, 03 May 2012 23:35:43 GMT
Updated Branches:
  refs/heads/cassandra-1.0 f20badb68 -> c1148cec0
  refs/heads/cassandra-1.1 249456b07 -> af1dc0f56
  refs/heads/trunk b4e520c3b -> 359c38a8f


merge from 1.1


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

Branch: refs/heads/trunk
Commit: 359c38a8f2262924e37e49d2261573bfe82cfef4
Parents: b4e520c af1dc0f
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu May 3 18:34:32 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu May 3 18:34:32 2012 -0500

----------------------------------------------------------------------
 CHANGES.txt                                        |    9 +++-
 src/java/org/apache/cassandra/cql3/Cql.g           |    1 +
 src/java/org/apache/cassandra/db/Directories.java  |   33 ++++----------
 .../cassandra/db/compaction/CompactionTask.java    |   20 ++-------
 .../apache/cassandra/io/sstable/Descriptor.java    |   13 +++++-
 .../cassandra/io/sstable/SSTableMetadata.java      |    4 +-
 6 files changed, 38 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/359c38a8/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/359c38a8/src/java/org/apache/cassandra/db/Directories.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/359c38a8/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/compaction/CompactionTask.java
index be7fc81,6d914e3..47eaf6e
--- a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
@@@ -200,10 -199,10 +195,10 @@@ public class CompactionTask extends Abs
  
          cfs.replaceCompactedSSTables(toCompact, sstables, compactionType);
          // TODO: this doesn't belong here, it should be part of the reader to load when
the tracker is wired up
-         for (Entry<SSTableReader, Map<DecoratedKey, RowIndexEntry>> ssTableReaderMapEntry
: cachedKeyMap.entrySet())
 -        for (Map.Entry<SSTableReader, Map<DecoratedKey, Long>> ssTableReaderMapEntry
: cachedKeyMap.entrySet())
++        for (Map.Entry<SSTableReader, Map<DecoratedKey, RowIndexEntry>> ssTableReaderMapEntry
: cachedKeyMap.entrySet())
          {
              SSTableReader key = ssTableReaderMapEntry.getKey();
-             for (Entry<DecoratedKey, RowIndexEntry> entry : ssTableReaderMapEntry.getValue().entrySet())
 -            for (Map.Entry<DecoratedKey, Long> entry : ssTableReaderMapEntry.getValue().entrySet())
++            for (Map.Entry<DecoratedKey, RowIndexEntry> entry : ssTableReaderMapEntry.getValue().entrySet())
                 key.cacheKey(entry.getKey(), entry.getValue());
          }
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/359c38a8/src/java/org/apache/cassandra/io/sstable/Descriptor.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/io/sstable/Descriptor.java
index bac0e5c,3c63c8b..d1bb7b6
--- a/src/java/org/apache/cassandra/io/sstable/Descriptor.java
+++ b/src/java/org/apache/cassandra/io/sstable/Descriptor.java
@@@ -54,10 -57,8 +54,11 @@@ public class Descripto
      // h (1.0): tracks max client timestamp in metadata component
      // hb (1.0.3): records compression ration in metadata component
      // hc (1.0.4): records partitioner in metadata component
+     // hd (1.0.10): includes row tombstones in maxtimestamp
 -    public static final String CURRENT_VERSION = "hd";
 +    // ia (1.2.0): column indexes are promoted to the index file
 +    //             records estimated histogram of deletion times in tombstones
 +    //             bloom filter (keys and columns) upgraded to Murmur3
 +    public static final String CURRENT_VERSION = "ia";
  
      public final File directory;
      /** version has the following format: <code>[a-z]+</code> */
@@@ -102,19 -101,12 +103,19 @@@
          hasStringsInBloomFilter = version.compareTo("c") < 0;
          hasIntRowSize = version.compareTo("d") < 0;
          hasEncodedKeys = version.compareTo("e") < 0;
 -        usesOldBloomFilter = version.compareTo("f") < 0;
          metadataIncludesReplayPosition = version.compareTo("g") >= 0;
-         tracksMaxTimestamp = version.compareTo("h") >= 0;
+         tracksMaxTimestamp = version.compareTo("hd") >= 0;
          hasCompressionRatio = version.compareTo("hb") >= 0;
          hasPartitioner = version.compareTo("hc") >= 0;
 +        tracksTombstones = version.compareTo("ia") >= 0;
 +        hasPromotedIndexes = version.compareTo("ia") >= 0;
          isLatestVersion = version.compareTo(CURRENT_VERSION) == 0;
 +        if (version.compareTo("f") < 0)
 +            filterType = FilterFactory.Type.SHA;
 +        else if (version.compareTo("ia") < 0)
 +            filterType = FilterFactory.Type.MURMUR2;
 +        else
 +            filterType = FilterFactory.Type.MURMUR3;
      }
  
      public String filenameFor(Component component)
@@@ -236,9 -228,19 +237,19 @@@
          // we could add compatibility for earlier versions with the new single-pass streaming
          // (see SSTableWriter.appendFromStream) but versions earlier than 0.7.1 don't have
the
          // MessagingService version awareness anyway so there's no point.
 -        return isCompatible() && version.charAt(0) >= 'f';
 +        return isCompatible() && version.charAt(0) >= 'i';
      }
  
+     /**
+      * Versions [h..hc] contained a timestamp value that was computed incorrectly, ignoring
row tombstones.
+      * containsTimestamp returns true if there is a timestamp value in the metadata file;
to know if it
+      * actually contains a *correct* timestamp, see tracksMaxTimestamp.
+      */
+     public boolean containsTimestamp()
+     {
+         return version.compareTo("h") >= 0;
+     }
+ 
      @Override
      public String toString()
      {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/359c38a8/src/java/org/apache/cassandra/io/sstable/SSTableMetadata.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/io/sstable/SSTableMetadata.java
index 42a6c73,bf17c6f..8099f90
--- a/src/java/org/apache/cassandra/io/sstable/SSTableMetadata.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableMetadata.java
@@@ -253,15 -206,14 +253,17 @@@ public class SSTableMetadat
              ReplayPosition replayPosition = desc.metadataIncludesReplayPosition
                                            ? ReplayPosition.serializer.deserialize(dis)
                                            : ReplayPosition.NONE;
-             long maxTimestamp = desc.tracksMaxTimestamp ? dis.readLong() : Long.MIN_VALUE;
+             long maxTimestamp = desc.containsTimestamp() ? dis.readLong() : Long.MIN_VALUE;
+             if (!desc.tracksMaxTimestamp) // see javadoc to Descriptor.containsTimestamp
+                 maxTimestamp = Long.MIN_VALUE;
              double compressionRatio = desc.hasCompressionRatio
                                      ? dis.readDouble()
 -                                    : Double.MIN_VALUE;
 +                                              : Double.MIN_VALUE;
              String partitioner = desc.hasPartitioner ? dis.readUTF() : null;
 -            return new SSTableMetadata(rowSizes, columnCounts, replayPosition, maxTimestamp,
compressionRatio, partitioner);
 +            StreamingHistogram tombstoneHistogram = desc.tracksTombstones
 +                                                   ? StreamingHistogram.serializer.deserialize(dis)
 +                                                   : defaultTombstoneDropTimeHistogram();
 +            return new SSTableMetadata(rowSizes, columnCounts, replayPosition, maxTimestamp,
compressionRatio, partitioner, tombstoneHistogram);
          }
      }
  }


Mime
View raw message