This is an automated email from the ASF dual-hosted git repository.
absurdfarce pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/cassandra-java-driver.git
The following commit(s) were added to refs/heads/3.x by this push:
new 0d04c85f4 CASSJAVA-128 Upgrade Netty to 4.1.138 and migrate to Java8
0d04c85f4 is described below
commit 0d04c85f40c16a451f078bf5ad77edf8d5285102
Author: absurdfarce <[email protected]>
AuthorDate: Tue May 12 16:05:49 2026 -0500
CASSJAVA-128 Upgrade Netty to 4.1.138 and migrate to Java8
patch by Bret McGuire; reviewed by Andy Tolbert
---
Jenkinsfile-datastax | 99 +++--
README.md | 20 +-
driver-core/pom.xml | 2 +-
.../com/datastax/driver/core/VersionNumber.java | 12 +
.../java/com/datastax/driver/core/CCMBridge.java | 54 ++-
.../com/datastax/driver/core/CCMTestsSupport.java | 24 --
.../datastax/driver/core/ExportAsStringTest.java | 2 -
.../datastax/driver/core/TableMetadataTest.java | 418 +++------------------
.../driver/core/VirtualTableMetadataTest.java | 32 +-
.../com/datastax/driver/core/cloud/CloudTest.java | 259 -------------
.../datastax/driver/core/cloud/SniProxyServer.java | 114 ------
.../test/resources/export_as_string_test_2.0.cql | 63 ----
.../test/resources/export_as_string_test_2.1.cql | 85 -----
.../test/resources/export_as_string_test_2.2.cql | 132 -------
...test_3.11.cql => export_as_string_test_4.1.cql} | 50 +--
..._test_3.0.cql => export_as_string_test_5.0.cql} | 56 +--
driver-examples/pom.xml | 1 -
.../com/datastax/driver/osgi/BundleOptions.java | 10 +-
driver-tests/osgi/pom.xml | 6 +-
manual/compression/README.md | 6 +-
pom.xml | 97 +----
21 files changed, 279 insertions(+), 1263 deletions(-)
diff --git a/Jenkinsfile-datastax b/Jenkinsfile-datastax
index 9e7b92bed..55f116dc1 100644
--- a/Jenkinsfile-datastax
+++ b/Jenkinsfile-datastax
@@ -100,8 +100,7 @@ def executeTests() {
-Dccm.maxNumberOfNodes=3 \
-DfailIfNoTests=false \
-Dmaven.test.failure.ignore=true \
- -Dmaven.javadoc.skip=true \
- -Dproxy.path=${HOME}/proxy
+ -Dmaven.javadoc.skip=true
# run isolated tests
mvn -B -V verify \
@@ -220,67 +219,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® 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>
+ <td><strong>4.0</strong></td>
+ <td>Apache Cassandra® v4.0.x</td>
</tr>
<tr>
- <td><strong>2.1</strong></td>
- <td>Apache Cassandra® v2.1.x</td>
+ <td><strong>4.1</strong></td>
+ <td>Apache Cassandra® v4.1.x</td>
</tr>
<tr>
- <td><strong>2.2</strong></td>
- <td>Apache Cassandra® v2.2.x</td>
+ <td><strong>5.0</strong></td>
+ <td>Apache Cassandra® v5.0.x</td>
</tr>
<tr>
- <td><strong>3.0</strong></td>
- <td>Apache Cassandra® v3.0.x</td>
+ <td><strong>dse-5.1.35</strong></td>
+ <td>DataStax Enterprise v5.1.35</td>
</tr>
<tr>
- <td><strong>3.11</strong></td>
- <td>Apache Cassandra® v3.11.x</td>
+ <td><strong>dse-6.0.18</strong></td>
+ <td>DataStax Enterprise v6.0.18</td>
</tr>
<tr>
- <td><strong>4.0</strong></td>
- <td>Apache Cassandra® v4.x (<b>CURRENTLY UNDER
DEVELOPMENT</b>)</td>
+ <td><strong>dse-6.7.17</strong></td>
+ <td>DataStax Enterprise v6.7.17</td>
</tr>
<tr>
- <td><strong>dse-5.1</strong></td>
- <td>DataStax Enterprise v5.1.x</td>
+ <td><strong>dse-6.8.30</strong></td>
+ <td>DataStax Enterprise v6.8.30</td>
</tr>
<tr>
- <td><strong>dse-6.0</strong></td>
- <td>DataStax Enterprise v6.0.x</td>
+ <td><strong>dse-6.9.0</strong></td>
+ <td>DataStax Enterprise v6.9.0</td>
</tr>
<tr>
- <td><strong>dse-6.7</strong></td>
- <td>DataStax Enterprise v6.7.x</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: ['[email protected]', // Zulu JDK 1.6
- '[email protected]', // Zulu JDK 1.7
- '1.8', // Oracle JDK version 1.8 (current default)
- '[email protected]'], // OpenJDK version 11
+ choices: ['1.8',
+ '[email protected]'],
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%">
@@ -289,14 +282,6 @@ pipeline {
<th align="left">Choice</th>
<th align="left">Description</th>
</tr>
- <tr>
- <td><strong>[email protected]</strong></td>
- <td>Zulu JDK version 1.6</td>
- </tr>
- <tr>
- <td><strong>[email protected]</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>
@@ -341,7 +326,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'
}
@@ -367,8 +352,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'
}
}
@@ -474,14 +460,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 {
diff --git a/README.md b/README.md
index a56816e07..469c8c885 100644
--- a/README.md
+++ b/README.md
@@ -93,26 +93,10 @@ The 'extras' module is also published as a separate
artifact:
We also provide a [shaded JAR](manual/shaded_jar/)
to avoid the explicit dependency to Netty.
-If you can't use a dependency management tool, a
-[binary tarball](https://cassandra.apache.org/_/download.html)
-is available for download.
-
## Compatibility
-The Java client driver 3.12.1 ([branch
3.x](https://github.com/apache/cassandra-java-driver/tree/3.x)) is compatible
with Apache
-Cassandra 2.1, 2.2 and 3.0+ (see [this
page](http://docs.datastax.com/en/developer/java-driver/3.11/manual/native_protocol/)
for
-the most up-to-date compatibility information).
-
-UDT and tuple support is available only when using Apache Cassandra 2.1 or
higher (see [CQL improvements in Cassandra
2.1](http://www.datastax.com/dev/blog/cql-in-2-1)).
-
-Other features are available only when using Apache Cassandra 2.0 or higher
(e.g. result set paging,
-[BatchStatement](https://github.com/apache/cassandra-java-driver/blob/3.x/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java),
-[lightweight
transactions](http://www.datastax.com/documentation/cql/3.1/cql/cql_using/use_ltweight_transaction_t.html)
--- see [What's new in Cassandra
2.0](http://www.datastax.com/documentation/cassandra/2.0/cassandra/features/features_key_c.html)).
-Trying to use these with a cluster running Cassandra 1.2 will result in
-an
[UnsupportedFeatureException](https://github.com/apache/cassandra-java-driver/blob/3.x/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedFeatureException.java)
being thrown.
-
-The java driver supports Java JDK versions 6 and above.
+The Java client driver 3.13.0 ([branch
3.x](https://github.com/apache/cassandra-java-driver/tree/3.x)) has been tested
against Apache
+Cassandra 4.0.x, 4.1.x and 5.0.x. The Java driver supports Java 8 and above.
## Upgrading from previous versions
diff --git a/driver-core/pom.xml b/driver-core/pom.xml
index 45aff62c1..c1e1de9c3 100644
--- a/driver-core/pom.xml
+++ b/driver-core/pom.xml
@@ -76,7 +76,7 @@
</dependency>
<dependency>
- <groupId>org.lz4</groupId>
+ <groupId>at.yawk.lz4</groupId>
<artifactId>lz4-java</artifactId>
<optional>true</optional>
</dependency>
diff --git
a/driver-core/src/main/java/com/datastax/driver/core/VersionNumber.java
b/driver-core/src/main/java/com/datastax/driver/core/VersionNumber.java
index debf049ce..5b8ea3600 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/VersionNumber.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/VersionNumber.java
@@ -21,6 +21,7 @@ import com.datastax.driver.core.utils.MoreObjects;
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;
@@ -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;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
b/driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
index 5070e6730..8cab16407 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
@@ -682,11 +682,53 @@ public class CCMBridge implements CCMAccess {
@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();
+
+ String updateString =
+ String.join(
+ ":",
+ getConfigKey(originalKey, originalValue, cassandraVersion),
+ getConfigValue(originalKey, originalValue, cassandraVersion));
+ execute(CCM_COMMAND + " updateconf %s", updateString);
}
- 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();
+
+ private static 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 static 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
@@ -1081,11 +1123,13 @@ public class CCMBridge implements CCMAccess {
if (!dse) {
if (isMaterializedViewsDisabledByDefault(cassandraVersion)) {
// enable materialized views
- cassandraConfiguration.put("enable_materialized_views", true);
+ cassandraConfiguration.put(
+ getConfigKey("enable_materialized_views", true,
cassandraVersion), true);
}
if (isSasiConfigEnablementRequired(cassandraVersion)) {
// enable SASI indexing in config (disabled by default in C* 4.0)
- cassandraConfiguration.put("enable_sasi_indexes", true);
+ cassandraConfiguration.put(
+ getConfigKey("enable_sasi_indexes", true, cassandraVersion),
true);
}
}
final CCMBridge ccm =
diff --git
a/driver-core/src/test/java/com/datastax/driver/core/CCMTestsSupport.java
b/driver-core/src/test/java/com/datastax/driver/core/CCMTestsSupport.java
index 8e8add392..400860d37 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CCMTestsSupport.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CCMTestsSupport.java
@@ -29,7 +29,6 @@ import com.datastax.driver.core.Cluster.Builder;
import com.datastax.driver.core.CreateCCM.TestMode;
import com.datastax.driver.core.exceptions.InvalidQueryException;
import com.google.common.base.Throwables;
-import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.io.Closer;
import com.google.common.util.concurrent.Uninterruptibles;
@@ -75,14 +74,6 @@ public class CCMTestsSupport {
private static final List<String> TEST_GROUPS =
Lists.newArrayList("isolated", "short", "long", "stress", "duration");
- // A mapping of cassandra.yaml config options to their version requirements.
- // If a config is passed containing one of these options and the version
requirement cannot be met
- // the option is simply filtered.
- private static final Map<String, VersionNumber> configVersionRequirements =
- ImmutableMap.<String, VersionNumber>builder()
- .put("enable_user_defined_functions", VersionNumber.parse("2.2.0"))
- .build();
-
private static class ReadOnlyCCMAccess implements CCMAccess {
private final CCMAccess delegate;
@@ -386,21 +377,6 @@ public class CCMTestsSupport {
if (tokens.length != 2) fail("Wrong configuration option: " + aConf);
String key = tokens[0];
String value = tokens[1];
- // If we've detected a property with a version requirement, skip it if
the version
- // requirement
- // cannot be met.
- if (configVersionRequirements.containsKey(key)) {
- VersionNumber requirement = configVersionRequirements.get(key);
- if (version != null && version.compareTo(requirement) < 0) {
- LOGGER.debug(
- "Skipping inclusion of '{}' in cassandra.yaml since it
requires >= C* {} and {} "
- + "was detected.",
- aConf,
- requirement,
- version);
- continue;
- }
- }
config.put(key, value);
}
}
diff --git
a/driver-core/src/test/java/com/datastax/driver/core/ExportAsStringTest.java
b/driver-core/src/test/java/com/datastax/driver/core/ExportAsStringTest.java
index 934bfba79..4db02c5a9 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ExportAsStringTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ExportAsStringTest.java
@@ -21,7 +21,6 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import com.datastax.driver.core.schemabuilder.SchemaBuilder;
-import com.datastax.driver.core.utils.CassandraVersion;
import com.google.common.collect.ImmutableMap;
import com.google.common.io.Closer;
import java.io.BufferedReader;
@@ -34,7 +33,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Test;
-@CassandraVersion("2.0")
@CCMConfig(config = "enable_user_defined_functions:true")
public class ExportAsStringTest extends CCMTestsSupport {
diff --git
a/driver-core/src/test/java/com/datastax/driver/core/TableMetadataTest.java
b/driver-core/src/test/java/com/datastax/driver/core/TableMetadataTest.java
index 88717c72d..97640afa1 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TableMetadataTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TableMetadataTest.java
@@ -299,15 +299,13 @@ public class TableMetadataTest extends CCMTestsSupport {
public void should_parse_table_options() {
VersionNumber version = ccm().getCassandraVersion();
VersionNumber dseVersion = ccm().getDSEVersion();
- boolean isRealCassandra4 =
- version.getMajor() > 3
- && (dseVersion == null ||
dseVersion.compareTo(VersionNumber.parse("6.8")) >= 0);
+ boolean isOSSCassandra5 = version.getMajor() > 4 && dseVersion == null;
// given
String cql;
- // Cassandra 4.0 +
- if (isRealCassandra4) {
+ // Cassandra 5.0.x
+ if (isOSSCassandra5) {
cql =
String.format(
"CREATE TABLE %s.with_options (\n"
@@ -325,13 +323,13 @@ public class TableMetadataTest extends CCMTestsSupport {
+ " AND caching = { 'keys' : 'ALL', 'rows_per_partition'
: 10 }\n"
+ " AND comment = 'My awesome table'\n"
+ " AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy',
'sstable_size_in_mb' : 15 }\n"
- + " AND compression = { 'sstable_compression' :
'org.apache.cassandra.io.compress.SnappyCompressor', 'chunk_length_kb' : 128
}\n"
+ + " AND compression = { 'class' :
'org.apache.cassandra.io.compress.SnappyCompressor', 'chunk_length_in_kb' : 128
}\n"
+ " AND crc_check_chance = 0.5\n" // available from C* 3.0
+ " AND memtable_flush_period_in_ms = 1000;",
keyspace);
-
- // Cassandra 3.0 +
- } else if (version.compareTo(VersionNumber.parse("3.0")) >= 0) {
+ }
+ // Cassandra 4.0.x or 4.1.x
+ else {
cql =
String.format(
"CREATE TABLE %s.with_options (\n"
@@ -341,13 +339,11 @@ public class TableMetadataTest extends CCMTestsSupport {
+ " i int,\n"
+ " PRIMARY KEY (k, c1, c2)\n"
+ ") WITH CLUSTERING ORDER BY (c1 DESC, c2 ASC)\n"
- + " AND read_repair_chance = 0.5\n"
- + " AND dclocal_read_repair_chance = 0.6\n"
- + " AND speculative_retry = '99.9PERCENTILE'\n"
- // replicate_on_write not supported anymore in 3.0
+ + " AND additional_write_policy = '99p'\n"
+ + " AND read_repair = 'BLOCKING'\n"
+ + " AND speculative_retry = '99.9p'\n"
+ " AND gc_grace_seconds = 42\n"
+ " AND bloom_filter_fp_chance = 0.01\n"
- // older caching formats not supported anymore in 3.0
+ " AND caching = { 'keys' : 'ALL', 'rows_per_partition'
: 10 }\n"
+ " AND comment = 'My awesome table'\n"
+ " AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy',
'sstable_size_in_mb' : 15 }\n"
@@ -355,50 +351,6 @@ public class TableMetadataTest extends CCMTestsSupport {
+ " AND crc_check_chance = 0.5\n" // available from C* 3.0
+ " AND memtable_flush_period_in_ms = 1000;",
keyspace);
-
- // Cassandra 2.0 +
- } else if (version.getMajor() > 1) {
- cql =
- String.format(
- "CREATE TABLE %s.with_options (\n"
- + " k text,\n"
- + " c1 int,\n"
- + " c2 int,\n"
- + " i int,\n"
- + " PRIMARY KEY (k, c1, c2)\n"
- + ") WITH CLUSTERING ORDER BY (c1 DESC, c2 ASC)\n"
- + " AND read_repair_chance = 0.5\n"
- + " AND dclocal_read_repair_chance = 0.6\n"
- + " AND replicate_on_write = true\n"
- + " AND gc_grace_seconds = 42\n"
- + " AND bloom_filter_fp_chance = 0.01\n"
- + " AND caching = 'ALL'\n"
- + " AND comment = 'My awesome table'\n"
- + " AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy',
'sstable_size_in_mb' : 15 }\n"
- + " AND compression = { 'sstable_compression' :
'org.apache.cassandra.io.compress.SnappyCompressor', 'chunk_length_kb' : 128
}\n"
- + " AND memtable_flush_period_in_ms = 1000;",
- keyspace);
- // older versions
- } else {
- cql =
- String.format(
- "CREATE TABLE %s.with_options (\n"
- + " k text,\n"
- + " c1 int,\n"
- + " c2 int,\n"
- + " i int,\n"
- + " PRIMARY KEY (k, c1, c2)\n"
- + ") WITH CLUSTERING ORDER BY (c1 DESC, c2 ASC)\n"
- + " AND read_repair_chance = 0.5\n"
- + " AND dclocal_read_repair_chance = 0.6\n"
- + " AND replicate_on_write = true\n"
- + " AND gc_grace_seconds = 42\n"
- + " AND bloom_filter_fp_chance = 0.01\n"
- + " AND caching = 'ALL'\n"
- + " AND comment = 'My awesome table'\n"
- + " AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy',
'sstable_size_in_mb' : 15 }\n"
- + " AND compression = { 'sstable_compression' :
'org.apache.cassandra.io.compress.SnappyCompressor', 'chunk_length_kb' : 128
};",
- keyspace);
}
// when
@@ -431,304 +383,58 @@ public class TableMetadataTest extends CCMTestsSupport {
.hasType(cint());
assertThat(table);
- // Cassandra 4.0 +
- if (isRealCassandra4) {
-
- assertThat(table.getOptions().getGcGraceInSeconds()).isEqualTo(42);
-
assertThat(table.getOptions().getBloomFilterFalsePositiveChance()).isEqualTo(0.01);
- assertThat(table.getOptions().getComment()).isEqualTo("My awesome
table");
- assertThat(table.getOptions().getCaching()).contains(entry("keys",
"ALL"));
-
assertThat(table.getOptions().getCaching()).contains(entry("rows_per_partition",
"10"));
- assertThat(table.getOptions().getCompaction())
- .contains(entry("class",
"org.apache.cassandra.db.compaction.LeveledCompactionStrategy"));
-
assertThat(table.getOptions().getCompaction()).contains(entry("sstable_size_in_mb",
"15"));
- assertThat(table.getOptions().getCompression())
- .contains(
- entry(
- "class",
- "org.apache.cassandra.io.compress.SnappyCompressor")); //
sstable_compression
- // becomes class
- assertThat(table.getOptions().getCompression())
- .contains(entry("chunk_length_in_kb", "128")); // note the "in"
prefix
- assertThat(table.getOptions().getDefaultTimeToLive()).isEqualTo(0);
- assertThat(table.getOptions().getSpeculativeRetry())
- .isEqualTo(dseVersion == null ? "99.9p" : "99.9PERCENTILE");
- assertThat(table.getOptions().getIndexInterval()).isNull();
- assertThat(table.getOptions().getMinIndexInterval()).isEqualTo(128);
- assertThat(table.getOptions().getMaxIndexInterval()).isEqualTo(2048);
- assertThat(table.getOptions().getReplicateOnWrite()).isTrue(); // default
- assertThat(table.getOptions().getCrcCheckChance()).isEqualTo(0.5);
- assertThat(table.getOptions().getExtensions()).isEmpty(); // default
-
assertThat(table.getOptions().getMemtableFlushPeriodInMs()).isEqualTo(1000);
- assertThat(table.asCQLQuery())
- .contains("additional_write_policy = '99p'")
- .contains("read_repair = 'BLOCKING'")
- .contains("gc_grace_seconds = 42")
- .contains("bloom_filter_fp_chance = 0.01")
- .contains("comment = 'My awesome table'")
- .contains("'keys' : 'ALL'")
- .contains("'rows_per_partition' : 10")
- .contains("'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'")
- .contains("'sstable_size_in_mb' : 15")
- .contains(
- "'class' : 'org.apache.cassandra.io.compress.SnappyCompressor'")
// sstable_compression becomes class
- .contains("'chunk_length_in_kb' : 128") // note the "in" prefix
- .contains("default_time_to_live = 0")
- .contains(
- dseVersion == null
- ? "speculative_retry = '99.9p'"
- : "speculative_retry = '99.9PERCENTILE'")
- .contains("min_index_interval = 128")
- .contains("max_index_interval = 2048")
- .contains("crc_check_chance = 0.5")
- .contains("cdc = false")
- .contains("memtable_flush_period_in_ms = 1000")
- .doesNotContain(" index_interval")
- .doesNotContain("replicate_on_write");
- // Cassandra 3.8 +
- } else if (version.compareTo(VersionNumber.parse("3.8")) >= 0) {
-
- assertThat(table.getOptions().getReadRepairChance()).isEqualTo(0.5);
- assertThat(table.getOptions().getLocalReadRepairChance()).isEqualTo(0.6);
- assertThat(table.getOptions().getGcGraceInSeconds()).isEqualTo(42);
-
assertThat(table.getOptions().getBloomFilterFalsePositiveChance()).isEqualTo(0.01);
- assertThat(table.getOptions().getComment()).isEqualTo("My awesome
table");
- assertThat(table.getOptions().getCaching()).contains(entry("keys",
"ALL"));
-
assertThat(table.getOptions().getCaching()).contains(entry("rows_per_partition",
"10"));
- assertThat(table.getOptions().getCompaction())
- .contains(entry("class",
"org.apache.cassandra.db.compaction.LeveledCompactionStrategy"));
-
assertThat(table.getOptions().getCompaction()).contains(entry("sstable_size_in_mb",
"15"));
- assertThat(table.getOptions().getCompression())
- .contains(
- entry(
- "class",
- "org.apache.cassandra.io.compress.SnappyCompressor")); //
sstable_compression
- // becomes class
- assertThat(table.getOptions().getCompression())
- .contains(entry("chunk_length_in_kb", "128")); // note the "in"
prefix
- assertThat(table.getOptions().getDefaultTimeToLive()).isEqualTo(0);
-
assertThat(table.getOptions().getSpeculativeRetry()).isEqualTo("99.9PERCENTILE");
- assertThat(table.getOptions().getIndexInterval()).isNull();
- assertThat(table.getOptions().getMinIndexInterval()).isEqualTo(128);
- assertThat(table.getOptions().getMaxIndexInterval()).isEqualTo(2048);
- assertThat(table.getOptions().getReplicateOnWrite()).isTrue(); // default
- assertThat(table.getOptions().getCrcCheckChance()).isEqualTo(0.5);
- assertThat(table.getOptions().getExtensions()).isEmpty(); // default
-
assertThat(table.getOptions().getMemtableFlushPeriodInMs()).isEqualTo(1000);
- assertThat(table.asCQLQuery())
- .contains("read_repair_chance = 0.5")
- .contains("dclocal_read_repair_chance = 0.6")
- .contains("gc_grace_seconds = 42")
- .contains("bloom_filter_fp_chance = 0.01")
- .contains("comment = 'My awesome table'")
- .contains("'keys' : 'ALL'")
- .contains("'rows_per_partition' : 10")
- .contains("'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'")
- .contains("'sstable_size_in_mb' : 15")
- .contains(
- "'class' : 'org.apache.cassandra.io.compress.SnappyCompressor'")
// sstable_compression becomes class
- .contains("'chunk_length_in_kb' : 128") // note the "in" prefix
- .contains("default_time_to_live = 0")
- .contains("speculative_retry = '99.9PERCENTILE'")
- .contains("min_index_interval = 128")
- .contains("max_index_interval = 2048")
- .contains("crc_check_chance = 0.5")
- .contains("cdc = false")
- .contains("memtable_flush_period_in_ms = 1000")
- .doesNotContain(" index_interval")
- .doesNotContain("replicate_on_write");
- // Cassandra 3.0 +
- } else if (version.compareTo(VersionNumber.parse("3.0")) >= 0) {
-
- assertThat(table.getOptions().getReadRepairChance()).isEqualTo(0.5);
- assertThat(table.getOptions().getLocalReadRepairChance()).isEqualTo(0.6);
- assertThat(table.getOptions().getGcGraceInSeconds()).isEqualTo(42);
-
assertThat(table.getOptions().getBloomFilterFalsePositiveChance()).isEqualTo(0.01);
- assertThat(table.getOptions().getComment()).isEqualTo("My awesome
table");
- assertThat(table.getOptions().getCaching()).contains(entry("keys",
"ALL"));
-
assertThat(table.getOptions().getCaching()).contains(entry("rows_per_partition",
"10"));
- assertThat(table.getOptions().getCompaction())
- .contains(entry("class",
"org.apache.cassandra.db.compaction.LeveledCompactionStrategy"));
-
assertThat(table.getOptions().getCompaction()).contains(entry("sstable_size_in_mb",
"15"));
- assertThat(table.getOptions().getCompression())
- .contains(
- entry(
- "class",
- "org.apache.cassandra.io.compress.SnappyCompressor")); //
sstable_compression
- // becomes class
- assertThat(table.getOptions().getCompression())
- .contains(entry("chunk_length_in_kb", "128")); // note the "in"
prefix
- assertThat(table.getOptions().getDefaultTimeToLive()).isEqualTo(0);
-
assertThat(table.getOptions().getSpeculativeRetry()).isEqualTo("99.9PERCENTILE");
- assertThat(table.getOptions().getIndexInterval()).isNull();
- assertThat(table.getOptions().getMinIndexInterval()).isEqualTo(128);
- assertThat(table.getOptions().getMaxIndexInterval()).isEqualTo(2048);
- assertThat(table.getOptions().getReplicateOnWrite()).isTrue(); // default
- assertThat(table.getOptions().getCrcCheckChance()).isEqualTo(0.5);
- assertThat(table.getOptions().getExtensions()).isEmpty(); // default
-
assertThat(table.getOptions().getMemtableFlushPeriodInMs()).isEqualTo(1000);
- assertThat(table.asCQLQuery())
- .contains("read_repair_chance = 0.5")
- .contains("dclocal_read_repair_chance = 0.6")
- .contains("gc_grace_seconds = 42")
- .contains("bloom_filter_fp_chance = 0.01")
- .contains("comment = 'My awesome table'")
- .contains("'keys' : 'ALL'")
- .contains("'rows_per_partition' : 10")
- .contains("'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'")
- .contains("'sstable_size_in_mb' : 15")
- .contains(
- "'class' : 'org.apache.cassandra.io.compress.SnappyCompressor'")
// sstable_compression becomes class
- .contains("'chunk_length_in_kb' : 128") // note the "in" prefix
- .contains("default_time_to_live = 0")
- .contains("speculative_retry = '99.9PERCENTILE'")
- .contains("min_index_interval = 128")
- .contains("max_index_interval = 2048")
- .contains("crc_check_chance = 0.5")
- .contains("memtable_flush_period_in_ms = 1000")
- .doesNotContain(" index_interval")
- .doesNotContain("replicate_on_write")
- .doesNotContain("cdc"); // 3.8+
-
- // Cassandra 2.1 and 2.2
- } else if (version.getMajor() == 2 && version.getMinor() > 0) {
-
- // With 2.1 we have different options, the caching option changes and
replicate_on_write
- // disappears
- assertThat(table.getOptions().getReadRepairChance()).isEqualTo(0.5);
- assertThat(table.getOptions().getLocalReadRepairChance()).isEqualTo(0.6);
- assertThat(table.getOptions().getGcGraceInSeconds()).isEqualTo(42);
-
assertThat(table.getOptions().getBloomFilterFalsePositiveChance()).isEqualTo(0.01);
- assertThat(table.getOptions().getComment()).isEqualTo("My awesome
table");
- assertThat(table.getOptions().getCaching()).contains(entry("keys",
"ALL"));
-
assertThat(table.getOptions().getCaching()).contains(entry("rows_per_partition",
"ALL"));
- assertThat(table.getOptions().getCompaction())
- .contains(entry("class",
"org.apache.cassandra.db.compaction.LeveledCompactionStrategy"));
-
assertThat(table.getOptions().getCompaction()).contains(entry("sstable_size_in_mb",
"15"));
- assertThat(table.getOptions().getCompression())
- .contains(
- entry("sstable_compression",
"org.apache.cassandra.io.compress.SnappyCompressor"));
-
assertThat(table.getOptions().getCompression()).contains(entry("chunk_length_kb",
"128"));
- assertThat(table.getOptions().getDefaultTimeToLive()).isEqualTo(0);
-
assertThat(table.getOptions().getSpeculativeRetry()).isEqualTo("99.0PERCENTILE");
- assertThat(table.getOptions().getIndexInterval()).isNull();
- assertThat(table.getOptions().getMinIndexInterval()).isEqualTo(128);
- assertThat(table.getOptions().getMaxIndexInterval()).isEqualTo(2048);
- assertThat(table.getOptions().getReplicateOnWrite()).isTrue(); // default
- assertThat(table.getOptions().getExtensions()).isEmpty();
-
assertThat(table.getOptions().getMemtableFlushPeriodInMs()).isEqualTo(1000);
- assertThat(table.asCQLQuery())
- .contains("read_repair_chance = 0.5")
- .contains("dclocal_read_repair_chance = 0.6")
- .contains("gc_grace_seconds = 42")
- .contains("bloom_filter_fp_chance = 0.01")
- .contains("comment = 'My awesome table'")
- .contains("'keys' : 'ALL'")
- .contains("'rows_per_partition' : 'ALL'")
- .contains("'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'")
- .contains("'sstable_size_in_mb' : 15")
- .contains("'sstable_compression' :
'org.apache.cassandra.io.compress.SnappyCompressor'")
- .contains("'chunk_length_kb' : 128")
- .contains("default_time_to_live = 0")
- .contains("speculative_retry = '99.0PERCENTILE'")
- .contains("min_index_interval = 128")
- .contains("max_index_interval = 2048")
- .contains("memtable_flush_period_in_ms = 1000")
- .doesNotContain(" index_interval")
- .doesNotContain("replicate_on_write")
- .doesNotContain("cdc");
-
- // Cassandra 2.0
- } else if (version.getMajor() == 2 && version.getMinor() == 0) {
-
- assertThat(table.getOptions().getReadRepairChance()).isEqualTo(0.5);
- assertThat(table.getOptions().getLocalReadRepairChance()).isEqualTo(0.6);
- assertThat(table.getOptions().getGcGraceInSeconds()).isEqualTo(42);
-
assertThat(table.getOptions().getBloomFilterFalsePositiveChance()).isEqualTo(0.01);
- assertThat(table.getOptions().getComment()).isEqualTo("My awesome
table");
- assertThat(table.getOptions().getCaching()).contains(entry("keys",
"ALL"));
- assertThat(table.getOptions().getCaching())
- .doesNotContain(entry("rows_per_partition", "ALL")); // 2.1 +
- assertThat(table.getOptions().getCompaction())
- .contains(entry("class",
"org.apache.cassandra.db.compaction.LeveledCompactionStrategy"));
-
assertThat(table.getOptions().getCompaction()).contains(entry("sstable_size_in_mb",
"15"));
- assertThat(table.getOptions().getCompression())
- .contains(
- entry("sstable_compression",
"org.apache.cassandra.io.compress.SnappyCompressor"));
-
assertThat(table.getOptions().getCompression()).contains(entry("chunk_length_kb",
"128"));
- assertThat(table.getOptions().getDefaultTimeToLive()).isEqualTo(0);
-
assertThat(table.getOptions().getSpeculativeRetry()).isEqualTo("99.0PERCENTILE");
// default
- assertThat(table.getOptions().getIndexInterval()).isEqualTo(128);
- assertThat(table.getOptions().getMinIndexInterval()).isNull();
- assertThat(table.getOptions().getMaxIndexInterval()).isNull();
- assertThat(table.getOptions().getReplicateOnWrite()).isTrue(); //
explicitly set
- assertThat(table.getOptions().getExtensions()).isEmpty();
-
assertThat(table.getOptions().getMemtableFlushPeriodInMs()).isEqualTo(1000);
- assertThat(table.asCQLQuery())
- .contains("read_repair_chance = 0.5")
- .contains("dclocal_read_repair_chance = 0.6")
- .contains("gc_grace_seconds = 42")
- .contains("bloom_filter_fp_chance = 0.01")
- .contains("comment = 'My awesome table'")
- .contains("caching = 'ALL'")
- .contains("'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'")
- .contains("'sstable_size_in_mb' : 15")
- .contains("'sstable_compression' :
'org.apache.cassandra.io.compress.SnappyCompressor'")
- .contains("'chunk_length_kb' : 128")
- .contains("replicate_on_write = true")
- .contains("index_interval = 128")
- .contains("speculative_retry = '99.0PERCENTILE'")
- .contains("default_time_to_live = 0")
- .contains("memtable_flush_period_in_ms = 1000")
- .doesNotContain("min_index_interval") // 2.1 +
- .doesNotContain("max_index_interval") // 2.1 +
- .doesNotContain("cdc");
-
- // Cassandra 1.2
- } else {
-
- assertThat(table.getOptions().getReadRepairChance()).isEqualTo(0.5);
- assertThat(table.getOptions().getLocalReadRepairChance()).isEqualTo(0.6);
- assertThat(table.getOptions().getGcGraceInSeconds()).isEqualTo(42);
-
assertThat(table.getOptions().getBloomFilterFalsePositiveChance()).isEqualTo(0.01);
- assertThat(table.getOptions().getComment()).isEqualTo("My awesome
table");
- assertThat(table.getOptions().getCaching()).contains(entry("keys",
"ALL"));
- assertThat(table.getOptions().getCaching())
- .doesNotContain(entry("rows_per_partition", "ALL")); // 2.1 +
- assertThat(table.getOptions().getCompaction())
- .contains(entry("class",
"org.apache.cassandra.db.compaction.LeveledCompactionStrategy"));
-
assertThat(table.getOptions().getCompaction()).contains(entry("sstable_size_in_mb",
"15"));
- assertThat(table.getOptions().getCompression())
- .contains(
- entry("sstable_compression",
"org.apache.cassandra.io.compress.SnappyCompressor"));
-
assertThat(table.getOptions().getCompression()).contains(entry("chunk_length_kb",
"128"));
- assertThat(table.getOptions().getDefaultTimeToLive()).isEqualTo(0); //
default
- assertThat(table.getOptions().getSpeculativeRetry()).isEqualTo("NONE");
// default
- assertThat(table.getOptions().getIndexInterval()).isNull();
- assertThat(table.getOptions().getMinIndexInterval()).isNull();
- assertThat(table.getOptions().getMaxIndexInterval()).isNull();
- assertThat(table.getOptions().getReplicateOnWrite()).isTrue(); //
explicitly set
- assertThat(table.getOptions().getExtensions()).isEmpty();
- assertThat(table.asCQLQuery())
- .contains("read_repair_chance = 0.5")
- .contains("dclocal_read_repair_chance = 0.6")
- .contains("gc_grace_seconds = 42")
- .contains("bloom_filter_fp_chance = 0.01")
- .contains("comment = 'My awesome table'")
- .contains("caching = 'ALL'")
- .contains("'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'")
- .contains("'sstable_size_in_mb' : 15")
- .contains("'sstable_compression' :
'org.apache.cassandra.io.compress.SnappyCompressor'")
- .contains("'chunk_length_kb' : 128")
- .contains("replicate_on_write = true")
- .doesNotContain("index_interval") // 2.0
- .doesNotContain("min_index_interval") // 2.1 +
- .doesNotContain("max_index_interval") // 2.1 +
- .doesNotContain("speculative_retry") // 2.0 +
- .doesNotContain("default_time_to_live") // 2.0 +
- .doesNotContain("cdc")
- .doesNotContain("memtable_flush_period_in_ms"); // 2.0 +
- }
+ assertThat(table.getOptions().getGcGraceInSeconds()).isEqualTo(42);
+
assertThat(table.getOptions().getBloomFilterFalsePositiveChance()).isEqualTo(0.01);
+ assertThat(table.getOptions().getComment()).isEqualTo("My awesome table");
+ assertThat(table.getOptions().getCaching()).contains(entry("keys", "ALL"));
+
assertThat(table.getOptions().getCaching()).contains(entry("rows_per_partition",
"10"));
+ assertThat(table.getOptions().getCompaction())
+ .contains(entry("class",
"org.apache.cassandra.db.compaction.LeveledCompactionStrategy"));
+
assertThat(table.getOptions().getCompaction()).contains(entry("sstable_size_in_mb",
"15"));
+ assertThat(table.getOptions().getCompression())
+ .contains(
+ entry(
+ "class",
+ "org.apache.cassandra.io.compress.SnappyCompressor")); //
sstable_compression
+ // becomes class
+ assertThat(table.getOptions().getCompression())
+ .contains(entry("chunk_length_in_kb", "128")); // note the "in" prefix
+ assertThat(table.getOptions().getDefaultTimeToLive()).isEqualTo(0);
+ assertThat(table.getOptions().getSpeculativeRetry())
+ .isEqualTo(dseVersion == null ? "99.9p" : "99.9PERCENTILE");
+ assertThat(table.getOptions().getIndexInterval()).isNull();
+ assertThat(table.getOptions().getMinIndexInterval()).isEqualTo(128);
+ assertThat(table.getOptions().getMaxIndexInterval()).isEqualTo(2048);
+ assertThat(table.getOptions().getReplicateOnWrite()).isTrue(); // default
+ assertThat(table.getOptions().getCrcCheckChance()).isEqualTo(0.5);
+ assertThat(table.getOptions().getExtensions()).isEmpty(); // default
+
assertThat(table.getOptions().getMemtableFlushPeriodInMs()).isEqualTo(1000);
+ assertThat(table.asCQLQuery())
+ .contains("additional_write_policy = '99p'")
+ .contains("read_repair = 'BLOCKING'")
+ .contains("gc_grace_seconds = 42")
+ .contains("bloom_filter_fp_chance = 0.01")
+ .contains("comment = 'My awesome table'")
+ .contains("'keys' : 'ALL'")
+ .contains("'rows_per_partition' : 10")
+ .contains("'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'")
+ .contains("'sstable_size_in_mb' : 15")
+ .contains(
+ "'class' : 'org.apache.cassandra.io.compress.SnappyCompressor'")
// sstable_compression
+
// becomes class
+ .contains("'chunk_length_in_kb' : 128") // note the "in" prefix
+ .contains("default_time_to_live = 0")
+ .contains(
+ dseVersion == null
+ ? "speculative_retry = '99.9p'"
+ : "speculative_retry = '99.9PERCENTILE'")
+ .contains("min_index_interval = 128")
+ .contains("max_index_interval = 2048")
+ .contains("crc_check_chance = 0.5")
+ .contains("cdc = false")
+ .contains("memtable_flush_period_in_ms = 1000")
+ .doesNotContain(" index_interval")
+ .doesNotContain("replicate_on_write");
// Also check that the generated CQL is valid and creates an identical
table
session().execute("DROP TABLE " + table.getName());
diff --git
a/driver-core/src/test/java/com/datastax/driver/core/VirtualTableMetadataTest.java
b/driver-core/src/test/java/com/datastax/driver/core/VirtualTableMetadataTest.java
index 55b99cdf9..ed10e76d2 100644
---
a/driver-core/src/test/java/com/datastax/driver/core/VirtualTableMetadataTest.java
+++
b/driver-core/src/test/java/com/datastax/driver/core/VirtualTableMetadataTest.java
@@ -51,7 +51,7 @@ public class VirtualTableMetadataTest extends CCMTestsSupport
{
assertThat(tm).isNotNull();
assertThat(tm.getName()).isEqualTo("clients");
assertThat(tm.isVirtual()).isTrue();
- assertThat(tm.getColumns().size()).isEqualTo(12);
+ assertThat(tm.getColumns().size()).isEqualTo(expectedColumnCount());
assertThat(tm.getPartitionKey().size()).isEqualTo(1);
assertThat(tm.getPartitionKey().get(0).getName()).isEqualTo("address");
assertThat(tm.getClusteringColumns().size()).isEqualTo(1);
@@ -63,12 +63,7 @@ public class VirtualTableMetadataTest extends
CCMTestsSupport {
assertThat(tm.getId()).isEqualTo(new UUID(0L, 0L));
assertThat(tm.getOptions()).isNull();
assertThat(tm.getKeyspace()).isEqualTo(km);
- assertThat(tm.asCQLQuery())
- .isEqualTo(
- "/* VIRTUAL TABLE system_views.clients (address inet, port int, "
- + "connection_stage text, driver_name text, driver_version
text, hostname text, protocol_version int, "
- + "request_count bigint, ssl_cipher_suite text, ssl_enabled
boolean, ssl_protocol text, username text, "
- + "PRIMARY KEY (address, port)) */");
+ assertThat(tm.asCQLQuery()).isEqualTo(expectedCQLQuery());
// ColumnMetadata is as expected
ColumnMetadata cm = tm.getColumn("driver_name");
assertThat(cm).isNotNull();
@@ -76,4 +71,27 @@ public class VirtualTableMetadataTest extends
CCMTestsSupport {
assertThat(cm.getType()).isEqualTo(DataType.text());
assertThat(cm.getName()).isEqualTo("driver_name");
}
+
+ private int expectedColumnCount() {
+ if (isCassandraVersionOrHigher("5.0.0")) return 14;
+ if (isCassandraVersionOrHigher("4.1.0")) return 13;
+ return 12;
+ }
+
+ private String expectedCQLQuery() {
+ if (isCassandraVersionOrHigher("5.0.0"))
+ return "/* VIRTUAL TABLE system_views.clients (address inet, port int,
client_options frozen<map<text, text>>, "
+ + "connection_stage text, driver_name text, driver_version text,
hostname text, keyspace_name text, "
+ + "protocol_version int, request_count bigint, ssl_cipher_suite
text, ssl_enabled boolean, "
+ + "ssl_protocol text, username text, PRIMARY KEY (address, port))
*/";
+ if (isCassandraVersionOrHigher("4.1.0"))
+ return "/* VIRTUAL TABLE system_views.clients (address inet, port int,
client_options frozen<map<text, text>>, "
+ + "connection_stage text, driver_name text, driver_version text,
hostname text, protocol_version int, "
+ + "request_count bigint, ssl_cipher_suite text, ssl_enabled boolean,
ssl_protocol text, username text, "
+ + "PRIMARY KEY (address, port)) */";
+ return "/* VIRTUAL TABLE system_views.clients (address inet, port int, "
+ + "connection_stage text, driver_name text, driver_version text,
hostname text, protocol_version int, "
+ + "request_count bigint, ssl_cipher_suite text, ssl_enabled boolean,
ssl_protocol text, username text, "
+ + "PRIMARY KEY (address, port)) */";
+ }
}
diff --git
a/driver-core/src/test/java/com/datastax/driver/core/cloud/CloudTest.java
b/driver-core/src/test/java/com/datastax/driver/core/cloud/CloudTest.java
deleted file mode 100644
index 7e9154386..000000000
--- a/driver-core/src/test/java/com/datastax/driver/core/cloud/CloudTest.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.datastax.driver.core.cloud;
-
-import static
com.datastax.driver.core.cloud.SniProxyServer.CERTS_BUNDLE_SUFFIX;
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.any;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static
com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.fail;
-
-import com.datastax.driver.core.Cluster;
-import com.datastax.driver.core.EndPoint;
-import com.datastax.driver.core.PlainTextAuthProvider;
-import com.datastax.driver.core.ProtocolVersion;
-import com.datastax.driver.core.ResultSet;
-import com.datastax.driver.core.Session;
-import com.datastax.driver.core.exceptions.AuthenticationException;
-import com.github.tomakehurst.wiremock.WireMockServer;
-import java.io.File;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.URL;
-import org.parboiled.common.FileUtils;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-public class CloudTest {
-
- private SniProxyServer proxy = new SniProxyServer();
-
- private WireMockServer wireMockServer;
-
- @BeforeClass(groups = "short")
- public void startProxy() {
- proxy.startProxy();
- }
-
- @BeforeMethod(groups = "short")
- public void startWireMock() {
- wireMockServer = new
WireMockServer(wireMockConfig().dynamicPort().dynamicHttpsPort());
- wireMockServer.start();
- }
-
- @AfterMethod(groups = "short")
- public void stopWireMock() {
- wireMockServer.stop();
- }
-
- @AfterClass(groups = "short", alwaysRun = true)
- public void stopProxy() throws Exception {
- proxy.stopProxy();
- }
-
- @Test(groups = "short")
- public void should_connect_to_proxy_using_absolute_path() {
- Session session =
- Cluster.builder()
- .withCloudSecureConnectBundle(proxy.getSecureBundleFile())
- .withProtocolVersion(ProtocolVersion.V4)
- .build()
- .connect();
- ResultSet set = session.execute("select * from system.local");
- assertThat(set).isNotNull();
- }
-
- @Test(groups = "short")
- public void should_connect_to_proxy_using_non_normalized_path() {
- String path =
- String.format("%s/%s", proxy.getProxyRootPath(),
"certs/bundles/../bundles/creds-v1.zip");
- Session session =
- Cluster.builder()
- .withCloudSecureConnectBundle(new File(path))
- .withProtocolVersion(ProtocolVersion.V4)
- .build()
- .connect();
- ResultSet set = session.execute("select * from system.local");
- assertThat(set).isNotNull();
- }
-
- @Test(groups = "short")
- public void should_connect_to_proxy_using_file_provided_by_the_http_URL()
throws IOException {
- // given
- wireMockServer.stubFor(
- any(urlEqualTo(CERTS_BUNDLE_SUFFIX))
- .willReturn(
- aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "application/octet-stream")
-
.withBody(FileUtils.readAllBytes(proxy.getSecureBundleFile()))));
-
- URL configFile =
- new URL(String.format("http://localhost:%d%s", wireMockServer.port(),
CERTS_BUNDLE_SUFFIX));
-
- // when
- Session session =
- Cluster.builder()
- .withCloudSecureConnectBundle(configFile)
- .withProtocolVersion(ProtocolVersion.V4)
- .build()
- .connect();
-
- // then
- ResultSet set = session.execute("select * from system.local");
- assertThat(set).isNotNull();
- }
-
- @Test(groups = "short")
- public void should_connect_to_proxy_using_file_provided_by_input_stream()
throws IOException {
- // given
- wireMockServer.stubFor(
- any(urlEqualTo(CERTS_BUNDLE_SUFFIX))
- .willReturn(
- aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "application/octet-stream")
-
.withBody(FileUtils.readAllBytes(proxy.getSecureBundleFile()))));
-
- URL configFile =
- new URL(String.format("http://localhost:%d%s", wireMockServer.port(),
CERTS_BUNDLE_SUFFIX));
-
- // when
- Session session =
- Cluster.builder()
- .withCloudSecureConnectBundle(configFile.openStream())
- .withProtocolVersion(ProtocolVersion.V4)
- .build()
- .connect();
-
- // then
- ResultSet set = session.execute("select * from system.local");
- assertThat(set).isNotNull();
- }
-
- @Test(groups = "short")
- public void should_connect_to_proxy_using_auth_provider() {
- Session session =
- Cluster.builder()
- .withCloudSecureConnectBundle(proxy.getSecureBundleNoCredsPath())
- .withAuthProvider(new PlainTextAuthProvider("cassandra",
"cassandra"))
- .withProtocolVersion(ProtocolVersion.V4)
- .build()
- .connect();
- ResultSet set = session.execute("select * from system.local");
- assertThat(set).isNotNull();
- }
-
- @Test(groups = "short")
- public void should_not_connect_to_proxy_bad_creds() {
- try {
- Session session =
- Cluster.builder()
- .withCloudSecureConnectBundle(proxy.getSecureBundleNoCredsPath())
- .withProtocolVersion(ProtocolVersion.V4)
- .build()
- .connect();
- fail("Expected an AuthenticationException");
- } catch (AuthenticationException e) {
- assertThat(e).hasMessageStartingWith("Authentication error on host");
- }
- }
-
- @Test(groups = "short")
- public void should_not_connect_to_proxy() {
- try {
- Session session =
- Cluster.builder()
- .withCloudSecureConnectBundle(proxy.getSecureBundleUnreachable())
- .withProtocolVersion(ProtocolVersion.V4)
- .build()
- .connect();
- fail("Expected an IllegalStateException");
- } catch (IllegalStateException e) {
- assertThat(e).hasMessageStartingWith("Cannot construct cloud config from
the cloudConfigUrl");
- }
- }
-
- @Test(groups = "short")
- public void should_not_allow_contact_points_and_cloud() {
- try {
- Session session =
- Cluster.builder()
- .addContactPoint("127.0.0.1")
- .withCloudSecureConnectBundle(proxy.getSecureBundleNoCredsPath())
- .withCredentials("cassandra", "cassandra")
- .withProtocolVersion(ProtocolVersion.V4)
- .build()
- .connect();
- fail("Expected an IllegalStateException");
- } catch (IllegalStateException e) {
- assertThat(e)
- .hasMessageStartingWith(
- "Can't use withCloudSecureConnectBundle if you've already called
addContactPoint(s)");
- }
- }
-
- @Test(groups = "short")
- public void should_not_allow_cloud_with_contact_points_string() {
- try {
- Session session =
- Cluster.builder()
- .withCloudSecureConnectBundle(proxy.getSecureBundleNoCredsPath())
- .addContactPoint("127.0.0.1")
- .withCredentials("cassandra", "cassandra")
- .withProtocolVersion(ProtocolVersion.V4)
- .build()
- .connect();
- fail("Expected an IllegalStateException");
- } catch (IllegalStateException e) {
- assertThat(e)
- .hasMessageStartingWith(
- "Can't use addContactPoint(s) if you've already called
withCloudSecureConnectBundle");
- }
- }
-
- @Test(groups = "short")
- public void should_not_allow_cloud_with_contact_points_endpoint() {
- try {
- Session session =
- Cluster.builder()
- .withCloudSecureConnectBundle(proxy.getSecureBundleNoCredsPath())
- .addContactPoint(
- new EndPoint() {
- @Override
- public InetSocketAddress resolve() {
- return null;
- }
- })
- .withCredentials("cassandra", "cassandra")
- .withProtocolVersion(ProtocolVersion.V4)
- .build()
- .connect();
- fail("Expected an IllegalStateException");
- } catch (IllegalStateException e) {
- assertThat(e)
- .hasMessageStartingWith(
- "Can't use addContactPoint(s) if you've already called
withCloudSecureConnectBundle");
- }
- }
-}
diff --git
a/driver-core/src/test/java/com/datastax/driver/core/cloud/SniProxyServer.java
b/driver-core/src/test/java/com/datastax/driver/core/cloud/SniProxyServer.java
deleted file mode 100644
index 59c3e0c51..000000000
---
a/driver-core/src/test/java/com/datastax/driver/core/cloud/SniProxyServer.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.datastax.driver.core.cloud;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.util.concurrent.TimeUnit;
-import org.apache.commons.exec.CommandLine;
-import org.apache.commons.exec.DefaultExecutor;
-import org.apache.commons.exec.ExecuteStreamHandler;
-import org.apache.commons.exec.ExecuteWatchdog;
-import org.apache.commons.exec.Executor;
-import org.apache.commons.exec.LogOutputStream;
-import org.apache.commons.exec.PumpStreamHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SniProxyServer {
- private static final Logger logger =
LoggerFactory.getLogger(SniProxyServer.class);
- private final File proxyPath;
- private boolean isRunning = false;
-
- static final String CERTS_BUNDLE_SUFFIX = "/certs/bundles/creds-v1.zip";
-
- public SniProxyServer() {
- proxyPath = new File(System.getProperty("proxy.path", "./"));
- }
-
- public void startProxy() {
- CommandLine run = CommandLine.parse(proxyPath + "/run.sh");
- execute(run);
- isRunning = true;
- }
-
- public void stopProxy() {
- if (isRunning) {
- CommandLine findImageId =
- CommandLine.parse("docker ps -a -q --filter
ancestor=single_endpoint");
- String id = execute(findImageId);
- CommandLine stop = CommandLine.parse("docker kill " + id);
- execute(stop);
- isRunning = false;
- }
- }
-
- public boolean isRunning() {
- return isRunning;
- }
-
- public File getProxyRootPath() {
- return proxyPath;
- }
-
- public File getSecureBundleFile() {
- return new File(proxyPath + CERTS_BUNDLE_SUFFIX);
- }
-
- public File getSecureBundleNoCredsPath() {
- return new File(proxyPath + "/certs/bundles/creds-v1-wo-creds.zip");
- }
-
- public File getSecureBundleUnreachable() {
- return new File(proxyPath + "/certs/bundles/creds-v1-unreachable.zip");
- }
-
- private String execute(CommandLine cli) {
- logger.debug("Executing: " + cli);
- ExecuteWatchdog watchDog = new
ExecuteWatchdog(TimeUnit.MINUTES.toMillis(10));
- ByteArrayOutputStream outStream = new ByteArrayOutputStream();
- LogOutputStream errStream =
- new LogOutputStream() {
- @Override
- protected void processLine(String line, int logLevel) {
- logger.error("sniendpointerr> {}", line);
- }
- };
- try {
- Executor executor = new DefaultExecutor();
- ExecuteStreamHandler streamHandler = new PumpStreamHandler(outStream,
errStream);
- executor.setStreamHandler(streamHandler);
- executor.setWatchdog(watchDog);
- executor.setWorkingDirectory(proxyPath);
- int retValue = executor.execute(cli);
- if (retValue != 0) {
- logger.error(
- "Non-zero exit code ({}) returned from executing ccm command: {}",
retValue, cli);
- }
- return outStream.toString();
- } catch (IOException ex) {
- if (watchDog.killedProcess()) {
- throw new RuntimeException("The command '" + cli + "' was killed after
10 minutes");
- } else {
- throw new RuntimeException("The command '" + cli + "' failed to
execute", ex);
- }
- }
- }
-}
diff --git a/driver-core/src/test/resources/export_as_string_test_2.0.cql
b/driver-core/src/test/resources/export_as_string_test_2.0.cql
deleted file mode 100644
index a2e180ad8..000000000
--- a/driver-core/src/test/resources/export_as_string_test_2.0.cql
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-CREATE KEYSPACE complex_ks WITH REPLICATION = { 'class' :
'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1' } AND
DURABLE_WRITES = true;
-
-CREATE TABLE complex_ks.rank_by_year_and_name (
- race_year int,
- race_name text,
- rank int,
- cyclist_name text,
- PRIMARY KEY ((race_year, race_name), rank)
-) WITH CLUSTERING ORDER BY (rank ASC)
- AND read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
- AND replicate_on_write = true
- AND gc_grace_seconds = 864000
- AND bloom_filter_fp_chance = 0.01
- AND caching = 'KEYS_ONLY'
- AND comment = ''
- AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
- AND compression = { 'sstable_compression' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
- AND default_time_to_live = 0
- AND speculative_retry = '99.0PERCENTILE'
- AND index_interval = 128
- AND memtable_flush_period_in_ms = 0;
-
-CREATE INDEX rrank ON complex_ks.rank_by_year_and_name (rank);
-
-CREATE INDEX ryear ON complex_ks.rank_by_year_and_name (race_year);
-
-CREATE TABLE complex_ks.ztable (
- zkey text,
- a int,
- PRIMARY KEY (zkey)
-) WITH read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
- AND replicate_on_write = true
- AND gc_grace_seconds = 864000
- AND bloom_filter_fp_chance = 0.1
- AND caching = 'KEYS_ONLY'
- AND comment = ''
- AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy',
'sstable_size_in_mb' : 95 }
- AND compression = { 'sstable_compression' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
- AND default_time_to_live = 0
- AND speculative_retry = '99.0PERCENTILE'
- AND index_interval = 128
- AND memtable_flush_period_in_ms = 0;
diff --git a/driver-core/src/test/resources/export_as_string_test_2.1.cql
b/driver-core/src/test/resources/export_as_string_test_2.1.cql
deleted file mode 100644
index 71257fbdf..000000000
--- a/driver-core/src/test/resources/export_as_string_test_2.1.cql
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-CREATE KEYSPACE complex_ks WITH REPLICATION = { 'class' :
'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1' } AND
DURABLE_WRITES = true;
-
-CREATE TYPE complex_ks.btype (
- a text
-);
-
-CREATE TYPE complex_ks.xtype (
- d text
-);
-
-CREATE TYPE complex_ks.ztype (
- c text,
- a int
-);
-
-CREATE TYPE complex_ks.ctype (
- "Z" frozen<complex_ks.ztype>,
- x frozen<complex_ks.xtype>
-);
-
-CREATE TYPE complex_ks.atype (
- c frozen<complex_ks.ctype>
-);
-
-CREATE TABLE complex_ks.rank_by_year_and_name (
- race_year int,
- race_name text,
- rank int,
- cyclist_name text,
- PRIMARY KEY ((race_year, race_name), rank)
-) WITH CLUSTERING ORDER BY (rank ASC)
- AND read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
- AND gc_grace_seconds = 864000
- AND bloom_filter_fp_chance = 0.01
- AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
- AND comment = ''
- AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
- AND compression = { 'sstable_compression' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
- AND default_time_to_live = 0
- AND speculative_retry = '99.0PERCENTILE'
- AND min_index_interval = 128
- AND max_index_interval = 2048
- AND memtable_flush_period_in_ms = 0;
-
-CREATE INDEX rrank ON complex_ks.rank_by_year_and_name (rank);
-
-CREATE INDEX ryear ON complex_ks.rank_by_year_and_name (race_year);
-
-CREATE TABLE complex_ks.ztable (
- zkey text,
- a frozen<complex_ks.atype>,
- PRIMARY KEY (zkey)
-) WITH read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
- AND gc_grace_seconds = 864000
- AND bloom_filter_fp_chance = 0.1
- AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
- AND comment = ''
- AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy',
'sstable_size_in_mb' : 95 }
- AND compression = { 'sstable_compression' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
- AND default_time_to_live = 0
- AND speculative_retry = '99.0PERCENTILE'
- AND min_index_interval = 128
- AND max_index_interval = 2048
- AND memtable_flush_period_in_ms = 0;
diff --git a/driver-core/src/test/resources/export_as_string_test_2.2.cql
b/driver-core/src/test/resources/export_as_string_test_2.2.cql
deleted file mode 100644
index b86ee43b1..000000000
--- a/driver-core/src/test/resources/export_as_string_test_2.2.cql
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-CREATE KEYSPACE complex_ks WITH REPLICATION = { 'class' :
'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1' } AND
DURABLE_WRITES = true;
-
-CREATE TYPE complex_ks.btype (
- a text
-);
-
-CREATE TYPE complex_ks.xtype (
- d text
-);
-
-CREATE TYPE complex_ks.ztype (
- c text,
- a int
-);
-
-CREATE TYPE complex_ks.ctype (
- "Z" frozen<complex_ks.ztype>,
- x frozen<complex_ks.xtype>
-);
-
-CREATE TYPE complex_ks.atype (
- c frozen<complex_ks.ctype>
-);
-
-CREATE TABLE complex_ks.cyclist_mv (
- cid uuid,
- age int,
- birthday date,
- country text,
- name text,
- PRIMARY KEY (cid)
-) WITH read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
- AND gc_grace_seconds = 864000
- AND bloom_filter_fp_chance = 0.01
- AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
- AND comment = ''
- AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
- AND compression = { 'sstable_compression' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
- AND default_time_to_live = 0
- AND speculative_retry = '99.0PERCENTILE'
- AND min_index_interval = 128
- AND max_index_interval = 2048
- AND memtable_flush_period_in_ms = 0;
-
-CREATE INDEX cyclist_by_country ON complex_ks.cyclist_mv (country);
-
-CREATE TABLE complex_ks.rank_by_year_and_name (
- race_year int,
- race_name text,
- rank int,
- cyclist_name text,
- PRIMARY KEY ((race_year, race_name), rank)
-) WITH CLUSTERING ORDER BY (rank ASC)
- AND read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
- AND gc_grace_seconds = 864000
- AND bloom_filter_fp_chance = 0.01
- AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
- AND comment = ''
- AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
- AND compression = { 'sstable_compression' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
- AND default_time_to_live = 0
- AND speculative_retry = '99.0PERCENTILE'
- AND min_index_interval = 128
- AND max_index_interval = 2048
- AND memtable_flush_period_in_ms = 0;
-
-CREATE INDEX rrank ON complex_ks.rank_by_year_and_name (rank);
-
-CREATE INDEX ryear ON complex_ks.rank_by_year_and_name (race_year);
-
-CREATE TABLE complex_ks.ztable (
- zkey text,
- a frozen<complex_ks.atype>,
- PRIMARY KEY (zkey)
-) WITH read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
- AND gc_grace_seconds = 864000
- AND bloom_filter_fp_chance = 0.1
- AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
- AND comment = ''
- AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy',
'sstable_size_in_mb' : 95 }
- AND compression = { 'sstable_compression' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
- AND default_time_to_live = 0
- AND speculative_retry = '99.0PERCENTILE'
- AND min_index_interval = 128
- AND max_index_interval = 2048
- AND memtable_flush_period_in_ms = 0;
-
-CREATE FUNCTION complex_ks.avgfinal(state tuple<int, bigint>)
- CALLED ON NULL INPUT
- RETURNS double
- LANGUAGE java
- AS 'double r = 0; if (state.getInt(0) == 0) return null; r =
state.getLong(1); r /= state.getInt(0); return Double.valueOf(r);';
-
-CREATE FUNCTION complex_ks.avgstate(state tuple<int, bigint>,val int)
- CALLED ON NULL INPUT
- RETURNS tuple<int, bigint>
- LANGUAGE java
- AS 'if (val !=null) { state.setInt(0, state.getInt(0)+1); state.setLong(1,
state.getLong(1)+val.intValue()); } return state;';
-
-CREATE AGGREGATE complex_ks.average(int)
- SFUNC avgstate
- STYPE tuple<int, bigint>
- FINALFUNC avgfinal
- INITCOND (0,0);
-
-CREATE AGGREGATE complex_ks.mean(int)
- SFUNC avgstate
- STYPE tuple<int, bigint>
- FINALFUNC avgfinal
- INITCOND (0,0);
diff --git a/driver-core/src/test/resources/export_as_string_test_3.11.cql
b/driver-core/src/test/resources/export_as_string_test_4.1.cql
similarity index 85%
rename from driver-core/src/test/resources/export_as_string_test_3.11.cql
rename to driver-core/src/test/resources/export_as_string_test_4.1.cql
index c7edb57ba..3c02a3371 100644
--- a/driver-core/src/test/resources/export_as_string_test_3.11.cql
+++ b/driver-core/src/test/resources/export_as_string_test_4.1.cql
@@ -48,16 +48,16 @@ CREATE TABLE complex_ks.cyclist_mv (
country text,
name text,
PRIMARY KEY (cid)
-) WITH read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
+) WITH read_repair = 'BLOCKING'
AND gc_grace_seconds = 864000
+ AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.01
AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
AND comment = ''
AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold' : 32, 'min_threshold' : 4 }
- AND compression = { 'chunk_length_in_kb' : 64, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND compression = { 'chunk_length_in_kb' : 16, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
AND default_time_to_live = 0
- AND speculative_retry = '99PERCENTILE'
+ AND speculative_retry = '99p'
AND min_index_interval = 128
AND max_index_interval = 2048
AND crc_check_chance = 1.0
@@ -72,16 +72,16 @@ CREATE MATERIALIZED VIEW complex_ks.cyclist_by_a_age AS
WHERE age IS NOT NULL AND cid IS NOT NULL
PRIMARY KEY (age, cid)
WITH CLUSTERING ORDER BY (cid ASC)
- AND read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
+ AND read_repair = 'BLOCKING'
AND gc_grace_seconds = 864000
+ AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.01
AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
AND comment = ''
AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold' : 32, 'min_threshold' : 4 }
- AND compression = { 'chunk_length_in_kb' : 64, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND compression = { 'chunk_length_in_kb' : 16, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
AND default_time_to_live = 0
- AND speculative_retry = '99PERCENTILE'
+ AND speculative_retry = '99p'
AND min_index_interval = 128
AND max_index_interval = 2048
AND crc_check_chance = 1.0
@@ -94,16 +94,16 @@ CREATE MATERIALIZED VIEW complex_ks.cyclist_by_age AS
WHERE age IS NOT NULL AND cid IS NOT NULL
PRIMARY KEY (age, cid)
WITH CLUSTERING ORDER BY (cid ASC)
- AND read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
+ AND read_repair = 'BLOCKING'
AND gc_grace_seconds = 864000
+ AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.01
AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
AND comment = 'simple view'
AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold' : 32, 'min_threshold' : 4 }
- AND compression = { 'chunk_length_in_kb' : 64, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND compression = { 'chunk_length_in_kb' : 16, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
AND default_time_to_live = 0
- AND speculative_retry = '99PERCENTILE'
+ AND speculative_retry = '99p'
AND min_index_interval = 128
AND max_index_interval = 2048
AND crc_check_chance = 1.0
@@ -116,16 +116,16 @@ CREATE MATERIALIZED VIEW complex_ks.cyclist_by_r_age AS
WHERE age IS NOT NULL AND cid IS NOT NULL
PRIMARY KEY (age, cid)
WITH CLUSTERING ORDER BY (cid DESC)
- AND read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
+ AND read_repair = 'BLOCKING'
AND gc_grace_seconds = 864000
+ AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.01
AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
AND comment = ''
AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold' : 32, 'min_threshold' : 4 }
- AND compression = { 'chunk_length_in_kb' : 64, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND compression = { 'chunk_length_in_kb' : 16, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
AND default_time_to_live = 0
- AND speculative_retry = '99PERCENTILE'
+ AND speculative_retry = '99p'
AND min_index_interval = 128
AND max_index_interval = 2048
AND crc_check_chance = 1.0
@@ -139,16 +139,16 @@ CREATE TABLE complex_ks.rank_by_year_and_name (
cyclist_name text,
PRIMARY KEY ((race_year, race_name), rank)
) WITH CLUSTERING ORDER BY (rank ASC)
- AND read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
+ AND read_repair = 'BLOCKING'
AND gc_grace_seconds = 864000
+ AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.01
AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
AND comment = ''
AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold' : 32, 'min_threshold' : 4 }
- AND compression = { 'chunk_length_in_kb' : 64, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND compression = { 'chunk_length_in_kb' : 16, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
AND default_time_to_live = 0
- AND speculative_retry = '99PERCENTILE'
+ AND speculative_retry = '99p'
AND min_index_interval = 128
AND max_index_interval = 2048
AND crc_check_chance = 1.0
@@ -163,16 +163,16 @@ CREATE TABLE complex_ks.ztable (
zkey text,
a frozen<complex_ks.atype>,
PRIMARY KEY (zkey)
-) WITH read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
+) WITH read_repair = 'BLOCKING'
AND gc_grace_seconds = 864000
+ AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.1
AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
AND comment = ''
- AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy',
'sstable_size_in_mb' : 95 }
- AND compression = { 'chunk_length_in_kb' : 64, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy', 'max_threshold'
: 32, 'min_threshold' : 4, 'sstable_size_in_mb' : 95 }
+ AND compression = { 'chunk_length_in_kb' : 16, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
AND default_time_to_live = 0
- AND speculative_retry = '99PERCENTILE'
+ AND speculative_retry = '99p'
AND min_index_interval = 128
AND max_index_interval = 2048
AND crc_check_chance = 1.0
diff --git a/driver-core/src/test/resources/export_as_string_test_3.0.cql
b/driver-core/src/test/resources/export_as_string_test_5.0.cql
similarity index 83%
rename from driver-core/src/test/resources/export_as_string_test_3.0.cql
rename to driver-core/src/test/resources/export_as_string_test_5.0.cql
index 90a91603e..3c02a3371 100644
--- a/driver-core/src/test/resources/export_as_string_test_3.0.cql
+++ b/driver-core/src/test/resources/export_as_string_test_5.0.cql
@@ -48,19 +48,20 @@ CREATE TABLE complex_ks.cyclist_mv (
country text,
name text,
PRIMARY KEY (cid)
-) WITH read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
+) WITH read_repair = 'BLOCKING'
AND gc_grace_seconds = 864000
+ AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.01
AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
AND comment = ''
AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold' : 32, 'min_threshold' : 4 }
- AND compression = { 'chunk_length_in_kb' : 64, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND compression = { 'chunk_length_in_kb' : 16, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
AND default_time_to_live = 0
- AND speculative_retry = '99PERCENTILE'
+ AND speculative_retry = '99p'
AND min_index_interval = 128
AND max_index_interval = 2048
AND crc_check_chance = 1.0
+ AND cdc = false
AND memtable_flush_period_in_ms = 0;
CREATE INDEX cyclist_by_country ON complex_ks.cyclist_mv (country);
@@ -71,19 +72,20 @@ CREATE MATERIALIZED VIEW complex_ks.cyclist_by_a_age AS
WHERE age IS NOT NULL AND cid IS NOT NULL
PRIMARY KEY (age, cid)
WITH CLUSTERING ORDER BY (cid ASC)
- AND read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
+ AND read_repair = 'BLOCKING'
AND gc_grace_seconds = 864000
+ AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.01
AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
AND comment = ''
AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold' : 32, 'min_threshold' : 4 }
- AND compression = { 'chunk_length_in_kb' : 64, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND compression = { 'chunk_length_in_kb' : 16, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
AND default_time_to_live = 0
- AND speculative_retry = '99PERCENTILE'
+ AND speculative_retry = '99p'
AND min_index_interval = 128
AND max_index_interval = 2048
AND crc_check_chance = 1.0
+ AND cdc = false
AND memtable_flush_period_in_ms = 0;
CREATE MATERIALIZED VIEW complex_ks.cyclist_by_age AS
@@ -92,19 +94,20 @@ CREATE MATERIALIZED VIEW complex_ks.cyclist_by_age AS
WHERE age IS NOT NULL AND cid IS NOT NULL
PRIMARY KEY (age, cid)
WITH CLUSTERING ORDER BY (cid ASC)
- AND read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
+ AND read_repair = 'BLOCKING'
AND gc_grace_seconds = 864000
+ AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.01
AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
AND comment = 'simple view'
AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold' : 32, 'min_threshold' : 4 }
- AND compression = { 'chunk_length_in_kb' : 64, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND compression = { 'chunk_length_in_kb' : 16, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
AND default_time_to_live = 0
- AND speculative_retry = '99PERCENTILE'
+ AND speculative_retry = '99p'
AND min_index_interval = 128
AND max_index_interval = 2048
AND crc_check_chance = 1.0
+ AND cdc = false
AND memtable_flush_period_in_ms = 0;
CREATE MATERIALIZED VIEW complex_ks.cyclist_by_r_age AS
@@ -113,19 +116,20 @@ CREATE MATERIALIZED VIEW complex_ks.cyclist_by_r_age AS
WHERE age IS NOT NULL AND cid IS NOT NULL
PRIMARY KEY (age, cid)
WITH CLUSTERING ORDER BY (cid DESC)
- AND read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
+ AND read_repair = 'BLOCKING'
AND gc_grace_seconds = 864000
+ AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.01
AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
AND comment = ''
AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold' : 32, 'min_threshold' : 4 }
- AND compression = { 'chunk_length_in_kb' : 64, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND compression = { 'chunk_length_in_kb' : 16, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
AND default_time_to_live = 0
- AND speculative_retry = '99PERCENTILE'
+ AND speculative_retry = '99p'
AND min_index_interval = 128
AND max_index_interval = 2048
AND crc_check_chance = 1.0
+ AND cdc = false
AND memtable_flush_period_in_ms = 0;
CREATE TABLE complex_ks.rank_by_year_and_name (
@@ -135,19 +139,20 @@ CREATE TABLE complex_ks.rank_by_year_and_name (
cyclist_name text,
PRIMARY KEY ((race_year, race_name), rank)
) WITH CLUSTERING ORDER BY (rank ASC)
- AND read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
+ AND read_repair = 'BLOCKING'
AND gc_grace_seconds = 864000
+ AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.01
AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
AND comment = ''
AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold' : 32, 'min_threshold' : 4 }
- AND compression = { 'chunk_length_in_kb' : 64, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND compression = { 'chunk_length_in_kb' : 16, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
AND default_time_to_live = 0
- AND speculative_retry = '99PERCENTILE'
+ AND speculative_retry = '99p'
AND min_index_interval = 128
AND max_index_interval = 2048
AND crc_check_chance = 1.0
+ AND cdc = false
AND memtable_flush_period_in_ms = 0;
CREATE INDEX rrank ON complex_ks.rank_by_year_and_name (rank);
@@ -158,19 +163,20 @@ CREATE TABLE complex_ks.ztable (
zkey text,
a frozen<complex_ks.atype>,
PRIMARY KEY (zkey)
-) WITH read_repair_chance = 0.0
- AND dclocal_read_repair_chance = 0.1
+) WITH read_repair = 'BLOCKING'
AND gc_grace_seconds = 864000
+ AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.1
AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
AND comment = ''
- AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy',
'sstable_size_in_mb' : 95 }
- AND compression = { 'chunk_length_in_kb' : 64, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND compaction = { 'class' :
'org.apache.cassandra.db.compaction.LeveledCompactionStrategy', 'max_threshold'
: 32, 'min_threshold' : 4, 'sstable_size_in_mb' : 95 }
+ AND compression = { 'chunk_length_in_kb' : 16, 'class' :
'org.apache.cassandra.io.compress.LZ4Compressor' }
AND default_time_to_live = 0
- AND speculative_retry = '99PERCENTILE'
+ AND speculative_retry = '99p'
AND min_index_interval = 128
AND max_index_interval = 2048
AND crc_check_chance = 1.0
+ AND cdc = false
AND memtable_flush_period_in_ms = 0;
CREATE FUNCTION complex_ks.avgfinal(state tuple<int, bigint>)
diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml
index a5508fa9d..a160e1174 100644
--- a/driver-examples/pom.xml
+++ b/driver-examples/pom.xml
@@ -47,7 +47,6 @@
</dependency>
<!--Jackson-->
-
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
diff --git
a/driver-tests/osgi/common/src/test/java/com/datastax/driver/osgi/BundleOptions.java
b/driver-tests/osgi/common/src/test/java/com/datastax/driver/osgi/BundleOptions.java
index e4d9ef9aa..3589b58cf 100644
---
a/driver-tests/osgi/common/src/test/java/com/datastax/driver/osgi/BundleOptions.java
+++
b/driver-tests/osgi/common/src/test/java/com/datastax/driver/osgi/BundleOptions.java
@@ -96,8 +96,10 @@ public class BundleOptions {
@Override
public Option[] getOptions() {
return options(
-
systemProperty("cassandra.compression").value(ProtocolOptions.Compression.LZ4.name()),
- mavenBundle("org.lz4", "lz4-java", getVersion("lz4.version")));
+ mavenBundle("at.yawk.lz4", "lz4-java", getVersion("lz4.version")),
+ mavenBundle("com.diffplug.osgi",
"com.diffplug.osgi.extension.sun.misc")
+ .version("0.0.0"),
+
systemProperty("cassandra.compression").value(ProtocolOptions.Compression.LZ4.name()));
}
};
}
@@ -182,13 +184,13 @@ public class BundleOptions {
mavenBundle(
"com.fasterxml.jackson.core",
"jackson-databind",
- getVersion("jackson-databind.version")),
+ getVersion("jackson.version")),
mavenBundle(
"com.fasterxml.jackson.core", "jackson-core",
getVersion("jackson.version")),
mavenBundle(
"com.fasterxml.jackson.core",
"jackson-annotations",
- getVersion("jackson.version")),
+ getVersion("jackson-annotations.version")),
mavenBundle("org.testng", "testng",
getVersion("testng.version")),
systemPackages(
"org.testng",
diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml
index 8609753a8..ad5b51b58 100644
--- a/driver-tests/osgi/pom.xml
+++ b/driver-tests/osgi/pom.xml
@@ -129,7 +129,6 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
-
</dependencies>
<build>
@@ -166,11 +165,8 @@
<testng.version>${testng.version}</testng.version>
<jsr353-api.version>${jsr353-api.version}</jsr353-api.version>
<jackson.version>${jackson.version}</jackson.version>
-
<jackson-databind.version>${jackson-databind.version}</jackson-databind.version>
+
<jackson-annotations.version>${jackson-annotations.version}</jackson-annotations.version>
<ipprefix>${ipprefix}</ipprefix>
-
<org.ops4j.pax.url.mvn.useFallbackRepositories>false</org.ops4j.pax.url.mvn.useFallbackRepositories>
- <!-- repo1.maven.org requires https but the old
version of pax-exam we use hard-codes http -->
-
<org.ops4j.pax.url.mvn.repositories>https://repo1.maven.org/maven2@id=central</org.ops4j.pax.url.mvn.repositories>
</systemPropertyVariables>
</configuration>
</plugin>
diff --git a/manual/compression/README.md b/manual/compression/README.md
index 6b25b5e5c..3a3e77c54 100644
--- a/manual/compression/README.md
+++ b/manual/compression/README.md
@@ -30,7 +30,7 @@ It reduces network traffic at the cost of CPU overhead,
therefore it
will likely be beneficial when you have larger payloads.
Two algorithms are available:
-[LZ4](https://github.com/jpountz/lz4-java) and
+[LZ4](https://github.com/yawkat/lz4-java) and
[Snappy](https://code.google.com/p/snappy/). The LZ4 implementation is a good
first choice; it offers fallback implementations in case native libraries fail
to load and
@@ -47,9 +47,9 @@ Maven dependency:
```xml
<dependency>
- <groupId>org.lz4</groupId>
+ <groupId>at.yawk.lz4</groupId>
<artifactId>lz4-java</artifactId>
- <version>1.4.1</version>
+ <version>1.11.3</version>
</dependency>
```
diff --git a/pom.xml b/pom.xml
index d179f45d0..e00653663 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,20 +53,19 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<cassandra.version>3.11.2</cassandra.version>
- <java.version>1.6</java.version>
+ <java.version>1.8</java.version>
<log4j.version>1.2.17</log4j.version>
- <slf4j.version>1.7.25</slf4j.version>
- <slf4j-log4j12.version>1.7.25</slf4j-log4j12.version>
+ <slf4j.version>1.7.26</slf4j.version>
+ <slf4j-log4j12.version>1.7.26</slf4j-log4j12.version>
<guava.version>19.0</guava.version>
- <netty.version>4.1.119.Final</netty.version>
- <netty-tcnative.version>2.0.70.Final</netty-tcnative.version>
+ <netty.version>4.1.138.Final</netty.version>
+ <netty-tcnative.version>2.0.74.Final</netty-tcnative.version>
<metrics.version>3.2.2</metrics.version>
<snappy.version>1.1.2.6</snappy.version>
- <lz4.version>1.4.1</lz4.version>
+ <lz4.version>1.11.3</lz4.version>
<hdr.version>2.1.10</hdr.version>
- <jackson.version>2.8.11</jackson.version>
- <!-- jackson-databind 2.7.x is the last to support java 6 -->
- <jackson-databind.version>2.7.9.7</jackson-databind.version>
+ <jackson.version>2.20.1</jackson.version>
+ <jackson-annotations.version>2.20</jackson-annotations.version>
<joda.version>2.9.9</joda.version>
<jsr353-api.version>1.0</jsr353-api.version>
<jsr353-ri.version>1.0.4</jsr353-ri.version>
@@ -78,17 +77,16 @@
<jax-rs.version>2.0.1</jax-rs.version>
<jersey.version>2.23.1</jersey.version>
<hk2.version>2.4.0-b34</hk2.version>
- <felix.version>4.4.1</felix.version>
- <!-- more recent versions of pax-exam require JDK7+ -->
- <pax-exam.version>3.6.0</pax-exam.version>
- <url.version>2.4.0</url.version>
+ <felix.version>7.0.1</felix.version>
+ <pax-exam.version>4.13.4</pax-exam.version>
+ <url.version>2.6.4</url.version>
<testng.version>6.8.8</testng.version>
<assertj.version>1.7.0</assertj.version>
<mockito.version>1.10.8</mockito.version>
<wiremock.version>2.25.0</wiremock.version>
<commons-exec.version>1.3</commons-exec.version>
<scassandra.version>1.1.2</scassandra.version>
- <logback.version>1.2.3</logback.version>
+ <logback.version>1.2.13</logback.version>
<byteman.version>3.0.8</byteman.version>
<ipprefix>127.0.1.</ipprefix>
<!-- defaults below are overridden by profiles and/or submodules -->
@@ -176,7 +174,7 @@
</dependency>
<dependency>
- <groupId>org.lz4</groupId>
+ <groupId>at.yawk.lz4</groupId>
<artifactId>lz4-java</artifactId>
<version>${lz4.version}</version>
</dependency>
@@ -202,13 +200,13 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
- <version>${jackson-databind.version}</version>
+ <version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
- <version>${jackson.version}</version>
+ <version>${jackson-annotations.version}</version>
</dependency>
<dependency>
@@ -665,23 +663,6 @@ limitations under the License.
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.16</version>
<executions>
- <execution>
- <id>check-jdk6</id>
- <phase>process-classes</phase>
- <goals>
- <goal>check</goal>
- </goals>
- <configuration>
- <signature>
-
<groupId>org.codehaus.mojo.signature</groupId>
- <artifactId>java16</artifactId>
- <version>1.0</version>
- </signature>
- <annotations>
-
<annotation>com.datastax.driver.core.IgnoreJDK6Requirement</annotation>
- </annotations>
- </configuration>
- </execution>
<execution>
<id>check-jdk8</id>
<goals>
@@ -1006,18 +987,6 @@ limitations under the License.
<skipLocalStaging>true</skipLocalStaging>
</configuration>
</plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>modern-jdks</id>
- <activation>
- <jdk>[1.8,)</jdk>
- </activation>
- <build>
- <plugins>
- <!-- only activate for jdk8+ since requires java 8 -->
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
@@ -1031,39 +1000,11 @@ limitations under the License.
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration combine.self="override">
- <doclint>none</doclint>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>legacy-jdks</id>
- <activation>
- <jdk>[,1.8)</jdk>
- </activation>
- <build>
- <plugins>
<plugin>
- <!--
- Exclude Jdk* test classes from being run
- This is needed in event that code was built with JDK8
- and tests are ran with JDK6 or 7.
- Note that running CCM tests with a legacy JDK require
- setting two system properties: ccm.java.home and
ccm.path;
- both should point to a valid JDK8+ installation.
- -->
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>**/jdk8/*.java</exclude>
- <exclude>**/Jdk8*.java</exclude>
- </excludes>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration combine.self="override">
+ <doclint>none</doclint>
</configuration>
</plugin>
</plugins>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]