cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [2/6] cassandra git commit: remove unnecessary BB allocatetion; follow up for CASSANDRA-8979
Date Tue, 31 Mar 2015 16:58:58 GMT
remove unnecessary BB allocatetion; follow up for CASSANDRA-8979


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

Branch: refs/heads/cassandra-2.1
Commit: 74bfa773a299f2f0c825096c9c6ec521a5073e69
Parents: ec958f0
Author: Oleg Anastasyev <oleganas@gmail.com>
Authored: Tue Mar 31 11:55:37 2015 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Tue Mar 31 11:57:14 2015 -0500

----------------------------------------------------------------------
 .../db/compaction/PrecompactedRow.java          | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/74bfa773/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java b/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
index 4627fa2..f41e073 100644
--- a/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
+++ b/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
@@ -157,20 +157,20 @@ public class PrecompactedRow extends AbstractCompactedRow
         if (compactedCf == null)
             return;
 
-        DataOutputBuffer buffer = new DataOutputBuffer();
-        try
+        // do not update digest in case of missing or purged row level tombstones, see CASSANDRA-8979
+        if (compactedCf.deletionInfo().getTopLevelDeletion() != DeletionTime.LIVE)
         {
-            DeletionTime.serializer.serialize(compactedCf.deletionInfo().getTopLevelDeletion(),
buffer);
-
-            // do not update digest in case of missing or purged row level tombstones, see
CASSANDRA-8979
-            if (compactedCf.deletionInfo().getTopLevelDeletion() != DeletionTime.LIVE)
+            DataOutputBuffer buffer = new DataOutputBuffer();
+            try
             {
+                DeletionTime.serializer.serialize(compactedCf.deletionInfo().getTopLevelDeletion(),
buffer);
+
                 digest.update(buffer.getData(), 0, buffer.getLength());
             }
-        }
-        catch (IOException e)
-        {
-            throw new RuntimeException(e);
+            catch (IOException e)
+            {
+                throw new RuntimeException(e);
+            }
         }
         compactedCf.updateDigest(digest);
     }


Mime
View raw message