You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sl...@apache.org on 2011/04/18 16:44:17 UTC

svn commit: r1094604 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java

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);