cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject git commit: Track min/max timestamps for range tombstones.
Date Thu, 31 Jul 2014 05:43:07 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 b40cb0507 -> 892bf5551


Track min/max timestamps for range tombstones.

Patch by marcuse; reviewed by iamaleksey for CASSANDRA-7647


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

Branch: refs/heads/cassandra-2.0
Commit: 892bf5551c06e669b02d161439463ebf2de0793c
Parents: b40cb05
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Wed Jul 30 13:38:51 2014 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Thu Jul 31 07:36:39 2014 +0200

----------------------------------------------------------------------
 CHANGES.txt                                                       | 1 +
 src/java/org/apache/cassandra/db/ColumnFamily.java                | 3 ++-
 .../org/apache/cassandra/db/compaction/LazilyCompactedRow.java    | 3 ++-
 src/java/org/apache/cassandra/io/sstable/SSTableWriter.java       | 2 ++
 4 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/892bf555/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 4f08764..a6fc837 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -21,6 +21,7 @@
  * Add option to disable STCS in L0 (CASSANDRA-6621)
  * Fix error when doing reversed queries with static columns (CASSANDRA-7490)
  * Backport CASSANDRA-6747 (CASSANDRA-7560)
+ * Track max/min timestamps for range tombstones (CASSANDRA-7647)
 Merged from 1.2:
  * Set correct stream ID on responses when non-Exception Throwables
    are thrown while handling native protocol messages (CASSANDRA-7470)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/892bf555/src/java/org/apache/cassandra/db/ColumnFamily.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamily.java b/src/java/org/apache/cassandra/db/ColumnFamily.java
index 638eacc..95e5645 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamily.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamily.java
@@ -426,7 +426,8 @@ public abstract class ColumnFamily implements Iterable<Column>,
IRowCacheEntry
         {
             RangeTombstone rangeTombstone = it.next();
             tombstones.update(rangeTombstone.getLocalDeletionTime());
-
+            minTimestampSeen = Math.min(minTimestampSeen, rangeTombstone.minTimestamp());
+            maxTimestampSeen = Math.max(maxTimestampSeen, rangeTombstone.maxTimestamp());
             minColumnNamesSeen = ColumnNameHelper.minComponents(minColumnNamesSeen, rangeTombstone.min,
metadata.comparator);
             maxColumnNamesSeen = ColumnNameHelper.maxComponents(maxColumnNamesSeen, rangeTombstone.max,
metadata.comparator);
         }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/892bf555/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java b/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
index 7cd0842..1da1757 100644
--- a/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
+++ b/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
@@ -253,7 +253,8 @@ public class LazilyCompactedRow extends AbstractCompactedRow implements
Iterable
                 else
                 {
                     tombstones.update(t.getLocalDeletionTime());
-
+                    minTimestampSeen = Math.min(minTimestampSeen, t.minTimestamp());
+                    maxTimestampSeen = Math.max(maxTimestampSeen, t.maxTimestamp());
                     minColumnNameSeen = ColumnNameHelper.minComponents(minColumnNameSeen,
t.min, controller.cfs.metadata.comparator);
                     maxColumnNameSeen = ColumnNameHelper.maxComponents(maxColumnNameSeen,
t.max, controller.cfs.metadata.comparator);
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/892bf555/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java b/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
index 3a2dca0..8a9bb18 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
@@ -243,6 +243,8 @@ public class SSTableWriter extends SSTable
         {
             RangeTombstone rangeTombstone = rangeTombstoneIterator.next();
             tombstones.update(rangeTombstone.getLocalDeletionTime());
+            minTimestamp = Math.min(minTimestamp, rangeTombstone.minTimestamp());
+            maxTimestamp = Math.max(maxTimestamp, rangeTombstone.maxTimestamp());
 
             minColumnNames = ColumnNameHelper.minComponents(minColumnNames, rangeTombstone.min,
metadata.comparator);
             maxColumnNames = ColumnNameHelper.maxComponents(maxColumnNames, rangeTombstone.max,
metadata.comparator);


Mime
View raw message