Invalidate cache for streamed rows

patch by slebresne; reviewed by jbellis for CASSANDRA-2420


git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.7@1094604 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sylvain Lebresne 2011-04-18 14:44:17 +00:00
parent 1e20bf521d
commit 0fb4df9716
1 changed files with 5 additions and 0 deletions

View File

@ -309,6 +309,11 @@ public class SSTableWriter extends SSTable
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);