-
Notifications
You must be signed in to change notification settings - Fork 885
CASSANDRA-19292 Enable Jenkins to test against Cassandra 4.1.x #1924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -236,12 +236,33 @@ public void create() { | |
| Arrays.stream(nodes).mapToObj(n -> "" + n).collect(Collectors.joining(":")), | ||
|
Contributor
Author
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. All changes in this file aim to address configuration changes in Cassandra 4.1 brought in by CASSANDRA-15234 |
||
| createOptions.stream().collect(Collectors.joining(" "))); | ||
|
|
||
| Version cassandraVersion = getCassandraVersion(); | ||
| for (Map.Entry<String, Object> conf : cassandraConfiguration.entrySet()) { | ||
| execute("updateconf", String.format("%s:%s", conf.getKey(), conf.getValue())); | ||
| String originalKey = conf.getKey(); | ||
| Object originalValue = conf.getValue(); | ||
| execute( | ||
| "updateconf", | ||
| String.join( | ||
| ":", | ||
| getConfigKey(originalKey, originalValue, cassandraVersion), | ||
| getConfigValue(originalKey, originalValue, cassandraVersion))); | ||
| } | ||
| if (getCassandraVersion().compareTo(Version.V2_2_0) >= 0) { | ||
| execute("updateconf", "enable_user_defined_functions:true"); | ||
|
|
||
| // If we're dealing with anything more recent than 2.2 explicitly enable UDF... but run it | ||
| // through our conversion process to make | ||
| // sure more recent versions don't have a problem. | ||
| if (cassandraVersion.compareTo(Version.V2_2_0) >= 0) { | ||
| String originalKey = "enable_user_defined_functions"; | ||
| Object originalValue = "true"; | ||
| execute( | ||
| "updateconf", | ||
| String.join( | ||
| ":", | ||
| getConfigKey(originalKey, originalValue, cassandraVersion), | ||
| getConfigValue(originalKey, originalValue, cassandraVersion))); | ||
| } | ||
|
|
||
| // Note that we aren't performing any substitution on DSE key/value props (at least for now) | ||
| if (DSE_ENABLEMENT) { | ||
| for (Map.Entry<String, Object> conf : dseConfiguration.entrySet()) { | ||
| execute("updatedseconf", String.format("%s:%s", conf.getKey(), conf.getValue())); | ||
|
|
@@ -463,6 +484,40 @@ private Optional<Integer> overrideJvmVersionForDseWorkloads() { | |
| return Optional.empty(); | ||
| } | ||
|
|
||
| private static String IN_MS_STR = "_in_ms"; | ||
| private static int IN_MS_STR_LENGTH = IN_MS_STR.length(); | ||
| private static String ENABLE_STR = "enable_"; | ||
| private static int ENABLE_STR_LENGTH = ENABLE_STR.length(); | ||
| private static String IN_KB_STR = "_in_kb"; | ||
| private static int IN_KB_STR_LENGTH = IN_KB_STR.length(); | ||
|
|
||
| @SuppressWarnings("unused") | ||
| private String getConfigKey(String originalKey, Object originalValue, Version cassandraVersion) { | ||
|
|
||
| // At least for now we won't support substitutions on nested keys. This requires an extra | ||
| // traversal of the string | ||
| // but we'll live with that for now | ||
| if (originalKey.contains(".")) return originalKey; | ||
| if (cassandraVersion.compareTo(Version.V4_1_0) < 0) return originalKey; | ||
| if (originalKey.endsWith(IN_MS_STR)) | ||
| return originalKey.substring(0, originalKey.length() - IN_MS_STR_LENGTH); | ||
| if (originalKey.startsWith(ENABLE_STR)) | ||
| return originalKey.substring(ENABLE_STR_LENGTH) + "_enabled"; | ||
| if (originalKey.endsWith(IN_KB_STR)) | ||
| return originalKey.substring(0, originalKey.length() - IN_KB_STR_LENGTH); | ||
| return originalKey; | ||
| } | ||
|
|
||
| private String getConfigValue( | ||
| String originalKey, Object originalValue, Version cassandraVersion) { | ||
|
|
||
| String originalValueStr = originalValue.toString(); | ||
| if (cassandraVersion.compareTo(Version.V4_1_0) < 0) return originalValueStr; | ||
| if (originalKey.endsWith(IN_MS_STR)) return originalValueStr + "ms"; | ||
| if (originalKey.endsWith(IN_KB_STR)) return originalValueStr + "KiB"; | ||
| return originalValueStr; | ||
| } | ||
|
Contributor
Author
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. Not intended to be an exhaustive set of changes required to support CASSANDRA-15234. For now I'm just worried about the set of props necessary to support the current collection of ITs; we can always update this as necessary if new configs need to be added for future test customization. |
||
|
|
||
| public static Builder builder() { | ||
| return new Builder(); | ||
| } | ||
|
|
||
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.
Table changed slightly with 4.1.x: