cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject cassandra git commit: Optimize range tombstone memory footprint
Date Wed, 20 May 2015 17:00:14 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 7af9c6ac8 -> 2248780ea


Optimize range tombstone memory footprint

patch by Benjamin Lerer; reviewed by Aleksey Yeschenko for
CASSANDRA-8603


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

Branch: refs/heads/cassandra-2.1
Commit: 2248780eae46d98be8a9414d3e833fb6c16c7137
Parents: 7af9c6a
Author: blerer <benjamin.lerer@datastax.com>
Authored: Tue May 19 16:12:53 2015 +0200
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Wed May 20 19:57:35 2015 +0300

----------------------------------------------------------------------
 CHANGES.txt                                          | 1 +
 src/java/org/apache/cassandra/db/RangeTombstone.java | 4 ++++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2248780e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 6fc1c9c..92d4d54 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.6
+ * Optimize range tombstone memory footprint (CASSANDRA-8603)
  * Use configured gcgs in anticompaction (CASSANDRA-9397)
  * Warn on misuse of unlogged batches (CASSANDRA-9282)
  * Failure detector detects and ignores local pauses (CASSANDRA-9183)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2248780e/src/java/org/apache/cassandra/db/RangeTombstone.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/RangeTombstone.java b/src/java/org/apache/cassandra/db/RangeTombstone.java
index 3f3d675..feeadbb 100644
--- a/src/java/org/apache/cassandra/db/RangeTombstone.java
+++ b/src/java/org/apache/cassandra/db/RangeTombstone.java
@@ -273,6 +273,10 @@ public class RangeTombstone extends Interval<Composite, DeletionTime>
implements
         {
             Composite max = type.serializer().deserialize(in);
             DeletionTime dt = DeletionTime.serializer.deserialize(in);
+            // If the max equals the min.end(), we can avoid keeping an extra ByteBuffer
in memory by using
+            // min.end() instead of max
+            Composite minEnd = min.end();
+            max = minEnd.equals(max) ? minEnd : max;
             return new RangeTombstone(min, max, dt);
         }
 


Mime
View raw message