Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Added parameter row_cache_size_in_mb #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class cassandra::config(
$config_path,
$package_name,
$max_heap_size,
$heap_newsize,
$jmx_port,
Expand Down Expand Up @@ -30,6 +31,7 @@
$endpoint_snitch,
$internode_compression,
$disk_failure_policy,
$row_cache_size_in_mb,
$thread_stack_size,
) {
group { 'cassandra':
Expand Down Expand Up @@ -58,8 +60,13 @@
content => template("${module_name}/cassandra-env.sh.erb"),
}

$config_template = $package_name ? {
'cassandra20' => 'cassandra-20',
'default' => 'cassandra',
}

file { "${config_path}/cassandra.yaml":
ensure => file,
content => template("${module_name}/cassandra.yaml.erb"),
content => template("${module_name}/${config_template}.yaml.erb"),
}
}
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
$endpoint_snitch = $cassandra::params::endpoint_snitch,
$internode_compression = $cassandra::params::internode_compression,
$disk_failure_policy = $cassandra::params::disk_failure_policy,
$row_cache_size_in_mb = $cassandra::params::row_cache_size_in_mb,
$thread_stack_size = $cassandra::params::thread_stack_size,
$service_enable = $cassandra::params::service_enable,
$service_ensure = $cassandra::params::service_ensure
Expand Down Expand Up @@ -69,6 +70,7 @@
validate_re("${num_tokens}", '^[0-9]+$')
validate_re($internode_compression, '^(all|dc|none)$')
validate_re($disk_failure_policy, '^(stop|best_effort|ignore)$')
validate_re("${row_cache_size_in_mb}", '^[0-9]+$')
validate_re("${thread_stack_size}", '^[0-9]+$')
validate_re($service_enable, '^(true|false)$')
validate_re($service_ensure, '^(running|stopped)$')
Expand Down Expand Up @@ -138,6 +140,7 @@

class { 'cassandra::config':
config_path => $config_path,
package_name => $package_name,
max_heap_size => $max_heap_size,
heap_newsize => $heap_newsize,
jmx_port => $jmx_port,
Expand Down Expand Up @@ -168,6 +171,7 @@
endpoint_snitch => $endpoint_snitch,
internode_compression => $internode_compression,
disk_failure_policy => $disk_failure_policy,
row_cache_size_in_mb => $row_cache_size_in_mb,
thread_stack_size => $thread_stack_size,
}

Expand Down
5 changes: 5 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@
default => $::cassandra_disk_failure_policy,
}

$row_cache_size_in_mb = $::cassandra_row_cache_size_in_mb ? {
undef => 0,
default => $::cassandra_row_cache_size_in_mb,
}

$start_native_transport = $::cassandra_start_native_transport ? {
undef => 'false',
default => $::cassandra_start_native_transport,
Expand Down
2 changes: 2 additions & 0 deletions spec/classes/cassandra_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
:endpoint_snitch => 'SimpleSnitch',
:internode_compression => 'all',
:disk_failure_policy => 'stop',
:row_cache_size_in_mb => 0,
:start_native_transport => 'false',
:start_rpc => 'true',
:native_transport_port => 9042,
Expand Down Expand Up @@ -114,6 +115,7 @@
:endpoint_snitch => 'SimpleSnitch',
:internode_compression => 'all',
:disk_failure_policy => 'stop',
:row_cache_size_in_mb => 0,
:start_native_transport => 'false',
:start_rpc => 'true',
:native_transport_port => 9042,
Expand Down
4 changes: 3 additions & 1 deletion spec/classes/cassandra_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
:endpoint_snitch => 'SimpleSnitch',
:internode_compression => 'all',
:disk_failure_policy => 'stop',
:row_cache_size_in_mb => 0,
:start_native_transport => 'false',
:start_rpc => 'true',
:native_transport_port => 9042,
Expand Down Expand Up @@ -162,12 +163,13 @@
:data_file_directories => [[['a', 'b']], ['bozo', '']],
:jmx_port => [[1, 65535], [420000, true]],
:listen_address => [['1.2.3.4'], ['4.5.6']],
:broadcast_address => [['1.2.3.4'], ['1.2', 'foo']],
:broadcast_address => [['1.2.3.4'], ['1.2', 'foo']],
:rpc_address => [['1.2.3.4'], ['4.5.6']],
:rpc_port => [[1, 65535], [420000, true]],
:storage_port => [[1, 65535], [420000, true]],
:internode_compression => [['all', 'dc' ,'none'], [9, 'bozo', true]],
:disk_failure_policy => [['stop', 'best_effort', 'ignore'], [9, 'bozo', true]],
:row_cache_size_in_mb => [[0, 128, 4096, 32768], ['bozo', true, false]],
:start_native_transport => [['true', 'false'], [9, 'bozo']],
:start_rpc => [['true', 'false'], [9, 'bozo']],
:native_transport_port => [[1, 65535], [420000, true]],
Expand Down
Loading