cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [1/3] git commit: Exclude localTimestamp from merkle tree calculation for tombstones patch by Christian Spriegel; reviewed by yukim for CASSANDRA-5398
Date Wed, 22 May 2013 19:10:08 GMT
Updated Branches:
  refs/heads/cassandra-1.2 bf28e8d4b -> c48c7ef16
  refs/heads/trunk 62f429337 -> 2fc450a0b


Exclude localTimestamp from merkle tree calculation for tombstones patch by Christian Spriegel;
reviewed by yukim for CASSANDRA-5398


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

Branch: refs/heads/cassandra-1.2
Commit: c48c7ef16610b1ef86fc3c784a0659de9b5effd4
Parents: bf28e8d
Author: Christian Spriegel <horschi@googlemail.com>
Authored: Wed May 22 11:51:45 2013 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Wed May 22 14:05:56 2013 -0500

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 .../org/apache/cassandra/db/DeletedColumn.java     |   21 +++++++++++++++
 .../org/apache/cassandra/db/RangeTombstone.java    |    1 -
 3 files changed, 22 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c48c7ef1/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 21faf5a..6f1127a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,6 +3,7 @@
  * Write row markers when serializing schema (CASSANDRA-5572)
  * Check only SSTables for the requested range when streaming (CASSANDRA-5569)
  * Improve batchlog replay behavior and hint ttl handling (CASSANDRA-5314)
+ * Exclude localTimestamp from validation for tombstones (CASSANDRA-5398)
 Merged from 1.1:
  * Remove buggy thrift max message length option (CASSANDRA-5529)
  * Fix NPE in Pig's widerow mode (CASSANDRA-5488)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c48c7ef1/src/java/org/apache/cassandra/db/DeletedColumn.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/DeletedColumn.java b/src/java/org/apache/cassandra/db/DeletedColumn.java
index 18faeef..9814a3d 100644
--- a/src/java/org/apache/cassandra/db/DeletedColumn.java
+++ b/src/java/org/apache/cassandra/db/DeletedColumn.java
@@ -17,10 +17,13 @@
  */
 package org.apache.cassandra.db;
 
+import java.io.IOException;
 import java.nio.ByteBuffer;
+import java.security.MessageDigest;
 
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.db.marshal.MarshalException;
+import org.apache.cassandra.io.util.DataOutputBuffer;
 import org.apache.cassandra.utils.Allocator;
 import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.HeapAllocator;
@@ -52,6 +55,24 @@ public class DeletedColumn extends Column
     }
 
     @Override
+    public void updateDigest(MessageDigest digest)
+    {
+        digest.update(name.duplicate());
+
+        DataOutputBuffer buffer = new DataOutputBuffer();
+        try
+        {
+            buffer.writeLong(timestamp);
+            buffer.writeByte(serializationFlags());
+        }
+        catch (IOException e)
+        {
+            throw new RuntimeException(e);
+        }
+        digest.update(buffer.getData(), 0, buffer.getLength());
+    }
+
+    @Override
     public int getLocalDeletionTime()
     {
        return value.getInt(value.position());

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c48c7ef1/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 1d472c3..5e87847 100644
--- a/src/java/org/apache/cassandra/db/RangeTombstone.java
+++ b/src/java/org/apache/cassandra/db/RangeTombstone.java
@@ -96,7 +96,6 @@ public class RangeTombstone extends Interval<ByteBuffer, DeletionTime>
implement
         try
         {
             buffer.writeLong(data.markedForDeleteAt);
-            buffer.writeInt(data.localDeletionTime);
         }
         catch (IOException e)
         {


Mime
View raw message