merge from 0.6

git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.7@1071786 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2011-02-17 21:03:34 +00:00
parent 842bb4ab0f
commit 534d24faa6
5 changed files with 23 additions and 6 deletions

View File

@ -5,7 +5,10 @@
* fixes for cache save/load (CASSANDRA-2172, -2174)
* Handle whole-row deletions in CFOutputFormat (CASSANDRA-2014)
* Make memtable_flush_writers flush in parallel (CASSANDRA-2178)
* refactor stress.py to have only one copy of the format string used for creating row keys (CASSANDRA-2108)
* make key cache preheating default to false; enable with
-Dcompaction_preheat_key_cache=true (CASSANDRA-2175)
* refactor stress.py to have only one copy of the format string
used for creating row keys (CASSANDRA-2108)
0.7.2

View File

@ -226,6 +226,11 @@ column_index_size_in_kb: 64
# will be logged specifying the row key.
in_memory_compaction_limit_in_mb: 64
# Track cached row keys during compaction, and re-cache their new
# positions in the compacted sstable. Disable if you use really large
# key caches.
compaction_preheat_key_cache: true
# Time to wait for a reply from other nodes before failing the command
rpc_timeout_in_ms: 10000

View File

@ -107,6 +107,7 @@ public class Config
public Double reduce_cache_sizes_at = 1.0;
public double reduce_cache_capacity_to = 0.6;
public int hinted_handoff_throttle_delay_in_ms = 0;
public boolean compaction_preheat_key_cache = true;
public static enum CommitLogSync {
periodic,

View File

@ -1174,4 +1174,9 @@ public class DatabaseDescriptor
{
return conf.hinted_handoff_throttle_delay_in_ms;
}
public static boolean getPreheatKeyCache()
{
return conf.compaction_preheat_key_cache;
}
}

View File

@ -430,12 +430,15 @@ public class CompactionManager implements CompactionManagerMBean
long position = writer.append(row);
totalkeysWritten++;
for (SSTableReader sstable : sstables)
if (DatabaseDescriptor.getPreheatKeyCache())
{
if (sstable.getCachedPosition(row.key) != null)
for (SSTableReader sstable : sstables)
{
cachedKeys.put(row.key, position);
break;
if (sstable.getCachedPosition(row.key) != null)
{
cachedKeys.put(row.key, position);
break;
}
}
}
}
@ -447,7 +450,7 @@ public class CompactionManager implements CompactionManagerMBean
SSTableReader ssTable = writer.closeAndOpenReader(getMaxDataAge(sstables));
cfs.replaceCompactedSSTables(sstables, Arrays.asList(ssTable));
for (Entry<DecoratedKey, Long> entry : cachedKeys.entrySet())
for (Entry<DecoratedKey, Long> entry : cachedKeys.entrySet()) // empty if preheat is off
ssTable.cacheKey(entry.getKey(), entry.getValue());
submitMinorIfNeeded(cfs);