Unhardcoding concurrent_compactors variable
Change-Id: Idd61c48f9d747aff897c7ddbc1a44a996c5cfa95
Tags: Customer-Related
diff --git a/README.rst b/README.rst
index f858209..da9d0b4 100644
--- a/README.rst
+++ b/README.rst
@@ -137,6 +137,7 @@
name: 'Contrail'
original_token: 0
compaction_throughput_mb_per_sec: 16
+ concurrent_compactors: 1
data_dirs:
- /var/lib/cassandra
id: 1
diff --git a/opencontrail/files/2.2/cassandra.yaml b/opencontrail/files/2.2/cassandra.yaml
index f3ca089..0ffd86a 100644
--- a/opencontrail/files/2.2/cassandra.yaml
+++ b/opencontrail/files/2.2/cassandra.yaml
@@ -572,6 +572,9 @@
# If your data directories are backed by SSD, you should increase this
# to the number of cores.
#concurrent_compactors: 1
+{% if database.concurrent_compactors is defined %}
+concurrent_compactors: {{ database.concurrent_compactors }}
+{% endif %}
# Throttles compaction to the given total throughput across the entire
# system. The faster you insert data, the faster you need to compact in
diff --git a/opencontrail/files/3.0/cassandra.yaml b/opencontrail/files/3.0/cassandra.yaml
index f3ca089..0ffd86a 100644
--- a/opencontrail/files/3.0/cassandra.yaml
+++ b/opencontrail/files/3.0/cassandra.yaml
@@ -572,6 +572,9 @@
# If your data directories are backed by SSD, you should increase this
# to the number of cores.
#concurrent_compactors: 1
+{% if database.concurrent_compactors is defined %}
+concurrent_compactors: {{ database.concurrent_compactors }}
+{% endif %}
# Throttles compaction to the given total throughput across the entire
# system. The faster you insert data, the faster you need to compact in
diff --git a/opencontrail/files/4.0/cassandra.yaml b/opencontrail/files/4.0/cassandra.yaml
index f3ca089..0ffd86a 100644
--- a/opencontrail/files/4.0/cassandra.yaml
+++ b/opencontrail/files/4.0/cassandra.yaml
@@ -572,6 +572,9 @@
# If your data directories are backed by SSD, you should increase this
# to the number of cores.
#concurrent_compactors: 1
+{% if database.concurrent_compactors is defined %}
+concurrent_compactors: {{ database.concurrent_compactors }}
+{% endif %}
# Throttles compaction to the given total throughput across the entire
# system. The faster you insert data, the faster you need to compact in
diff --git a/opencontrail/files/cassandra.yaml.1 b/opencontrail/files/cassandra.yaml.1
index f90c30a..c2e028f 100644
--- a/opencontrail/files/cassandra.yaml.1
+++ b/opencontrail/files/cassandra.yaml.1
@@ -471,6 +471,9 @@
# concurrent_compactors defaults to the number of cores.
# Uncomment to make compaction mono-threaded, the pre-0.8 default.
#concurrent_compactors: 1
+{% if database.concurrent_compactors is defined %}
+concurrent_compactors: {{ database.concurrent_compactors }}
+{% endif %}
# Multi-threaded compaction. When enabled, each compaction will use
# up to one thread per core, plus one thread per sstable being merged.
diff --git a/tests/pillar/cluster.sls b/tests/pillar/cluster.sls
index 7d89d10..f3685e2 100644
--- a/tests/pillar/cluster.sls
+++ b/tests/pillar/cluster.sls
@@ -121,6 +121,7 @@
id: 2
- host: 127.0.0.1
id: 3
+ concurrent_compactors: 1
web:
version: 3.0
enabled: True