mirror of https://github.com/apache/cassandra
merge CASSANDRA-2558 from 0.8
git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@1097889 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
832a45d89c
commit
7a49fb0797
|
|
@ -17,6 +17,7 @@
|
|||
* fix incorrect use of NBHM.size in ReadCallback that could cause
|
||||
reads to time out even when responses were received (CASSAMDRA-2552)
|
||||
* trigger read repair correctly for LOCAL_QUORUM reads (CASSANDRA-2556)
|
||||
* Allow configuring the number of compaction thread (CASSANDRA-2558)
|
||||
|
||||
|
||||
0.8.0-beta1
|
||||
|
|
|
|||
|
|
@ -249,10 +249,15 @@ column_index_size_in_kb: 64
|
|||
# will be logged specifying the row key.
|
||||
in_memory_compaction_limit_in_mb: 64
|
||||
|
||||
# Enables multiple compactions to execute at once. This is highly recommended
|
||||
# for preserving read performance in a mixed read/write workload as this
|
||||
# avoids sstables from accumulating during long running compactions.
|
||||
compaction_multithreading: false
|
||||
# Number of compaction threads. This default to the number of processors,
|
||||
# enabling multiple compactions to execute at once. Using more than one
|
||||
# thread is highly recommended to preserve read performance in a mixed
|
||||
# read/write workload as this avoids sstables from accumulating during long
|
||||
# running compactions. The default is usually fine and if you experience
|
||||
# problems with compaction running too slowly or too fast, you should look at
|
||||
# compaction_throughput_mb_per_sec first.
|
||||
# Uncomment to make compaction mono-threaded.
|
||||
#concurrent_compacters: 1
|
||||
|
||||
# Throttles compaction to the given total throughput across the entire
|
||||
# system. The faster you insert data, the faster you need to compact in
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class Config
|
|||
/* if the size of columns or super-columns are more than this, indexing will kick in */
|
||||
public Integer column_index_size_in_kb = 64;
|
||||
public Integer in_memory_compaction_limit_in_mb = 256;
|
||||
public Boolean compaction_multithreading = true;
|
||||
public Integer concurrent_compactors = Runtime.getRuntime().availableProcessors();
|
||||
public Integer compaction_throughput_mb_per_sec = 16;
|
||||
|
||||
public String[] data_file_directories;
|
||||
|
|
|
|||
|
|
@ -341,8 +341,11 @@ public class DatabaseDescriptor
|
|||
throw new ConfigurationException("in_memory_compaction_limit_in_mb must be a positive integer");
|
||||
}
|
||||
|
||||
if (conf.compaction_multithreading == null)
|
||||
conf.compaction_multithreading = true;
|
||||
if (conf.concurrent_compactors == null)
|
||||
conf.concurrent_compactors = Runtime.getRuntime().availableProcessors();
|
||||
|
||||
if (conf.concurrent_compactors <= 0)
|
||||
throw new ConfigurationException("concurrent_compactors should be strictly greater than 0");
|
||||
|
||||
if (conf.compaction_throughput_mb_per_sec == null)
|
||||
conf.compaction_throughput_mb_per_sec = 16;
|
||||
|
|
@ -729,9 +732,9 @@ public class DatabaseDescriptor
|
|||
return conf.in_memory_compaction_limit_in_mb * 1024 * 1024;
|
||||
}
|
||||
|
||||
public static boolean getCompactionMultithreading()
|
||||
public static int getConcurrentCompactors()
|
||||
{
|
||||
return conf.compaction_multithreading;
|
||||
return conf.concurrent_compactors;
|
||||
}
|
||||
|
||||
public static int getCompactionThroughputMbPerSec()
|
||||
|
|
|
|||
|
|
@ -1212,9 +1212,7 @@ public class CompactionManager implements CompactionManagerMBean
|
|||
|
||||
private static int getThreadCount()
|
||||
{
|
||||
if (!DatabaseDescriptor.getCompactionMultithreading())
|
||||
return 1;
|
||||
return Math.max(2, Runtime.getRuntime().availableProcessors());
|
||||
return Math.max(1, DatabaseDescriptor.getConcurrentCompactors());
|
||||
}
|
||||
|
||||
void beginCompaction(CompactionInfo.Holder ci)
|
||||
|
|
|
|||
Loading…
Reference in New Issue