Author: slebresne
Date: Mon Apr 18 14:44:17 2011
New Revision: 1094604

URL: http://svn.apache.org/viewvc?rev=1094604&view=rev
Log:
Invalidate cache for streamed rows
patch by slebresne; reviewed by jbellis for CASSANDRA-2420

Modified:
    
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java

Modified: 
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
URL: 
http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java?rev=1094604&r1=1094603&r2=1094604&view=diff
==============================================================================
--- 
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
 (original)
+++ 
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
 Mon Apr 18 14:44:17 2011
@@ -309,6 +309,11 @@ public class SSTableWriter extends SSTab
                 while (rowPosition < dfile.length())
                 {
                     key = 
SSTableReader.decodeKey(StorageService.getPartitioner(), desc, 
ByteBufferUtil.readWithShortLength(dfile));
+
+                    // If the key is in (row) cache, we need the cache to be 
aware of the streamed row. To keep this simple, we
+                    // simply invalidate the row (we always invalidate but 
invalidating a key not in the cache is a no-op).
+                    cfs.invalidateCachedRow(key);
+
                     iwriter.afterAppend(key, rowPosition);
 
                     long dataSize = SSTableReader.readRowSize(dfile, desc);


Reply via email to