Skip to content
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
96 changes: 42 additions & 54 deletions Jenkinsfile-datastax
Original file line number Diff line number Diff line change
Expand Up @@ -220,67 +220,61 @@ pipeline {
</table>''')
choice(
name: 'ADHOC_BUILD_AND_EXECUTE_TESTS_SERVER_VERSION',
choices: ['2.1', // Legacy Apache CassandraⓇ
'2.2', // Legacy Apache CassandraⓇ
'3.0', // Previous Apache CassandraⓇ
'3.11', // Current Apache CassandraⓇ
'4.0', // Development Apache CassandraⓇ
'dse-5.1', // Legacy DataStax Enterprise
'dse-6.0', // Previous DataStax Enterprise
'dse-6.7', // Previous DataStax Enterprise
'dse-6.8.0', // Current DataStax Enterprise
choices: ['4.0',
'4.1',
'5.0',
'dse-5.1.35',
'dse-6.0.18',
'dse-6.7.17',
'dse-6.8.30',
'dse-6.9.0',
'hcd-1.0.0',
'ALL'],
description: '''Apache Cassandra&reg; or DataStax Enterprise server version to use for adhoc <b>BUILD-AND-EXECUTE-TESTS</b> builds
<table style="width:100%">
<col width="15%">
<col width="85%">
<tr>
<th align="left">Choice</th>
<th align="left">Description</th>
</tr>
<tr>
<td><strong>2.1</strong></td>
<td>Apache Cassandra&reg; v2.1.x</td>
<td><strong>4.0</strong></td>
<td>Apache Cassandra&reg; v4.0.x</td>
</tr>
<tr>
<td><strong>2.2</strong></td>
<td>Apache Cassandra&reg; v2.2.x</td>
<td><strong>4.1</strong></td>
<td>Apache Cassandra&reg; v4.1.x</td>
</tr>
<tr>
<td><strong>3.0</strong></td>
<td>Apache Cassandra&reg; v3.0.x</td>
<td><strong>5.0</strong></td>
<td>Apache Cassandra&reg; v5.0.x</td>
</tr>
<tr>
<td><strong>3.11</strong></td>
<td>Apache Cassandra&reg; v3.11.x</td>
<td><strong>dse-5.1.35</strong></td>
<td>DataStax Enterprise v5.1.35</td>
</tr>
<tr>
<td><strong>4.0</strong></td>
<td>Apache Cassandra&reg; v4.x (<b>CURRENTLY UNDER DEVELOPMENT</b>)</td>
<td><strong>dse-6.0.18</strong></td>
<td>DataStax Enterprise v6.0.18</td>
</tr>
<tr>
<td><strong>dse-5.1</strong></td>
<td>DataStax Enterprise v5.1.x</td>
<td><strong>dse-6.7.17</strong></td>
<td>DataStax Enterprise v6.7.17</td>
</tr>
<tr>
<td><strong>dse-6.0</strong></td>
<td>DataStax Enterprise v6.0.x</td>
<td><strong>dse-6.8.30</strong></td>
<td>DataStax Enterprise v6.8.30</td>
</tr>
<tr>
<td><strong>dse-6.7</strong></td>
<td>DataStax Enterprise v6.7.x</td>
<td><strong>dse-6.9.0</strong></td>
<td>DataStax Enterprise v6.9.0</td>
</tr>
<tr>
<td><strong>dse-6.8.0</strong></td>
<td>DataStax Enterprise v6.8.0</td>
<td><strong>hcd-1.0.0</strong></td>
<td>DataStax HCD v1.0.0</td>
</tr>
</table>''')
choice(
name: 'ADHOC_BUILD_AND_EXECUTE_TESTS_JABBA_VERSION',
choices: ['zulu@1.6', // Zulu JDK 1.6
'zulu@1.7', // Zulu JDK 1.7
'1.8', // Oracle JDK version 1.8 (current default)
'openjdk@1.11'], // OpenJDK version 11
choices: ['1.8',
'openjdk@1.11'],
description: '''JDK version to use for <b>TESTING</b> when running adhoc <b>BUILD-AND-EXECUTE-TESTS</b> builds. <i>All builds will use JDK8 for building the driver</i>
<table style="width:100%">
<col width="15%">
Expand All @@ -289,14 +283,6 @@ pipeline {
<th align="left">Choice</th>
<th align="left">Description</th>
</tr>
<tr>
<td><strong>zulu@1.6</strong></td>
<td>Zulu JDK version 1.6</td>
</tr>
<tr>
<td><strong>zulu@1.7</strong></td>
<td>Zulu JDK version 1.7</td>
</tr>
<tr>
<td><strong>1.8</strong></td>
<td>Oracle JDK version 1.8 (<i>Used for compiling regardless of choice</i>)</td>
Expand Down Expand Up @@ -341,7 +327,7 @@ pipeline {
}

environment {
OS_VERSION = 'ubuntu/jammy64/java-driver'
OS_VERSION = 'ubuntu/focal64/java-driver'
JABBA_SHELL = '/usr/lib/jabba/jabba.sh'
CCM_ENVIRONMENT_SHELL = '/usr/local/bin/ccm_environment.sh'
}
Expand All @@ -367,8 +353,9 @@ pipeline {
axes {
axis {
name 'SERVER_VERSION'
values '3.11', // Current Apache CassandraⓇ
'4.0' // Development Apache CassandraⓇ
values '4.0',
'4.1',
'5.0'
}
}

Expand Down Expand Up @@ -474,14 +461,15 @@ pipeline {
axes {
axis {
name 'SERVER_VERSION'
values '2.1', // Legacy Apache CassandraⓇ
'3.0', // Previous Apache CassandraⓇ
'3.11', // Current Apache CassandraⓇ
'4.0', // Development Apache CassandraⓇ
'dse-5.1', // Legacy DataStax Enterprise
'dse-6.0', // Previous DataStax Enterprise
'dse-6.7', // Previous DataStax Enterprise
'dse-6.8.0' // Current DataStax Enterprise
values '4.0',
'4.1',
'5.0',
'dse-5.1.35',
'dse-6.0.18',
'dse-6.7.17',
'dse-6.8.30',
'dse-6.9.0',
'hcd-1.0.0'
}
}
when {
Expand Down
2 changes: 1 addition & 1 deletion driver-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
</dependency>

<dependency>
<groupId>org.lz4</groupId>
<groupId>at.yawk.lz4</groupId>
<artifactId>lz4-java</artifactId>
<optional>true</optional>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand All @@ -39,6 +40,17 @@ public class VersionNumber implements Comparable<VersionNumber> {
"(\\d+)\\.(\\d+)(\\.\\d+)?(\\.\\d+)?([~\\-]\\w[.\\w]*(?:\\-\\w[.\\w]*)*)?(\\+[.\\w]+)?";
private static final Pattern pattern = Pattern.compile(VERSION_REGEXP);

public static final VersionNumber V1_0_0 = Objects.requireNonNull(parse("1.0.0"));
public static final VersionNumber V2_1_0 = Objects.requireNonNull(parse("2.1.0"));
public static final VersionNumber V2_2_0 = Objects.requireNonNull(parse("2.2.0"));
public static final VersionNumber V3_0_0 = Objects.requireNonNull(parse("3.0.0"));
public static final VersionNumber V4_0_0 = Objects.requireNonNull(parse("4.0.0"));
public static final VersionNumber V4_1_0 = Objects.requireNonNull(parse("4.1.0"));
public static final VersionNumber V5_0_0 = Objects.requireNonNull(parse("5.0.0"));
public static final VersionNumber V6_7_0 = Objects.requireNonNull(parse("6.7.0"));
public static final VersionNumber V6_8_0 = Objects.requireNonNull(parse("6.8.0"));
public static final VersionNumber V6_9_0 = Objects.requireNonNull(parse("6.9.0"));

private final int major;
private final int minor;
private final int patch;
Expand Down
49 changes: 46 additions & 3 deletions driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -682,11 +682,54 @@ public void decommission(int n) {

@Override
public void updateConfig(Map<String, Object> configs) {
StringBuilder confStr = new StringBuilder();
VersionNumber cassandraVersion = getCassandraVersion();
for (Map.Entry<String, Object> entry : configs.entrySet()) {
confStr.append(entry.getKey()).append(":").append(entry.getValue()).append(" ");

String originalKey = entry.getKey();
Object originalValue = entry.getValue();

execute(
CCM_COMMAND + " updateconf",
String.join(
":",
getConfigKey(originalKey, originalValue, cassandraVersion),
getConfigValue(originalKey, originalValue, cassandraVersion)));
}
execute(CCM_COMMAND + " updateconf " + confStr);
}

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, VersionNumber 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(VersionNumber.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, VersionNumber cassandraVersion) {

String originalValueStr = originalValue.toString();
if (cassandraVersion.compareTo(VersionNumber.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;
}

@Override
Expand Down
Loading