This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Custom Cassandra YAML and JVM options. #9
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
af7082c
Configurable JVM_OPTIONS_OVERRIDES
96d9dae
updated spacing
58ccf74
Added test for custom cassandra.yaml
0b32d06
Update operator/params.yaml
f283c9d
Update operator/params.yaml
3fb04df
Update tests/suites/sanity_test.go
79960ae
Update tests/suites/sanity_test.go
ae6c5ee
Added test for custom java.options
1bbfbb3
Merge branch 'master' into DCOS-59495
mpereira 470b997
Custom Cassandra YAML and JVM options improvements. (#20)
mpereira 1010dbc
Merge branch 'master' into DCOS-59495
mpereira File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,36 @@ import ( | |
|
||
log "github.com/sirupsen/logrus" | ||
|
||
kudo "github.com/mesosphere/kudo-cassandra-operator/tests/utils/kudo" | ||
"github.com/mesosphere/kudo-cassandra-operator/tests/utils/kudo" | ||
) | ||
|
||
func ClusterConfiguration( | ||
namespaceName string, instanceName string, | ||
) (map[string]string, error) { | ||
return getConfigurationFromNodeLogs( | ||
namespaceName, | ||
instanceName, | ||
"org.apache.cassandra.config.Config - Node configuration:\\[(.+)\\]", | ||
";", | ||
) | ||
} | ||
|
||
func NodeJvmOptions( | ||
namespaceName string, instanceName string, | ||
) (map[string]string, error) { | ||
return getConfigurationFromNodeLogs( | ||
namespaceName, | ||
instanceName, | ||
"o.a.c.service.CassandraDaemon - JVM Arguments: \\[(.+)\\]", | ||
",", | ||
) | ||
} | ||
|
||
func getConfigurationFromNodeLogs( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice approach. |
||
namespaceName string, | ||
instanceName string, | ||
regexpr string, | ||
separator string, | ||
) (map[string]string, error) { | ||
configuration := make(map[string]string) | ||
|
||
|
@@ -27,9 +52,7 @@ func ClusterConfiguration( | |
} | ||
|
||
scanner := bufio.NewScanner(logs) | ||
configurationLinePattern := regexp.MustCompile( | ||
"org.apache.cassandra.config.Config - Node configuration:\\[(.+)\\]", | ||
) | ||
configurationLinePattern := regexp.MustCompile(regexpr) | ||
var configurationLine string | ||
for scanner.Scan() { | ||
match := configurationLinePattern.FindStringSubmatch(scanner.Text()) | ||
|
@@ -47,7 +70,7 @@ func ClusterConfiguration( | |
return configuration, err | ||
} | ||
|
||
for _, kv := range strings.Split(configurationLine, ";") { | ||
for _, kv := range strings.Split(configurationLine, separator) { | ||
parts := strings.Split(strings.TrimSpace(kv), "=") | ||
if len(parts) == 2 { | ||
configuration[parts[0]] = parts[1] | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about this change.