From 3456ac081cb826fc44639c7fc16777f67a72b113 Mon Sep 17 00:00:00 2001 From: Andrew Tolbert Date: Wed, 2 Jan 2019 16:14:27 -0600 Subject: [PATCH 001/211] Update native protocol matrix - Include C* 3.x with 3.0.x and indicate DSE 5.0+ for compatibility - Use table headers to emphasize driver/C* versions --- manual/native_protocol/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/manual/native_protocol/README.md b/manual/native_protocol/README.md index 363e10f3c90..7ee0f4414fb 100644 --- a/manual/native_protocol/README.md +++ b/manual/native_protocol/README.md @@ -16,11 +16,12 @@ Cassandra when the first connection is established. Both sides are backward-compatible with older versions: - - - - - + + + + +
 Cassandra: 1.2.x
(DSE 3.2)
2.0.x
(DSE 4.0 to 4.6)
2.1.x
(DSE 4.7)
2.2.x3.0.x
Driver: 1.0.x v1 v1 v1 v1 Unsupported (1)
2.0.x to 2.1.1 v1 v2 v2 v2 Unsupported (1)
2.1.2 to 2.1.x v1 v2 v3 v3 Unsupported (2)
3.x v1 v2 v3 v4 v4
Driver VersionCassandra: 1.2.x
(DSE 3.2)
2.0.x
(DSE 4.0 to 4.6) +
2.1.x
(DSE 4.7)
2.2.x3.0.x & 3.x
(DSE 5.0+)
1.0.x v1 v1 v1 v1 Unsupported (1)
2.0.x to 2.1.1 v1 v2 v2 v2 Unsupported (1)
2.1.2 to 2.1.x v1 v2 v3 v3 Unsupported (2)
3.x v1 v2 v3 v4 v4
*(1) Cassandra 3.0 does not support protocol versions v1 and v2* From 234cd55a9a2081d4ccc873447f404b3eb5e7301e Mon Sep 17 00:00:00 2001 From: Andrew Tolbert Date: Thu, 3 Jan 2019 10:01:52 -0600 Subject: [PATCH 002/211] JAVA-2074: Document preference for LZ4 over Snappy (#1158) --- changelog/README.md | 2 +- manual/compression/README.md | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 1f00268b898..1eca207e3c4 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -2,13 +2,13 @@ ### 3.7.0 (In progress) -- [improvement] JAVA-2025: Include exception message in Abstract*Codec.accepts(null). - [improvement] JAVA-2025: Include exception message in Abstract\*Codec.accepts(null). - [improvement] JAVA-1980: Use covariant return types in RemoteEndpointAwareJdkSSLOptions.Builder methods. - [documentation] JAVA-2062: Document frozen collection preference with Mapper. - [bug] JAVA-2071: Fix NPE in ArrayBackedRow.toString(). - [bug] JAVA-2070: Call onRemove instead of onDown when rack and/or DC information changes for a host. - [improvement] JAVA-1256: Log parameters of BuiltStatement in QueryLogger. +- [documentation] JAVA-2074: Document preference for LZ4 over Snappy. ### 3.6.0 diff --git a/manual/compression/README.md b/manual/compression/README.md index 9d149e7ea09..10966388943 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -12,12 +12,15 @@ will likely be beneficial when you have larger payloads. Two algorithms are available: [LZ4](https://github.com/jpountz/lz4-java) and -[Snappy](https://code.google.com/p/snappy/). +[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 +[benchmarks](http://java-performance.info/performance-general-compression/) +suggest that it offers better performance and compression ratios over Snappy. Both rely on third-party libraries, declared by the driver as *optional* -dependencies. So If you use a build tool like Maven, you'll need to -declare an explicit dependency to pull the appropriate library in your -application's classpath. Then you configure compression at driver -startup. +dependencies. So if you use a build tool like Maven, you'll need to declare an +explicit dependency to pull the appropriate library in your application's +classpath. Then you configure compression at driver startup. ### LZ4 From 78540291d2c3bad3bb19f06083e222e9a83b0485 Mon Sep 17 00:00:00 2001 From: Andrew Tolbert Date: Thu, 3 Jan 2019 17:08:55 -0600 Subject: [PATCH 003/211] JAVA-1612: Include netty-common jar in binary tarball (#1164) Motivation: Users of the binary tarball noticed that the netty-common dependency was missing, via a NoClassDefFoundError for io.netty.util.Timer. This was caused by netty-common being excluded as it is a transitive dependency of netty-transport-epoll. While it is also a transitive dependency of included jars, the maven-assembly-plugin still excludes it. Modifications: Remove the use of useTransitiveFiltering in the dependencySet. This is ok as netty-transport-epoll dependencies are depended on by the driver jar already. Result: netty-common jar is now included in the lib directory of the binary tarball. --- changelog/README.md | 1 + driver-dist/src/assembly/binary-tarball.xml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/README.md b/changelog/README.md index 1eca207e3c4..63e3a1ce78d 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -9,6 +9,7 @@ - [bug] JAVA-2070: Call onRemove instead of onDown when rack and/or DC information changes for a host. - [improvement] JAVA-1256: Log parameters of BuiltStatement in QueryLogger. - [documentation] JAVA-2074: Document preference for LZ4 over Snappy. +- [bug] JAVA-1612: Include netty-common jar in binary tarball. ### 3.6.0 diff --git a/driver-dist/src/assembly/binary-tarball.xml b/driver-dist/src/assembly/binary-tarball.xml index 4e9b78b48f4..7b1a1a35c8c 100644 --- a/driver-dist/src/assembly/binary-tarball.xml +++ b/driver-dist/src/assembly/binary-tarball.xml @@ -45,7 +45,6 @@ io.netty:netty-transport-native-epoll:* - true From 064042ff5e17a2949f0acc603b0457e6568a53c7 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 4 Jan 2019 17:02:39 -0200 Subject: [PATCH 004/211] JAVA-2003: Simplify CBUtil internal API to improve performance (#1109) --- changelog/README.md | 1 + .../datastax/driver/core/BatchStatement.java | 19 +- .../datastax/driver/core/BoundStatement.java | 3 +- .../java/com/datastax/driver/core/CBUtil.java | 169 ++++++------------ .../driver/core/RegularStatement.java | 4 +- .../com/datastax/driver/core/Requests.java | 34 ++-- .../datastax/driver/core/SessionManager.java | 9 +- 7 files changed, 81 insertions(+), 158 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 63e3a1ce78d..787824af84c 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -10,6 +10,7 @@ - [improvement] JAVA-1256: Log parameters of BuiltStatement in QueryLogger. - [documentation] JAVA-2074: Document preference for LZ4 over Snappy. - [bug] JAVA-1612: Include netty-common jar in binary tarball. +- [improvement] JAVA-2003: Simplify CBUtil internal API to improve performance. ### 3.6.0 diff --git a/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java b/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java index ef8cd34800f..e5fc175fe62 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java +++ b/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java @@ -21,9 +21,7 @@ import com.google.common.collect.ImmutableList; import java.nio.ByteBuffer; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; -import java.util.Collections; import java.util.List; /** @@ -82,22 +80,23 @@ public BatchStatement(Type batchType) { IdAndValues getIdAndValues(ProtocolVersion protocolVersion, CodecRegistry codecRegistry) { IdAndValues idAndVals = new IdAndValues(statements.size()); - for (Statement statement : statements) { - if (statement instanceof StatementWrapper) + for (int i = 0; i < statements.size(); i++) { + Statement statement = statements.get(i); + if (statement instanceof StatementWrapper) { statement = ((StatementWrapper) statement).getWrappedStatement(); + } if (statement instanceof RegularStatement) { RegularStatement st = (RegularStatement) statement; ByteBuffer[] vals = st.getValues(protocolVersion, codecRegistry); String query = st.getQueryString(codecRegistry); idAndVals.ids.add(query); - idAndVals.values.add( - vals == null ? Collections.emptyList() : Arrays.asList(vals)); + idAndVals.values[i] = vals == null ? Requests.EMPTY_BB_ARRAY : vals; } else { // We handle BatchStatement in add() so ... assert statement instanceof BoundStatement; BoundStatement st = (BoundStatement) statement; idAndVals.ids.add(st.statement.getPreparedId().boundValuesMetadata.id); - idAndVals.values.add(Arrays.asList(st.wrapper.values)); + idAndVals.values[i] = st.wrapper.values; } } return idAndVals; @@ -212,7 +211,7 @@ public int requestSizeInBytes(ProtocolVersion protocolVersion, CodecRegistry cod + (q instanceof String ? CBUtil.sizeOfLongString((String) q) : CBUtil.sizeOfShortBytes(((MD5Digest) q).bytes)); - size += CBUtil.sizeOfValueList(idAndVals.values.get(i)); + size += CBUtil.sizeOfValueList(idAndVals.values[i]); } switch (protocolVersion) { case V2: @@ -301,11 +300,11 @@ void ensureAllSet() { static class IdAndValues { public final List ids; - public final List> values; + public final ByteBuffer[][] values; IdAndValues(int nbstatements) { ids = new ArrayList(nbstatements); - values = new ArrayList>(nbstatements); + values = new ByteBuffer[nbstatements][]; } } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java b/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java index 279f81bc25d..9b1c8d0a3d2 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java +++ b/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java @@ -23,7 +23,6 @@ import java.math.BigInteger; import java.net.InetAddress; import java.nio.ByteBuffer; -import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Map; @@ -325,7 +324,7 @@ public int requestSizeInBytes(ProtocolVersion protocolVersion, CodecRegistry cod size += CBUtil.sizeOfConsistencyLevel(getConsistencyLevel()); size += QueryFlag.serializedSize(protocolVersion); if (wrapper.values.length > 0) { - size += CBUtil.sizeOfValueList(Arrays.asList(wrapper.values)); + size += CBUtil.sizeOfValueList(wrapper.values); } // Fetch size, serial CL and default timestamp also depend on session-level defaults // (QueryOptions). diff --git a/driver-core/src/main/java/com/datastax/driver/core/CBUtil.java b/driver-core/src/main/java/com/datastax/driver/core/CBUtil.java index 00019fa0173..6941055f263 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/CBUtil.java +++ b/driver-core/src/main/java/com/datastax/driver/core/CBUtil.java @@ -25,13 +25,16 @@ import java.nio.ByteBuffer; import java.nio.charset.CharacterCodingException; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; /** ByteBuf utility methods. */ + +// Implementation note: in order to facilitate loop optimizations by the JIT compiler, this class +// favors indexed loops over "foreach" loops. +@SuppressWarnings("ForLoopReplaceableByForEach") abstract class CBUtil { // TODO rename private CBUtil() {} @@ -49,7 +52,7 @@ private static String readString(ByteBuf cb, int length) { } } - public static String readString(ByteBuf cb) { + static String readString(ByteBuf cb) { try { int length = cb.readUnsignedShort(); return readString(cb, length); @@ -59,13 +62,13 @@ public static String readString(ByteBuf cb) { } } - public static void writeString(String str, ByteBuf cb) { + private static void writeString(String str, ByteBuf cb) { byte[] bytes = str.getBytes(CharsetUtil.UTF_8); cb.writeShort(bytes.length); cb.writeBytes(bytes); } - public static int sizeOfString(String str) { + static int sizeOfString(String str) { return 2 + encodedUTF8Length(str); } @@ -81,27 +84,17 @@ private static int encodedUTF8Length(String st) { return utflen; } - public static String readLongString(ByteBuf cb) { - try { - int length = cb.readInt(); - return readString(cb, length); - } catch (IndexOutOfBoundsException e) { - throw new DriverInternalError( - "Not enough bytes to read an UTF8 serialized string preceded by it's 4 bytes length"); - } - } - - public static void writeLongString(String str, ByteBuf cb) { + static void writeLongString(String str, ByteBuf cb) { byte[] bytes = str.getBytes(CharsetUtil.UTF_8); cb.writeInt(bytes.length); cb.writeBytes(bytes); } - public static int sizeOfLongString(String str) { + static int sizeOfLongString(String str) { return 4 + str.getBytes(CharsetUtil.UTF_8).length; } - public static byte[] readBytes(ByteBuf cb) { + static byte[] readBytes(ByteBuf cb) { try { int length = cb.readUnsignedShort(); byte[] bytes = new byte[length]; @@ -113,20 +106,20 @@ public static byte[] readBytes(ByteBuf cb) { } } - public static void writeShortBytes(byte[] bytes, ByteBuf cb) { + static void writeShortBytes(byte[] bytes, ByteBuf cb) { cb.writeShort(bytes.length); cb.writeBytes(bytes); } - public static int sizeOfShortBytes(byte[] bytes) { + static int sizeOfShortBytes(byte[] bytes) { return 2 + bytes.length; } - public static int sizeOfBytes(ByteBuffer bytes) { + private static int sizeOfBytes(ByteBuffer bytes) { return 4 + bytes.remaining(); } - public static Map readBytesMap(ByteBuf cb) { + static Map readBytesMap(ByteBuf cb) { int length = cb.readUnsignedShort(); ImmutableMap.Builder builder = ImmutableMap.builder(); for (int i = 0; i < length; i++) { @@ -138,7 +131,7 @@ public static Map readBytesMap(ByteBuf cb) { return builder.build(); } - public static void writeBytesMap(Map m, ByteBuf cb) { + static void writeBytesMap(Map m, ByteBuf cb) { cb.writeShort(m.size()); for (Map.Entry entry : m.entrySet()) { writeString(entry.getKey(), cb); @@ -148,7 +141,7 @@ public static void writeBytesMap(Map m, ByteBuf cb) { } } - public static int sizeOfBytesMap(Map m) { + static int sizeOfBytesMap(Map m) { int size = 2; for (Map.Entry entry : m.entrySet()) { size += sizeOfString(entry.getKey()); @@ -157,19 +150,19 @@ public static int sizeOfBytesMap(Map m) { return size; } - public static ConsistencyLevel readConsistencyLevel(ByteBuf cb) { + static ConsistencyLevel readConsistencyLevel(ByteBuf cb) { return ConsistencyLevel.fromCode(cb.readUnsignedShort()); } - public static void writeConsistencyLevel(ConsistencyLevel consistency, ByteBuf cb) { + static void writeConsistencyLevel(ConsistencyLevel consistency, ByteBuf cb) { cb.writeShort(consistency.code); } - public static int sizeOfConsistencyLevel(ConsistencyLevel consistency) { + static int sizeOfConsistencyLevel(@SuppressWarnings("unused") ConsistencyLevel consistency) { return 2; } - public static > T readEnumValue(Class enumType, ByteBuf cb) { + static > T readEnumValue(Class enumType, ByteBuf cb) { String value = CBUtil.readString(cb); try { return Enum.valueOf(enumType, value.toUpperCase()); @@ -179,59 +172,30 @@ public static > T readEnumValue(Class enumType, ByteBuf cb) } } - public static > void writeEnumValue(T enumValue, ByteBuf cb) { + static > void writeEnumValue(T enumValue, ByteBuf cb) { writeString(enumValue.toString(), cb); } - public static > int sizeOfEnumValue(T enumValue) { + static > int sizeOfEnumValue(T enumValue) { return sizeOfString(enumValue.toString()); } - public static UUID readUUID(ByteBuf cb) { + static UUID readUUID(ByteBuf cb) { long msb = cb.readLong(); long lsb = cb.readLong(); return new UUID(msb, lsb); } - public static void writeUUID(UUID uuid, ByteBuf cb) { - cb.writeLong(uuid.getMostSignificantBits()); - cb.writeLong(uuid.getLeastSignificantBits()); - } - - public static int sizeOfUUID(UUID uuid) { - return 16; - } - - public static List readStringList(ByteBuf cb) { + static List readStringList(ByteBuf cb) { int length = cb.readUnsignedShort(); List l = new ArrayList(length); - for (int i = 0; i < length; i++) l.add(readString(cb)); - return l; - } - - public static void writeStringList(List l, ByteBuf cb) { - cb.writeShort(l.size()); - for (String str : l) writeString(str, cb); - } - - public static int sizeOfStringList(List l) { - int size = 2; - for (String str : l) size += sizeOfString(str); - return size; - } - - public static Map readStringMap(ByteBuf cb) { - int length = cb.readUnsignedShort(); - Map m = new HashMap(length); for (int i = 0; i < length; i++) { - String k = readString(cb).toUpperCase(); - String v = readString(cb); - m.put(k, v); + l.add(readString(cb)); } - return m; + return l; } - public static void writeStringMap(Map m, ByteBuf cb) { + static void writeStringMap(Map m, ByteBuf cb) { cb.writeShort(m.size()); for (Map.Entry entry : m.entrySet()) { writeString(entry.getKey(), cb); @@ -239,7 +203,7 @@ public static void writeStringMap(Map m, ByteBuf cb) { } } - public static int sizeOfStringMap(Map m) { + static int sizeOfStringMap(Map m) { int size = 2; for (Map.Entry entry : m.entrySet()) { size += sizeOfString(entry.getKey()); @@ -248,7 +212,7 @@ public static int sizeOfStringMap(Map m) { return size; } - public static Map> readStringToStringListMap(ByteBuf cb) { + static Map> readStringToStringListMap(ByteBuf cb) { int length = cb.readUnsignedShort(); Map> m = new HashMap>(length); for (int i = 0; i < length; i++) { @@ -259,24 +223,7 @@ public static Map> readStringToStringListMap(ByteBuf cb) { return m; } - public static void writeStringToStringListMap(Map> m, ByteBuf cb) { - cb.writeShort(m.size()); - for (Map.Entry> entry : m.entrySet()) { - writeString(entry.getKey(), cb); - writeStringList(entry.getValue(), cb); - } - } - - public static int sizeOfStringToStringListMap(Map> m) { - int size = 2; - for (Map.Entry> entry : m.entrySet()) { - size += sizeOfString(entry.getKey()); - size += sizeOfStringList(entry.getValue()); - } - return size; - } - - public static ByteBuffer readValue(ByteBuf cb) { + static ByteBuffer readValue(ByteBuf cb) { int length = cb.readInt(); if (length < 0) return null; ByteBuf slice = cb.readSlice(length); @@ -284,7 +231,7 @@ public static ByteBuffer readValue(ByteBuf cb) { return ByteBuffer.wrap(readRawBytes(slice)); } - public static void writeValue(byte[] bytes, ByteBuf cb) { + static void writeValue(byte[] bytes, ByteBuf cb) { if (bytes == null) { cb.writeInt(-1); return; @@ -294,7 +241,7 @@ public static void writeValue(byte[] bytes, ByteBuf cb) { cb.writeBytes(bytes); } - public static void writeValue(ByteBuffer bytes, ByteBuf cb) { + static void writeValue(ByteBuffer bytes, ByteBuf cb) { if (bytes == null) { cb.writeInt(-1); return; @@ -309,35 +256,32 @@ public static void writeValue(ByteBuffer bytes, ByteBuf cb) { cb.writeBytes(bytes.duplicate()); } - public static int sizeOfValue(byte[] bytes) { + static int sizeOfValue(byte[] bytes) { return 4 + (bytes == null ? 0 : bytes.length); } - public static int sizeOfValue(ByteBuffer bytes) { + static int sizeOfValue(ByteBuffer bytes) { return 4 + (bytes == null ? 0 : bytes.remaining()); } - public static List readValueList(ByteBuf cb) { - int size = cb.readUnsignedShort(); - if (size == 0) return Collections.emptyList(); - - List l = new ArrayList(size); - for (int i = 0; i < size; i++) l.add(readValue(cb)); - return l; - } - - public static void writeValueList(List values, ByteBuf cb) { - cb.writeShort(values.size()); - for (ByteBuffer value : values) CBUtil.writeValue(value, cb); + static void writeValueList(ByteBuffer[] values, ByteBuf cb) { + cb.writeShort(values.length); + for (int i = 0; i < values.length; i++) { + ByteBuffer value = values[i]; + CBUtil.writeValue(value, cb); + } } - public static int sizeOfValueList(List values) { + static int sizeOfValueList(ByteBuffer[] values) { int size = 2; - for (ByteBuffer value : values) size += CBUtil.sizeOfValue(value); + for (int i = 0; i < values.length; i++) { + ByteBuffer value = values[i]; + size += CBUtil.sizeOfValue(value); + } return size; } - public static void writeNamedValueList(Map namedValues, ByteBuf cb) { + static void writeNamedValueList(Map namedValues, ByteBuf cb) { cb.writeShort(namedValues.size()); for (Map.Entry entry : namedValues.entrySet()) { CBUtil.writeString(entry.getKey(), cb); @@ -345,7 +289,7 @@ public static void writeNamedValueList(Map namedValues, Byte } } - public static int sizeOfNamedValueList(Map namedValues) { + static int sizeOfNamedValueList(Map namedValues) { int size = 2; for (Map.Entry entry : namedValues.entrySet()) { size += CBUtil.sizeOfString(entry.getKey()); @@ -354,7 +298,7 @@ public static int sizeOfNamedValueList(Map namedValues) { return size; } - public static InetSocketAddress readInet(ByteBuf cb) { + static InetSocketAddress readInet(ByteBuf cb) { int addrSize = cb.readByte() & 0xFF; byte[] address = new byte[addrSize]; cb.readBytes(address); @@ -369,7 +313,7 @@ public static InetSocketAddress readInet(ByteBuf cb) { } } - public static InetAddress readInetWithoutPort(ByteBuf cb) { + static InetAddress readInetWithoutPort(ByteBuf cb) { int addrSize = cb.readByte() & 0xFF; byte[] address = new byte[addrSize]; cb.readBytes(address); @@ -383,24 +327,11 @@ public static InetAddress readInetWithoutPort(ByteBuf cb) { } } - public static void writeInet(InetSocketAddress inet, ByteBuf cb) { - byte[] address = inet.getAddress().getAddress(); - - cb.writeByte(address.length); - cb.writeBytes(address); - cb.writeInt(inet.getPort()); - } - - public static int sizeOfInet(InetSocketAddress inet) { - byte[] address = inet.getAddress().getAddress(); - return 1 + address.length + 4; - } - /* * Reads *all* readable bytes from {@code cb} and return them. * If {@code cb} is backed by an array, this will return the underlying array directly, without copy. */ - public static byte[] readRawBytes(ByteBuf cb) { + private static byte[] readRawBytes(ByteBuf cb) { if (cb.hasArray() && cb.readableBytes() == cb.array().length) { // Move the readerIndex just so we consistently consume the input cb.readerIndex(cb.writerIndex()); diff --git a/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java b/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java index 534bbc51a34..27f08226e60 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java +++ b/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java @@ -22,7 +22,6 @@ import com.datastax.driver.core.querybuilder.BuiltStatement; import com.datastax.driver.core.schemabuilder.SchemaStatement; import java.nio.ByteBuffer; -import java.util.Arrays; import java.util.Map; /** @@ -201,8 +200,7 @@ public int requestSizeInBytes(ProtocolVersion protocolVersion, CodecRegistry cod if (usesNamedValues()) { size += CBUtil.sizeOfNamedValueList(getNamedValues(protocolVersion, codecRegistry)); } else { - size += - CBUtil.sizeOfValueList(Arrays.asList(getValues(protocolVersion, codecRegistry))); + size += CBUtil.sizeOfValueList(getValues(protocolVersion, codecRegistry)); } } // Fetch size, serial CL and default timestamp also depend on session-level defaults diff --git a/driver-core/src/main/java/com/datastax/driver/core/Requests.java b/driver-core/src/main/java/com/datastax/driver/core/Requests.java index 7663dae4e2f..df16bf8d425 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Requests.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Requests.java @@ -19,13 +19,12 @@ import com.google.common.collect.ImmutableMap; import io.netty.buffer.ByteBuf; import java.nio.ByteBuffer; -import java.util.Collections; -import java.util.EnumSet; -import java.util.List; -import java.util.Map; +import java.util.*; class Requests { + static final ByteBuffer[] EMPTY_BB_ARRAY = new ByteBuffer[0]; + private Requests() {} static class Startup extends Message.Request { @@ -290,7 +289,7 @@ static class QueryProtocolOptions { new QueryProtocolOptions( Message.Request.Type.QUERY, ConsistencyLevel.ONE, - Collections.emptyList(), + EMPTY_BB_ARRAY, Collections.emptyMap(), false, -1, @@ -301,7 +300,7 @@ static class QueryProtocolOptions { private final EnumSet flags = EnumSet.noneOf(QueryFlag.class); private final Message.Request.Type requestType; final ConsistencyLevel consistency; - final List positionalValues; + final ByteBuffer[] positionalValues; final Map namedValues; final boolean skipMetadata; final int pageSize; @@ -312,7 +311,7 @@ static class QueryProtocolOptions { QueryProtocolOptions( Message.Request.Type requestType, ConsistencyLevel consistency, - List positionalValues, + ByteBuffer[] positionalValues, Map namedValues, boolean skipMetadata, int pageSize, @@ -320,7 +319,7 @@ static class QueryProtocolOptions { ConsistencyLevel serialConsistency, long defaultTimestamp) { - Preconditions.checkArgument(positionalValues.isEmpty() || namedValues.isEmpty()); + Preconditions.checkArgument(positionalValues.length == 0 || namedValues.isEmpty()); this.requestType = requestType; this.consistency = consistency; @@ -333,7 +332,9 @@ static class QueryProtocolOptions { this.defaultTimestamp = defaultTimestamp; // Populate flags - if (!positionalValues.isEmpty()) flags.add(QueryFlag.VALUES); + if (positionalValues.length > 0) { + flags.add(QueryFlag.VALUES); + } if (!namedValues.isEmpty()) { flags.add(QueryFlag.VALUES); flags.add(QueryFlag.VALUE_NAMES); @@ -434,7 +435,7 @@ public String toString() { return String.format( "[cl=%s, positionalVals=%s, namedVals=%s, skip=%b, psize=%d, state=%s, serialCl=%s]", consistency, - positionalValues, + Arrays.toString(positionalValues), namedValues, skipMetadata, pageSize, @@ -461,7 +462,7 @@ public void encode(Batch msg, ByteBuf dest, ProtocolVersion version) { if (q instanceof String) CBUtil.writeLongString((String) q, dest); else CBUtil.writeShortBytes(((MD5Digest) q).bytes, dest); - CBUtil.writeValueList(msg.values.get(i), dest); + CBUtil.writeValueList(msg.values[i], dest); } msg.options.encode(dest, version); @@ -478,7 +479,7 @@ public int encodedSize(Batch msg, ProtocolVersion version) { ? CBUtil.sizeOfLongString((String) q) : CBUtil.sizeOfShortBytes(((MD5Digest) q).bytes)); - size += CBUtil.sizeOfValueList(msg.values.get(i)); + size += CBUtil.sizeOfValueList(msg.values[i]); } size += msg.options.encodedSize(version); return size; @@ -500,13 +501,13 @@ private byte fromType(BatchStatement.Type type) { final BatchStatement.Type type; final List queryOrIdList; - final List> values; + final ByteBuffer[][] values; final BatchProtocolOptions options; Batch( BatchStatement.Type type, List queryOrIdList, - List> values, + ByteBuffer[][] values, BatchProtocolOptions options, boolean tracingRequested) { super(Message.Request.Type.BATCH, tracingRequested); @@ -533,10 +534,7 @@ public String toString() { sb.append("BATCH of ["); for (int i = 0; i < queryOrIdList.size(); i++) { if (i > 0) sb.append(", "); - sb.append(queryOrIdList.get(i)) - .append(" with ") - .append(values.get(i).size()) - .append(" values"); + sb.append(queryOrIdList.get(i)).append(" with ").append(values[i].length).append(" values"); } sb.append("] with options ").append(options); return sb.toString(); diff --git a/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java b/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java index f0d38b0b92e..a366dd82f33 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java +++ b/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java @@ -37,7 +37,6 @@ import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -608,10 +607,8 @@ else if (fetchSize != Integer.MAX_VALUE) if (protocolVersion == ProtocolVersion.V2 && rawNamedValues != null) throw new UnsupportedFeatureException(protocolVersion, "Named values are not supported"); - List positionalValues = - rawPositionalValues == null - ? Collections.emptyList() - : Arrays.asList(rawPositionalValues); + ByteBuffer[] positionalValues = + rawPositionalValues == null ? Requests.EMPTY_BB_ARRAY : rawPositionalValues; Map namedValues = rawNamedValues == null ? Collections.emptyMap() : rawNamedValues; @@ -650,7 +647,7 @@ else if (fetchSize != Integer.MAX_VALUE) new Requests.QueryProtocolOptions( Message.Request.Type.EXECUTE, consistency, - Arrays.asList(bs.wrapper.values), + bs.wrapper.values, Collections.emptyMap(), skipMetadata, fetchSize, From 313ed03cfa387621988a7ee390f1d1dfe1fb8123 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 4 Jan 2019 17:03:37 -0200 Subject: [PATCH 005/211] JAVA-2002: Reimplement TypeCodec.accepts to improve performance (#1108) --- changelog/README.md | 1 + .../com/datastax/driver/core/TypeCodec.java | 39 ++++++++++++++----- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 787824af84c..4e55e4a876b 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -11,6 +11,7 @@ - [documentation] JAVA-2074: Document preference for LZ4 over Snappy. - [bug] JAVA-1612: Include netty-common jar in binary tarball. - [improvement] JAVA-2003: Simplify CBUtil internal API to improve performance. +- [improvement] JAVA-2002: Reimplement TypeCodec.accepts to improve performance. ### 3.6.0 diff --git a/driver-core/src/main/java/com/datastax/driver/core/TypeCodec.java b/driver-core/src/main/java/com/datastax/driver/core/TypeCodec.java index 52c904456a8..bbaea77a4ca 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/TypeCodec.java +++ b/driver-core/src/main/java/com/datastax/driver/core/TypeCodec.java @@ -30,7 +30,6 @@ import com.google.common.reflect.TypeToken; import java.io.DataInput; import java.io.IOException; -import java.lang.reflect.Type; import java.math.BigDecimal; import java.math.BigInteger; import java.net.InetAddress; @@ -592,7 +591,11 @@ public boolean accepts(TypeToken javaType) { /** * Return {@code true} if this codec is capable of serializing the given {@code javaType}. * - *

This implementation simply calls {@link #accepts(TypeToken)}. + *

This implementation simply compares the given type against this codec's runtime (raw) type + * for equality; it is invariant with respect to the passed argument (through the usage + * of {@link Class#equals(Object)} and it's strongly recommended not to modify this + * behavior. This means that a codec will only ever return {@code true} for the + * exact runtime (raw) Java type that it has been created for. * * @param javaType The Java type this codec should serialize from and deserialize to; cannot be * {@code null}. @@ -602,7 +605,26 @@ public boolean accepts(TypeToken javaType) { */ public boolean accepts(Class javaType) { checkNotNull(javaType, "Parameter javaType cannot be null"); - return accepts(TypeToken.of(javaType)); + if (javaType.isPrimitive()) { + if (javaType == Boolean.TYPE) { + javaType = Boolean.class; + } else if (javaType == Character.TYPE) { + javaType = Character.class; + } else if (javaType == Byte.TYPE) { + javaType = Byte.class; + } else if (javaType == Short.TYPE) { + javaType = Short.class; + } else if (javaType == Integer.TYPE) { + javaType = Integer.class; + } else if (javaType == Long.TYPE) { + javaType = Long.class; + } else if (javaType == Float.TYPE) { + javaType = Float.class; + } else if (javaType == Double.TYPE) { + javaType = Double.class; + } + } + return this.javaType.getRawType().equals(javaType); } /** @@ -621,7 +643,7 @@ public boolean accepts(DataType cqlType) { /** * Return {@code true} if this codec is capable of serializing the given object. Note that the - * object's Java type is inferred from the object' runtime (raw) type, contrary to {@link + * object's Java type is inferred from the object's runtime (raw) type, contrary to {@link * #accepts(TypeToken)} which is capable of handling generic types. * *

This method is intended mostly to be used by the QueryBuilder when no type information is @@ -631,10 +653,9 @@ public boolean accepts(DataType cqlType) { * *

    *
  1. The default implementation is covariant with respect to the passed argument - * (through the usage of {@link TypeToken#isAssignableFrom(TypeToken)} or {@link - * TypeToken#isSupertypeOf(Type)}) and it's strongly recommended not to modify this - * behavior. This means that, by default, a codec will accept any subtype of - * the Java type that it has been created for. + * (through the usage of {@link Class#isAssignableFrom(Class)}) and it's strongly + * recommended not to modify this behavior. This means that, by default, a codec will + * accept any subtype of the Java type that it has been created for. *
  2. The base implementation provided here can only handle non-parameterized types; codecs * handling parameterized types, such as collection types, must override this method and * perform some sort of "manual" inspection of the actual type parameters. @@ -651,7 +672,7 @@ public boolean accepts(DataType cqlType) { */ public boolean accepts(Object value) { checkNotNull(value, "Parameter value cannot be null"); - return GuavaCompatibility.INSTANCE.isSupertypeOf(this.javaType, TypeToken.of(value.getClass())); + return javaType.getRawType().isAssignableFrom(value.getClass()); } @Override From 75418099170cd83984d3f15662b836e6957e8c1f Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Fri, 4 Jan 2019 14:01:13 -0600 Subject: [PATCH 006/211] JAVA-2041: Deprecate cross-DC failover in DCAwareRoundRobinPolicy (#1165) --- changelog/README.md | 1 + .../policies/DCAwareRoundRobinPolicy.java | 9 ++++++++- manual/load_balancing/README.md | 20 +------------------ 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 4e55e4a876b..2b91d3200cc 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -12,6 +12,7 @@ - [bug] JAVA-1612: Include netty-common jar in binary tarball. - [improvement] JAVA-2003: Simplify CBUtil internal API to improve performance. - [improvement] JAVA-2002: Reimplement TypeCodec.accepts to improve performance. +- [documentation] JAVA-2041: Deprecate cross-DC failover in DCAwareRoundRobinPolicy. ### 3.6.0 diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.java index 121683f22ed..5443d7da4e7 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.java +++ b/driver-core/src/main/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.java @@ -342,7 +342,11 @@ public Builder withLocalDc(String localDc) { * * @param usedHostsPerRemoteDc the number. * @return this builder. + * @deprecated This functionality will be removed in the next major release of the driver. DC + * failover shouldn't be done in the driver, which does not have the necessary context to know + * what makes sense considering application semantics. */ + @Deprecated public Builder withUsedHostsPerRemoteDc(int usedHostsPerRemoteDc) { Preconditions.checkArgument( usedHostsPerRemoteDc >= 0, "usedHostsPerRemoteDc must be equal or greater than 0"); @@ -363,7 +367,10 @@ public Builder withUsedHostsPerRemoteDc(int usedHostsPerRemoteDc) { * you do. * * @return this builder. - */ + * @deprecated This functionality will be removed in the next major release of the driver. DC + * failover shouldn't be done in the driver, which does not have the necessary context to know + * what makes sense considering application semantics. */ + @Deprecated public Builder allowRemoteDCsForLocalConsistencyLevel() { this.allowRemoteDCsForLocalConsistencyLevel = true; return this; diff --git a/manual/load_balancing/README.md b/manual/load_balancing/README.md index 5177d769428..40ac9bd3f34 100644 --- a/manual/load_balancing/README.md +++ b/manual/load_balancing/README.md @@ -101,14 +101,11 @@ Cluster cluster = Cluster.builder() .withLoadBalancingPolicy( DCAwareRoundRobinPolicy.builder() .withLocalDc("myLocalDC") - .withUsedHostsPerRemoteDc(2) - .allowRemoteDCsForLocalConsistencyLevel() .build() ).build(); ``` -This policy queries nodes of the local data-center in a round-robin fashion; optionally, it can also try a configurable -number of hosts in remote data centers if all local hosts failed. +This policy queries nodes of the local data-center in a round-robin fashion. Call `withLocalDc` to specify the name of your local datacenter. You can also leave it out, and the driver will use the datacenter of the first contact point that was reached [at initialization](../#cluster-initialization). However, @@ -118,21 +115,6 @@ local datacenter. In general, providing the datacenter name explicitly is a safe Hosts belonging to the local datacenter are at distance `LOCAL`, and appear first in query plans (in a round-robin fashion). -If you call `withUsedHostsPerRemoteDc`, the policy will pick that number of hosts for each remote DC, and add them at -the end of query plans. To illustrate this, let's assume that the value is 2, there are 3 datacenters and 3 hosts in the -local datacenter. Query plans would look like this: - -* query 1: localHost1, localHost2, localHost3, host1InRemoteDc1, host2InRemoteDc1, host1InRemoteDc2, host2InRemoteDc2 -* query 2: localHost2, localHost3, localHost1, host1InRemoteDc1, host2InRemoteDc1, host1InRemoteDc2, host2InRemoteDc2 -* query 3: localHost3, localHost1, localHost2, host1InRemoteDc1, host2InRemoteDc1, host1InRemoteDc2, host2InRemoteDc2 - -Hosts selected by this option are at distance `REMOTE`. Note that they always appear in the same order. - -Finally, `allowRemoteDCsForLocalConsistencyLevel` controls whether remote hosts included by the previous option are -included when the consistency level of the query is `LOCAL_ONE` or `LOCAL_QUORUM`. By default, it is off (remote hosts -are not included for local CLs). - - ### [TokenAwarePolicy] ```java From be8de668342708de38299082cb2f08bd032bb35b Mon Sep 17 00:00:00 2001 From: Andrew Tolbert Date: Fri, 4 Jan 2019 14:04:45 -0600 Subject: [PATCH 007/211] Fix javadoc formatting --- .../driver/core/policies/DCAwareRoundRobinPolicy.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.java index 5443d7da4e7..a1274f6b458 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.java +++ b/driver-core/src/main/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.java @@ -343,8 +343,8 @@ public Builder withLocalDc(String localDc) { * @param usedHostsPerRemoteDc the number. * @return this builder. * @deprecated This functionality will be removed in the next major release of the driver. DC - * failover shouldn't be done in the driver, which does not have the necessary context to know - * what makes sense considering application semantics. + * failover shouldn't be done in the driver, which does not have the necessary context to + * know what makes sense considering application semantics. */ @Deprecated public Builder withUsedHostsPerRemoteDc(int usedHostsPerRemoteDc) { @@ -368,8 +368,9 @@ public Builder withUsedHostsPerRemoteDc(int usedHostsPerRemoteDc) { * * @return this builder. * @deprecated This functionality will be removed in the next major release of the driver. DC - * failover shouldn't be done in the driver, which does not have the necessary context to know - * what makes sense considering application semantics. */ + * failover shouldn't be done in the driver, which does not have the necessary context to + * know what makes sense considering application semantics. + */ @Deprecated public Builder allowRemoteDCsForLocalConsistencyLevel() { this.allowRemoteDCsForLocalConsistencyLevel = true; From fe61331239f87509063b422423f72d5b8aa1bc8b Mon Sep 17 00:00:00 2001 From: Andrew Tolbert Date: Fri, 4 Jan 2019 15:10:38 -0600 Subject: [PATCH 008/211] JAVA-1612: Include netty-common jar in binary tarball (2) Second attempt which is more explicit. --- driver-dist/src/assembly/binary-tarball.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/driver-dist/src/assembly/binary-tarball.xml b/driver-dist/src/assembly/binary-tarball.xml index 7b1a1a35c8c..1b9d2adf796 100644 --- a/driver-dist/src/assembly/binary-tarball.xml +++ b/driver-dist/src/assembly/binary-tarball.xml @@ -45,6 +45,15 @@ io.netty:netty-transport-native-epoll:* + true + + + lib + + + io.netty:netty-common:* + + true From a0bbb520e50526d3074c201beb95cce873493f47 Mon Sep 17 00:00:00 2001 From: Andrew Tolbert Date: Mon, 7 Jan 2019 12:32:19 -0600 Subject: [PATCH 009/211] JAVA-1159: Document workaround for using tuple with udt field in Mapper (#1166) --- changelog/README.md | 1 + .../mapping/MapperUDTCollectionsTest.java | 113 +++++++++++++++++- manual/object_mapper/creating/README.md | 23 ++++ 3 files changed, 136 insertions(+), 1 deletion(-) diff --git a/changelog/README.md b/changelog/README.md index 2b91d3200cc..dad3caeb188 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -13,6 +13,7 @@ - [improvement] JAVA-2003: Simplify CBUtil internal API to improve performance. - [improvement] JAVA-2002: Reimplement TypeCodec.accepts to improve performance. - [documentation] JAVA-2041: Deprecate cross-DC failover in DCAwareRoundRobinPolicy. +- [documentation] JAVA-1159: Document workaround for using tuple with udt field in Mapper. ### 3.6.0 diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTCollectionsTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTCollectionsTest.java index 117ab376c1f..f38bb4b8e45 100644 --- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTCollectionsTest.java +++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTCollectionsTest.java @@ -15,9 +15,14 @@ */ package com.datastax.driver.mapping; +import static org.assertj.core.api.Assertions.assertThat; import static org.testng.Assert.assertEquals; import com.datastax.driver.core.CCMTestsSupport; +import com.datastax.driver.core.DataType; +import com.datastax.driver.core.TupleType; +import com.datastax.driver.core.TupleValue; +import com.datastax.driver.core.UserType; import com.datastax.driver.core.utils.CassandraVersion; import com.datastax.driver.core.utils.MoreObjects; import com.datastax.driver.mapping.annotations.FrozenKey; @@ -30,6 +35,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.UUID; import org.testng.annotations.Test; import org.testng.collections.Lists; @@ -47,7 +53,8 @@ public void onTestContextInitialized() { + "s set>, " + "m1 map>, " + "m2 map,int>, " - + "m3 map,frozen<\"Sub\">>)"); + + "m3 map,frozen<\"Sub\">>)", + "CREATE TABLE user_with_tuple (id uuid PRIMARY KEY, sub tuple)"); } @UDT(name = "Sub", caseSensitiveType = true) @@ -198,4 +205,108 @@ public void testNullCollection() { assertEquals(m.get(c.getId()), c); } + + @Table(name = "user_with_tuple") + public static class UserWithTuple { + @PartitionKey private UUID id; + + private TupleValue sub; + + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public TupleValue getSub() { + return sub; + } + + public void setSub(TupleValue sub) { + this.sub = sub; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + UserWithTuple that = (UserWithTuple) o; + + if (id != null ? !id.equals(that.id) : that.id != null) return false; + return sub != null ? sub.equals(that.sub) : that.sub == null; + } + + @Override + public int hashCode() { + int result = id != null ? id.hashCode() : 0; + result = 31 * result + (sub != null ? sub.hashCode() : 0); + return result; + } + } + + @UDT(name = "Sub", caseSensitiveType = true) + // Create a separate class with the same structure to test effectiveness of udtCodec + public static class SubInTuple { + private int i; + + public SubInTuple() {} + + public SubInTuple(int i) { + this.i = i; + } + + public int getI() { + return i; + } + + public void setI(int i) { + this.i = i; + } + + @Override + public boolean equals(Object other) { + if (other instanceof SubInTuple) { + SubInTuple that = (SubInTuple) other; + return this.i == that.i; + } + return false; + } + + @Override + public int hashCode() { + return MoreObjects.hashCode(i); + } + } + + /** + * Validates that tables having a tuple that has a UDT field can be handled by the object mapper + * assuming a udt codec has been registered with {@link MappingManager#udtCodec(Class)} + * + * @jira_ticket JAVA-1159 + * @test_category object_mapper + */ + @Test(groups = "short") + public void should_be_able_to_create_entity_from_table_having_tuple_with_udt() { + MappingManager manager = new MappingManager(session()); + Mapper mapper = manager.mapper(UserWithTuple.class); + + // register a codec using udtCodec, this is mandatory. + manager.udtCodec(SubInTuple.class); + + UserType subType = cluster().getMetadata().getKeyspace(keyspace).getUserType("\"Sub\""); + TupleType tt = cluster().getMetadata().newTupleType(DataType.text(), subType); + TupleValue tv = tt.newValue("seven", new SubInTuple(7)); + + UserWithTuple user = new UserWithTuple(); + user.setId(UUID.randomUUID()); + user.setSub(tv); + + mapper.save(user); + + UserWithTuple retrieved = mapper.get(user.getId()); + assertThat(retrieved).isEqualTo(user); + } } diff --git a/manual/object_mapper/creating/README.md b/manual/object_mapper/creating/README.md index 0819888e0b2..ab337e071e3 100644 --- a/manual/object_mapper/creating/README.md +++ b/manual/object_mapper/creating/README.md @@ -359,9 +359,32 @@ private Map> frozenKeyValueMap; private Map> frozenValueMap; ``` +With regards to tuples, these can be represented as `TupleValue` fields, i.e.: + +```java +@Frozen +private TupleValue myTupleValue; +``` + +Please note however that tuples are not a good fit for the mapper since it is up to the user to +resolve the associated `TupleType` when creating and accessing `TupleValue`s and properly use the +right types since java type information is not known. + +Also note that `@UDT`-annotated classes are not implicitly registered with `TupleValue` like they +otherwise are because the mapper is not able to identify the cql type information at the time +entities are constructed. + +To work around this, one may use [udtCodec] to register a `TypeCodec` that the mapper can use +to figure out how to appropriately handle UDT conversion, i.e.: + +```java +mappingManager.udtCodec(Address.class); +``` + [frozen]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/Frozen.html [frozenkey]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/FrozenKey.html [frozenvalue]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/FrozenValue.html +[udtCodec]:https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/MappingManager.html#udtCodec-java.lang.Class- #### Prefer Frozen Collections From 7928d731a5dab588f6331deb958deb68e3d55704 Mon Sep 17 00:00:00 2001 From: Andrew Tolbert Date: Mon, 7 Jan 2019 13:49:32 -0600 Subject: [PATCH 010/211] JAVA-1964: Complete remaining "Coming Soon" sections in docs (#1167) * Authentication * Control Connection * Reconnection * Statements * UDTs --- changelog/README.md | 1 + manual/auth/README.md | 33 +++++++++- manual/control_connection/README.md | 27 +++++--- manual/reconnection/README.md | 38 ++++++++--- manual/statements/batch/README.md | 41 +++++++++++- manual/udts/README.md | 98 ++++++++++++++++++++++++++++- 6 files changed, 217 insertions(+), 21 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index dad3caeb188..35458aa8eb2 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -14,6 +14,7 @@ - [improvement] JAVA-2002: Reimplement TypeCodec.accepts to improve performance. - [documentation] JAVA-2041: Deprecate cross-DC failover in DCAwareRoundRobinPolicy. - [documentation] JAVA-1159: Document workaround for using tuple with udt field in Mapper. +- [documentation] JAVA-1964: Complete remaining "Coming Soon" sections in docs. ### 3.6.0 diff --git a/manual/auth/README.md b/manual/auth/README.md index 502973702cc..a77834eff0a 100644 --- a/manual/auth/README.md +++ b/manual/auth/README.md @@ -1,5 +1,34 @@ ## Authentication -*Coming soon... In the meantime, see the javadoc for [AuthProvider].* +Cassandra’s binary protocol supports [SASL]-based authentication. To enable it, use +[Cluster.Builder.withCredentials] when building your `Cluster` instance to provide the credentials +you wish to authenticate with: -[AuthProvider]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/AuthProvider.html \ No newline at end of file +```java +Cluster.builder() + .withCredentials("bob", "mypassword") + .build(); +``` + +This is a shortcut for using [PlainTextAuthProvider] for simple username/password authentication +(intended to work with the server-side `PasswordAuthenticator`). This may alternatively be +provided using the [Cluster.Builder.withAuthProvider] method: + + +```java +Cluster.builder() + .withAuthProvider(new PlainTextAuthProvider("bob", "mypassword")) + .build(); +``` + +Authentication must be configured before opening a session, it cannot be changed at runtime. + +You can also write your own provider; it must implement [AuthProvider]. + + +[SASL]: https://en.wikipedia.org/wiki/Simple_Authentication_and_Security_Layer + +[Cluster.Builder.withCredentials]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.Builder.html#withCredentials-java.lang.String-java.lang.String- +[AuthProvider]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/AuthProvider.html +[Cluster.Builder.withAuthProvider]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.Builder.html#withAuthProvider-com.datastax.driver.core.AuthProvider- +[PlainTextAuthProvider]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PlainTextAuthProvider.html diff --git a/manual/control_connection/README.md b/manual/control_connection/README.md index eccef57e029..6b6385fd30a 100644 --- a/manual/control_connection/README.md +++ b/manual/control_connection/README.md @@ -1,10 +1,21 @@ ## Control connection -*Coming soon...* - - \ No newline at end of file +The control connection is a dedicated connection used for administrative tasks: + +* querying system tables to learn about the cluster's topology and + [schema](../metadata/#schema-metadata); +* checking [schema agreement](../metadata/#schema-agreement); +* reacting to server events, which are used to notify the driver of external topology or schema + changes. + +When the driver starts, the control connection is established to the first contacted node. If that +node goes down, a [reconnection](../reconnection/) is started to find another node; it is governed +by the same policy as regular connections and tries the nodes according to a query plan from the +[load balancing policy](../load_balancing/). + +The control connection is managed independently from [regular pooled connections](../pooling/), and +used exclusively for administrative requests. It is included in [Session.State.getOpenConnections], +as well as the `open-connections` [metric](../metrics); for example, if you've configured a pool +size of 2, the control node will have 3 connections. + +[Session.State.getOpenConnections]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Session.State.html#getOpenConnections-com.datastax.driver.core.Host- \ No newline at end of file diff --git a/manual/reconnection/README.md b/manual/reconnection/README.md index d1273197077..d54390813dc 100644 --- a/manual/reconnection/README.md +++ b/manual/reconnection/README.md @@ -1,11 +1,35 @@ ## Reconnection -*Coming soon... In the meantime, see the javadoc for [ReconnectionPolicy].* +If the driver loses a connection to a node, it tries to re-establish it according to a configurable +policy. This is used in two places: - +* [connection pools](../pooling/): for each node, a session has a fixed-size pool of connections to + execute user requests. If a node is detected as down, a reconnection is started. +* [control connection](../control_connection/): a session uses a single connection to an arbitrary + node for administrative requests. If that connection goes down, a reconnection gets started; each + attempt iterates through all active nodes until one of them accepts a connection. This goes on + until we have a control node again. -[ReconnectionPolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/ReconnectionPolicy.html \ No newline at end of file +[ReconnectionPolicy] controls the interval between each attempt. The policy to use may be +provided using [Cluster.Builder.withReconnectionPolicy]. For example, the following configures +an [ExponentialReconnectionPolicy] with a base delay of 1 second, and a max delay of 10 minutes +(this is the default behavior). + +```java +Cluster.builder() + .withReconnectionPolicy(new ExponentialReconnectionPolicy(1000, 10 * 60 * 1000)) + .build(); +``` + +[ConstantReconnectionPolicy] uses the same delay every time, regardless of the +previous number of attempts. + +You can also write your own policy; it must implement [ReconnectionPolicy]. + +For best results, use reasonable values: very low values (for example a constant delay of 10 +milliseconds) will quickly saturate your system. + +[ReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/ReconnectionPolicy.html +[Cluster.Builder.withReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.Builder.html#withReconnectionPolicy-com.datastax.driver.core.policies.ReconnectionPolicy- +[ExponentialReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.html +[ConstantReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/ConstantReconnectionPolicy.html diff --git a/manual/statements/batch/README.md b/manual/statements/batch/README.md index ebc156d731b..fd8e50b9f41 100644 --- a/manual/statements/batch/README.md +++ b/manual/statements/batch/README.md @@ -1,5 +1,42 @@ ## Batch statements -*Coming soon... In the meantime, see the javadoc for [BatchStatement].* +Use [BatchStatement] to execute a set of queries as a single operation (refer to +[Batching inserts, updates and deletes][batch_dse] to understand how to use batching effectively): -[BatchStatement]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/BatchStatement.html +```java +PreparedStatement preparedInsertExpense = + session.prepare( + "INSERT INTO cyclist_expenses (cyclist_name, expense_id, amount, description, paid) " + + "VALUES (:name, :id, :amount, :description, :paid)"); +SimpleStatement simpleInsertBalance = + new SimpleStatement("INSERT INTO cyclist_expenses (cyclist_name, balance) VALUES (?, 0) IF NOT EXISTS", + "Vera ADRIAN"); + +BatchStatement batch = new BatchStatement(BatchStatement.Type.UNLOGGED) + .add(simpleInsertBalance) + .add(preparedInsertExpense.bind("Vera ADRIAN", 1, 7.95f, "Breakfast", false)); + +session.execute(batch); +``` + +As shown in the examples above, batches can contain any combination of simple statements and bound +statements. A given batch can contain at most 65536 statements. Past this limit, addition methods +throw an `IllegalStateException`. + +By default, batches are configured as [LOGGED]. This ensures that if any statement in the batch +succeeds, all will eventually succeed. Ensuring all queries in a batch succeed has a +performance cost. Consider using [UNLOGGED] as shown above if you do not need this capability. + +Please note that the size of a batch is subject to the [batch_size_fail_threshold] configuration +option on the server. + +In addition, simple statements with named parameters are currently not supported in batches (this is +due to a [protocol limitation][CASSANDRA-10246] that will be fixed in a future version). If you try +to execute such a batch, an `IllegalArgumentException` is thrown. + +[BatchStatement]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/BatchStatement.html +[batch_dse]: http://docs.datastax.com/en/dse/5.1/cql/cql/cql_using/useBatch.html +[LOGGED]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/BatchStatement.Type.html#LOGGED +[UNLOGGED]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/BatchStatement.Type.html#UNLOGGED +[batch_size_fail_threshold]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html#configCassandra_yaml__batch_size_fail_threshold_in_kb +[CASSANDRA-10246]: https://issues.apache.org/jira/browse/CASSANDRA-10246 diff --git a/manual/udts/README.md b/manual/udts/README.md index 8fd946908d7..08f37ac48c7 100644 --- a/manual/udts/README.md +++ b/manual/udts/README.md @@ -1,5 +1,99 @@ ## User-defined types -*Coming soon... In the meantime, see the javadoc for [UserType].* +[CQL user-defined types][cql_doc] are ordered sets of named, typed fields. They must be defined in a +keyspace: -[UserType]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/UserType.html \ No newline at end of file +``` +CREATE TYPE ks.type1 ( + a int, + b text, + c float); +``` + +And can then be used as a column type in tables, or a field type in other user-defined types in that +keyspace: + +``` +CREATE TABLE ks.collect_things ( + pk int, + ck1 text, + ck2 text, + v frozen, + PRIMARY KEY (pk, ck1, ck2) +); + +CREATE TYPE ks.type2 (v frozen); +``` + +### Fetching UDTs from results + +The driver maps UDT columns to the [UDTValue] class, which exposes getters and setters to access +individual fields by index or name: + +```java +Row row = session.execute("SELECT v FROM ks.collect_things WHERE pk = 1").one(); + +UDTValue udtValue = row.getUDTValue("v"); +int a = udtValue.getInt(0); +String b = udtValue.getString("b"); +Float c = udtValue.getFloat(2); +``` + +### Using UDTs as parameters + +Statements may contain UDTs as bound values: + +```java +PreparedStatement ps = + session.prepare( + "INSERT INTO ks.collect_things (pk, ck1, ck2, v) VALUES (:pk, :ck1, :ck2, :v)"); +``` + +To create a new UDT value, you must first have a reference to its [UserType]. There are +various ways to get it: + +* from the statement's metadata + + ```java + UserType udt = (UserType) ps.getVariables().getType("v"); + ``` + +* from the driver's [schema metadata](../metadata/#schema-metadata): + + ```java + UserType udt = session.getMetadata().getKeyspace("ks").getUserType("type1"); + ``` + +* from another UDT value: + + ```java + UserType udt = udtValue.getType(); + ``` + +Note that the driver's official API does not expose a way to build [UserType] instances manually. +This is because the type's internal definition must precisely match the database schema; +if it doesn't (for example if the fields are not in the same order), you run the risk of inserting +corrupt data, that you won't be able to read back. + +Once you have the type, call `newValue()` and set the fields: + +```java +UDTValue udtValue = udt.newValue().setInt(0, 1).setString(1, "hello").setFloat(2, 2.3f); +``` + +And bind your UDT value like any other type: + +```java +BoundStatement bs = + ps.bind() + .setInt("pk", 1) + .setString("ck1", "1") + .setString("ck2", "1") + .setUDTValue("v", udtValue); +session.execute(bs); +``` + +[cql_doc]: https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlRefUDType.html + +[UDTValue]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/UDTValue.html +[UserType]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/UserType.html From ada717cf1ef021e733a86005c49afd4bf8fd8460 Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Fri, 15 Feb 2019 03:49:09 -0600 Subject: [PATCH 011/211] JAVA-1950: Log server side warnings returned from a query (#1178) --- changelog/README.md | 1 + .../datastax/driver/core/RequestHandler.java | 19 +++ .../datastax/driver/core/WarningsTest.java | 114 ++++++++++++++++-- manual/logging/README.md | 41 +++++++ 4 files changed, 166 insertions(+), 9 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 35458aa8eb2..076f59fa2e9 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -15,6 +15,7 @@ - [documentation] JAVA-2041: Deprecate cross-DC failover in DCAwareRoundRobinPolicy. - [documentation] JAVA-1159: Document workaround for using tuple with udt field in Mapper. - [documentation] JAVA-1964: Complete remaining "Coming Soon" sections in docs. +- [improvement] JAVA-1950: Log server side warnings returned from a query. ### 3.6.0 diff --git a/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java b/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java index b50fc121399..6b968f5d7be 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java +++ b/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java @@ -64,6 +64,8 @@ class RequestHandler { private static final boolean HOST_METRICS_ENABLED = Boolean.getBoolean("com.datastax.driver.HOST_METRICS_ENABLED"); + private static final QueryLogger QUERY_LOGGER = QueryLogger.builder().build(); + static final String DISABLE_QUERY_WARNING_LOGS = "com.datastax.driver.DISABLE_QUERY_WARNING_LOGS"; final String id; @@ -224,6 +226,14 @@ private void setFinalResult( response.getCustomPayload()); } callback.onSet(connection, response, info, statement, System.nanoTime() - startTime); + // if the response from the server has warnings, they'll be set on the ExecutionInfo. Log them + // here, unless they've been disabled. + if (response.warnings != null + && !response.warnings.isEmpty() + && !Boolean.getBoolean(RequestHandler.DISABLE_QUERY_WARNING_LOGS) + && logger.isWarnEnabled()) { + logServerWarnings(response.warnings); + } } catch (Exception e) { callback.onException( connection, @@ -234,6 +244,15 @@ private void setFinalResult( } } + private void logServerWarnings(List warnings) { + // truncate the statement query to the DEFAULT_MAX_QUERY_STRING_LENGTH, if necessary + final String queryString = QUERY_LOGGER.statementAsString(statement); + // log each warning separately + for (String warning : warnings) { + logger.warn("Query '{}' generated server side warning(s): {}", queryString, warning); + } + } + private void setFinalException( SpeculativeExecution execution, Connection connection, Exception exception) { if (!isDone.compareAndSet(false, true)) { diff --git a/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java b/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java index f3db41a4c12..c7c3590a2b4 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java @@ -20,34 +20,130 @@ import com.datastax.driver.core.utils.CassandraVersion; import com.google.common.base.Strings; import java.util.List; +import org.slf4j.LoggerFactory; import org.testng.annotations.Test; @CCMConfig(config = {"batch_size_warn_threshold_in_kb:5"}) @CassandraVersion("2.2.0") public class WarningsTest extends CCMTestsSupport { + private MemoryAppender logAppender; + @Override public void onTestContextInitialized() { execute("CREATE TABLE foo(k int primary key, v text)"); } + @Override + public void beforeTestClass(Object instance) throws Exception { + // create a MemoryAppender and add it + logAppender = new MemoryAppender(); + logAppender.enableFor(LoggerFactory.getLogger(RequestHandler.class)); + super.beforeTestClass(instance); + } + + @Override + public void afterTestClass() throws Exception { + super.afterTestClass(); + // remove the log appender + logAppender.disableFor(LoggerFactory.getLogger(RequestHandler.class)); + logAppender = null; + } + @Test(groups = "short") public void should_expose_warnings_on_execution_info() { // the default batch size warn threshold is 5 * 1024 bytes, but after CASSANDRA-10876 there must // be // multiple mutations in a batch to trigger this warning so the batch includes 2 different // inserts. - ResultSet rs = - session() - .execute( - String.format( - "BEGIN UNLOGGED BATCH\n" - + "INSERT INTO foo (k, v) VALUES (1, '%s')\n" - + "INSERT INTO foo (k, v) VALUES (2, '%s')\n" - + "APPLY BATCH", - Strings.repeat("1", 2 * 1024), Strings.repeat("1", 3 * 1024))); + final String query = + String.format( + "BEGIN UNLOGGED BATCH\n" + + "INSERT INTO foo (k, v) VALUES (1, '%s')\n" + + "INSERT INTO foo (k, v) VALUES (2, '%s')\n" + + "APPLY BATCH", + Strings.repeat("1", 2 * 1024), Strings.repeat("1", 3 * 1024)); + ResultSet rs = session().execute(query); List warnings = rs.getExecutionInfo().getWarnings(); assertThat(warnings).hasSize(1); + // also assert that by default, the warning is logged and truncated to + // DEFAULT_MAX_QUERY_STRING_LENGTH + String log = logAppender.getNext(); + assertThat(log).isNotNull(); + assertThat(log).isNotEmpty(); + assertThat(log) + .startsWith("Query '") + // query will only be logged up to QueryLogger.DEFAULT_MAX_QUERY_STRING_LENGTH characters + .contains(query.substring(0, QueryLogger.DEFAULT_MAX_QUERY_STRING_LENGTH)) + .contains("' generated server side warning(s): ") + .contains( + String.format( + "Batch for [%s.foo] is of size 5152, exceeding specified threshold of 5120 by 32.", + keyspace)); + } + + @Test(groups = "short") + public void should_execute_query_and_log_server_side_warnings() { + // Assert that logging of server-side query warnings is NOT disabled + assertThat(Boolean.getBoolean(RequestHandler.DISABLE_QUERY_WARNING_LOGS)).isFalse(); + + // Given a query that will produce server side warnings that will be embedded in the + // ExecutionInfo + final String query = "SELECT count(*) FROM foo;"; + SimpleStatement statement = new SimpleStatement(query); + // When the query is executed + ResultSet rs = session().execute(statement); + // Then the result has 1 Row + Row row = rs.one(); + assertThat(row).isNotNull(); + // And there is a server side warning captured in the ResultSet's ExecutionInfo + ExecutionInfo ei = rs.getExecutionInfo(); + List warnings = ei.getWarnings(); + assertThat(warnings).isNotEmpty(); + assertThat(warnings.size()).isEqualTo(1); + assertThat(warnings.get(0)).isEqualTo("Aggregation query used without partition key"); + // And the driver logged the server side warning + String log = logAppender.getNext(); + assertThat(log).isNotNull(); + assertThat(log).isNotEmpty(); + assertThat(log) + .startsWith( + "Query '[0 bound values] " + + query + + "' generated server side warning(s): Aggregation query used without partition key"); + } + + @Test(groups = "isolated") + public void should_execute_query_and_not_log_server_side_warnings() { + // Get the system property value for disabling logging server side warnings + final String disabledLogFlag = + System.getProperty(RequestHandler.DISABLE_QUERY_WARNING_LOGS, "false"); + // assert that logs are NOT disabled + assertThat(disabledLogFlag).isEqualTo("false"); + // Disable the logs + System.setProperty(RequestHandler.DISABLE_QUERY_WARNING_LOGS, "true"); + try { + // Given a query that will produce server side warnings that will be embedded in the + // ExecutionInfo + SimpleStatement statement = new SimpleStatement("SELECT count(*) FROM foo"); + // When the query is executed + ResultSet rs = session().execute(statement); + // Then the result has 1 Row + Row row = rs.one(); + assertThat(row).isNotNull(); + // And there is a server side warning captured in the ResultSet's ExecutionInfo + ExecutionInfo ei = rs.getExecutionInfo(); + List warnings = ei.getWarnings(); + assertThat(warnings).isNotEmpty(); + assertThat(warnings.size()).isEqualTo(1); + assertThat(warnings.get(0)).isEqualTo("Aggregation query used without partition key"); + // And the driver did NOT log the server side warning + String log = logAppender.getNext(); + assertThat(log).isNullOrEmpty(); + } finally { + // reset the logging flag + System.setProperty(RequestHandler.DISABLE_QUERY_WARNING_LOGS, disabledLogFlag); + } } } diff --git a/manual/logging/README.md b/manual/logging/README.md index 08cbda9c6b1..86edf1943c5 100644 --- a/manual/logging/README.md +++ b/manual/logging/README.md @@ -192,6 +192,47 @@ that can significantly boost latencies when writing log messages. without stopping the application. This usually involves JMX and is available for [Logback](http://logback.qos.ch/manual/jmxConfig.html); Log4J provides a `configureAndWatch()` method but it is not recommended to use it inside J2EE containers (see [FAQ](https://logging.apache.org/log4j/1.2/faq.html#a3.6)). +### Server Side Warnings + +When using the driver to execute queries, it is possible that the server will generate warnings and +return them along with the results. Consider the following query: + +```sql +SELECT count(*) FROM cycling.cyclist_name; +``` + +Executing this query would generate a warning in Cassandra: + +``` +Aggregation query used without partition key +``` + +These +[query warnings](http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) +are available programmatically from the +[ExecutionInfo](https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ExecutionInfo.html) +via +[ResultSet](https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ResultSet.html)'s +[getExecutionInfo()](https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PagingIterable.html#getExecutionInfo--) +method. They are also logged by the driver: + +``` +WARN com.datastax.driver.core.RequestHandler - Query 'SELECT count(*) FROM cycling.cyclist_name' generated server side warning(s): Aggregation query used without partition key +``` + +Sometimes, it is not desirable for the driver to log server-side warnings. In such cases, logging +these warnings can be disabled in the driver by setting the system property `com.datastax.driver.DISABLE_QUERY_WARNING_LOGS` +to "true". This can be done at application startup (`-Dcom.datastax.driver.DISABLE_QUERY_WARNING_LOGS=true`) +or it can be toggled programmatically in application code: + +```java +// disable driver logging of server-side warnings +System.setProperty("com.datastax.driver.DISABLE_QUERY_WARNING_LOGS", "true"); +.... +// enable driver logging of server-side warnings +System.setProperty("com.datastax.driver.DISABLE_QUERY_WARNING_LOGS", "false"); +``` + ### Logback Example Here is a typical example configuration for Logback. *Please adapt it to your specific needs before using it!* From 5c98360c516ac2c83a416e133b4df95d6b12bcb5 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Thu, 21 Feb 2019 10:54:19 +0100 Subject: [PATCH 012/211] JAVA-2123: Allow to use QueryBuilder for building queries against Materialized Views (#1189) --- changelog/README.md | 1 + .../driver/core/querybuilder/Select.java | 24 +++++++++- .../QueryBuilderExecutionTest.java | 48 +++++++++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) diff --git a/changelog/README.md b/changelog/README.md index 076f59fa2e9..7cd430eaed6 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -16,6 +16,7 @@ - [documentation] JAVA-1159: Document workaround for using tuple with udt field in Mapper. - [documentation] JAVA-1964: Complete remaining "Coming Soon" sections in docs. - [improvement] JAVA-1950: Log server side warnings returned from a query. +- [improvement] JAVA-2123: Allow to use QueryBuilder for building queries against Materialized Views. ### 3.6.0 diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Select.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Select.java index 73031988854..1974e5fca30 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Select.java +++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Select.java @@ -15,9 +15,11 @@ */ package com.datastax.driver.core.querybuilder; +import com.datastax.driver.core.AbstractTableMetadata; import com.datastax.driver.core.CodecRegistry; import com.datastax.driver.core.ColumnMetadata; import com.datastax.driver.core.DataType; +import com.datastax.driver.core.MaterializedViewMetadata; import com.datastax.driver.core.Metadata; import com.datastax.driver.core.TableMetadata; import java.util.ArrayList; @@ -47,7 +49,8 @@ public class Select extends BuiltStatement { this(keyspace, table, null, null, columnNames, isDistinct, isJson); } - Select(TableMetadata table, List columnNames, boolean isDistinct, boolean isJson) { + Select( + AbstractTableMetadata table, List columnNames, boolean isDistinct, boolean isJson) { this( Metadata.quoteIfNecessary(table.getKeyspace().getName()), Metadata.quoteIfNecessary(table.getName()), @@ -469,6 +472,16 @@ public Select from(String keyspace, String table) { public Select from(TableMetadata table) { return new Select(table, columnNames, isDistinct, isJson); } + + /** + * Adds the materialized view to select from. + * + * @param view the materialized view to select from. + * @return a newly built SELECT statement that selects from {@code view}. + */ + public Select from(MaterializedViewMetadata view) { + return new Select(view, columnNames, isDistinct, isJson); + } } /** An Selection clause for an in-construction SELECT statement. */ @@ -857,5 +870,14 @@ public Select from(TableMetadata table) { previousSelection = null; return super.from(table); } + + @Override + public Select from(MaterializedViewMetadata view) { + if (previousSelection != null) { + addName(previousSelection); + } + previousSelection = null; + return super.from(view); + } } } diff --git a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java index 26c617945f2..9587025081c 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java @@ -36,6 +36,7 @@ import static com.datastax.driver.core.querybuilder.QueryBuilder.token; import static com.datastax.driver.core.querybuilder.QueryBuilder.update; import static com.datastax.driver.core.schemabuilder.SchemaBuilder.createTable; +import static java.util.concurrent.TimeUnit.MINUTES; import static org.assertj.core.data.MapEntry.entry; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; @@ -43,7 +44,9 @@ import static org.testng.Assert.fail; import com.datastax.driver.core.CCMTestsSupport; +import com.datastax.driver.core.ConditionChecker; import com.datastax.driver.core.DataType; +import com.datastax.driver.core.MaterializedViewMetadata; import com.datastax.driver.core.PreparedStatement; import com.datastax.driver.core.RegularStatement; import com.datastax.driver.core.ResultSet; @@ -56,6 +59,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.Callable; import org.assertj.core.api.iterable.Extractor; import org.testng.annotations.Test; @@ -924,4 +928,48 @@ public void should_support_group_by() throws Exception { .groupBy("b"))) .containsExactly(row(1, 1, 12)); } + + /** + * Validates that {@link QueryBuilder} can construct a SELECT query for a materialized view. + * + * @test_category queries:builder + * @jira_ticket JAVA-2123 + * @since 3.7.0 + */ + @CassandraVersion( + value = "3.0", + description = "Support for materialized views was added to C* 3.0") + @Test(groups = "short") + public void should_select_from_materialized_view() { + + String table = TestUtils.generateIdentifier("table"); + final String mv = TestUtils.generateIdentifier("mv"); + + execute( + String.format("CREATE TABLE %s (pk int, cc int, v int, PRIMARY KEY (pk, cc))", table), + String.format("INSERT INTO %s (pk, cc, v) VALUES (0,0,0)", table), + String.format("INSERT INTO %s (pk, cc, v) VALUES (0,1,1)", table), + String.format("INSERT INTO %s (pk, cc, v) VALUES (0,2,2)", table), + String.format( + "CREATE MATERIALIZED VIEW %s AS SELECT cc FROM %s WHERE cc IS NOT NULL PRIMARY KEY (pk, cc)", + mv, table)); + + // Wait until the MV is fully constructed + ConditionChecker.check() + .that( + new Callable() { + @Override + public Boolean call() { + return session().execute("SELECT * FROM " + mv).all().size() == 3; + } + }) + .before(1, MINUTES) + .becomesTrue(); + + MaterializedViewMetadata materializedView = + session().getCluster().getMetadata().getKeyspace(keyspace).getMaterializedView(mv); + + assertThat(session().execute(select().column("cc").as("mycc").from(materializedView))) + .containsExactly(row(0), row(1), row(2)); + } } From 3cb45e8a4545af32439e833b3eb89fb34f986188 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Thu, 21 Feb 2019 15:56:58 +0100 Subject: [PATCH 013/211] JAVA-2082: Avoid race condition during cluster close and schema refresh (#1174) --- changelog/README.md | 1 + .../datastax/driver/core/EventDebouncer.java | 17 +++++++++++++++-- .../com/datastax/driver/core/SchemaParser.java | 8 +++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 7cd430eaed6..3b6b8404775 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -17,6 +17,7 @@ - [documentation] JAVA-1964: Complete remaining "Coming Soon" sections in docs. - [improvement] JAVA-1950: Log server side warnings returned from a query. - [improvement] JAVA-2123: Allow to use QueryBuilder for building queries against Materialized Views. +- [bug] JAVA-2082: Avoid race condition during cluster close and schema refresh. ### 3.6.0 diff --git a/driver-core/src/main/java/com/datastax/driver/core/EventDebouncer.java b/driver-core/src/main/java/com/datastax/driver/core/EventDebouncer.java index 430a80ebbd6..fc6cf90a71c 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/EventDebouncer.java +++ b/driver-core/src/main/java/com/datastax/driver/core/EventDebouncer.java @@ -117,6 +117,12 @@ void stop() { break; } } + while (true) { + DeliveryAttempt previous = cancelImmediateDelivery(); + if (immediateDelivery.compareAndSet(previous, null)) { + break; + } + } completeAllPendingFutures(); @@ -205,14 +211,21 @@ private void scheduleDelayedDelivery() { } private DeliveryAttempt cancelDelayedDelivery() { - DeliveryAttempt previous = delayedDelivery.get(); + return cancelDelivery(delayedDelivery.get()); + } + + private DeliveryAttempt cancelImmediateDelivery() { + return cancelDelivery(immediateDelivery.get()); + } + + private DeliveryAttempt cancelDelivery(DeliveryAttempt previous) { if (previous != null) { previous.cancel(); } return previous; } - void deliverEvents() { + private void deliverEvents() { if (state == State.STOPPED) { completeAllPendingFutures(); return; diff --git a/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java b/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java index d6e3094c663..ce16ad04761 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java +++ b/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java @@ -93,7 +93,13 @@ void refresh( connection, cassandraVersion); - Metadata metadata = cluster.getMetadata(); + Metadata metadata; + try { + metadata = cluster.getMetadata(); + } catch (IllegalStateException e) { + logger.warn("Unable to refresh metadata, cluster has been closed"); + return; + } metadata.lock.lock(); try { if (targetType == null || targetType == KEYSPACE) { From 60e6696a251da59d91d63cae19f6d22cd78d20d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Jastrz=C4=99bski?= Date: Fri, 22 Feb 2019 13:28:04 +0100 Subject: [PATCH 014/211] Avoid full cluster scans in Connection.checkClusterName (#1195) Select without a partition key results in full cluster scan that can hurt the performance of the cluster. There is an easy solution to the problem by just using a 'local' partition key for the query. Signed-off-by: Piotr Jastrzebski --- .../src/main/java/com/datastax/driver/core/Connection.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java index bf9c4ab5f84..1b92a57c47f 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java @@ -382,7 +382,9 @@ private ListenableFuture checkClusterName( DefaultResultSetFuture clusterNameFuture = new DefaultResultSetFuture( - null, protocolVersion, new Requests.Query("select cluster_name from system.local")); + null, + protocolVersion, + new Requests.Query("select cluster_name from system.local where key = 'local'")); try { write(clusterNameFuture); return GuavaCompatibility.INSTANCE.transformAsync( From 5fe593a66ec40f829f2cd424fc572ec79348b653 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Sat, 23 Feb 2019 15:01:13 +0100 Subject: [PATCH 015/211] Remove Travis CI badge --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index efb3a113cad..9c373876342 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Datastax Java Driver for Apache Cassandra® -[![Build Status](https://travis-ci.org/datastax/java-driver.svg?branch=3.x)](https://travis-ci.org/datastax/java-driver) - *If you're reading this on github.com, please note that this is the readme for the development version and that some features described here might not yet have been released. You can find the documentation for the latest From 5cd6a94587d5adfe7b69c6c78675758e202f12fc Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 26 Feb 2019 11:53:10 +0100 Subject: [PATCH 016/211] Revert "Avoid full cluster scans in Connection.checkClusterName (#1195)" This reverts commit 60e6696a251da59d91d63cae19f6d22cd78d20d6. --- .../src/main/java/com/datastax/driver/core/Connection.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java index 1b92a57c47f..bf9c4ab5f84 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java @@ -382,9 +382,7 @@ private ListenableFuture checkClusterName( DefaultResultSetFuture clusterNameFuture = new DefaultResultSetFuture( - null, - protocolVersion, - new Requests.Query("select cluster_name from system.local where key = 'local'")); + null, protocolVersion, new Requests.Query("select cluster_name from system.local")); try { write(clusterNameFuture); return GuavaCompatibility.INSTANCE.transformAsync( From 674278f10bcb359e1fe465d587c16a205845377d Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 26 Feb 2019 22:38:16 +0100 Subject: [PATCH 017/211] Update version in docs --- README.md | 18 +++++------ changelog/README.md | 2 +- faq/README.md | 4 +-- faq/osgi/README.md | 2 +- manual/README.md | 30 +++++++++--------- manual/async/README.md | 8 ++--- manual/auth/README.md | 8 ++--- manual/compression/README.md | 2 +- manual/custom_codecs/README.md | 38 +++++++++++------------ manual/custom_codecs/extras/README.md | 44 +++++++++++++-------------- manual/idempotence/README.md | 6 ++-- manual/metadata/README.md | 16 +++++----- manual/metrics/README.md | 2 +- manual/object_mapper/README.md | 2 +- manual/object_mapper/using/README.md | 18 +++++------ manual/paging/README.md | 6 ++-- manual/query_timestamps/README.md | 8 ++--- manual/reconnection/README.md | 8 ++--- manual/shaded_jar/README.md | 6 ++-- manual/ssl/README.md | 10 +++--- manual/udts/README.md | 4 +-- pom.xml | 2 +- 22 files changed, 122 insertions(+), 122 deletions(-) diff --git a/README.md b/README.md index 9c373876342..4b9f3f7f252 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ not yet have been released. You can find the documentation for the latest version through the [Java driver docs](http://docs.datastax.com/en/developer/java-driver/latest/index.html) or via the release tags, [e.g. -3.6.0](https://github.com/datastax/java-driver/tree/3.6.0).* +3.7.0](https://github.com/datastax/java-driver/tree/3.7.0).* _**Feeback requested!** Help us focus our efforts, provide your input on the [Platform and Runtime Survey](http://goo.gl/forms/qwUE6qnL7U) (we kept it short)._ @@ -53,12 +53,12 @@ The driver contains the following modules: driver releases and important announcements (low frequency). [@DataStaxEng](https://twitter.com/datastaxeng) has more news including other drivers, Cassandra, and DSE. -- DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.5/manual/) has quick +- DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.7/manual/) has quick start material and technical details about the driver and its features. -- API: http://www.datastax.com/drivers/java/3.5 +- API: http://www.datastax.com/drivers/java/3.7 - GITHUB REPOSITORY: https://github.com/datastax/java-driver - [changelog](changelog/) -- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.6.0.tar.gz) +- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.7.0.tar.gz) ## Getting the driver @@ -70,7 +70,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-dri com.datastax.cassandra cassandra-driver-core - 3.6.0 + 3.7.0 ``` @@ -80,7 +80,7 @@ Note that the object mapper is published as a separate artifact: com.datastax.cassandra cassandra-driver-mapping - 3.6.0 + 3.7.0 ``` @@ -90,7 +90,7 @@ The 'extras' module is also published as a separate artifact: com.datastax.cassandra cassandra-driver-extras - 3.6.0 + 3.7.0 ``` @@ -99,12 +99,12 @@ 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](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.6.0.tar.gz) +[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.7.0.tar.gz) is available for download. ## Compatibility -The Java client driver 3.6.0 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache +The Java client driver 3.7.0 ([branch 3.x](https://github.com/datastax/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/latest/manual/native_protocol/) for the most up-to-date compatibility information). diff --git a/changelog/README.md b/changelog/README.md index 3b6b8404775..10a0c329a4c 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -1,6 +1,6 @@ ## Changelog -### 3.7.0 (In progress) +### 3.7.0 - [improvement] JAVA-2025: Include exception message in Abstract\*Codec.accepts(null). - [improvement] JAVA-1980: Use covariant return types in RemoteEndpointAwareJdkSSLOptions.Builder methods. diff --git a/faq/README.md b/faq/README.md index ea8e9b17f02..d68b6abda63 100644 --- a/faq/README.md +++ b/faq/README.md @@ -35,7 +35,7 @@ row.getBool(0); // this is equivalent row.getBool("applied") Note that, unlike manual inspection, `wasApplied` does not consume the first row. -[wasApplied]: http://docs.datastax.com/en/drivers/java/3.5/com/datastax/driver/core/ResultSet.html#wasApplied-- +[wasApplied]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ResultSet.html#wasApplied-- ### What is a parameterized statement and how can I use it? @@ -289,7 +289,7 @@ version is available, you may want to reach out to the maintainer of that tool t an update with compatibility to this driver version. -[Blobs.java]: https://github.com/datastax/java-driver/tree/3.6.0/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java +[Blobs.java]: https://github.com/datastax/java-driver/tree/3.7.0/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304 [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding [Mapper options]: ../manual/object_mapper/using/#mapper-options diff --git a/faq/osgi/README.md b/faq/osgi/README.md index dd01a6bce4c..18e1cfb831b 100644 --- a/faq/osgi/README.md +++ b/faq/osgi/README.md @@ -157,7 +157,7 @@ it is also normal to see the following log lines when starting the driver: [BND]:http://bnd.bndtools.org/ [Maven bundle plugin]:https://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Maven+Bundle+Plugin+%28BND%29 [OSGi examples repository]:https://github.com/datastax/java-driver-examples-osgi -[without metrics]:http://docs.datastax.com/en/drivers/java/3.5/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- +[without metrics]:http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- [SLF4J]:http://www.slf4j.org/ [Logback]:http://logback.qos.ch/ [Tycho]:https://eclipse.org/tycho/ diff --git a/manual/README.md b/manual/README.md index 735259da078..283d835933a 100644 --- a/manual/README.md +++ b/manual/README.md @@ -209,7 +209,7 @@ String firstName = row.getString("first_name"); blob getBytes java.nio.ByteBuffer boolean getBool boolean counter getLong long - date getDate LocalDate + date getDate LocalDate decimal getDecimal java.math.BigDecimal double getDouble double float getFloat float @@ -291,17 +291,17 @@ menu on the left hand side to navigate sub-sections. If you're [browsing the sou github.com](https://github.com/datastax/java-driver/tree/3.x/manual), simply navigate to each sub-directory. -[Cluster]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.html -[Cluster.Builder]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.Builder.html -[Initializer]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.Initializer.html -[Session]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Session.html -[ResultSet]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ResultSet.html -[Row]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Row.html -[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/NettyOptions.html -[QueryOptions]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/QueryOptions.html -[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SocketOptions.html -[Host.StateListener]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Host.StateListener.html -[LatencyTracker]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/LatencyTracker.html -[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SchemaChangeListener.html -[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/NoHostAvailableException.html -[LocalDate]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/LocalDate.html \ No newline at end of file +[Cluster]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.html +[Cluster.Builder]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.Builder.html +[Initializer]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.Initializer.html +[Session]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Session.html +[ResultSet]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ResultSet.html +[Row]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Row.html +[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/NettyOptions.html +[QueryOptions]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/QueryOptions.html +[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/SocketOptions.html +[Host.StateListener]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Host.StateListener.html +[LatencyTracker]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/LatencyTracker.html +[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/SchemaChangeListener.html +[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[LocalDate]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/LocalDate.html \ No newline at end of file diff --git a/manual/async/README.md b/manual/async/README.md index 124b25e8c07..a50d3180bbb 100644 --- a/manual/async/README.md +++ b/manual/async/README.md @@ -51,8 +51,8 @@ to the current page, and [fetchMoreResults] to get a future to the next page (see also the section on [paging](../paging/)). Here is a full example: -[getAvailableWithoutFetching]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ResultSet.html#getAvailableWithoutFetching-- -[fetchMoreResults]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ResultSet.html#fetchMoreResults-- +[getAvailableWithoutFetching]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ResultSet.html#getAvailableWithoutFetching-- +[fetchMoreResults]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ResultSet.html#fetchMoreResults-- ```java Statement statement = new SimpleStatement("select * from foo").setFetchSize(20); @@ -134,5 +134,5 @@ There are still a few places where the driver will block internally hasn't been fetched already. [ListenableFuture]: https://github.com/google/guava/wiki/ListenableFutureExplained -[init]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.html#init-- -[query trace]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/QueryTrace.html +[init]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.html#init-- +[query trace]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/QueryTrace.html diff --git a/manual/auth/README.md b/manual/auth/README.md index a77834eff0a..50fdaf3bf3b 100644 --- a/manual/auth/README.md +++ b/manual/auth/README.md @@ -28,7 +28,7 @@ You can also write your own provider; it must implement [AuthProvider]. [SASL]: https://en.wikipedia.org/wiki/Simple_Authentication_and_Security_Layer -[Cluster.Builder.withCredentials]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.Builder.html#withCredentials-java.lang.String-java.lang.String- -[AuthProvider]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/AuthProvider.html -[Cluster.Builder.withAuthProvider]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.Builder.html#withAuthProvider-com.datastax.driver.core.AuthProvider- -[PlainTextAuthProvider]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PlainTextAuthProvider.html +[Cluster.Builder.withCredentials]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.Builder.html#withCredentials-java.lang.String-java.lang.String- +[AuthProvider]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/AuthProvider.html +[Cluster.Builder.withAuthProvider]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.Builder.html#withAuthProvider-com.datastax.driver.core.AuthProvider- +[PlainTextAuthProvider]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/PlainTextAuthProvider.html diff --git a/manual/compression/README.md b/manual/compression/README.md index 10966388943..9acd44706e9 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -88,4 +88,4 @@ cluster = Cluster.builder() .build(); ``` -[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.6.0/cassandra-driver-parent-3.6.0.pom +[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.7.0/cassandra-driver-parent-3.7.0.pom diff --git a/manual/custom_codecs/README.md b/manual/custom_codecs/README.md index 1bd34b8f19e..15e90d48a3f 100644 --- a/manual/custom_codecs/README.md +++ b/manual/custom_codecs/README.md @@ -447,26 +447,26 @@ Beware that in these cases, the lookup performs in average 10x worse. If perform consider using prepared statements all the time. [JAVA-721]: https://datastax-oss.atlassian.net/browse/JAVA-721 -[TypeCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TypeCodec.html -[LocalDate]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/LocalDate.html +[TypeCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TypeCodec.html +[LocalDate]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/LocalDate.html [ByteBuffer]: http://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html -[serialize]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TypeCodec.html#serialize-T-com.datastax.driver.core.ProtocolVersion- -[deserialize]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TypeCodec.html#deserialize-java.nio.ByteBuffer-com.datastax.driver.core.ProtocolVersion- -[TypeCodec.format]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TypeCodec.html#format-T- -[TypeCodec.parse]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TypeCodec.html#parse-java.lang.String- -[accepts]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TypeCodec.html#accepts-com.datastax.driver.core.DataType- -[CodecRegistry]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/CodecRegistry.html -[CodecNotFoundException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/CodecNotFoundException.html +[serialize]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TypeCodec.html#serialize-T-com.datastax.driver.core.ProtocolVersion- +[deserialize]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TypeCodec.html#deserialize-java.nio.ByteBuffer-com.datastax.driver.core.ProtocolVersion- +[TypeCodec.format]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TypeCodec.html#format-T- +[TypeCodec.parse]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TypeCodec.html#parse-java.lang.String- +[accepts]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TypeCodec.html#accepts-com.datastax.driver.core.DataType- +[CodecRegistry]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/CodecRegistry.html +[CodecNotFoundException]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/exceptions/CodecNotFoundException.html [Jackson]: https://github.com/FasterXML/jackson [AbstractType]: https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/marshal/AbstractType.java -[UserType]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/UserType.html -[UDTValue]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/UDTValue.html -[TupleType]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TupleType.html -[TupleValue]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TupleValue.html -[CustomType]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/DataType.CustomType.html +[UserType]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/UserType.html +[UDTValue]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/UDTValue.html +[TupleType]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TupleType.html +[TupleValue]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TupleValue.html +[CustomType]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/DataType.CustomType.html [TypeToken]: https://google.github.io/guava/releases/19.0/api/docs/com/google/common/reflect/TypeToken.html -[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SimpleStatement.html -[BuiltStatement]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/querybuilder/BuiltStatement.html -[setList]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SettableByIndexData.html#setList-int-java.util.List- -[setSet]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SettableByIndexData.html#setSet-int-java.util.Set- -[setMap]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SettableByIndexData.html#setMap-int-java.util.Map- +[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/SimpleStatement.html +[BuiltStatement]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/querybuilder/BuiltStatement.html +[setList]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/SettableByIndexData.html#setList-int-java.util.List- +[setSet]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/SettableByIndexData.html#setSet-int-java.util.Set- +[setMap]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/SettableByIndexData.html#setMap-int-java.util.Map- diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index 0571cf70b72..ca604f74af4 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -10,7 +10,7 @@ The module is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-extras - 3.6.0 + 3.7.0 ``` @@ -73,10 +73,10 @@ session.execute("INSERT INTO example (id, t) VALUES (1, ?)", ZoneId.of("GMT+07:00")); ``` -[InstantCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/jdk8/InstantCodec.html -[LocalDateCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.html -[LocalTimeCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.html -[ZonedDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.html +[InstantCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/InstantCodec.html +[LocalDateCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.html +[LocalTimeCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.html +[ZonedDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.html [Instant]: https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html [LocalDate]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html [LocalTime]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html @@ -127,10 +127,10 @@ session.execute("INSERT INTO example (id, t) VALUES (1, ?)", DateTime.parse("2010-06-30T01:20:47.999+01:00")); ``` -[InstantCodec_joda]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/joda/InstantCodec.html -[LocalDateCodec_joda]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/joda/LocalDateCodec.html -[LocalTimeCodec_joda]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.html -[DateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/joda/DateTimeCodec.html +[InstantCodec_joda]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/joda/InstantCodec.html +[LocalDateCodec_joda]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/joda/LocalDateCodec.html +[LocalTimeCodec_joda]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.html +[DateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/joda/DateTimeCodec.html [DateTime]: http://www.joda.org/joda-time/apidocs/org/joda/time/DateTime.html [Instant_joda]: http://www.joda.org/joda-time/apidocs/org/joda/time/Instant.html [LocalDate_joda]: http://www.joda.org/joda-time/apidocs/org/joda/time/LocalDate.html @@ -148,8 +148,8 @@ Time can also be expressed as simple durations: There is no extra codec for `time`, because by default the driver already maps that type to a `long` representing the number of nanoseconds since midnight. -[SimpleTimestampCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.html -[SimpleDateCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/date/SimpleDateCodec.html +[SimpleTimestampCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.html +[SimpleDateCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/date/SimpleDateCodec.html ### Enums @@ -187,8 +187,8 @@ Note that if you registered an `EnumNameCodec` and an `EnumOrdinalCodec` _for th In practice, this is unlikely to happen, because you'll probably stick to a single CQL type for a given enum type; however, if you ever run into that issue, the workaround is to use [prepared statements](../../statements/prepared/), for which the driver knows the CQL type and can pick the exact codec. -[EnumNameCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/enums/EnumNameCodec.html -[EnumOrdinalCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.html +[EnumNameCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/enums/EnumNameCodec.html +[EnumOrdinalCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.html [name]: https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name-- [ordinal]: https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal-- @@ -233,7 +233,7 @@ session.execute("insert into example (id, owner) values (1, ?)", // owner saved as '{"id":1,"name":"root"}' ``` -[JacksonJsonCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.html +[JacksonJsonCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.html [Jackson]: https://github.com/FasterXML/jackson @@ -272,7 +272,7 @@ session.execute("insert into example (id, owner) values (1, ?)", ``` -[Jsr353JsonCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.html +[Jsr353JsonCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.html [JsonStructure]: https://docs.oracle.com/javaee/7/tutorial/jsonp002.htm @@ -325,7 +325,7 @@ For the same reason, we need to give a type hint when setting "v", in the form o anonymous inner class; we recommend storing these tokens as constants in a utility class, to avoid creating them too often. -[OptionalCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.html +[OptionalCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.html [Optional]: https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html [TypeToken]: http://google.github.io/guava/releases/19.0/api/docs/com/google/common/reflect/TypeToken.html @@ -369,7 +369,7 @@ session.execute(pst.bind() See the JDK8 Optional section above for explanations about [TypeToken]. -[OptionalCodec_guava]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/guava/OptionalCodec.html +[OptionalCodec_guava]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/guava/OptionalCodec.html [Optional_guava]: http://google.github.io/guava/releases/19.0/api/docs/com/google/common/base/Optional.html @@ -394,9 +394,9 @@ session.execute("insert into example (i, l) values (1, ?)", Package [com.datastax.driver.extras.codecs.arrays][arrays] contains similar codecs for all primitive types, and [ObjectArrayCodec] to map arrays of objects. -[IntArrayCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.html -[ObjectArrayCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.html -[arrays]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/arrays/package-summary.html +[IntArrayCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.html +[ObjectArrayCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.html +[arrays]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/arrays/package-summary.html ### Abstract utilities @@ -426,5 +426,5 @@ These two classes are convenient, but since they perform conversions in two step optimal approach. If performance is paramount, it's better to start from scratch and convert your objects to `ByteBuffer` directly. -[MappingCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/MappingCodec.html -[ParsingCodec]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/extras/codecs/ParsingCodec.html +[MappingCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/MappingCodec.html +[ParsingCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/ParsingCodec.html diff --git a/manual/idempotence/README.md b/manual/idempotence/README.md index 8c833a18805..a130a6952cd 100644 --- a/manual/idempotence/README.md +++ b/manual/idempotence/README.md @@ -125,8 +125,8 @@ broke linearizability by doing a transparent retry at step 6. If linearizability is important for you, you should ensure that lightweight transactions are appropriately flagged as not idempotent. -[isIdempotent]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Statement.html#isIdempotent-- -[setDefaultIdempotence]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/QueryOptions.html#setDefaultIdempotence-boolean- -[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/querybuilder/QueryBuilder.html +[isIdempotent]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Statement.html#isIdempotent-- +[setDefaultIdempotence]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/QueryOptions.html#setDefaultIdempotence-boolean- +[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/querybuilder/QueryBuilder.html [linearizability]: https://en.wikipedia.org/wiki/Linearizability#Definition_of_linearizability \ No newline at end of file diff --git a/manual/metadata/README.md b/manual/metadata/README.md index 51f28296283..0155bb82882 100644 --- a/manual/metadata/README.md +++ b/manual/metadata/README.md @@ -4,7 +4,7 @@ The driver maintains global information about the Cassandra cluster it is connected to. It is available via [Cluster#getMetadata()][getMetadata]. -[getMetadata]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.html#getMetadata-- +[getMetadata]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.html#getMetadata-- ### Schema metadata @@ -12,8 +12,8 @@ Use [getKeyspace(String)][getKeyspace] or [getKeyspaces()][getKeyspaces] to get keyspace-level metadata. From there you can access the keyspace's objects (tables, and UDTs and UDFs if relevant). -[getKeyspace]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Metadata.html#getKeyspace-java.lang.String- -[getKeyspaces]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Metadata.html#getKeyspaces-- +[getKeyspace]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Metadata.html#getKeyspace-java.lang.String- +[getKeyspaces]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Metadata.html#getKeyspaces-- #### Refreshes @@ -47,8 +47,8 @@ Note that it is preferable to register a listener only *after* the cluster is fu otherwise the listener could be notified with a great deal of "Added" events as the driver builds the schema metadata from scratch for the first time. -[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SchemaChangeListener.html -[registerListener]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.html#register-com.datastax.driver.core.SchemaChangeListener- +[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/SchemaChangeListener.html +[registerListener]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.html#register-com.datastax.driver.core.SchemaChangeListener- #### Schema agreement @@ -135,9 +135,9 @@ custom executor). Check out the API docs for the features in this section: -* [withMaxSchemaAgreementWaitSeconds(int)](http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.Builder.html#withMaxSchemaAgreementWaitSeconds-int-) -* [isSchemaInAgreement()](http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ExecutionInfo.html#isSchemaInAgreement--) -* [checkSchemaAgreement()](http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Metadata.html#checkSchemaAgreement--) +* [withMaxSchemaAgreementWaitSeconds(int)](http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.Builder.html#withMaxSchemaAgreementWaitSeconds-int-) +* [isSchemaInAgreement()](http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ExecutionInfo.html#isSchemaInAgreement--) +* [checkSchemaAgreement()](http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Metadata.html#checkSchemaAgreement--) ### Token metadata diff --git a/manual/metrics/README.md b/manual/metrics/README.md index fe9c560e70c..4939dff9253 100644 --- a/manual/metrics/README.md +++ b/manual/metrics/README.md @@ -38,7 +38,7 @@ To do this in a maven project: com.datastax.cassandra cassandra-driver-core - 3.6.0 + 3.7.0 io.dropwizard.metrics diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md index 054e9e6e97c..1ae04001d58 100644 --- a/manual/object_mapper/README.md +++ b/manual/object_mapper/README.md @@ -11,7 +11,7 @@ The mapper is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-mapping - 3.6.0 + 3.7.0 ``` diff --git a/manual/object_mapper/using/README.md b/manual/object_mapper/using/README.md index 457c00be5a3..f55c19e843e 100644 --- a/manual/object_mapper/using/README.md +++ b/manual/object_mapper/using/README.md @@ -28,9 +28,9 @@ Mapper mapper = manager.mapper(User.class); calling `manager#mapper` more than once for the same class will return the previously generated mapper. -[Mapper]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/Mapper.html -[MappingManager]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/MappingManager.html -[Session]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Session.html +[Mapper]:http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/Mapper.html +[MappingManager]:http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/MappingManager.html +[Session]:http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Session.html #### Basic CRUD operations @@ -179,7 +179,7 @@ It provides methods `one()`, `all()`, `iterator()`, `getExecutionInfo()` and `isExhausted()`. Note that iterating the `Result` will consume the `ResultSet`, and vice-versa. -[Result]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/Result.html +[Result]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/Result.html ### Accessors @@ -229,7 +229,7 @@ corresponds to which marker: ResultSet insert(@Param("u") UUID userId, @Param("n") String name); ``` -[param]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/Param.html +[param]:http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/annotations/Param.html If a method argument is a Java enumeration, it must be annotated with `@Enumerated` to indicate how to convert it to a CQL type (the rules are @@ -301,7 +301,7 @@ query with the annotation [@QueryParameters]. Then, options like public ListenableFuture> getAllAsync(); ``` -[@QueryParameters]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/QueryParameters.html +[@QueryParameters]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/annotations/QueryParameters.html ### Mapping configuration @@ -345,6 +345,6 @@ PropertyMapper propertyMapper = new DefaultPropertyMapper() There is more to `DefaultPropertyMapper`; see the Javadocs and implementation for details. -[MappingConfiguration]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/MappingConfiguration.html -[PropertyMapper]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/PropertyMapper.html -[DefaultPropertyMapper]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/DefaultPropertyMapper.html +[MappingConfiguration]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/MappingConfiguration.html +[PropertyMapper]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/PropertyMapper.html +[DefaultPropertyMapper]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/DefaultPropertyMapper.html diff --git a/manual/paging/README.md b/manual/paging/README.md index 5453c34f80f..ea4e9febf15 100644 --- a/manual/paging/README.md +++ b/manual/paging/README.md @@ -176,8 +176,8 @@ if (nextPage != null) { } ``` -[result_set]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ResultSet.html -[paging_state]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PagingState.html +[result_set]:http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ResultSet.html +[paging_state]:http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/PagingState.html Due to internal implementation details, `PagingState` instances are not @@ -239,7 +239,7 @@ There are two situations where you might want to use the unsafe API: implementing your own validation logic (for example, signing the raw state with a private key). -[gpsu]: https://www.datastax.com/drivers/java/3.6/com/datastax/driver/core/ExecutionInfo.html#getPagingStateUnsafe-- +[gpsu]: https://www.datastax.com/drivers/java/3.7/com/datastax/driver/core/ExecutionInfo.html#getPagingStateUnsafe-- [spsu]: https://www.datastax.com/drivers/java/3.6/com/datastax/driver/core/Statement.html#setPagingStateUnsafe-byte:A- ### Offset queries diff --git a/manual/query_timestamps/README.md b/manual/query_timestamps/README.md index 8b2fac9d5d9..fcdc66c7189 100644 --- a/manual/query_timestamps/README.md +++ b/manual/query_timestamps/README.md @@ -140,10 +140,10 @@ following: Steps 2 and 3 only apply if native protocol v3 or above is in use. -[TimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TimestampGenerator.html -[AtomicMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.html -[ThreadLocalMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.html -[ServerSideTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ServerSideTimestampGenerator.html +[TimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TimestampGenerator.html +[AtomicMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.html +[ThreadLocalMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.html +[ServerSideTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ServerSideTimestampGenerator.html [gettimeofday]: http://man7.org/linux/man-pages/man2/settimeofday.2.html [JNR]: https://github.com/jnr/jnr-ffi diff --git a/manual/reconnection/README.md b/manual/reconnection/README.md index d54390813dc..ee078e61751 100644 --- a/manual/reconnection/README.md +++ b/manual/reconnection/README.md @@ -29,7 +29,7 @@ You can also write your own policy; it must implement [ReconnectionPolicy]. For best results, use reasonable values: very low values (for example a constant delay of 10 milliseconds) will quickly saturate your system. -[ReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/ReconnectionPolicy.html -[Cluster.Builder.withReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.Builder.html#withReconnectionPolicy-com.datastax.driver.core.policies.ReconnectionPolicy- -[ExponentialReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.html -[ConstantReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/ConstantReconnectionPolicy.html +[ReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/policies/ReconnectionPolicy.html +[Cluster.Builder.withReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.Builder.html#withReconnectionPolicy-com.datastax.driver.core.policies.ReconnectionPolicy- +[ExponentialReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.html +[ConstantReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/policies/ConstantReconnectionPolicy.html diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md index b4cfe416561..ef3ed3bb3f2 100644 --- a/manual/shaded_jar/README.md +++ b/manual/shaded_jar/README.md @@ -12,7 +12,7 @@ package name: com.datastax.cassandra cassandra-driver-core - 3.6.0 + 3.7.0 shaded @@ -32,7 +32,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-core - 3.6.0 + 3.7.0 shaded @@ -44,7 +44,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-mapping - 3.6.0 + 3.7.0 com.datastax.cassandra diff --git a/manual/ssl/README.md b/manual/ssl/README.md index 8297660925e..6cf2b892603 100644 --- a/manual/ssl/README.md +++ b/manual/ssl/README.md @@ -207,8 +207,8 @@ Cluster cluster = Cluster.builder() .build(); ``` -[RemoteEndpointAwareSSLOptions]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.html -[RemoteEndpointAwareJdkSSLOptions]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html -[newSSLEngine]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html#newSSLEngine-io.netty.channel.socket.SocketChannel-java.net.InetSocketAddress- -[RemoteEndpointAwareNettySSLOptions]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.html -[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/NettyOptions.html +[RemoteEndpointAwareSSLOptions]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.html +[RemoteEndpointAwareJdkSSLOptions]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html +[newSSLEngine]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html#newSSLEngine-io.netty.channel.socket.SocketChannel-java.net.InetSocketAddress- +[RemoteEndpointAwareNettySSLOptions]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.html +[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/NettyOptions.html diff --git a/manual/udts/README.md b/manual/udts/README.md index 08f37ac48c7..7221ba5cc4b 100644 --- a/manual/udts/README.md +++ b/manual/udts/README.md @@ -95,5 +95,5 @@ session.execute(bs); [cql_doc]: https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlRefUDType.html -[UDTValue]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/UDTValue.html -[UserType]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/UserType.html +[UDTValue]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/UDTValue.html +[UserType]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/UserType.html diff --git a/pom.xml b/pom.xml index f6408522554..1eac20eb11e 100644 --- a/pom.xml +++ b/pom.xml @@ -634,7 +634,7 @@ - 3.5.0 + 3.6.0 ../clirr-ignores.xml com/datastax/shaded/** From efe69bbd3622d4f493e217ea29632be3c37616f2 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 26 Feb 2019 22:53:10 +0100 Subject: [PATCH 018/211] [maven-release-plugin] prepare release 3.7.0 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index c2bf48fbe17..e2f312f1854 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.6.1-SNAPSHOT + 3.7.0 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 973f004090f..b8696db2eae 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.6.1-SNAPSHOT + 3.7.0 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index f2d18e738af..9286a7874de 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.6.1-SNAPSHOT + 3.7.0 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 03d642f5ea3..643dab5509d 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.6.1-SNAPSHOT + 3.7.0 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 60fe47c4f1a..16dbc944c2e 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.6.1-SNAPSHOT + 3.7.0 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 7cd3dc04055..dce1b40e0bb 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.6.1-SNAPSHOT + 3.7.0 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 4853bd08bac..1b7b98663b1 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.6.1-SNAPSHOT + 3.7.0 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 87e337ce67f..d8e0ee7e8b3 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.6.1-SNAPSHOT + 3.7.0 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 844818095ed..3508118c388 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.6.1-SNAPSHOT + 3.7.0 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 8e974ca2711..c1689598465 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.6.1-SNAPSHOT + 3.7.0 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index d291201009a..f03e110fd2b 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.6.1-SNAPSHOT + 3.7.0 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 1eac20eb11e..61c1c620209 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.6.1-SNAPSHOT + 3.7.0 pom DataStax Java Driver for Apache Cassandra @@ -1141,7 +1141,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.7.0 From 9e0bac677da3b9fa4b5da4fd71edd5c769da420b Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 26 Feb 2019 22:53:26 +0100 Subject: [PATCH 019/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index e2f312f1854..964501befcf 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.0 + 3.7.1-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index b8696db2eae..bcc2a52db18 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.0 + 3.7.1-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 9286a7874de..b421fb9e2c5 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.0 + 3.7.1-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 643dab5509d..720f26b17a5 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.0 + 3.7.1-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 16dbc944c2e..ad67c512c7b 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.0 + 3.7.1-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index dce1b40e0bb..90c822676db 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.0 + 3.7.1-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 1b7b98663b1..94006eb0c92 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.0 + 3.7.1-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index d8e0ee7e8b3..5b657a4d239 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.0 + 3.7.1-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 3508118c388..c38208962d6 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.7.0 + 3.7.1-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index c1689598465..b2b09a3e7d9 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.7.0 + 3.7.1-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index f03e110fd2b..654220aaea8 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.0 + 3.7.1-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 61c1c620209..ba709dda280 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.0 + 3.7.1-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1141,7 +1141,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.7.0 + HEAD From 79d0e4cd00662d7f3796e93e959b7779115bba41 Mon Sep 17 00:00:00 2001 From: Tomasz Lelek Date: Fri, 1 Mar 2019 17:15:35 +0100 Subject: [PATCH 020/211] JAVA-2174: Metadata.needsQuote should accept empty strings (#1204) --- changelog/README.md | 1 + .../src/main/java/com/datastax/driver/core/Metadata.java | 9 +++++++-- .../test/java/com/datastax/driver/core/MetadataTest.java | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 10a0c329a4c..ace9afc61a9 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -18,6 +18,7 @@ - [improvement] JAVA-1950: Log server side warnings returned from a query. - [improvement] JAVA-2123: Allow to use QueryBuilder for building queries against Materialized Views. - [bug] JAVA-2082: Avoid race condition during cluster close and schema refresh. +- [bug] JAVA-2174: Metadata.needsQuote should accept empty strings. ### 3.6.0 diff --git a/driver-core/src/main/java/com/datastax/driver/core/Metadata.java b/driver-core/src/main/java/com/datastax/driver/core/Metadata.java index 7ef5d9b2b8e..2db76467155 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Metadata.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Metadata.java @@ -241,11 +241,16 @@ public static String quoteIfNecessary(String id) { /** * We don't need to escape an identifier if it matches non-quoted CQL3 ids ([a-z][a-z0-9_]*), and * if it's not a CQL reserved keyword. + * + *

    When 'Migrating from compact storage' after DROP COMPACT STORAGE on the table, it can have a + * column with an empty name. (See JAVA-2174 for the reference) For that case, we need to escape + * empty column name. */ private static boolean needsQuote(String s) { // this method should only be called for C*-provided identifiers, - // so we expect it to be non-null and non-empty. - assert s != null && !s.isEmpty(); + // so we expect it to be non-null + assert s != null; + if (s.isEmpty()) return true; char c = s.charAt(0); if (!(c >= 97 && c <= 122)) // a-z return true; diff --git a/driver-core/src/test/java/com/datastax/driver/core/MetadataTest.java b/driver-core/src/test/java/com/datastax/driver/core/MetadataTest.java index 178f4f3f780..44774cc59b3 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/MetadataTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/MetadataTest.java @@ -170,6 +170,12 @@ public void escapeId_should_quote_reserved_cql_keywords() { assertThat(Metadata.quoteIfNecessary("columnfamily")).isEqualTo("\"columnfamily\""); } + /** @jira_ticket JAVA-2174 */ + @Test(groups = "unit") + public void escapeId_should_quote_empty_keyword() { + assertThat(Metadata.quoteIfNecessary("")).isEqualTo("\"\""); + } + @Test(groups = "unit") public void should_detect_reserved_keywords_in_upper_case() { assertThat(Metadata.isReservedCqlKeyword("COLUMNFAMILY")).isTrue(); From e5e142edce88fe32faf777cfd7f0cd664a203f3f Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 1 Mar 2019 17:22:56 +0100 Subject: [PATCH 021/211] Fix misplaced changelog entry --- changelog/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog/README.md b/changelog/README.md index ace9afc61a9..2e02f432ccd 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -1,5 +1,10 @@ ## Changelog +### 3.7.1 (in progress) + +- [bug] JAVA-2174: Metadata.needsQuote should accept empty strings. + + ### 3.7.0 - [improvement] JAVA-2025: Include exception message in Abstract\*Codec.accepts(null). @@ -18,7 +23,6 @@ - [improvement] JAVA-1950: Log server side warnings returned from a query. - [improvement] JAVA-2123: Allow to use QueryBuilder for building queries against Materialized Views. - [bug] JAVA-2082: Avoid race condition during cluster close and schema refresh. -- [bug] JAVA-2174: Metadata.needsQuote should accept empty strings. ### 3.6.0 From fc0f78515faaa118f2c10aaff891057440d8a1d5 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 1 Mar 2019 17:23:42 +0100 Subject: [PATCH 022/211] Update version in docs --- README.md | 14 +++++++------- changelog/README.md | 2 +- faq/README.md | 2 +- manual/compression/README.md | 2 +- manual/custom_codecs/extras/README.md | 2 +- manual/metrics/README.md | 2 +- manual/object_mapper/README.md | 2 +- manual/shaded_jar/README.md | 6 +++--- pom.xml | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 4b9f3f7f252..51df608aae8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ not yet have been released. You can find the documentation for the latest version through the [Java driver docs](http://docs.datastax.com/en/developer/java-driver/latest/index.html) or via the release tags, [e.g. -3.7.0](https://github.com/datastax/java-driver/tree/3.7.0).* +3.7.1](https://github.com/datastax/java-driver/tree/3.7.1).* _**Feeback requested!** Help us focus our efforts, provide your input on the [Platform and Runtime Survey](http://goo.gl/forms/qwUE6qnL7U) (we kept it short)._ @@ -58,7 +58,7 @@ The driver contains the following modules: - API: http://www.datastax.com/drivers/java/3.7 - GITHUB REPOSITORY: https://github.com/datastax/java-driver - [changelog](changelog/) -- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.7.0.tar.gz) +- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.7.1.tar.gz) ## Getting the driver @@ -70,7 +70,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-dri com.datastax.cassandra cassandra-driver-core - 3.7.0 + 3.7.1 ``` @@ -80,7 +80,7 @@ Note that the object mapper is published as a separate artifact: com.datastax.cassandra cassandra-driver-mapping - 3.7.0 + 3.7.1 ``` @@ -90,7 +90,7 @@ The 'extras' module is also published as a separate artifact: com.datastax.cassandra cassandra-driver-extras - 3.7.0 + 3.7.1 ``` @@ -99,12 +99,12 @@ 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](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.7.0.tar.gz) +[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.7.1.tar.gz) is available for download. ## Compatibility -The Java client driver 3.7.0 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache +The Java client driver 3.7.1 ([branch 3.x](https://github.com/datastax/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/latest/manual/native_protocol/) for the most up-to-date compatibility information). diff --git a/changelog/README.md b/changelog/README.md index 2e02f432ccd..2b32d3ead94 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -1,6 +1,6 @@ ## Changelog -### 3.7.1 (in progress) +### 3.7.1 - [bug] JAVA-2174: Metadata.needsQuote should accept empty strings. diff --git a/faq/README.md b/faq/README.md index d68b6abda63..dd76299e874 100644 --- a/faq/README.md +++ b/faq/README.md @@ -289,7 +289,7 @@ version is available, you may want to reach out to the maintainer of that tool t an update with compatibility to this driver version. -[Blobs.java]: https://github.com/datastax/java-driver/tree/3.7.0/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java +[Blobs.java]: https://github.com/datastax/java-driver/tree/3.7.1/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304 [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding [Mapper options]: ../manual/object_mapper/using/#mapper-options diff --git a/manual/compression/README.md b/manual/compression/README.md index 9acd44706e9..d7d24fa8a31 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -88,4 +88,4 @@ cluster = Cluster.builder() .build(); ``` -[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.7.0/cassandra-driver-parent-3.7.0.pom +[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.7.1/cassandra-driver-parent-3.7.1.pom diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index ca604f74af4..0bc4633ae24 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -10,7 +10,7 @@ The module is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-extras - 3.7.0 + 3.7.1 ``` diff --git a/manual/metrics/README.md b/manual/metrics/README.md index 4939dff9253..ee15107788c 100644 --- a/manual/metrics/README.md +++ b/manual/metrics/README.md @@ -38,7 +38,7 @@ To do this in a maven project: com.datastax.cassandra cassandra-driver-core - 3.7.0 + 3.7.1 io.dropwizard.metrics diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md index 1ae04001d58..3b9e26667f3 100644 --- a/manual/object_mapper/README.md +++ b/manual/object_mapper/README.md @@ -11,7 +11,7 @@ The mapper is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-mapping - 3.7.0 + 3.7.1 ``` diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md index ef3ed3bb3f2..25d8bf4a124 100644 --- a/manual/shaded_jar/README.md +++ b/manual/shaded_jar/README.md @@ -12,7 +12,7 @@ package name: com.datastax.cassandra cassandra-driver-core - 3.7.0 + 3.7.1 shaded @@ -32,7 +32,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-core - 3.7.0 + 3.7.1 shaded @@ -44,7 +44,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-mapping - 3.7.0 + 3.7.1 com.datastax.cassandra diff --git a/pom.xml b/pom.xml index ba709dda280..4cf88aea248 100644 --- a/pom.xml +++ b/pom.xml @@ -634,7 +634,7 @@ - 3.6.0 + 3.7.0 ../clirr-ignores.xml com/datastax/shaded/** From bc3fe7cdf54d3dae5624cd29c18b3577a0b79517 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 1 Mar 2019 17:27:55 +0100 Subject: [PATCH 023/211] [maven-release-plugin] prepare release 3.7.1 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 964501befcf..5c4a954d218 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.1-SNAPSHOT + 3.7.1 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index bcc2a52db18..72ffa9fb504 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.1-SNAPSHOT + 3.7.1 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index b421fb9e2c5..0027db86f5f 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.1-SNAPSHOT + 3.7.1 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 720f26b17a5..a5d37984a9f 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.1-SNAPSHOT + 3.7.1 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index ad67c512c7b..bc60e34ee80 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.1-SNAPSHOT + 3.7.1 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 90c822676db..44acff7fe26 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.1-SNAPSHOT + 3.7.1 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 94006eb0c92..8b097a20270 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.1-SNAPSHOT + 3.7.1 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 5b657a4d239..d23c9e7daa1 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.1-SNAPSHOT + 3.7.1 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index c38208962d6..a3531ca1b6b 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.7.1-SNAPSHOT + 3.7.1 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index b2b09a3e7d9..4f1370b835d 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.7.1-SNAPSHOT + 3.7.1 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 654220aaea8..8f04fbe5d73 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.1-SNAPSHOT + 3.7.1 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 4cf88aea248..350e56d4e0a 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.1-SNAPSHOT + 3.7.1 pom DataStax Java Driver for Apache Cassandra @@ -1141,7 +1141,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.7.1 From a374fa05ab6a0e09c3a923642c51460b673558f4 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 1 Mar 2019 17:28:10 +0100 Subject: [PATCH 024/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 5c4a954d218..c71fa400ee8 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.1 + 3.7.2-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 72ffa9fb504..ecda4446775 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.1 + 3.7.2-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 0027db86f5f..88d0767afed 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.1 + 3.7.2-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index a5d37984a9f..aecdceb51d7 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.1 + 3.7.2-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index bc60e34ee80..4878ead6694 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.1 + 3.7.2-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 44acff7fe26..1b1e9bc1e41 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.1 + 3.7.2-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 8b097a20270..ca03c2cab70 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.1 + 3.7.2-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index d23c9e7daa1..0e2c4ba58c5 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.1 + 3.7.2-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index a3531ca1b6b..d568d6c40e3 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.7.1 + 3.7.2-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 4f1370b835d..9ba4cf73420 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.7.1 + 3.7.2-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 8f04fbe5d73..e35ed7d0954 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.1 + 3.7.2-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 350e56d4e0a..86c621d4854 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.1 + 3.7.2-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1141,7 +1141,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.7.1 + HEAD From c485103c08500d04f4ad2024b46f0f9554571b49 Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Mon, 11 Mar 2019 05:54:16 -0500 Subject: [PATCH 025/211] Fix flaky tests for JAVA-1950 (#1200) --- .../datastax/driver/core/WarningsTest.java | 140 +++++++++--------- 1 file changed, 68 insertions(+), 72 deletions(-) diff --git a/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java b/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java index c7c3590a2b4..d753eb3a074 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java @@ -20,38 +20,19 @@ import com.datastax.driver.core.utils.CassandraVersion; import com.google.common.base.Strings; import java.util.List; -import org.slf4j.LoggerFactory; import org.testng.annotations.Test; @CCMConfig(config = {"batch_size_warn_threshold_in_kb:5"}) @CassandraVersion("2.2.0") public class WarningsTest extends CCMTestsSupport { - private MemoryAppender logAppender; - @Override public void onTestContextInitialized() { execute("CREATE TABLE foo(k int primary key, v text)"); } - @Override - public void beforeTestClass(Object instance) throws Exception { - // create a MemoryAppender and add it - logAppender = new MemoryAppender(); - logAppender.enableFor(LoggerFactory.getLogger(RequestHandler.class)); - super.beforeTestClass(instance); - } - - @Override - public void afterTestClass() throws Exception { - super.afterTestClass(); - // remove the log appender - logAppender.disableFor(LoggerFactory.getLogger(RequestHandler.class)); - logAppender = null; - } - @Test(groups = "short") - public void should_expose_warnings_on_execution_info() { + public void should_expose_warnings_on_execution_info() throws Exception { // the default batch size warn threshold is 5 * 1024 bytes, but after CASSANDRA-10876 there must // be // multiple mutations in a batch to trigger this warning so the batch includes 2 different @@ -63,28 +44,32 @@ public void should_expose_warnings_on_execution_info() { + "INSERT INTO foo (k, v) VALUES (2, '%s')\n" + "APPLY BATCH", Strings.repeat("1", 2 * 1024), Strings.repeat("1", 3 * 1024)); - ResultSet rs = session().execute(query); - - List warnings = rs.getExecutionInfo().getWarnings(); - assertThat(warnings).hasSize(1); - // also assert that by default, the warning is logged and truncated to - // DEFAULT_MAX_QUERY_STRING_LENGTH - String log = logAppender.getNext(); - assertThat(log).isNotNull(); - assertThat(log).isNotEmpty(); - assertThat(log) - .startsWith("Query '") - // query will only be logged up to QueryLogger.DEFAULT_MAX_QUERY_STRING_LENGTH characters - .contains(query.substring(0, QueryLogger.DEFAULT_MAX_QUERY_STRING_LENGTH)) - .contains("' generated server side warning(s): ") - .contains( - String.format( - "Batch for [%s.foo] is of size 5152, exceeding specified threshold of 5120 by 32.", - keyspace)); + MemoryAppender logAppender = new MemoryAppender(); + logAppender.enableFor(RequestHandler.class); + try { + ResultSet rs = session().execute(query); + List warnings = rs.getExecutionInfo().getWarnings(); + assertThat(warnings).hasSize(1); + // also assert that by default, the warning is logged and truncated to + // DEFAULT_MAX_QUERY_STRING_LENGTH + String log = logAppender.waitAndGet(2000); + assertThat(log).isNotEmpty(); + assertThat(log) + .startsWith("Query '") + // query will only be logged up to QueryLogger.DEFAULT_MAX_QUERY_STRING_LENGTH characters + .contains(query.substring(0, QueryLogger.DEFAULT_MAX_QUERY_STRING_LENGTH)) + .contains("' generated server side warning(s): ") + .contains( + String.format( + "Batch for [%s.foo] is of size 5152, exceeding specified threshold of 5120 by 32.", + keyspace)); + } finally { + logAppender.disableFor(RequestHandler.class); + } } @Test(groups = "short") - public void should_execute_query_and_log_server_side_warnings() { + public void should_execute_query_and_log_server_side_warnings() throws Exception { // Assert that logging of server-side query warnings is NOT disabled assertThat(Boolean.getBoolean(RequestHandler.DISABLE_QUERY_WARNING_LOGS)).isFalse(); @@ -93,29 +78,34 @@ public void should_execute_query_and_log_server_side_warnings() { final String query = "SELECT count(*) FROM foo;"; SimpleStatement statement = new SimpleStatement(query); // When the query is executed - ResultSet rs = session().execute(statement); - // Then the result has 1 Row - Row row = rs.one(); - assertThat(row).isNotNull(); - // And there is a server side warning captured in the ResultSet's ExecutionInfo - ExecutionInfo ei = rs.getExecutionInfo(); - List warnings = ei.getWarnings(); - assertThat(warnings).isNotEmpty(); - assertThat(warnings.size()).isEqualTo(1); - assertThat(warnings.get(0)).isEqualTo("Aggregation query used without partition key"); - // And the driver logged the server side warning - String log = logAppender.getNext(); - assertThat(log).isNotNull(); - assertThat(log).isNotEmpty(); - assertThat(log) - .startsWith( - "Query '[0 bound values] " - + query - + "' generated server side warning(s): Aggregation query used without partition key"); + MemoryAppender logAppender = new MemoryAppender(); + logAppender.enableFor(RequestHandler.class); + try { + ResultSet rs = session().execute(statement); + // Then the result has 1 Row + Row row = rs.one(); + assertThat(row).isNotNull(); + // And there is a server side warning captured in the ResultSet's ExecutionInfo + ExecutionInfo ei = rs.getExecutionInfo(); + List warnings = ei.getWarnings(); + assertThat(warnings).isNotEmpty(); + assertThat(warnings.size()).isEqualTo(1); + assertThat(warnings.get(0)).isEqualTo("Aggregation query used without partition key"); + // And the driver logged the server side warning + String log = logAppender.waitAndGet(2000); + assertThat(log).isNotEmpty(); + assertThat(log) + .startsWith( + "Query '[0 bound values] " + + query + + "' generated server side warning(s): Aggregation query used without partition key"); + } finally { + logAppender.disableFor(RequestHandler.class); + } } @Test(groups = "isolated") - public void should_execute_query_and_not_log_server_side_warnings() { + public void should_execute_query_and_not_log_server_side_warnings() throws Exception { // Get the system property value for disabling logging server side warnings final String disabledLogFlag = System.getProperty(RequestHandler.DISABLE_QUERY_WARNING_LOGS, "false"); @@ -128,19 +118,25 @@ public void should_execute_query_and_not_log_server_side_warnings() { // ExecutionInfo SimpleStatement statement = new SimpleStatement("SELECT count(*) FROM foo"); // When the query is executed - ResultSet rs = session().execute(statement); - // Then the result has 1 Row - Row row = rs.one(); - assertThat(row).isNotNull(); - // And there is a server side warning captured in the ResultSet's ExecutionInfo - ExecutionInfo ei = rs.getExecutionInfo(); - List warnings = ei.getWarnings(); - assertThat(warnings).isNotEmpty(); - assertThat(warnings.size()).isEqualTo(1); - assertThat(warnings.get(0)).isEqualTo("Aggregation query used without partition key"); - // And the driver did NOT log the server side warning - String log = logAppender.getNext(); - assertThat(log).isNullOrEmpty(); + MemoryAppender logAppender = new MemoryAppender(); + logAppender.enableFor(RequestHandler.class); + try { + ResultSet rs = session().execute(statement); + // Then the result has 1 Row + Row row = rs.one(); + assertThat(row).isNotNull(); + // And there is a server side warning captured in the ResultSet's ExecutionInfo + ExecutionInfo ei = rs.getExecutionInfo(); + List warnings = ei.getWarnings(); + assertThat(warnings).isNotEmpty(); + assertThat(warnings.size()).isEqualTo(1); + assertThat(warnings.get(0)).isEqualTo("Aggregation query used without partition key"); + // And the driver did NOT log the server side warning + String log = logAppender.waitAndGet(2000); + assertThat(log).isNullOrEmpty(); + } finally { + logAppender.disableFor(RequestHandler.class); + } } finally { // reset the logging flag System.setProperty(RequestHandler.DISABLE_QUERY_WARNING_LOGS, disabledLogFlag); From 5fe82e4bf429c0f66cd42ee3906b4b78839b9da7 Mon Sep 17 00:00:00 2001 From: Aki <36778587+aki-ks@users.noreply.github.com> Date: Tue, 2 Apr 2019 00:18:05 +0200 Subject: [PATCH 026/211] getMetadata() is a member of Cluster, not Session (#1214) --- manual/udts/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual/udts/README.md b/manual/udts/README.md index 7221ba5cc4b..87090aa5901 100644 --- a/manual/udts/README.md +++ b/manual/udts/README.md @@ -61,7 +61,7 @@ various ways to get it: * from the driver's [schema metadata](../metadata/#schema-metadata): ```java - UserType udt = session.getMetadata().getKeyspace("ks").getUserType("type1"); + UserType udt = session.getCluster().getMetadata().getKeyspace("ks").getUserType("type1"); ``` * from another UDT value: From 4b5c104dfd6f62678c776e44023664e7ece38143 Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Wed, 20 Mar 2019 15:03:26 -0500 Subject: [PATCH 027/211] JAVA-2193: Fix flaky tests in WarningsTest --- changelog/README.md | 1 + .../com/datastax/driver/core/WarningsTest.java | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 2b32d3ead94..2e42cd1bd3d 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -3,6 +3,7 @@ ### 3.7.1 - [bug] JAVA-2174: Metadata.needsQuote should accept empty strings. +- [bug] JAVA-2193: Fix flaky tests in WarningsTest ### 3.7.0 diff --git a/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java b/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java index d753eb3a074..870ecf81380 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java @@ -23,7 +23,6 @@ import org.testng.annotations.Test; @CCMConfig(config = {"batch_size_warn_threshold_in_kb:5"}) -@CassandraVersion("2.2.0") public class WarningsTest extends CCMTestsSupport { @Override @@ -32,6 +31,7 @@ public void onTestContextInitialized() { } @Test(groups = "short") + @CassandraVersion("2.2.0") public void should_expose_warnings_on_execution_info() throws Exception { // the default batch size warn threshold is 5 * 1024 bytes, but after CASSANDRA-10876 there must // be @@ -49,7 +49,8 @@ public void should_expose_warnings_on_execution_info() throws Exception { try { ResultSet rs = session().execute(query); List warnings = rs.getExecutionInfo().getWarnings(); - assertThat(warnings).hasSize(1); + // some versions of Cassandra will generate more than 1 log for this query + assertThat(warnings).isNotEmpty(); // also assert that by default, the warning is logged and truncated to // DEFAULT_MAX_QUERY_STRING_LENGTH String log = logAppender.waitAndGet(2000); @@ -59,16 +60,16 @@ public void should_expose_warnings_on_execution_info() throws Exception { // query will only be logged up to QueryLogger.DEFAULT_MAX_QUERY_STRING_LENGTH characters .contains(query.substring(0, QueryLogger.DEFAULT_MAX_QUERY_STRING_LENGTH)) .contains("' generated server side warning(s): ") - .contains( - String.format( - "Batch for [%s.foo] is of size 5152, exceeding specified threshold of 5120 by 32.", - keyspace)); + .contains("Batch") + .contains(String.format("for [%s.foo] is of size", keyspace)) + .contains(", exceeding specified threshold"); } finally { logAppender.disableFor(RequestHandler.class); } } @Test(groups = "short") + @CassandraVersion("3.0.0") public void should_execute_query_and_log_server_side_warnings() throws Exception { // Assert that logging of server-side query warnings is NOT disabled assertThat(Boolean.getBoolean(RequestHandler.DISABLE_QUERY_WARNING_LOGS)).isFalse(); @@ -105,6 +106,7 @@ public void should_execute_query_and_log_server_side_warnings() throws Exception } @Test(groups = "isolated") + @CassandraVersion("3.0.0") public void should_execute_query_and_not_log_server_side_warnings() throws Exception { // Get the system property value for disabling logging server side warnings final String disabledLogFlag = From 79f40513980f7706c944416dbf8b39a33261dbf2 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 8 Apr 2019 14:20:34 +0200 Subject: [PATCH 028/211] Fix wrong log category in manual page on compression --- manual/compression/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manual/compression/README.md b/manual/compression/README.md index d7d24fa8a31..8d593fb6c72 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -56,11 +56,11 @@ LZ4-java has three internal implementations (from fastest to slowest): It will pick the best implementation depending on what's possible on your platform. To find out which one was chosen, [enable INFO logs](../logging/) on the category -`com.datastax.driver.core.FrameCompressor` and look for a log similar to +`com.datastax.driver.core.LZ4Compressor` and look for a log similar to this: ``` -INFO com.datastax.driver.core.FrameCompressor - Using LZ4Factory:JNI +INFO com.datastax.driver.core.LZ4Compressor - Using LZ4Factory:JNI ``` ### Snappy From 2cd92139e3c91e278ace50f82bea1185e8422497 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 8 Apr 2019 14:28:55 +0200 Subject: [PATCH 029/211] Remove feedback form from main README page --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 51df608aae8..339fc0d2838 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,6 @@ docs](http://docs.datastax.com/en/developer/java-driver/latest/index.html) or vi [e.g. 3.7.1](https://github.com/datastax/java-driver/tree/3.7.1).* -_**Feeback requested!** Help us focus our efforts, provide your input on -the [Platform and Runtime Survey](http://goo.gl/forms/qwUE6qnL7U) (we kept it short)._ - A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol and Cassandra Query Language v3. _Use the [DataStax Enterprise Java driver][dse-driver] From 85f2ced0584867c76df3024bc97de9f0038c0908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Jastrz=C4=99bski?= Date: Fri, 22 Feb 2019 13:28:04 +0100 Subject: [PATCH 030/211] Avoid full cluster scans in Connection.checkClusterName (#1195) Select without a partition key results in full cluster scan that can hurt the performance of the cluster. There is an easy solution to the problem by just using a 'local' partition key for the query. Signed-off-by: Piotr Jastrzebski --- .../src/main/java/com/datastax/driver/core/Connection.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java index bf9c4ab5f84..1b92a57c47f 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java @@ -382,7 +382,9 @@ private ListenableFuture checkClusterName( DefaultResultSetFuture clusterNameFuture = new DefaultResultSetFuture( - null, protocolVersion, new Requests.Query("select cluster_name from system.local")); + null, + protocolVersion, + new Requests.Query("select cluster_name from system.local where key = 'local'")); try { write(clusterNameFuture); return GuavaCompatibility.INSTANCE.transformAsync( From 0bd9e50cec5c359132c472fadabc48e76be9a513 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 27 May 2019 13:57:20 +0200 Subject: [PATCH 031/211] Suppress deprecation warnings in ControlConnection when calling Host.getDseVersion() --- .../com/datastax/driver/core/ControlConnection.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java b/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java index 84e6bfad56f..91645ecefb4 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java @@ -395,14 +395,17 @@ static void refreshSchema( } else { cassandraVersion = host.getCassandraVersion(); } - VersionNumber dseVersion; SchemaParser schemaParser; - // If using DSE, derive parser from DSE version. - if (host == null || host.getDseVersion() == null) { + if (host == null) { schemaParser = SchemaParser.forVersion(cassandraVersion); } else { - dseVersion = host.getDseVersion(); - schemaParser = SchemaParser.forDseVersion(dseVersion); + @SuppressWarnings("deprecation") + VersionNumber dseVersion = host.getDseVersion(); + // If using DSE, derive parser from DSE version. + schemaParser = + dseVersion == null + ? SchemaParser.forVersion(cassandraVersion) + : SchemaParser.forDseVersion(dseVersion); } schemaParser.refresh( From 4aef6a81feca2378282f3edff9270cf1781b8e18 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 27 May 2019 13:57:43 +0200 Subject: [PATCH 032/211] Suppress deprecation warnings in GuavaCompatibility --- .../com/datastax/driver/core/GuavaCompatibility.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java b/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java index c4626ca539f..a0e7fe8ec55 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java +++ b/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java @@ -22,7 +22,6 @@ import com.google.common.reflect.TypeToken; import com.google.common.util.concurrent.AsyncFunction; import com.google.common.util.concurrent.FutureCallback; -import com.google.common.util.concurrent.FutureFallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; @@ -71,7 +70,7 @@ public static void init() { * Returns a {@code Future} whose result is taken from the given primary {@code input} or, if the * primary input fails, from the {@code Future} provided by the {@code fallback}. * - * @see Futures#withFallback(ListenableFuture, FutureFallback) + * @see Futures#withFallback(ListenableFuture, com.google.common.util.concurrent.FutureFallback) * @see Futures#catchingAsync(ListenableFuture, Class, AsyncFunction) */ public abstract ListenableFuture withFallback( @@ -81,7 +80,8 @@ public abstract ListenableFuture withFallback( * Returns a {@code Future} whose result is taken from the given primary {@code input} or, if the * primary input fails, from the {@code Future} provided by the {@code fallback}. * - * @see Futures#withFallback(ListenableFuture, FutureFallback, Executor) + * @see Futures#withFallback(ListenableFuture, com.google.common.util.concurrent.FutureFallback, + * Executor) * @see Futures#catchingAsync(ListenableFuture, Class, AsyncFunction, Executor) */ public abstract ListenableFuture withFallback( @@ -201,7 +201,7 @@ public ListenableFuture withFallback( ListenableFuture input, final AsyncFunction fallback) { return Futures.withFallback( input, - new FutureFallback() { + new com.google.common.util.concurrent.FutureFallback() { @Override public ListenableFuture create(Throwable t) throws Exception { return fallback.apply(t); @@ -216,7 +216,7 @@ public ListenableFuture withFallback( Executor executor) { return Futures.withFallback( input, - new FutureFallback() { + new com.google.common.util.concurrent.FutureFallback() { @Override public ListenableFuture create(Throwable t) throws Exception { return fallback.apply(t); From f2fb30e7e567d930fac6dc755abf0ed9c485df3b Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 27 May 2019 13:58:20 +0200 Subject: [PATCH 033/211] Suppress generic varargs array creation warning in PercentileTracker --- .../main/java/com/datastax/driver/core/PercentileTracker.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/PercentileTracker.java b/driver-core/src/main/java/com/datastax/driver/core/PercentileTracker.java index 1e8be97c5a7..5821866d11f 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/PercentileTracker.java +++ b/driver-core/src/main/java/com/datastax/driver/core/PercentileTracker.java @@ -263,8 +263,9 @@ protected boolean include(Host host, Statement statement, Exception exception) { * errors are not good indicators of the host's responsiveness, and tend to make the host's score * look better than it actually is. */ + @SuppressWarnings("unchecked") private static final Set> EXCLUDED_EXCEPTIONS = - ImmutableSet.>of( + ImmutableSet.of( UnavailableException.class, // this is done via the snitch and is usually very fast OverloadedException.class, BootstrappingException.class, From 9c957fce19fe4eef24e119125b9cffdc8a65c548 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 27 May 2019 14:00:09 +0200 Subject: [PATCH 034/211] Suppress deprecation warnings for deprecated methods in DCAwareRoundRobinPolicy --- .../driver/core/policies/DCAwareRoundRobinPolicyTest.java | 6 ++++++ .../datastax/driver/core/policies/TokenAwarePolicyTest.java | 1 + 2 files changed, 7 insertions(+) diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java index 8c48b04b184..a8c96c9acbf 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java @@ -121,6 +121,7 @@ public void should_round_robin_within_local_dc() { public void should_not_use_remote_hosts_if_some_nodes_are_up_in_local_dc() { // given: a 10 node 2 DC cluster with DC policy with 2 remote hosts. ScassandraCluster sCluster = ScassandraCluster.builder().withNodes(5, 5).build(); + @SuppressWarnings("deprecation") Cluster cluster = builder() .addContactPoints(sCluster.address(1, 1).getAddress()) @@ -169,6 +170,7 @@ public void should_not_use_remote_hosts_if_some_nodes_are_up_in_local_dc() { public void should_round_robin_on_remote_hosts_when_no_up_nodes_in_local_dc() { // given: a 10 node 2 DC cluster with DC policy with 2 remote hosts. ScassandraCluster sCluster = ScassandraCluster.builder().withNodes(5, 5).build(); + @SuppressWarnings("deprecation") Cluster cluster = builder() .addContactPoints(sCluster.address(1, 1).getAddress()) @@ -218,6 +220,7 @@ public void should_only_use_remote_hosts_when_using_non_dc_local_cl(ConsistencyL // given: a 4 node 2 DC Cluster with a LB policy that specifies to not allow remote dcs for // a local consistency level. ScassandraCluster sCluster = ScassandraCluster.builder().withNodes(2, 2).build(); + @SuppressWarnings("deprecation") Cluster cluster = builder() .addContactPoints(sCluster.address(1, 1).getAddress()) @@ -271,6 +274,7 @@ public void should_use_remote_hosts_for_local_cl_when_allowed(ConsistencyLevel c // given: a 4 node 2 DC Cluster with a LB policy that specifies to allow remote dcs for // a local consistency level. ScassandraCluster sCluster = ScassandraCluster.builder().withNodes(2, 2).build(); + @SuppressWarnings("deprecation") Cluster cluster = builder() .addContactPoints(sCluster.address(1, 1).getAddress()) @@ -317,6 +321,7 @@ public void should_use_remote_hosts_for_local_cl_when_allowed(ConsistencyLevel c public void should_not_send_requests_to_blacklisted_dc_using_host_filter_policy() { // given: a 6 node 3 DC cluster with a DCAwareRoundRobinPolicy that is filtering hosts in DC2. ScassandraCluster sCluster = ScassandraCluster.builder().withNodes(2, 2, 2).build(); + @SuppressWarnings("deprecation") LoadBalancingPolicy loadBalancingPolicy = HostFilterPolicy.fromDCBlackList( DCAwareRoundRobinPolicy.builder().withUsedHostsPerRemoteDc(2).build(), @@ -374,6 +379,7 @@ public void should_send_requests_to_whitelisted_dcs_using_host_filter_policy() { // given: a 6 node 3 DC cluster with a DCAwareRoundRobinPolicy that is whitelisting hosts in DC1 // and DC2. ScassandraCluster sCluster = ScassandraCluster.builder().withNodes(2, 2, 2).build(); + @SuppressWarnings("deprecation") LoadBalancingPolicy loadBalancingPolicy = HostFilterPolicy.fromDCWhiteList( DCAwareRoundRobinPolicy.builder().withUsedHostsPerRemoteDc(2).build(), diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/TokenAwarePolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/TokenAwarePolicyTest.java index d75f972904b..2bc7ff201be 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/policies/TokenAwarePolicyTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/policies/TokenAwarePolicyTest.java @@ -275,6 +275,7 @@ public void should_choose_host_in_local_dc_when_using_network_topology_strategy_ .withNodes(3, 3) .withNetworkTopologyKeyspace("keyspace", ImmutableMap.of(1, 1, 2, 1)) .build(); + @SuppressWarnings("deprecation") Cluster cluster = Cluster.builder() .addContactPoints(sCluster.address(1).getAddress()) From 4dea50389c607e9b399d07223633671e13f7270d Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 27 May 2019 14:01:20 +0200 Subject: [PATCH 035/211] Suppress deprecation warnings for usages of DowngradingConsistencyRetryPolicy --- .../driver/core/QueryTimestampTest.java | 24 +++++++++++-------- .../com/datastax/driver/core/TracingTest.java | 9 +++++-- .../examples/retry/DowngradingRetry.java | 6 ++--- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/driver-core/src/test/java/com/datastax/driver/core/QueryTimestampTest.java b/driver-core/src/test/java/com/datastax/driver/core/QueryTimestampTest.java index 27289bf6ea6..e4beebb14c1 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/QueryTimestampTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/QueryTimestampTest.java @@ -18,8 +18,8 @@ import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; +import com.datastax.driver.core.Cluster.Builder; import com.datastax.driver.core.Metrics.Errors; -import com.datastax.driver.core.policies.DowngradingConsistencyRetryPolicy; import com.datastax.driver.core.utils.CassandraVersion; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -37,15 +37,19 @@ public void onTestContextInitialized() { @Override public Cluster.Builder createClusterBuilder() { - return Cluster.builder() - .withTimestampGenerator( - new TimestampGenerator() { - @Override - public long next() { - return timestampFromGenerator; - } - }) - .withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE); + @SuppressWarnings("deprecation") + Builder builder = + Cluster.builder() + .withTimestampGenerator( + new TimestampGenerator() { + @Override + public long next() { + return timestampFromGenerator; + } + }) + .withRetryPolicy( + com.datastax.driver.core.policies.DowngradingConsistencyRetryPolicy.INSTANCE); + return builder; } @BeforeMethod(groups = "short") diff --git a/driver-core/src/test/java/com/datastax/driver/core/TracingTest.java b/driver-core/src/test/java/com/datastax/driver/core/TracingTest.java index f8e09b689fb..9c464e67e22 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/TracingTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/TracingTest.java @@ -17,7 +17,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.datastax.driver.core.policies.DowngradingConsistencyRetryPolicy; +import com.datastax.driver.core.Cluster.Builder; import com.datastax.driver.core.utils.CassandraVersion; import com.google.common.util.concurrent.Uninterruptibles; import java.util.List; @@ -32,7 +32,12 @@ public class TracingTest extends CCMTestsSupport { @Override public Cluster.Builder createClusterBuilder() { - return Cluster.builder().withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE); + @SuppressWarnings("deprecation") + Builder builder = + Cluster.builder() + .withRetryPolicy( + com.datastax.driver.core.policies.DowngradingConsistencyRetryPolicy.INSTANCE); + return builder; } @Override diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/retry/DowngradingRetry.java b/driver-examples/src/main/java/com/datastax/driver/examples/retry/DowngradingRetry.java index 7e10bcbe69b..5db45856a6b 100644 --- a/driver-examples/src/main/java/com/datastax/driver/examples/retry/DowngradingRetry.java +++ b/driver-examples/src/main/java/com/datastax/driver/examples/retry/DowngradingRetry.java @@ -33,12 +33,12 @@ import com.datastax.driver.core.exceptions.ReadTimeoutException; import com.datastax.driver.core.exceptions.UnavailableException; import com.datastax.driver.core.exceptions.WriteTimeoutException; -import com.datastax.driver.core.policies.DowngradingConsistencyRetryPolicy; import java.text.SimpleDateFormat; /** - * This example illustrates how to replace the deprecated {@link DowngradingConsistencyRetryPolicy} - * with equivalent application logic. + * This example illustrates how to replace the deprecated {@link + * com.datastax.driver.core.policies.DowngradingConsistencyRetryPolicy} with equivalent application + * logic. * *

    Preconditions: * From 7466c228b357a7f5898ecd0b0d6bf8d0e0c58e3e Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 27 May 2019 14:18:13 +0200 Subject: [PATCH 036/211] Suppress various warnings in DCAwareRoundRobinPolicyTest --- .../core/policies/DCAwareRoundRobinPolicyTest.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java index a8c96c9acbf..078166de0c0 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java @@ -46,12 +46,13 @@ public class DCAwareRoundRobinPolicyTest { - Logger policyLogger = Logger.getLogger(DCAwareRoundRobinPolicy.class); - Level originalLevel; - MemoryAppender logs; - QueryTracker queryTracker; + private final Logger policyLogger = Logger.getLogger(DCAwareRoundRobinPolicy.class); + private Level originalLevel; + private MemoryAppender logs; + private QueryTracker queryTracker; - @Captor ArgumentCaptor> initHostsCaptor; + @Captor + private ArgumentCaptor> initHostsCaptor; @BeforeMethod(groups = "short") public void setUp() { @@ -260,7 +261,7 @@ public void should_only_use_remote_hosts_when_using_non_dc_local_cl(ConsistencyL /** * Ensures that {@link DCAwareRoundRobinPolicy} will use remote hosts for non DC local Consistency - * Levels if {@link DCAwareRoundRobinPolicy.Builder#allowRemoteDCsForLocalConsistencyLevel} is + * Levels if {@code DCAwareRoundRobinPolicy.Builder#allowRemoteDCsForLocalConsistencyLevel} is * used. In the case that a DC local Consistency Level is provided a {@link * NoHostAvailableException} is raised. * From 4258b222e51264239e5ca6a08040e197f8d248b1 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 27 May 2019 14:39:03 +0200 Subject: [PATCH 037/211] Fix ScassandraCluster stubbed queries after 85f2ced05 (Avoid full cluster scans in Connection.checkClusterName) --- .../test/java/com/datastax/driver/core/ScassandraCluster.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java b/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java index 6db989b8511..bd9e62be7cd 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java @@ -42,7 +42,6 @@ import java.util.List; import java.util.Map; import java.util.TreeSet; -import java.util.UUID; import java.util.concurrent.TimeUnit; import org.scassandra.Scassandra; import org.scassandra.ScassandraFactory; @@ -552,7 +551,7 @@ private void primeMetadata(Scassandra node) { ImmutableMap.builder().put("cluster_name", "scassandra").build(); client.prime( PrimingRequest.queryBuilder() - .withQuery("select cluster_name from system.local") + .withQuery("select cluster_name from system.local where key = 'local'") .withThen( then() .withColumnTypes(SELECT_CLUSTER_NAME) From 669a4c20ef64fa125339ab40ebd8baae280ad878 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 27 May 2019 14:43:37 +0200 Subject: [PATCH 038/211] Fix formatting issue in DCAwareRoundRobinPolicyTest --- .../driver/core/policies/DCAwareRoundRobinPolicyTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java index 078166de0c0..4dc79359352 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java @@ -51,8 +51,7 @@ public class DCAwareRoundRobinPolicyTest { private MemoryAppender logs; private QueryTracker queryTracker; - @Captor - private ArgumentCaptor> initHostsCaptor; + @Captor private ArgumentCaptor> initHostsCaptor; @BeforeMethod(groups = "short") public void setUp() { From 29bb2806d11ec302ba1dbf502159d33050cc1a7b Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 27 May 2019 14:28:39 +0200 Subject: [PATCH 039/211] Log query warnings before setting the final result Motivation: Currently the callback result is set _before_ the query warnings are logged. As a consequence, client code dependent on the callback's completion may get executed before the warnings are logged. Modification: Set the callback result after the query warnings are logged. Result: Client code is guaranteed to be executed after the query warnings are logged. --- .../src/main/java/com/datastax/driver/core/RequestHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java b/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java index 6b968f5d7be..f2718f6b5a2 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java +++ b/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java @@ -225,7 +225,6 @@ private void setFinalResult( execution.retryConsistencyLevel, response.getCustomPayload()); } - callback.onSet(connection, response, info, statement, System.nanoTime() - startTime); // if the response from the server has warnings, they'll be set on the ExecutionInfo. Log them // here, unless they've been disabled. if (response.warnings != null @@ -234,6 +233,7 @@ private void setFinalResult( && logger.isWarnEnabled()) { logServerWarnings(response.warnings); } + callback.onSet(connection, response, info, statement, System.nanoTime() - startTime); } catch (Exception e) { callback.onException( connection, From e4d9deedea62719a237ed326ea72a95ca030355e Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 27 May 2019 14:30:01 +0200 Subject: [PATCH 040/211] Fix incorrect assertion in WarningsTest Depending on the DSE version, the message may contain "[keyspace.table]" or "{keyspace.table}". --- .../test/java/com/datastax/driver/core/WarningsTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java b/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java index 870ecf81380..bf411aac689 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java @@ -34,8 +34,7 @@ public void onTestContextInitialized() { @CassandraVersion("2.2.0") public void should_expose_warnings_on_execution_info() throws Exception { // the default batch size warn threshold is 5 * 1024 bytes, but after CASSANDRA-10876 there must - // be - // multiple mutations in a batch to trigger this warning so the batch includes 2 different + // be multiple mutations in a batch to trigger this warning so the batch includes 2 different // inserts. final String query = String.format( @@ -61,7 +60,8 @@ public void should_expose_warnings_on_execution_info() throws Exception { .contains(query.substring(0, QueryLogger.DEFAULT_MAX_QUERY_STRING_LENGTH)) .contains("' generated server side warning(s): ") .contains("Batch") - .contains(String.format("for [%s.foo] is of size", keyspace)) + .contains(keyspace + ".foo") + .contains(" is of size") .contains(", exceeding specified threshold"); } finally { logAppender.disableFor(RequestHandler.class); From 3d69a3e7980932f480f6f94f32d40c8ae2e8feac Mon Sep 17 00:00:00 2001 From: olim7t Date: Fri, 7 Jun 2019 09:17:49 -0700 Subject: [PATCH 041/211] Remove date from copyright in root README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 339fc0d2838..9996ca0440b 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ If you are upgrading to _DataStax Enterprise_, use the [DataStax Enterprise Java features and better compatibility. ## License -Copyright 2012-2018, DataStax +Copyright DataStax, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From b155cf567e887b41fc876ed3acc1e70a01e04788 Mon Sep 17 00:00:00 2001 From: Amanda Chow Date: Thu, 13 Jun 2019 04:30:35 -0400 Subject: [PATCH 042/211] JAVA-2249: Remove stripTrailingZeroBytes from OPPToken (#1234) --- changelog/README.md | 4 ++++ .../java/com/datastax/driver/core/Token.java | 19 +++---------------- .../driver/core/OPPTokenFactoryTest.java | 16 ++++++---------- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 2e42cd1bd3d..cb4418f7b2f 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -1,5 +1,9 @@ ## Changelog +### 3.7.2 (In progress) + +- [bug] JAVA-2249: Stop stripping trailing zeros in ByteOrderedTokens + ### 3.7.1 - [bug] JAVA-2174: Metadata.needsQuote should accept empty strings. diff --git a/driver-core/src/main/java/com/datastax/driver/core/Token.java b/driver-core/src/main/java/com/datastax/driver/core/Token.java index 733cb604e43..a3a1000d6c6 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Token.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Token.java @@ -418,7 +418,8 @@ List split(Token startToken, Token endToken, int numberOfSplits) { start = toBigInteger(oppStartToken.value, significantBytes); end = toBigInteger(oppEndToken.value, significantBytes); range = end.subtract(start); - if (addedBytes == 4 || range.compareTo(bigNumberOfSplits) >= 0) break; + if (addedBytes == 4 || start.equals(end) || range.compareTo(bigNumberOfSplits) >= 0) + break; significantBytes += 1; addedBytes += 1; } @@ -486,21 +487,7 @@ protected ByteBuffer toBytes(BigInteger value, int significantBytes) { @VisibleForTesting OPPToken(ByteBuffer value) { - this.value = stripTrailingZeroBytes(value); - } - - /** @return A new ByteBuffer from the input Buffer with any trailing 0-bytes stripped off. */ - private static ByteBuffer stripTrailingZeroBytes(ByteBuffer b) { - byte result[] = Bytes.getArray(b); - int zeroIndex = result.length; - for (int i = result.length - 1; i > 0; i--) { - if (result[i] == 0) { - zeroIndex = i; - } else { - break; - } - } - return ByteBuffer.wrap(result, 0, zeroIndex); + this.value = value; } @Override diff --git a/driver-core/src/test/java/com/datastax/driver/core/OPPTokenFactoryTest.java b/driver-core/src/test/java/com/datastax/driver/core/OPPTokenFactoryTest.java index adae7ff8240..32141d33d9e 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/OPPTokenFactoryTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/OPPTokenFactoryTest.java @@ -17,6 +17,7 @@ import static org.assertj.core.api.Assertions.assertThat; +import com.datastax.driver.core.utils.Bytes; import java.math.BigInteger; import java.nio.ByteBuffer; import java.util.List; @@ -46,17 +47,12 @@ public void should_split_range_producing_empty_splits_near_ring_end() { } @Test(groups = "unit") - public void should_strip_trailing_0_bytes() { - Token with0Bytes = token(ByteBuffer.wrap(new byte[] {4, 0, 0, 0})); - Token without0Bytes = token(ByteBuffer.wrap(new byte[] {4})); - Token fromStringWith0Bytes = factory.fromString("040000"); + public void should_split_range_where_start_as_int_equals_end_as_int() { + Token start = token(Bytes.fromHexString("0x11")); + Token end = token(Bytes.fromHexString("0x1100")); - assertThat(with0Bytes).isEqualTo(without0Bytes).isEqualTo(fromStringWith0Bytes); - - Token withMixed0Bytes = factory.fromString("0004000400"); - Token withoutMixed0Bytes = factory.fromString("00040004"); - - assertThat(withMixed0Bytes).isEqualTo(withoutMixed0Bytes); + List splits = factory.split(start, end, 3); + assertThat(splits).containsExactly(end, end); } @Test(groups = "unit") From fc44d4dd26b8228f8df5196739836316be01a7d6 Mon Sep 17 00:00:00 2001 From: olim7t Date: Wed, 26 Jun 2019 10:30:10 -0700 Subject: [PATCH 043/211] Upgrade fmt-maven-plugin to 2.9 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 86c621d4854..3b2c2fcefcc 100644 --- a/pom.xml +++ b/pom.xml @@ -658,7 +658,7 @@ com.coveo fmt-maven-plugin - 2.5.1 + 2.9 From 06c9022d9cd9c8fbcdfcbb407b05b5185ef2fef2 Mon Sep 17 00:00:00 2001 From: Olivier Michallat Date: Thu, 4 Jul 2019 06:39:05 -0700 Subject: [PATCH 044/211] JAVA-1492: Don't immediately reuse busy connections for another request (#1282) --- changelog/README.md | 1 + .../main/java/com/datastax/driver/core/Connection.java | 9 +++++++-- .../com/datastax/driver/core/HostConnectionPool.java | 4 ++-- .../java/com/datastax/driver/core/RequestHandler.java | 2 +- .../com/datastax/driver/core/HostConnectionPoolTest.java | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index cb4418f7b2f..b2868cd1cc9 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -3,6 +3,7 @@ ### 3.7.2 (In progress) - [bug] JAVA-2249: Stop stripping trailing zeros in ByteOrderedTokens +- [bug] JAVA-1492: Don't immediately reuse busy connections for another request ### 3.7.1 diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java index 1b92a57c47f..2aa22a9ad5f 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java @@ -807,9 +807,14 @@ boolean setOwner(Owner owner) { * If the connection is part of a pool, return it to the pool. The connection should generally not * be reused after that. */ - void release() { + void release(boolean busy) { Owner owner = ownerRef.get(); - if (owner instanceof HostConnectionPool) ((HostConnectionPool) owner).returnConnection(this); + if (owner instanceof HostConnectionPool) + ((HostConnectionPool) owner).returnConnection(this, busy); + } + + void release() { + release(false); } boolean isClosed() { diff --git a/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java b/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java index aa17a0ea2b1..c723808bf74 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java +++ b/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java @@ -344,7 +344,7 @@ private ListenableFuture enqueue(long timeout, TimeUnit unit, int ma return pendingBorrow.future; } - void returnConnection(Connection connection) { + void returnConnection(Connection connection, boolean busy) { connection.inFlight.decrementAndGet(); totalInFlight.decrementAndGet(); @@ -362,7 +362,7 @@ void returnConnection(Connection connection) { if (connection.state.get() != TRASHED) { if (connection.maxAvailableStreams() < minAllowedStreams) { replaceConnection(connection); - } else { + } else if (!busy) { dequeue(connection); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java b/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java index f2718f6b5a2..5094c4f1bc7 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java +++ b/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java @@ -423,7 +423,7 @@ public void onSuccess(Connection connection) { } catch (BusyConnectionException e) { // The pool shouldn't have give us a busy connection unless we've maxed up the pool, // so move on to the next host. - connection.release(); + connection.release(true); logError(host.getSocketAddress(), e); findNextHostAndQuery(); } catch (RuntimeException e) { diff --git a/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolTest.java b/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolTest.java index cad07e2ce27..916499904c8 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolTest.java @@ -798,7 +798,7 @@ public void should_trash_on_returning_connection_with_insufficient_streams() thr // On returning of the connection, should detect that there are no available streams and trash // it. assertThat(pool.trash).hasSize(0); - pool.returnConnection(extra1); + pool.returnConnection(extra1, false); assertThat(pool.trash).hasSize(1); } finally { MockRequest.completeAll(allRequests); From 64709f4737439a5a7acc6ba85022f51a0caad65e Mon Sep 17 00:00:00 2001 From: Olivier Michallat Date: Thu, 4 Jul 2019 06:40:23 -0700 Subject: [PATCH 045/211] JAVA-2198: Handle UDTs with names that clash with collection types (#1283) --- changelog/README.md | 8 +-- .../driver/core/DataTypeCqlNameParser.java | 51 ++++++++++--------- .../datastax/driver/core/UserTypesTest.java | 15 ++++++ 3 files changed, 47 insertions(+), 27 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index b2868cd1cc9..aeaff54bf3d 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -2,13 +2,15 @@ ### 3.7.2 (In progress) -- [bug] JAVA-2249: Stop stripping trailing zeros in ByteOrderedTokens -- [bug] JAVA-1492: Don't immediately reuse busy connections for another request +- [bug] JAVA-2249: Stop stripping trailing zeros in ByteOrderedTokens. +- [bug] JAVA-1492: Don't immediately reuse busy connections for another request. +- [bug] JAVA-2198: Handle UDTs with names that clash with collection types. + ### 3.7.1 - [bug] JAVA-2174: Metadata.needsQuote should accept empty strings. -- [bug] JAVA-2193: Fix flaky tests in WarningsTest +- [bug] JAVA-2193: Fix flaky tests in WarningsTest. ### 3.7.0 diff --git a/driver-core/src/main/java/com/datastax/driver/core/DataTypeCqlNameParser.java b/driver-core/src/main/java/com/datastax/driver/core/DataTypeCqlNameParser.java index 8a63e9a61e1..1137d2358bc 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/DataTypeCqlNameParser.java +++ b/driver-core/src/main/java/com/datastax/driver/core/DataTypeCqlNameParser.java @@ -119,8 +119,28 @@ static DataType parse( DataType nativeType = NATIVE_TYPES_MAP.get(type.toLowerCase()); if (nativeType != null) return nativeType; + if (parser.isEOS()) { + // return a custom type for the special empty type + // so that it gets detected later on, see TableMetadata + if (type.equalsIgnoreCase(EMPTY)) return custom(type); + + // We need to remove escaped double quotes within the type name as it is stored unescaped. + // Otherwise it's a UDT. If we only want a shallow definition build it, otherwise search known + // definitions. + if (shallowUserTypes) + return new UserType.Shallow(currentKeyspaceName, Metadata.handleId(type), frozen); + + UserType userType = null; + if (currentUserTypes != null) userType = currentUserTypes.get(Metadata.handleId(type)); + if (userType == null && oldUserTypes != null) + userType = oldUserTypes.get(Metadata.handleId(type)); + + if (userType == null) throw new UnresolvedUserTypeException(currentKeyspaceName, type); + else return userType.copy(frozen); + } + + List parameters = parser.parseTypeParameters(); if (type.equalsIgnoreCase(LIST)) { - List parameters = parser.parseTypeParameters(); if (parameters.size() != 1) throw new DriverInternalError( String.format("Excepting single parameter for list, got %s", parameters)); @@ -137,7 +157,6 @@ static DataType parse( } if (type.equalsIgnoreCase(SET)) { - List parameters = parser.parseTypeParameters(); if (parameters.size() != 1) throw new DriverInternalError( String.format("Excepting single parameter for set, got %s", parameters)); @@ -154,7 +173,6 @@ static DataType parse( } if (type.equalsIgnoreCase(MAP)) { - List parameters = parser.parseTypeParameters(); if (parameters.size() != 2) throw new DriverInternalError( String.format("Excepting two parameters for map, got %s", parameters)); @@ -180,7 +198,6 @@ static DataType parse( } if (type.equalsIgnoreCase(FROZEN)) { - List parameters = parser.parseTypeParameters(); if (parameters.size() != 1) throw new DriverInternalError( String.format("Excepting single parameter for frozen keyword, got %s", parameters)); @@ -195,9 +212,11 @@ static DataType parse( } if (type.equalsIgnoreCase(TUPLE)) { - List rawTypes = parser.parseTypeParameters(); - List types = new ArrayList(rawTypes.size()); - for (String rawType : rawTypes) { + if (parameters.isEmpty()) { + throw new IllegalArgumentException("Expecting at list one parameter for tuple, got none"); + } + List types = new ArrayList(parameters.size()); + for (String rawType : parameters) { types.add( parse( rawType, @@ -211,23 +230,7 @@ static DataType parse( return cluster.getMetadata().newTupleType(types); } - // return a custom type for the special empty type - // so that it gets detected later on, see TableMetadata - if (type.equalsIgnoreCase(EMPTY)) return custom(type); - - // We need to remove escaped double quotes within the type name as it is stored unescaped. - // Otherwise it's a UDT. If we only want a shallow definition build it, otherwise search known - // definitions. - if (shallowUserTypes) - return new UserType.Shallow(currentKeyspaceName, Metadata.handleId(type), frozen); - - UserType userType = null; - if (currentUserTypes != null) userType = currentUserTypes.get(Metadata.handleId(type)); - if (userType == null && oldUserTypes != null) - userType = oldUserTypes.get(Metadata.handleId(type)); - - if (userType == null) throw new UnresolvedUserTypeException(currentKeyspaceName, type); - else return userType.copy(frozen); + throw new IllegalArgumentException("Could not parse type name " + toParse); } private static class Parser { diff --git a/driver-core/src/test/java/com/datastax/driver/core/UserTypesTest.java b/driver-core/src/test/java/com/datastax/driver/core/UserTypesTest.java index 3f783ca6f1c..42a352c7034 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/UserTypesTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/UserTypesTest.java @@ -604,4 +604,19 @@ public void should_indicate_user_type_is_not_frozen() { PreparedStatement pst = session().prepare("SELECT v FROM not_frozen_table WHERE k = ?"); assertThat(pst.getVariables().getType(0)).isNotFrozen(); } + + @Test(groups = "short") + public void should_handle_udt_named_like_a_collection() { + execute( + "CREATE TYPE tuple(a text)", + "CREATE TYPE list(a text)", + "CREATE TYPE frozen(a text)", + "CREATE TYPE udt(tuple frozen, frozen frozen, " + + "m map,frozen>)"); + UserType udt = cluster().getMetadata().getKeyspace(keyspace).getUserType("udt"); + assertThat(udt.getFieldType("tuple")).isInstanceOf(UserType.class); + assertThat(udt.getFieldType("frozen")).isInstanceOf(UserType.class); + assertThat((udt.getFieldType("m").getTypeArguments().get(0))).isInstanceOf(UserType.class); + assertThat((udt.getFieldType("m").getTypeArguments().get(1))).isInstanceOf(UserType.class); + } } From 746e3ac3c059b85cf89b0dc319daae9e62c7e72c Mon Sep 17 00:00:00 2001 From: Olivier Michallat Date: Thu, 4 Jul 2019 06:42:39 -0700 Subject: [PATCH 046/211] JAVA-2204: Avoid memory leak when client holds onto a stale TableMetadata instance (#1288) --- changelog/README.md | 1 + .../datastax/driver/core/SchemaParser.java | 20 ++++++-- .../driver/core/SchemaChangesTest.java | 48 +++++++++++++++++-- 3 files changed, 60 insertions(+), 9 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index aeaff54bf3d..f02b925b416 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,6 +5,7 @@ - [bug] JAVA-2249: Stop stripping trailing zeros in ByteOrderedTokens. - [bug] JAVA-1492: Don't immediately reuse busy connections for another request. - [bug] JAVA-2198: Handle UDTs with names that clash with collection types. +- [bug] JAVA-2204: Avoid memory leak when client holds onto a stale TableMetadata instance. ### 3.7.1 diff --git a/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java b/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java index ce16ad04761..7c7f1352738 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java +++ b/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java @@ -441,19 +441,29 @@ private void updateKeyspaces( metadata.triggerOnKeyspaceChanged(newKeyspace, oldKeyspace); } Map oldTables = - oldKeyspace == null ? new HashMap() : oldKeyspace.tables; + oldKeyspace == null + ? new HashMap() + : new HashMap(oldKeyspace.tables); updateTables(metadata, oldTables, newKeyspace.tables, null); Map oldTypes = - oldKeyspace == null ? new HashMap() : oldKeyspace.userTypes; + oldKeyspace == null + ? new HashMap() + : new HashMap(oldKeyspace.userTypes); updateUserTypes(metadata, oldTypes, newKeyspace.userTypes, null); Map oldFunctions = - oldKeyspace == null ? new HashMap() : oldKeyspace.functions; + oldKeyspace == null + ? new HashMap() + : new HashMap(oldKeyspace.functions); updateFunctions(metadata, oldFunctions, newKeyspace.functions, null); Map oldAggregates = - oldKeyspace == null ? new HashMap() : oldKeyspace.aggregates; + oldKeyspace == null + ? new HashMap() + : new HashMap(oldKeyspace.aggregates); updateAggregates(metadata, oldAggregates, newKeyspace.aggregates, null); Map oldViews = - oldKeyspace == null ? new HashMap() : oldKeyspace.views; + oldKeyspace == null + ? new HashMap() + : new HashMap(oldKeyspace.views); updateViews(metadata, oldViews, newKeyspace.views, null); } } diff --git a/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java b/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java index f500a3d96af..20f6efedc36 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java @@ -35,6 +35,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import java.util.List; +import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; import org.mockito.ArgumentCaptor; import org.testng.annotations.AfterClass; @@ -80,13 +81,18 @@ public class SchemaChangesTest extends CCMTestsSupport { @BeforeClass(groups = "short") public void setup() throws InterruptedException { - Cluster.Builder builder = + cluster1 = Cluster.builder() .addContactPoints(getContactPoints()) .withPort(ccm().getBinaryPort()) - .withQueryOptions(nonDebouncingQueryOptions()); - cluster1 = builder.build(); - cluster2 = builder.build(); + .withQueryOptions(nonDebouncingQueryOptions()) + .build(); + cluster2 = + Cluster.builder() + .addContactPoints(getContactPoints()) + .withPort(ccm().getBinaryPort()) + .withQueryOptions(nonDebouncingQueryOptions()) + .build(); schemaDisabledCluster = spy( Cluster.builder() @@ -192,6 +198,40 @@ public void should_notify_of_table_update(String keyspace) throws InterruptedExc assertThat(m.getKeyspace(keyspace).getTable("table1")).hasColumn("j"); } + /** + * JAVA-2204: Make sure we don't accidentally store new table instances in an old keyspace + * instance, otherwise this will create a memory leak if a client holds onto a stale table + * instance (in particular, the object mapper does). + */ + @Test(groups = "short") + public void should_not_update_tables_on_stale_keyspace_instance() throws InterruptedException { + final Cluster cluster1 = session1.getCluster(); + final String keyspaceName = "lowercase"; + execute(CREATE_TABLE, keyspaceName); + final KeyspaceMetadata oldKeyspace = cluster1.getMetadata().getKeyspace(keyspaceName); + TableMetadata oldTable = oldKeyspace.getTable("table1"); + + // Force a full refresh + cluster1.getConfiguration().getQueryOptions().setMetadataEnabled(false); + cluster1.getConfiguration().getQueryOptions().setMetadataEnabled(true); + ConditionChecker.check() + .that( + new Callable() { + @Override + public Boolean call() { + return cluster1.getMetadata().getKeyspace(keyspaceName) == oldKeyspace; + } + }) + .becomesFalse(); + + // Before the fix, the schema parser updated the old keyspace's tables during a full refresh: + // oldTable -> oldKeyspace -> newTable + // If the client held onto the initial table instance, successive refreshes would grow the chain + // over time: + // table1 -> keyspace1 -> table2 -> keyspace2 -> ... + assertThat(oldKeyspace.getTable("table1")).isSameAs(oldTable); + } + /** * Verifies that when a table is updated that its associated views remain accessible from the * table via {@link TableMetadata#getView(String)}. From 1376363215bde6914d5a087af44ed01d6d78c8a5 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 9 Jul 2019 11:51:17 +0200 Subject: [PATCH 047/211] Update version in docs --- README.md | 14 +++++++------- changelog/README.md | 2 +- faq/README.md | 2 +- manual/compression/README.md | 2 +- manual/custom_codecs/extras/README.md | 2 +- manual/metrics/README.md | 2 +- manual/object_mapper/README.md | 2 +- manual/shaded_jar/README.md | 6 +++--- pom.xml | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 9996ca0440b..c41be282d4d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ not yet have been released. You can find the documentation for the latest version through the [Java driver docs](http://docs.datastax.com/en/developer/java-driver/latest/index.html) or via the release tags, [e.g. -3.7.1](https://github.com/datastax/java-driver/tree/3.7.1).* +3.7.2](https://github.com/datastax/java-driver/tree/3.7.2).* A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol @@ -55,7 +55,7 @@ The driver contains the following modules: - API: http://www.datastax.com/drivers/java/3.7 - GITHUB REPOSITORY: https://github.com/datastax/java-driver - [changelog](changelog/) -- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.7.1.tar.gz) +- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.7.2.tar.gz) ## Getting the driver @@ -67,7 +67,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-dri com.datastax.cassandra cassandra-driver-core - 3.7.1 + 3.7.2 ``` @@ -77,7 +77,7 @@ Note that the object mapper is published as a separate artifact: com.datastax.cassandra cassandra-driver-mapping - 3.7.1 + 3.7.2 ``` @@ -87,7 +87,7 @@ The 'extras' module is also published as a separate artifact: com.datastax.cassandra cassandra-driver-extras - 3.7.1 + 3.7.2 ``` @@ -96,12 +96,12 @@ 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](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.7.1.tar.gz) +[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.7.2.tar.gz) is available for download. ## Compatibility -The Java client driver 3.7.1 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache +The Java client driver 3.7.2 ([branch 3.x](https://github.com/datastax/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/latest/manual/native_protocol/) for the most up-to-date compatibility information). diff --git a/changelog/README.md b/changelog/README.md index f02b925b416..834ad3e6b56 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -1,6 +1,6 @@ ## Changelog -### 3.7.2 (In progress) +### 3.7.2 - [bug] JAVA-2249: Stop stripping trailing zeros in ByteOrderedTokens. - [bug] JAVA-1492: Don't immediately reuse busy connections for another request. diff --git a/faq/README.md b/faq/README.md index dd76299e874..b9d2122796a 100644 --- a/faq/README.md +++ b/faq/README.md @@ -289,7 +289,7 @@ version is available, you may want to reach out to the maintainer of that tool t an update with compatibility to this driver version. -[Blobs.java]: https://github.com/datastax/java-driver/tree/3.7.1/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java +[Blobs.java]: https://github.com/datastax/java-driver/tree/3.7.2/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304 [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding [Mapper options]: ../manual/object_mapper/using/#mapper-options diff --git a/manual/compression/README.md b/manual/compression/README.md index 8d593fb6c72..899ec68d167 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -88,4 +88,4 @@ cluster = Cluster.builder() .build(); ``` -[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.7.1/cassandra-driver-parent-3.7.1.pom +[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.7.2/cassandra-driver-parent-3.7.2.pom diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index 0bc4633ae24..d13e3865bff 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -10,7 +10,7 @@ The module is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-extras - 3.7.1 + 3.7.2 ``` diff --git a/manual/metrics/README.md b/manual/metrics/README.md index ee15107788c..634a32c0069 100644 --- a/manual/metrics/README.md +++ b/manual/metrics/README.md @@ -38,7 +38,7 @@ To do this in a maven project: com.datastax.cassandra cassandra-driver-core - 3.7.1 + 3.7.2 io.dropwizard.metrics diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md index 3b9e26667f3..d1acb1e6f72 100644 --- a/manual/object_mapper/README.md +++ b/manual/object_mapper/README.md @@ -11,7 +11,7 @@ The mapper is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-mapping - 3.7.1 + 3.7.2 ``` diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md index 25d8bf4a124..74a83505f1d 100644 --- a/manual/shaded_jar/README.md +++ b/manual/shaded_jar/README.md @@ -12,7 +12,7 @@ package name: com.datastax.cassandra cassandra-driver-core - 3.7.1 + 3.7.2 shaded @@ -32,7 +32,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-core - 3.7.1 + 3.7.2 shaded @@ -44,7 +44,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-mapping - 3.7.1 + 3.7.2 com.datastax.cassandra diff --git a/pom.xml b/pom.xml index 3b2c2fcefcc..0e732f5541c 100644 --- a/pom.xml +++ b/pom.xml @@ -634,7 +634,7 @@ - 3.7.0 + 3.7.1 ../clirr-ignores.xml com/datastax/shaded/** From 09b936dddeb2c7ce5731829dc5b3132825ab204e Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 9 Jul 2019 11:54:26 +0200 Subject: [PATCH 048/211] [maven-release-plugin] prepare release 3.7.2 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index c71fa400ee8..b2428d1870d 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.2-SNAPSHOT + 3.7.2 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index ecda4446775..9b167c5a3ec 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.2-SNAPSHOT + 3.7.2 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 88d0767afed..b1473cf913c 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.2-SNAPSHOT + 3.7.2 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index aecdceb51d7..03790b0b772 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.2-SNAPSHOT + 3.7.2 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 4878ead6694..a0f107cf693 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.2-SNAPSHOT + 3.7.2 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 1b1e9bc1e41..c781ea70728 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.2-SNAPSHOT + 3.7.2 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index ca03c2cab70..4968aa00e9c 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.2-SNAPSHOT + 3.7.2 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 0e2c4ba58c5..fc369f68d04 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.2-SNAPSHOT + 3.7.2 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index d568d6c40e3..6d355830cbe 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.7.2-SNAPSHOT + 3.7.2 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 9ba4cf73420..1fabd0e1849 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.7.2-SNAPSHOT + 3.7.2 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index e35ed7d0954..d081aeeb271 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.2-SNAPSHOT + 3.7.2 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 0e732f5541c..5be76bd8019 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.2-SNAPSHOT + 3.7.2 pom DataStax Java Driver for Apache Cassandra @@ -1141,7 +1141,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.7.2 From 1971fb397e7a56b484b16e9ce1d9fd94fb00e7fc Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 9 Jul 2019 11:54:43 +0200 Subject: [PATCH 049/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index b2428d1870d..2dddc6f47da 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.2 + 3.7.3-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 9b167c5a3ec..8208c9eee4c 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.2 + 3.7.3-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index b1473cf913c..1af15d90505 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.2 + 3.7.3-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 03790b0b772..68d4be996bb 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.2 + 3.7.3-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index a0f107cf693..366710a64f8 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.2 + 3.7.3-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index c781ea70728..aef04ea0831 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.2 + 3.7.3-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 4968aa00e9c..06200c1faa5 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.2 + 3.7.3-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index fc369f68d04..b2ba844fa51 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.2 + 3.7.3-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 6d355830cbe..f0224505576 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.7.2 + 3.7.3-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 1fabd0e1849..5eef7a87041 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.7.2 + 3.7.3-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index d081aeeb271..c95d319f824 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.2 + 3.7.3-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 5be76bd8019..dfc10e796cf 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.2 + 3.7.3-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1141,7 +1141,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.7.2 + HEAD From 0e41e9d2a731a534337137c642027cc85ff70695 Mon Sep 17 00:00:00 2001 From: Adam Holmberg Date: Tue, 16 Jul 2019 13:47:34 -0500 Subject: [PATCH 050/211] copyright symbol --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c41be282d4d..7739d69a5e4 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ If you are upgrading to _DataStax Enterprise_, use the [DataStax Enterprise Java features and better compatibility. ## License -Copyright DataStax, Inc. +© DataStax, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From a815196b81a6180d555b60b08bcbec2e87673fff Mon Sep 17 00:00:00 2001 From: Alex Ott Date: Wed, 21 Aug 2019 21:00:32 +0200 Subject: [PATCH 051/211] Fix missing links to LocalDateTimeCodec & LocalDateTime (#1297) --- manual/custom_codecs/extras/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index d13e3865bff..ddff801aca5 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -75,10 +75,13 @@ session.execute("INSERT INTO example (id, t) VALUES (1, ?)", [InstantCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/InstantCodec.html [LocalDateCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.html +[LocalDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/LocalDateTimeCodec.html [LocalTimeCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.html [ZonedDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.html +[ZoneIdCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/ZoneIdCodec.html [Instant]: https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html [LocalDate]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html +[LocalDateTime]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html [LocalTime]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html [ZonedDateTime]: https://docs.oracle.com/javase/8/docs/api/java/time/ZonedDateTime.html [ZoneId]: https://docs.oracle.com/javase/8/docs/api/java/time/ZoneId.html From aa5d6d859a5490e21a5216edf5aef54d9f6cd7c7 Mon Sep 17 00:00:00 2001 From: Greg Bestland Date: Tue, 3 Sep 2019 15:06:13 -0500 Subject: [PATCH 052/211] JAVA-2355: Support for DataStax Cloud API --- .travis.yml | 1 + build.yaml | 1 + changelog/README.md | 6 + clirr-ignores.xml | 196 +++++++++++- driver-core/pom.xml | 6 +- .../core/AbstractReconnectionHandler.java | 6 +- .../driver/core/ArrayBackedResultSet.java | 12 +- .../datastax/driver/core/AuthProvider.java | 27 +- .../com/datastax/driver/core/Cluster.java | 247 ++++++++------- .../core/ClusterNameMismatchException.java | 10 +- .../datastax/driver/core/Configuration.java | 54 +++- .../com/datastax/driver/core/Connection.java | 182 +++++------ .../driver/core/ControlConnection.java | 294 ++++++++++-------- .../datastax/driver/core/DbaasConfigUtil.java | 185 +++++++++++ .../driver/core/DbaasConfiguration.java | 140 +++++++++ .../driver/core/DefaultEndPointFactory.java | 69 ++++ .../driver/core/DefaultResultSetFuture.java | 10 +- .../driver/core/DelegatingCluster.java | 3 +- .../com/datastax/driver/core/EndPoint.java | 30 ++ .../datastax/driver/core/EndPointFactory.java | 37 +++ .../driver/core/ExtendedAuthProvider.java | 82 +++++ ...ExtendedRemoteEndpointAwareSslOptions.java | 39 +++ .../java/com/datastax/driver/core/Host.java | 78 +++-- .../driver/core/HostConnectionPool.java | 19 +- .../driver/core}/IgnoreJDK6Requirement.java | 10 +- .../com/datastax/driver/core/Metadata.java | 62 +++- .../com/datastax/driver/core/MetricsUtil.java | 15 +- .../driver/core/PlainTextAuthProvider.java | 16 +- .../RemoteEndpointAwareJdkSSLOptions.java | 24 +- .../RemoteEndpointAwareNettySSLOptions.java | 13 +- .../datastax/driver/core/RequestHandler.java | 52 ++-- .../com/datastax/driver/core/Responses.java | 43 +-- .../com/datastax/driver/core/SSLOptions.java | 5 +- .../datastax/driver/core/SessionManager.java | 9 +- .../com/datastax/driver/core/SniEndPoint.java | 112 +++++++ .../driver/core/SniEndPointFactory.java | 37 +++ .../datastax/driver/core/SniSSLOptions.java | 98 ++++++ .../core/TranslatedAddressEndPoint.java | 59 ++++ .../exceptions/AlreadyExistsException.java | 34 +- .../exceptions/AuthenticationException.java | 34 +- .../exceptions/BootstrappingException.java | 31 +- .../exceptions/BusyConnectionException.java | 30 +- .../core/exceptions/BusyPoolException.java | 38 ++- .../core/exceptions/ConnectionException.java | 28 +- .../core/exceptions/CoordinatorException.java | 26 +- .../FunctionExecutionException.java | 28 +- .../InvalidConfigurationInQueryException.java | 8 +- .../exceptions/InvalidQueryException.java | 26 +- .../exceptions/NoHostAvailableException.java | 16 +- .../OperationTimedOutException.java | 16 +- .../core/exceptions/OverloadedException.java | 31 +- .../driver/core/exceptions/ProtocolError.java | 30 +- .../exceptions/QueryConsistencyException.java | 42 ++- .../core/exceptions/ReadFailureException.java | 20 +- .../core/exceptions/ReadTimeoutException.java | 18 +- .../driver/core/exceptions/ServerError.java | 30 +- .../driver/core/exceptions/SyntaxError.java | 28 +- .../core/exceptions/TransportException.java | 12 +- .../core/exceptions/TruncateException.java | 28 +- .../exceptions/UnauthorizedException.java | 28 +- .../core/exceptions/UnavailableException.java | 36 ++- .../core/exceptions/UnpreparedException.java | 31 +- .../UnsupportedProtocolVersionException.java | 40 +-- .../core/exceptions/WrappingEndPoint.java | 34 ++ .../exceptions/WriteFailureException.java | 20 +- .../exceptions/WriteTimeoutException.java | 14 +- .../driver/core/policies/Policies.java | 24 +- .../driver/core/policies/WhiteListPolicy.java | 8 +- .../driver/core/AbstractPoliciesTest.java | 3 +- .../core/AbstractReconnectionHandlerTest.java | 3 +- .../core/AbstractReplicationStrategyTest.java | 5 +- .../datastax/driver/core/AsyncQueryTest.java | 2 +- .../driver/core/AuthenticationTest.java | 5 +- .../datastax/driver/core/ClusterAssert.java | 3 +- .../datastax/driver/core/ClusterInitTest.java | 4 +- .../driver/core/ConnectionReleaseTest.java | 2 +- .../driver/core/ControlConnectionTest.java | 41 ++- .../driver/core/DbaasConfigUtilTest.java | 59 ++++ .../com/datastax/driver/core/EndPoints.java | 33 ++ .../core/EventDebouncerIntegrationTest.java | 3 +- .../datastax/driver/core/HeartbeatTest.java | 6 +- .../com/datastax/driver/core/HostAssert.java | 2 +- .../driver/core/HostTargetingTest.java | 10 +- .../core/LoadBalancingPolicyRefreshTest.java | 16 +- .../driver/core/QueryLoggerErrorsTest.java | 2 +- .../datastax/driver/core/QueryTracker.java | 6 +- .../driver/core/ReconnectionTest.java | 3 +- .../driver/core/ScassandraCluster.java | 36 ++- .../driver/core/ScassandraTestBase.java | 25 +- .../core/SortingLoadBalancingPolicy.java | 4 +- .../com/datastax/driver/core/TestUtils.java | 8 +- .../driver/core/TokenIntegrationTest.java | 4 +- .../datastax/driver/core/cloud/DbaasTest.java | 99 ++++++ .../driver/core/cloud/SniProxyServer.java | 106 +++++++ .../exceptions/ConnectionExceptionTest.java | 11 +- .../exceptions/ExceptionsScassandraTest.java | 82 +---- .../core/exceptions/ExceptionsTest.java | 130 ++++---- .../NoHostAvailableExceptionTest.java | 9 +- .../CustomRetryPolicyIntegrationTest.java | 5 +- .../DefaultRetryPolicyIntegrationTest.java | 22 +- ...ConsistencyRetryPolicyIntegrationTest.java | 18 +- ...FallthroughRetryPolicyIntegrationTest.java | 5 +- .../core/policies/HostFilterPolicyTest.java | 10 - ...otenceAwareRetryPolicyIntegrationTest.java | 11 +- .../core/policies/LatencyAwarePolicyTest.java | 2 +- .../LoggingRetryPolicyIntegrationTest.java | 4 +- .../src/test/resources/dbaas/creds.zip | Bin 0 -> 389 bytes .../src/test/resources/dbaas/metadata.json | 1 + driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- .../basic/ReadTopologyAndSchemaMetadata.java | 2 +- driver-extras/pom.xml | 2 +- .../extras/codecs/jdk8/InstantCodec.java | 1 + .../extras/codecs/jdk8/LocalDateCodec.java | 1 + .../codecs/jdk8/LocalDateTimeCodec.java | 1 + .../extras/codecs/jdk8/LocalTimeCodec.java | 1 + .../extras/codecs/jdk8/OptionalCodec.java | 1 + .../extras/codecs/jdk8/ZoneIdCodec.java | 1 + .../codecs/jdk8/ZonedDateTimeCodec.java | 1 + driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 4 +- .../datastax/driver/osgi/BundleOptions.java | 1 + driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 7 +- 128 files changed, 2827 insertions(+), 1090 deletions(-) create mode 100644 driver-core/src/main/java/com/datastax/driver/core/DbaasConfigUtil.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/DbaasConfiguration.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/DefaultEndPointFactory.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/EndPoint.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/EndPointFactory.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/ExtendedAuthProvider.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/ExtendedRemoteEndpointAwareSslOptions.java rename {driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8 => driver-core/src/main/java/com/datastax/driver/core}/IgnoreJDK6Requirement.java (73%) create mode 100644 driver-core/src/main/java/com/datastax/driver/core/SniEndPoint.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/SniEndPointFactory.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/SniSSLOptions.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/TranslatedAddressEndPoint.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/exceptions/WrappingEndPoint.java create mode 100644 driver-core/src/test/java/com/datastax/driver/core/DbaasConfigUtilTest.java create mode 100644 driver-core/src/test/java/com/datastax/driver/core/EndPoints.java create mode 100644 driver-core/src/test/java/com/datastax/driver/core/cloud/DbaasTest.java create mode 100644 driver-core/src/test/java/com/datastax/driver/core/cloud/SniProxyServer.java create mode 100644 driver-core/src/test/resources/dbaas/creds.zip create mode 100644 driver-core/src/test/resources/dbaas/metadata.json diff --git a/.travis.yml b/.travis.yml index 0292d381cdd..c63c5b781f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: java +dist: trusty jdk: - openjdk7 - oraclejdk8 diff --git a/build.yaml b/build.yaml index 58442c8321d..ff82e80b49c 100644 --- a/build.yaml +++ b/build.yaml @@ -77,6 +77,7 @@ build: failIfNoTests=false maven.test.failure.ignore=true maven.javadoc.skip=true + proxy.path=$HOME/proxy - type: maven version: 3.2.5 goals: verify --fail-never -Pisolated diff --git a/changelog/README.md b/changelog/README.md index 834ad3e6b56..f1075b5a975 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -1,5 +1,11 @@ ## Changelog + +## DataStax Cloud (in progress) + +- [new feature] JAVA-2355: CaaS Enablement + + ### 3.7.2 - [bug] JAVA-2249: Stop stripping trailing zeros in ByteOrderedTokens. diff --git a/clirr-ignores.xml b/clirr-ignores.xml index e7c34ac458c..8c1bd47ab4c 100644 --- a/clirr-ignores.xml +++ b/clirr-ignores.xml @@ -140,7 +140,6 @@ com/datastax/driver/core/FrameCompressor$SnappyCompressor False positive, the enclosing class is package-private so this was never exposed - 8001 com/datastax/driver/core/FrameCompressor$LZ4Compressor @@ -158,5 +157,198 @@ * Relaxed parameters from List to Iterable for in, lt, lte, eq, gt, and gte - + + 7005 + com/datastax/driver/core/exceptions/AlreadyExistsException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/AuthenticationException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/BootstrappingException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/BusyConnectionException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/BusyPoolException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 6001 + com/datastax/driver/core/exceptions/ConnectionException + address + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/ConnectionException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7012 + com/datastax/driver/core/exceptions/CoordinatorException + com.datastax.driver.core.EndPoint getEndPoint() + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/FunctionExecutionException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/InvalidQueryException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/OperationTimedOutException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/OperationTimedOutException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/OverloadedException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/ProtocolError + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/QueryConsistencyException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/ReadFailureException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/ReadTimeoutException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/ServerError + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/SyntaxError + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/TransportException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/TruncateException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/UnauthorizedException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/UnavailableException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/UnpreparedException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/UnsupportedProtocolVersionException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/WriteFailureException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + + + 7005 + com/datastax/driver/core/exceptions/WriteTimeoutException + *java.net.InetSocketAddress* + *com.datastax.driver.core.EndPoint* + JAVA-2355: Abstract connection information into new EndPoint type for sni support + diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 2dddc6f47da..b4344336fcc 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.3-SNAPSHOT + 3.8.0-SNAPSHOT cassandra-driver-core @@ -154,6 +154,10 @@ + + com.fasterxml.jackson.core + jackson-databind + diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractReconnectionHandler.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractReconnectionHandler.java index ec109b6f308..97865150468 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/AbstractReconnectionHandler.java +++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractReconnectionHandler.java @@ -171,7 +171,7 @@ public void run() { } else { logger.error( "Retries against {} have been suspended. It won't be retried unless the node is restarted.", - e.getHost()); + e.getEndPoint()); currentAttempt.compareAndSet(handlerFuture, null); } } catch (InterruptedException e) { @@ -184,7 +184,7 @@ public void run() { } else { logger.error( "Retries against {} have been suspended. It won't be retried unless the node is restarted.", - e.getHost()); + e.getEndPoint()); currentAttempt.compareAndSet(handlerFuture, null); } } catch (ClusterNameMismatchException e) { @@ -195,7 +195,7 @@ public void run() { } else { logger.error( "Retries against {} have been suspended. It won't be retried unless the node is restarted.", - e.address.getAddress()); + e.endPoint); currentAttempt.compareAndSet(handlerFuture, null); } } catch (Exception e) { diff --git a/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedResultSet.java b/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedResultSet.java index 224dc252266..3337ec31d45 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedResultSet.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedResultSet.java @@ -467,13 +467,13 @@ public void onSet( // This mean we have probably have a bad node, so defunct the connection connection.defunct( new ConnectionException( - connection.address, + connection.endPoint, String.format("Got unexpected %s result response", rm.kind))); future.setException( new DriverInternalError( String.format( "Got unexpected %s result response from %s", - rm.kind, connection.address))); + rm.kind, connection.endPoint))); return; } @@ -482,26 +482,26 @@ public void onSet( break; case ERROR: future.setException( - ((Responses.Error) response).asException(connection.address)); + ((Responses.Error) response).asException(connection.endPoint)); break; default: // This mean we have probably have a bad node, so defunct the connection connection.defunct( new ConnectionException( - connection.address, + connection.endPoint, String.format("Got unexpected %s response", response.type))); future.setException( new DriverInternalError( String.format( "Got unexpected %s response from %s", - response.type, connection.address))); + response.type, connection.endPoint))); break; } } catch (RuntimeException e) { // If we get a bug here, the client will not get it, so better forwarding the error future.setException( new DriverInternalError( - "Unexpected error while processing response from " + connection.address, + "Unexpected error while processing response from " + connection.endPoint, e)); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/AuthProvider.java b/driver-core/src/main/java/com/datastax/driver/core/AuthProvider.java index 5a47debf1cd..b6ace5df32f 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/AuthProvider.java +++ b/driver-core/src/main/java/com/datastax/driver/core/AuthProvider.java @@ -31,17 +31,7 @@ public interface AuthProvider { * *

    This is only useful as a placeholder when no authentication is to be used. */ - public static final AuthProvider NONE = - new AuthProvider() { - @Override - public Authenticator newAuthenticator(InetSocketAddress host, String authenticator) { - throw new AuthenticationException( - host, - String.format( - "Host %s requires authentication, but no authenticator found in Cluster configuration", - host)); - } - }; + AuthProvider NONE = new ExtendedAuthProvider.NoAuthProvider(); /** * The {@code Authenticator} to use when connecting to {@code host} @@ -52,4 +42,19 @@ public Authenticator newAuthenticator(InetSocketAddress host, String authenticat */ public Authenticator newAuthenticator(InetSocketAddress host, String authenticator) throws AuthenticationException; + + /** + * Dummy Authenticator that accounts for DSE authentication configured with transitional mode. + * + *

    In this situation, the client is allowed to connect without authentication, but DSE would + * still send an AUTHENTICATE response. This Authenticator handles this situation by sending back + * a dummy credential. + */ + class TransitionalModePlainTextAuthenticator + extends PlainTextAuthProvider.PlainTextAuthenticator { + + public TransitionalModePlainTextAuthenticator() { + super("", ""); + } + } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java index b89e4c71c88..b0a5679d867 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java @@ -61,6 +61,8 @@ import java.util.Collections; import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -141,8 +143,7 @@ public class Cluster implements Closeable { * @param contactPoints the list of contact points to use for the new cluster. * @param configuration the configuration for the new cluster. */ - protected Cluster( - String name, List contactPoints, Configuration configuration) { + protected Cluster(String name, List contactPoints, Configuration configuration) { this(name, contactPoints, configuration, Collections.emptySet()); } @@ -164,7 +165,7 @@ protected Cluster(Initializer initializer) { initializer.getInitialListeners()); } - private static List checkNotEmpty(List contactPoints) { + private static List checkNotEmpty(List contactPoints) { if (contactPoints.isEmpty()) throw new IllegalArgumentException("Cannot build a cluster without contact points"); return contactPoints; @@ -172,7 +173,7 @@ private static List checkNotEmpty(List con private Cluster( String name, - List contactPoints, + List contactPoints, Configuration configuration, Collection listeners) { this.manager = new Manager(name, contactPoints, configuration, listeners); @@ -342,6 +343,10 @@ public Session connect(String keyspace) { * happens synchronously on the thread that called this method. Therefore it is recommended to * initialize the cluster at application startup, and not rely on this method to do it. * + *

    Note that if a {@linkplain Configuration#getDefaultKeyspace() default keyspace} has been + * configured for use with a DBaaS cluster, this method will attempt to set the session keyspace + * to that keyspace, effectively behaving like {@link #connect(String)}. + * * @return a future that will complete when the session is fully initialized. * @throws NoHostAvailableException if the Cluster has not been initialized yet ({@link #init} has * not been called and this is the first connect call) and no host amongst the contact points @@ -352,7 +357,8 @@ public Session connect(String keyspace) { * @see #connect() */ public ListenableFuture connectAsync() { - return connectAsync(null); + String defaultKeyspace = getConfiguration().getDefaultKeyspace(); + return connectAsync(defaultKeyspace); } /** @@ -402,7 +408,7 @@ public ListenableFuture apply(Throwable t) throws Exception { SyntaxError e = (SyntaxError) t; t = new SyntaxError( - e.getAddress(), + e.getEndPoint(), String.format( "Error executing \"%s\" (%s). Check that your keyspace name is valid", useQuery, e.getMessage())); @@ -671,7 +677,7 @@ public interface Initializer { * @return the initial Cassandra contact points. See {@link Builder#addContactPoint} for more * details on contact points. */ - public List getContactPoints(); + public List getContactPoints(); /** * The configuration to use for the new cluster. @@ -707,8 +713,12 @@ public interface Initializer { public static class Builder implements Initializer { private String clusterName; - private final List addresses = new ArrayList(); - private final List rawAddresses = new ArrayList(); + private final List rowHostAndPortContactPoints = + new ArrayList(); + private final List rawHostContactPoints = new ArrayList(); + private final Map> resolvedContactPoints = + new LinkedHashMap>(); + private final List contactPoints = new ArrayList(); private int port = ProtocolOptions.DEFAULT_PORT; private int maxSchemaAgreementWaitSeconds = ProtocolOptions.DEFAULT_MAX_SCHEMA_AGREEMENT_WAIT_SECONDS; @@ -733,13 +743,18 @@ public String getClusterName() { } @Override - public List getContactPoints() { - if (rawAddresses.isEmpty()) return addresses; - - List allAddresses = new ArrayList(addresses); - for (InetAddress address : rawAddresses) - allAddresses.add(new InetSocketAddress(address, port)); - return allAddresses; + public List getContactPoints() { + // Use a set to remove duplicate endpoints + Set allContactPoints = new LinkedHashSet(contactPoints); + // If contact points were provided as InetAddress/InetSocketAddress, assume the default + // endpoint factory is used. + for (InetAddress address : rawHostContactPoints) { + allContactPoints.add(new TranslatedAddressEndPoint(new InetSocketAddress(address, port))); + } + for (InetSocketAddress socketAddress : rowHostAndPortContactPoints) { + allContactPoints.add(new TranslatedAddressEndPoint(socketAddress)); + } + return new ArrayList(allContactPoints); } /** @@ -916,13 +931,26 @@ public Builder addContactPoint(String address) { if (address == null) throw new NullPointerException(); try { - addContactPoints(InetAddress.getAllByName(address)); + InetAddress[] allByName = InetAddress.getAllByName(address); + Collections.addAll(this.rawHostContactPoints, allByName); return this; } catch (UnknownHostException e) { throw new IllegalArgumentException("Failed to add contact point: " + address, e); } } + /** + * Adds a contact point using the given connection information. + * + *

    You only need this method if you use a custom connection mechanism and have configured a + * custom {@link EndPointFactory}; otherwise, you can safely ignore it and use the higher level, + * host-and-port-based variants such as {@link #addContactPoint(String)}. + */ + public Builder addContactPoint(EndPoint contactPoint) { + contactPoints.add(contactPoint); + return this; + } + /** * Adds contact points. * @@ -959,7 +987,7 @@ public Builder addContactPoints(String... addresses) { * @see Builder#addContactPoint */ public Builder addContactPoints(InetAddress... addresses) { - Collections.addAll(this.rawAddresses, addresses); + Collections.addAll(this.rawHostContactPoints, addresses); return this; } @@ -973,7 +1001,7 @@ public Builder addContactPoints(InetAddress... addresses) { * @see Builder#addContactPoint */ public Builder addContactPoints(Collection addresses) { - this.rawAddresses.addAll(addresses); + this.rawHostContactPoints.addAll(addresses); return this; } @@ -996,7 +1024,7 @@ public Builder addContactPoints(Collection addresses) { * @see Builder#addContactPoint */ public Builder addContactPointsWithPorts(InetSocketAddress... addresses) { - Collections.addAll(this.addresses, addresses); + Collections.addAll(this.rowHostAndPortContactPoints, addresses); return this; } @@ -1019,7 +1047,7 @@ public Builder addContactPointsWithPorts(InetSocketAddress... addresses) { * @see Builder#addContactPoint */ public Builder addContactPointsWithPorts(Collection addresses) { - this.addresses.addAll(addresses); + this.rowHostAndPortContactPoints.addAll(addresses); return this; } @@ -1112,6 +1140,18 @@ public Builder withSpeculativeExecutionPolicy(SpeculativeExecutionPolicy policy) return this; } + /** + * Configures the endpoint factory to use for the new cluster. + * + *

    This is a low-level component for advanced scenarios where connecting to a node requires + * more than its socket address. If you're simply using host+port, the default factory is + * sufficient. + */ + public Builder withEndPointFactory(EndPointFactory endPointFactory) { + policiesBuilder.withEndPointFactory(endPointFactory); + return this; + } + /** * Configures the {@link CodecRegistry} instance to use for the new cluster. * @@ -1325,6 +1365,30 @@ public Builder withNoCompact() { return this; } + /** + * Creates a {@link Builder} pre-configured for a specific DBaaS endpoint or configuration file. + * Currently this supports the format provided by DBaaS cloud provider, a creds.zip file. In the + * future this will be extended to work with DBaaS service provider endpoints. + * + * @param secureBundlePath Absolute path to secure bundle zip file. + * @return a preconfigured {@link Builder} ready for use. + */ + public Builder withCloudSecureConnectBundle(String secureBundlePath) { + DbaasConfiguration dbaasConfig = DbaasConfigUtil.getConfig(secureBundlePath); + SSLOptions sslOptions = DbaasConfigUtil.getSSLOptions(dbaasConfig); + InetSocketAddress proxyAddress = + new InetSocketAddress(dbaasConfig.getSniHost(), dbaasConfig.getSniPort()); + Builder builder = + withEndPointFactory(new SniEndPointFactory(proxyAddress)).withSSL(sslOptions); + if (dbaasConfig.getUsername() != null && dbaasConfig.getPassword() != null) { + builder = builder.withCredentials(dbaasConfig.getUsername(), dbaasConfig.getPassword()); + } + for (String hostID : dbaasConfig.getHostIds()) { + builder.addContactPoint(new SniEndPoint(proxyAddress, hostID)); + } + return builder; + } + /** * The configuration that will be used for the new cluster. * @@ -1394,7 +1458,7 @@ class Manager implements Connection.DefaultResponseHandler { private volatile boolean isFullyInit; private Exception initException; // Initial contacts point - final List contactPoints; + final List contactPoints; final Set sessions = new CopyOnWriteArraySet(); Metadata metadata; @@ -1440,7 +1504,7 @@ class Manager implements Connection.DefaultResponseHandler { private Manager( String clusterName, - List contactPoints, + List contactPoints, Configuration configuration, Collection listeners) { this.clusterName = clusterName == null ? generateClusterName() : clusterName; @@ -1553,39 +1617,32 @@ long delayMs() { this.scheduledTasksExecutor.scheduleWithFixedDelay( new CleanupIdleConnectionsTask(), 10, 10, TimeUnit.SECONDS); - for (InetSocketAddress address : contactPoints) { - // We don't want to signal -- call onAdd() -- because nothing is ready - // yet (loadbalancing policy, control connection, ...). All we want is - // create the Host object so we can initialize the control connection. - metadata.addIfAbsent(metadata.newHost(address)); + for (EndPoint contactPoint : contactPoints) { + metadata.addContactPoint(contactPoint); } - - Collection allHosts = metadata.allHosts(); - - // At this stage, metadata.allHosts() only contains the contact points, that's what we want - // to - // pass to LBP.init(). - // But the control connection will initialize first and discover more hosts, so make a copy. - Set contactPointHosts = Sets.newHashSet(allHosts); - + // Initialize the control connection: negotiateProtocolVersionAndConnect(); - // The control connection can mark hosts down if it failed to connect to them, or remove - // them if they weren't found - // in the control host's system.peers. Separate them: + // The control connection: + // - marked contact points down if they couldn't be reached + // - triggered an initial full refresh of metadata.allHosts. If any contact points weren't + // valid, they won't appear in it. Set downContactPointHosts = Sets.newHashSet(); Set removedContactPointHosts = Sets.newHashSet(); - for (Host host : contactPointHosts) { - if (!allHosts.contains(host)) removedContactPointHosts.add(host); - else if (host.state == Host.State.DOWN) downContactPointHosts.add(host); + for (Host contactPoint : metadata.getContactPoints()) { + if (!metadata.allHosts().contains(contactPoint)) { + removedContactPointHosts.add(contactPoint); + } else if (contactPoint.state == Host.State.DOWN) { + downContactPointHosts.add(contactPoint); + } } - contactPointHosts.removeAll(removedContactPointHosts); - contactPointHosts.removeAll(downContactPointHosts); // Now that the control connection is ready, we have all the information we need about the - // nodes (datacenter, - // rack...) to initialize the load balancing policy - loadBalancingPolicy().init(Cluster.this, contactPointHosts); + // nodes (datacenter, rack...) to initialize the load balancing policy + Set lbpContactPoints = Sets.newHashSet(metadata.getContactPoints()); + lbpContactPoints.removeAll(removedContactPointHosts); + lbpContactPoints.removeAll(downContactPointHosts); + loadBalancingPolicy().init(Cluster.this, lbpContactPoints); speculativeExecutionPolicy().init(Cluster.this); configuration.getPolicies().getRetryPolicy().init(Cluster.this); @@ -1606,7 +1663,7 @@ long delayMs() { configuration.getPoolingOptions().setProtocolVersion(protocolVersion()); - for (Host host : allHosts) { + for (Host host : metadata.allHosts()) { // If the host is down at this stage, it's a contact point that the control connection // failed to reach. // Reconnection attempts are already scheduled, and the LBP and listeners have been @@ -1625,7 +1682,7 @@ long delayMs() { continue; } - if (!contactPointHosts.contains(host)) loadBalancingPolicy().onAdd(host); + if (!lbpContactPoints.contains(host)) loadBalancingPolicy().onAdd(host); host.setUp(); @@ -1721,6 +1778,14 @@ void reportQuery(Host host, Statement statement, Exception exception, long laten } } + ControlConnection getControlConnection() { + return controlConnection; + } + + List getContactPoints() { + return contactPoints; + } + boolean isClosed() { return closeFuture.get() != null; } @@ -2565,30 +2630,22 @@ public void handle(Message.Response response) { switch (event.type) { case TOPOLOGY_CHANGE: ProtocolEvent.TopologyChange tpc = (ProtocolEvent.TopologyChange) event; - InetSocketAddress tpAddr = translateAddress(tpc.node.getAddress()); - Host.statesLogger.debug("[{}] received event {}", tpAddr, tpc.change); - switch (tpc.change) { - case NEW_NODE: - submitNodeRefresh(tpAddr, HostEvent.ADDED); - break; - case REMOVED_NODE: - submitNodeRefresh(tpAddr, HostEvent.REMOVED); - break; - case MOVED_NODE: - submitNodeListRefresh(); - break; - } + Host.statesLogger.debug("[{}] received event {}", tpc.node, tpc.change); + // Always do a full refresh for topology changes. This is simpler than trying to infer a + // new EndPoint from the rpc_address only. + submitNodeListRefresh(); break; case STATUS_CHANGE: ProtocolEvent.StatusChange stc = (ProtocolEvent.StatusChange) event; - InetSocketAddress stAddr = translateAddress(stc.node.getAddress()); - Host.statesLogger.debug("[{}] received event {}", stAddr, stc.status); + Host.statesLogger.debug("[{}] received event {}", stc.node, stc.status); + // Do NOT translate the address, it will be matched against Host.getBroadcastRpcAddress() + // to find the target host. switch (stc.status) { case UP: - submitNodeRefresh(stAddr, HostEvent.UP); + submitNodeRefresh(stc.node, HostEvent.UP); break; case DOWN: - submitNodeRefresh(stAddr, HostEvent.DOWN); + submitNodeRefresh(stc.node, HostEvent.DOWN); break; } break; @@ -2909,27 +2966,11 @@ public ListenableFuture deliver(List events) { case UP: Host upHost = metadata.getHost(address); if (upHost == null) { - upHost = metadata.newHost(address); - Host previous = metadata.addIfAbsent(upHost); - if (previous != null) { - // We got beat by another thread at adding the host. Let it win and ignore the - // notification here. - continue; - } - futures.add(schedule(hostAdded(upHost))); + submitNodeListRefresh(); } else { futures.add(schedule(hostUp(upHost))); } break; - case ADDED: - Host newHost = metadata.newHost(address); - Host previous = metadata.addIfAbsent(newHost); - if (previous == null) { - futures.add(schedule(hostAdded(newHost))); - } else if (!previous.isUp()) { - futures.add(schedule(hostUp(previous))); - } - break; case DOWN: // Note that there is a slight risk we can receive the event late and thus // mark the host down even though we already had reconnected successfully. @@ -2951,10 +2992,6 @@ public ListenableFuture deliver(List events) { } } break; - case REMOVED: - Host removedHost = metadata.getHost(address); - if (removedHost != null) futures.add(execute(hostRemoved(removedHost))); - break; } } return Futures.allAsList(futures); @@ -3000,28 +3037,13 @@ public void onFailure(Throwable t) { } } - // Make sure we call controlConnection.refreshNodeInfo(host) - // so that we have up-to-date infos on that host before adding it (so we typically - // catch that an upgraded node uses a new cassandra version). - - private ExceptionCatchingRunnable hostAdded(final Host host) { - return new ExceptionCatchingRunnable() { - @Override - public void runMayThrow() throws Exception { - if (controlConnection.refreshNodeInfo(host)) { - onAdd(host, null); - submitNodeListRefresh(); - } else { - logger.debug("Not enough info for {}, ignoring host", host); - } - } - }; - } - private ExceptionCatchingRunnable hostUp(final Host host) { return new ExceptionCatchingRunnable() { @Override public void runMayThrow() throws Exception { + // Make sure we call controlConnection.refreshNodeInfo(host) + // so that we have up-to-date infos on that host before recreating the pools (so we + // typically catch that an upgraded node uses a new cassandra version). if (controlConnection.refreshNodeInfo(host)) { onUp(host, null); } else { @@ -3039,19 +3061,6 @@ public void runMayThrow() throws Exception { } }; } - - private ExceptionCatchingRunnable hostRemoved(final Host host) { - return new ExceptionCatchingRunnable() { - @Override - public void runMayThrow() throws Exception { - if (metadata.remove(host)) { - logger.info("Cassandra host {} removed", host); - onRemove(host); - submitNodeListRefresh(); - } - } - }; - } } private class NodeListRefreshRequest { diff --git a/driver-core/src/main/java/com/datastax/driver/core/ClusterNameMismatchException.java b/driver-core/src/main/java/com/datastax/driver/core/ClusterNameMismatchException.java index 219cd6975f8..31891be7761 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ClusterNameMismatchException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ClusterNameMismatchException.java @@ -15,8 +15,6 @@ */ package com.datastax.driver.core; -import java.net.InetSocketAddress; - /** * Indicates that we've attempted to connect to a node which cluster name doesn't match that of the * other nodes known to the driver. @@ -25,17 +23,17 @@ class ClusterNameMismatchException extends Exception { private static final long serialVersionUID = 0; - public final InetSocketAddress address; + public final EndPoint endPoint; public final String expectedClusterName; public final String actualClusterName; public ClusterNameMismatchException( - InetSocketAddress address, String actualClusterName, String expectedClusterName) { + EndPoint endPoint, String actualClusterName, String expectedClusterName) { super( String.format( "[%s] Host %s reports cluster name '%s' that doesn't match our cluster name '%s'. This host will be ignored.", - address, address, actualClusterName, expectedClusterName)); - this.address = address; + endPoint, endPoint, actualClusterName, expectedClusterName)); + this.endPoint = endPoint; this.expectedClusterName = expectedClusterName; this.actualClusterName = actualClusterName; } diff --git a/driver-core/src/main/java/com/datastax/driver/core/Configuration.java b/driver-core/src/main/java/com/datastax/driver/core/Configuration.java index 26fc9b8d6ad..3ef6922df1b 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Configuration.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Configuration.java @@ -16,6 +16,9 @@ package com.datastax.driver.core; import com.datastax.driver.core.policies.Policies; +import com.google.common.base.Joiner; +import java.util.ArrayList; +import java.util.List; /** * The configuration of the cluster. It configures the following: @@ -55,6 +58,7 @@ public static Builder builder() { private final ThreadingOptions threadingOptions; private final NettyOptions nettyOptions; private final CodecRegistry codecRegistry; + private final String defaultKeyspace; private Configuration( Policies policies, @@ -65,7 +69,8 @@ private Configuration( QueryOptions queryOptions, ThreadingOptions threadingOptions, NettyOptions nettyOptions, - CodecRegistry codecRegistry) { + CodecRegistry codecRegistry, + String defaultKeyspace) { this.policies = policies; this.protocolOptions = protocolOptions; this.poolingOptions = poolingOptions; @@ -75,6 +80,7 @@ private Configuration( this.threadingOptions = threadingOptions; this.nettyOptions = nettyOptions; this.codecRegistry = codecRegistry; + this.defaultKeyspace = defaultKeyspace; } /** @@ -92,13 +98,45 @@ protected Configuration(Configuration toCopy) { toCopy.getQueryOptions(), toCopy.getThreadingOptions(), toCopy.getNettyOptions(), - toCopy.getCodecRegistry()); + toCopy.getCodecRegistry(), + toCopy.getDefaultKeyspace()); } void register(Cluster.Manager manager) { protocolOptions.register(manager); poolingOptions.register(manager); queryOptions.register(manager); + policies.getEndPointFactory().init(manager.getCluster()); + + checkPoliciesIfSni(); + } + + // If using SNI endpoints, the SSL options and auth provider MUST be the "extended" versions, the + // base versions work with IP addresses that might not be unique to a node. + // Throw now since that's probably a configuration error. + private void checkPoliciesIfSni() { + if (policies.getEndPointFactory() instanceof SniEndPointFactory) { + SSLOptions sslOptions = protocolOptions.getSSLOptions(); + List errors = new ArrayList(); + if (sslOptions != null && !(sslOptions instanceof ExtendedRemoteEndpointAwareSslOptions)) { + errors.add( + String.format( + "the configured %s must implement %s", + SSLOptions.class.getSimpleName(), + ExtendedRemoteEndpointAwareSslOptions.class.getSimpleName())); + } + AuthProvider authProvider = protocolOptions.getAuthProvider(); + if (authProvider != null && !(authProvider instanceof ExtendedAuthProvider)) { + errors.add( + String.format( + "the configured %s must implement %s", + AuthProvider.class.getSimpleName(), ExtendedAuthProvider.class.getSimpleName())); + } + if (!errors.isEmpty()) { + throw new IllegalStateException( + "Configuration error: if SNI endpoints are in use, " + Joiner.on(',').join(errors)); + } + } } /** @@ -172,6 +210,9 @@ public NettyOptions getNettyOptions() { return nettyOptions; } + public String getDefaultKeyspace() { + return defaultKeyspace; + } /** * Returns the {@link CodecRegistry} instance for this configuration. * @@ -197,6 +238,7 @@ public static class Builder { private ThreadingOptions threadingOptions; private NettyOptions nettyOptions; private CodecRegistry codecRegistry; + private String defaultKeyspace; /** * Sets the policies for this cluster. @@ -301,6 +343,11 @@ public Builder withCodecRegistry(CodecRegistry codecRegistry) { return this; } + public Builder withDefaultKeyspace(String keyspace) { + this.defaultKeyspace = keyspace; + return this; + } + /** * Builds the final object from this builder. * @@ -318,7 +365,8 @@ public Configuration build() { queryOptions != null ? queryOptions : new QueryOptions(), threadingOptions != null ? threadingOptions : new ThreadingOptions(), nettyOptions != null ? nettyOptions : NettyOptions.DEFAULT_INSTANCE, - codecRegistry != null ? codecRegistry : CodecRegistry.DEFAULT_INSTANCE); + codecRegistry != null ? codecRegistry : CodecRegistry.DEFAULT_INSTANCE, + defaultKeyspace); } } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java index 2aa22a9ad5f..4049c349349 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java @@ -19,40 +19,15 @@ import static io.netty.handler.timeout.IdleState.READER_IDLE; import com.datastax.driver.core.Responses.Result.SetKeyspace; -import com.datastax.driver.core.exceptions.AuthenticationException; -import com.datastax.driver.core.exceptions.BusyConnectionException; -import com.datastax.driver.core.exceptions.ConnectionException; -import com.datastax.driver.core.exceptions.DriverException; -import com.datastax.driver.core.exceptions.DriverInternalError; -import com.datastax.driver.core.exceptions.FrameTooLongException; -import com.datastax.driver.core.exceptions.OperationTimedOutException; -import com.datastax.driver.core.exceptions.TransportException; -import com.datastax.driver.core.exceptions.UnsupportedProtocolVersionException; +import com.datastax.driver.core.exceptions.*; import com.datastax.driver.core.utils.MoreFutures; import com.datastax.driver.core.utils.MoreObjects; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; import com.google.common.collect.MapMaker; -import com.google.common.util.concurrent.AbstractFuture; -import com.google.common.util.concurrent.AsyncFunction; -import com.google.common.util.concurrent.FutureCallback; -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.ListeningExecutorService; -import com.google.common.util.concurrent.SettableFuture; -import com.google.common.util.concurrent.Uninterruptibles; +import com.google.common.util.concurrent.*; import io.netty.bootstrap.Bootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelFutureListener; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelOption; -import io.netty.channel.ChannelPipeline; -import io.netty.channel.EventLoop; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.channel.*; import io.netty.channel.group.ChannelGroup; import io.netty.channel.group.DefaultChannelGroup; import io.netty.channel.socket.SocketChannel; @@ -65,17 +40,11 @@ import io.netty.util.TimerTask; import io.netty.util.concurrent.GlobalEventExecutor; import java.lang.ref.WeakReference; -import java.net.InetSocketAddress; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Queue; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Executor; -import java.util.concurrent.TimeUnit; +import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; @@ -110,7 +79,7 @@ enum State { volatile long maxIdleTime; - final InetSocketAddress address; + final EndPoint endPoint; private final String name; @VisibleForTesting volatile Channel channel; @@ -139,13 +108,13 @@ enum State { * Create a new connection to a Cassandra node and associate it with the given pool. * * @param name the connection name - * @param address the remote address + * @param endPoint the information to connect to the node * @param factory the connection factory to use * @param owner the component owning this connection (may be null). Note that an existing * connection can also be associated to an owner later with {@link #setOwner(Owner)}. */ - protected Connection(String name, InetSocketAddress address, Factory factory, Owner owner) { - this.address = address; + protected Connection(String name, EndPoint endPoint, Factory factory, Owner owner) { + this.endPoint = endPoint; this.factory = factory; this.dispatcher = new Dispatcher(); this.name = name; @@ -156,14 +125,14 @@ protected Connection(String name, InetSocketAddress address, Factory factory, Ow } /** Create a new connection to a Cassandra node. */ - Connection(String name, InetSocketAddress address, Factory factory) { - this(name, address, factory, null); + Connection(String name, EndPoint endPoint, Factory factory) { + this(name, endPoint, factory, null); } ListenableFuture initAsync() { if (factory.isShutdown) return Futures.immediateFailedFuture( - new ConnectionException(address, "Connection factory is shut down")); + new ConnectionException(endPoint, "Connection factory is shut down")); ProtocolVersion protocolVersion = factory.protocolVersion == null @@ -187,7 +156,7 @@ ListenableFuture initAsync() { ? factory.manager.metrics : null)); - ChannelFuture future = bootstrap.connect(address); + ChannelFuture future = bootstrap.connect(endPoint.resolve()); writer.incrementAndGet(); future.addListener( @@ -205,7 +174,7 @@ public void operationComplete(ChannelFuture future) throws Exception { public void operationComplete(ChannelFuture future) throws Exception { channelReadyFuture.setException( new TransportException( - Connection.this.address, + Connection.this.endPoint, "Connection closed during initialization.")); } }); @@ -217,11 +186,11 @@ public void operationComplete(ChannelFuture future) throws Exception { String.format( "%s Error connecting to %s%s", Connection.this, - Connection.this.address, + Connection.this.endPoint, extractMessage(future.cause()))); channelReadyFuture.setException( new TransportException( - Connection.this.address, "Cannot connect", future.cause())); + Connection.this.endPoint, "Cannot connect", future.cause())); } else { logger.debug( "{} Connection established, initializing transport", Connection.this); @@ -266,7 +235,7 @@ public ListenableFuture apply(Throwable t) throws Exception { || t instanceof Error) ? t : new ConnectionException( - Connection.this.address, + Connection.this.endPoint, String.format( "Unexpected error during transport initialization (%s)", t), t); @@ -329,13 +298,20 @@ public ListenableFuture apply(Message.Response response) throws Exception throw unsupportedProtocolVersionException( protocolVersion, error.serverProtocolVersion); throw new TransportException( - address, String.format("Error initializing connection: %s", error.message)); + endPoint, String.format("Error initializing connection: %s", error.message)); case AUTHENTICATE: Responses.Authenticate authenticate = (Responses.Authenticate) response; Authenticator authenticator; try { - authenticator = - factory.authProvider.newAuthenticator(address, authenticate.authenticator); + if (factory.authProvider instanceof ExtendedAuthProvider) { + authenticator = + ((ExtendedAuthProvider) factory.authProvider) + .newAuthenticator(endPoint, authenticate.authenticator); + } else { + authenticator = + factory.authProvider.newAuthenticator( + endPoint.resolve(), authenticate.authenticator); + } } catch (AuthenticationException e) { incrementAuthErrorMetric(); throw e; @@ -357,7 +333,7 @@ public ListenableFuture apply(Message.Response response) throws Exception } default: throw new TransportException( - address, + endPoint, String.format( "Unexpected %s response message from server to a STARTUP message", response.type)); @@ -395,7 +371,7 @@ public ListenableFuture apply(ResultSet rs) throws Exception { Row row = rs.one(); String actual = row.getString("cluster_name"); if (!expected.equals(actual)) - throw new ClusterNameMismatchException(address, actual, expected); + throw new ClusterNameMismatchException(endPoint, actual, expected); markInitialized(); return MoreFutures.VOID_SUCCESS; } @@ -408,7 +384,7 @@ public ListenableFuture apply(ResultSet rs) throws Exception { private void markInitialized() { isInitialized = true; - Host.statesLogger.debug("[{}] {} Transport initialized, connection ready", address, this); + Host.statesLogger.debug("[{}] {} Transport initialized, connection ready", endPoint, this); } private ListenableFuture authenticateV1( @@ -428,10 +404,10 @@ public ListenableFuture apply(Message.Response authResponse) throws Except case ERROR: incrementAuthErrorMetric(); throw new AuthenticationException( - address, ((Responses.Error) authResponse).message); + endPoint, ((Responses.Error) authResponse).message); default: throw new TransportException( - address, + endPoint, String.format( "Unexpected %s response message from server to a CREDENTIALS message", authResponse.type)); @@ -502,10 +478,10 @@ public ListenableFuture apply(Message.Response authResponse) throws Except + "only plain text authentication is supported with this protocol version", authenticator); incrementAuthErrorMetric(); - throw new AuthenticationException(address, message); + throw new AuthenticationException(endPoint, message); default: throw new TransportException( - address, + endPoint, String.format( "Unexpected %s response message from server to authentication message", authResponse.type)); @@ -530,7 +506,7 @@ private boolean isUnsupportedProtocolVersion(Responses.Error error) { private UnsupportedProtocolVersionException unsupportedProtocolVersionException( ProtocolVersion triedVersion, ProtocolVersion serverProtocolVersion) { UnsupportedProtocolVersionException e = - new UnsupportedProtocolVersionException(address, triedVersion, serverProtocolVersion); + new UnsupportedProtocolVersionException(endPoint, triedVersion, serverProtocolVersion); logger.debug(e.getMessage()); return e; } @@ -550,7 +526,7 @@ E defunct(E e) { else if (Host.statesLogger.isDebugEnabled()) Host.statesLogger.debug("Defuncting {} because: {}", this, e.getMessage()); - Host host = factory.manager.metadata.getHost(address); + Host host = getHost(); if (host != null) { // Sometimes close() can be called before defunct(); avoid decrementing the connection count // twice, but @@ -601,7 +577,7 @@ void setKeyspace(String keyspace) throws ConnectionException { "Tried to set the keyspace on busy {}. " + "This should not happen but is not critical (it will be retried)", this); - throw new ConnectionException(address, "Tried to set the keyspace on busy connection"); + throw new ConnectionException(endPoint, "Tried to set the keyspace on busy connection"); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof OperationTimedOutException) { @@ -611,9 +587,9 @@ void setKeyspace(String keyspace) throws ConnectionException { "Timeout while setting keyspace on {}. " + "This should not happen but is not critical (it will be retried)", this); - throw new ConnectionException(address, "Timeout while setting keyspace on connection"); + throw new ConnectionException(endPoint, "Timeout while setting keyspace on connection"); } else { - throw defunct(new ConnectionException(address, "Error while setting keyspace", cause)); + throw defunct(new ConnectionException(endPoint, "Error while setting keyspace", cause)); } } } @@ -664,7 +640,7 @@ public void onSuccess(Message.Response response) { targetKeyspace.compareAndSet(attempt, defaultKeyspaceAttempt); if (response.type == ERROR) { Responses.Error error = (Responses.Error) response; - ksFuture.setException(defunct(error.asException(address))); + ksFuture.setException(defunct(error.asException(endPoint))); } else { ksFuture.setException( defunct( @@ -723,12 +699,12 @@ ResponseHandler write( */ if (isDefunct.get()) { dispatcher.removeHandler(handler, true); - throw new ConnectionException(address, "Write attempt on defunct connection"); + throw new ConnectionException(endPoint, "Write attempt on defunct connection"); } if (isClosed()) { dispatcher.removeHandler(handler, true); - throw new ConnectionException(address, "Connection has been closed"); + throw new ConnectionException(endPoint, "Connection has been closed"); } logger.trace("{}, stream {}, writing request {}", this, request.getStreamId(), request); @@ -764,9 +740,9 @@ public void operationComplete(ChannelFuture writeFuture) { final ConnectionException ce; if (writeFuture.cause() instanceof java.nio.channels.ClosedChannelException) { - ce = new TransportException(address, "Error writing: Closed channel"); + ce = new TransportException(endPoint, "Error writing: Closed channel"); } else { - ce = new TransportException(address, "Error writing", writeFuture.cause()); + ce = new TransportException(endPoint, "Error writing", writeFuture.cause()); } final long latency = System.nanoTime() - handler.startTime; // This handler is executed while holding the writeLock of the channel. @@ -843,7 +819,7 @@ CloseFuture closeAsync() { // Only signal if defunct hasn't done it already if (signaled.compareAndSet(false, true)) { - Host host = factory.manager.metadata.getHost(address); + Host host = getHost(); if (host != null) { host.convictionPolicy.signalConnectionClosed(this); } @@ -862,6 +838,16 @@ CloseFuture closeAsync() { return future; } + private Host getHost() { + Metadata metadata = factory.manager.metadata; + Host host = metadata.getHost(endPoint); + // During init the host might not be in metatada.hosts yet, try the contact points + if (host == null) { + host = metadata.getContactPoint(endPoint); + } + return host; + } + /** * Tries to terminate a closed connection, i.e. release system resources. * @@ -957,12 +943,12 @@ int getPort() { Connection open(Host host) throws ConnectionException, InterruptedException, UnsupportedProtocolVersionException, ClusterNameMismatchException { - InetSocketAddress address = host.getSocketAddress(); + EndPoint endPoint = host.getEndPoint(); - if (isShutdown) throw new ConnectionException(address, "Connection factory is shut down"); + if (isShutdown) throw new ConnectionException(endPoint, "Connection factory is shut down"); host.convictionPolicy.signalConnectionsOpening(1); - Connection connection = new Connection(buildConnectionName(host), address, this); + Connection connection = new Connection(buildConnectionName(host), endPoint, this); // This method opens the connection synchronously, so wait until it's initialized try { connection.initAsync().get(); @@ -978,7 +964,7 @@ Connection open(HostConnectionPool pool) ClusterNameMismatchException { pool.host.convictionPolicy.signalConnectionsOpening(1); Connection connection = - new Connection(buildConnectionName(pool.host), pool.host.getSocketAddress(), this, pool); + new Connection(buildConnectionName(pool.host), pool.host.getEndPoint(), this, pool); try { connection.initAsync().get(); return connection; @@ -996,13 +982,12 @@ List newConnections(HostConnectionPool pool, int count) { List connections = Lists.newArrayListWithCapacity(count); for (int i = 0; i < count; i++) connections.add( - new Connection( - buildConnectionName(pool.host), pool.host.getSocketAddress(), this, pool)); + new Connection(buildConnectionName(pool.host), pool.host.getEndPoint(), this, pool)); return connections; } private String buildConnectionName(Host host) { - return host.getSocketAddress().toString() + '-' + getIdGenerator(host).getAndIncrement(); + return host.getEndPoint().toString() + '-' + getIdGenerator(host).getAndIncrement(); } static RuntimeException launderAsyncInitException(ExecutionException e) @@ -1307,7 +1292,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E } defunct( new TransportException( - address, String.format("Unexpected exception triggered (%s)", cause), cause)); + endPoint, String.format("Unexpected exception triggered (%s)", cause), cause)); } void errorOutAllHandler(ConnectionException ce) { @@ -1329,10 +1314,10 @@ public void operationComplete(ChannelFuture future) throws Exception { // connection, but // if there is remaining thread waiting on us, we still want to wake them up if (!isInitialized || isClosed()) { - dispatcher.errorOutAllHandler(new TransportException(address, "Channel has been closed")); + dispatcher.errorOutAllHandler(new TransportException(endPoint, "Channel has been closed")); // we still want to force so that the future completes Connection.this.closeAsync().force(); - } else defunct(new TransportException(address, "Channel has been closed")); + } else defunct(new TransportException(endPoint, "Channel has been closed")); } } @@ -1360,7 +1345,7 @@ public void onSet( fail( connection, new ConnectionException( - connection.address, "Unexpected heartbeat response: " + response)); + connection.endPoint, "Unexpected heartbeat response: " + response)); } } @@ -1373,7 +1358,8 @@ public void onException( @Override public boolean onTimeout(Connection connection, long latency, int retryCount) { fail( - connection, new ConnectionException(connection.address, "Heartbeat query timed out")); + connection, + new ConnectionException(connection.endPoint, "Heartbeat query timed out")); return true; } @@ -1401,7 +1387,7 @@ public ConnectionCloseFuture force() { // forever. In general this won't happen since we get there only when all ongoing query are // done, but this can happen // if the shutdown is forced. This is a no-op if there is no handler set anymore. - dispatcher.errorOutAllHandler(new TransportException(address, "Connection has been closed")); + dispatcher.errorOutAllHandler(new TransportException(endPoint, "Connection has been closed")); ChannelFuture future = channel.close(); future.addListener( @@ -1447,7 +1433,7 @@ public int hashCode() { static class Future extends AbstractFuture implements RequestHandler.Callback { private final Message.Request request; - private volatile InetSocketAddress address; + private volatile EndPoint endPoint; Future(Message.Request request) { this.request = request; @@ -1482,7 +1468,7 @@ public void onSet( @Override public void onSet( Connection connection, Message.Response response, long latency, int retryCount) { - this.address = connection.address; + this.endPoint = connection.endPoint; super.set(response); } @@ -1491,7 +1477,7 @@ public void onException( Connection connection, Exception exception, long latency, int retryCount) { // If all nodes are down, we will get a null connection here. This is fine, if we have // an exception, consumers shouldn't assume the address is not null. - if (connection != null) this.address = connection.address; + if (connection != null) this.endPoint = connection.endPoint; super.setException(exception); } @@ -1499,12 +1485,12 @@ public void onException( public boolean onTimeout(Connection connection, long latency, int retryCount) { assert connection != null; // We always timeout on a specific connection, so this shouldn't be null - this.address = connection.address; - return super.setException(new OperationTimedOutException(connection.address)); + this.endPoint = connection.endPoint; + return super.setException(new OperationTimedOutException(connection.endPoint)); } - InetSocketAddress getAddress() { - return address; + EndPoint getEndPoint() { + return endPoint; } } @@ -1542,7 +1528,7 @@ static class ResponseHandler { ? statementReadTimeoutMillis : connection.factory.getReadTimeoutMillis(); this.streamId = connection.dispatcher.streamIdHandler.next(); - if (streamId == -1) throw new BusyConnectionException(connection.address); + if (streamId == -1) throw new BusyConnectionException(connection.endPoint); this.callback = callback; this.retryCount = callback.retryCount(); @@ -1642,16 +1628,20 @@ protected void initChannel(SocketChannel channel) throws Exception { ChannelPipeline pipeline = channel.pipeline(); if (sslOptions != null) { - if (sslOptions instanceof RemoteEndpointAwareSSLOptions) { - SslHandler handler = + SslHandler handler; + if (sslOptions instanceof ExtendedRemoteEndpointAwareSslOptions) { + handler = + ((ExtendedRemoteEndpointAwareSslOptions) sslOptions) + .newSSLHandler(channel, connection.endPoint); + + } else if (sslOptions instanceof RemoteEndpointAwareSSLOptions) { + handler = ((RemoteEndpointAwareSSLOptions) sslOptions) - .newSSLHandler(channel, connection.address); - pipeline.addLast("ssl", handler); + .newSSLHandler(channel, connection.endPoint.resolve()); } else { - @SuppressWarnings("deprecation") - SslHandler handler = sslOptions.newSSLHandler(channel); - pipeline.addLast("ssl", handler); + handler = sslOptions.newSSLHandler(channel); } + pipeline.addLast("ssl", handler); } // pipeline.addLast("debug", new LoggingHandler(LogLevel.INFO)); diff --git a/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java b/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java index 91645ecefb4..b16bbfaf92a 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java @@ -73,9 +73,9 @@ class ControlConnection implements Connection.Owner { private static final String SELECT_LOCAL = "SELECT * FROM system.local WHERE key='local'"; private static final String SELECT_SCHEMA_PEERS = - "SELECT peer, rpc_address, schema_version FROM system.peers"; + "SELECT peer, rpc_address, schema_version, host_id FROM system.peers"; private static final String SELECT_SCHEMA_LOCAL = - "SELECT schema_version FROM system.local WHERE key='local'"; + "SELECT schema_version, host_id FROM system.local WHERE key='local'"; @VisibleForTesting final AtomicReference connectionRef = new AtomicReference(); @@ -99,8 +99,7 @@ public ControlConnection(Cluster.Manager manager) { void connect() throws UnsupportedProtocolVersionException { if (isShutdown) return; - // NB: at this stage, allHosts() only contains the initial contact points - List hosts = new ArrayList(cluster.metadata.allHosts()); + List hosts = new ArrayList(cluster.metadata.getContactPoints()); // shuffle so that multiple clients with the same contact points don't all pick the same control // host Collections.shuffle(hosts); @@ -123,7 +122,7 @@ CloseFuture closeAsync() { Host connectedHost() { Connection current = connectionRef.get(); - return (current == null) ? null : cluster.metadata.getHost(current.address); + return (current == null) ? null : cluster.metadata.getHost(current.endPoint); } void triggerReconnect() { @@ -213,7 +212,7 @@ private void signalError() { } private void setNewConnection(Connection newConnection) { - Host.statesLogger.debug("[Control connection] established to {}", newConnection.address); + Host.statesLogger.debug("[Control connection] established to {}", newConnection.endPoint); newConnection.setOwner(this); Connection old = connectionRef.getAndSet(newConnection); if (old != null && !old.isClosed()) old.closeAsync().force(); @@ -222,7 +221,7 @@ private void setNewConnection(Connection newConnection) { private Connection reconnectInternal(Iterator iter, boolean isInitialConnection) throws UnsupportedProtocolVersionException { - Map errors = null; + Map errors = null; Host host = null; try { @@ -265,17 +264,14 @@ private Connection reconnectInternal(Iterator iter, boolean isInitialConne iter.next(), new DriverException("Connection thread interrupted"), errors, iter); } throw new NoHostAvailableException( - errors == null ? Collections.emptyMap() : errors); + errors == null ? Collections.emptyMap() : errors); } - private static Map logError( - Host host, - Throwable exception, - Map errors, - Iterator iter) { - if (errors == null) errors = new HashMap(); + private static Map logError( + Host host, Throwable exception, Map errors, Iterator iter) { + if (errors == null) errors = new HashMap(); - errors.put(host.getSocketAddress(), exception); + errors.put(host.getEndPoint(), exception); if (logger.isDebugEnabled()) { if (iter.hasNext()) { @@ -377,7 +373,7 @@ static void refreshSchema( Cluster.Manager cluster) throws ConnectionException, BusyConnectionException, ExecutionException, InterruptedException { - Host host = cluster.metadata.getHost(connection.address); + Host host = cluster.metadata.getHost(connection.endPoint); // Neither host, nor it's version should be null. But instead of dying if there is a race or // something, we can kind of try to infer // a Cassandra version from the protocol version (this is not full proof, we can have the @@ -390,7 +386,7 @@ static void refreshSchema( logger.warn( "Cannot find Cassandra version for host {} to parse the schema, using {} based on protocol version in use. " + "If parsing the schema fails, this could be the cause", - connection.address, + connection.endPoint, cassandraVersion); } else { cassandraVersion = host.getCassandraVersion(); @@ -447,52 +443,27 @@ void refreshNodeListAndTokenMap() { } } - private static InetSocketAddress nativeAddressForPeerHost( - Row peersRow, InetSocketAddress connectedHost, Cluster.Manager cluster) { - // if native_address is present, this comes from the peers_v2 table. - if (peersRow.getColumnDefinitions().contains("native_address")) { - InetAddress nativeAddress = peersRow.getInet("native_address"); - int nativePort = peersRow.getInt("native_port"); - return cluster.translateAddress(new InetSocketAddress(nativeAddress, nativePort)); - } else { - // after CASSANDRA-9436, system.peers contains the following inet columns: - // - peer: this is actually broadcast_address - // - rpc_address: the address we are looking for (this corresponds to broadcast_rpc_address in - // the peer's cassandra yaml file; - // if this setting if unset, it defaults to the value for rpc_address or - // rpc_interface) - // - preferred_ip: used by Ec2MultiRegionSnitch and GossipingPropertyFileSnitch, possibly - // others; contents unclear - InetAddress broadcastAddress = peersRow.getInet("peer"); - InetAddress rpcAddress = peersRow.getInet("rpc_address"); - - if (broadcastAddress == null) { - return null; - } else if (broadcastAddress.equals(connectedHost.getAddress()) - || (rpcAddress != null && rpcAddress.equals(connectedHost.getAddress()))) { - // Some DSE versions were inserting a line for the local node in peers (with mostly null - // values). This has been fixed, but if we - // detect that's the case, ignore it as it's not really a big deal. - logger.debug( - "System.peers on node {} has a line for itself. This is not normal but is a known problem of some DSE version. Ignoring the entry.", - connectedHost); - return null; - } else if (rpcAddress == null) { - return null; - } else if (rpcAddress.equals(bindAllAddress)) { - logger.warn( - "Found host with 0.0.0.0 as rpc_address, using broadcast_address ({}) to contact it instead. If this is incorrect you should avoid the use of 0.0.0.0 server side.", - broadcastAddress); - rpcAddress = broadcastAddress; - } - return cluster.translateAddress(rpcAddress); + private static EndPoint endPointForPeerHost( + Row peersRow, EndPoint connectedEndPoint, Cluster.Manager cluster) { + EndPoint endPoint = cluster.configuration.getPolicies().getEndPointFactory().create(peersRow); + if (connectedEndPoint.equals(endPoint)) { + // Some DSE versions were inserting a line for the local node in peers (with mostly null + // values). This has been fixed, but if we detect that's the case, ignore it as it's not + // really a big deal. + logger.debug( + "System.peers on node {} has a line for itself. " + + "This is not normal but is a known problem of some DSE versions. " + + "Ignoring the entry.", + connectedEndPoint); + return null; } + return endPoint; } private Row fetchNodeInfo(Host host, Connection c) throws ConnectionException, BusyConnectionException, ExecutionException, InterruptedException { - boolean isConnectedHost = c.address.equals(host.getSocketAddress()); + boolean isConnectedHost = c.endPoint.equals(host.getEndPoint()); if (isConnectedHost || host.getBroadcastSocketAddress() != null) { String query; if (isConnectedHost) { @@ -534,8 +505,10 @@ private Row fetchNodeInfo(Host host, Connection c) // We have to fetch the whole peers table and find the host we're looking for ListenableFuture future = selectPeersFuture(c); for (Row row : future.get()) { - InetSocketAddress addr = nativeAddressForPeerHost(row, c.address, cluster); - if (addr != null && addr.equals(host.getSocketAddress())) return row; + UUID rowId = row.getUUID("host_id"); + if (host.getHostId().equals(rowId)) { + return row; + } } return null; } @@ -561,9 +534,9 @@ boolean refreshNodeInfo(Host host) { } else { logger.warn( "No row found for host {} in {}'s peers system table. {} will be ignored.", - host.getAddress(), - c.address, - host.getAddress()); + host.getEndPoint(), + c.endPoint, + host.getEndPoint()); return false; } // Ignore hosts with a null rpc_address, as this is most likely a phantom row in @@ -571,7 +544,7 @@ boolean refreshNodeInfo(Host host) { // Don't test this for the control host since we're already connected to it anyway, and we // read the info from system.local // which didn't have an rpc_address column (JAVA-546) until CASSANDRA-9436 - } else if (!c.address.equals(host.getSocketAddress()) && !isValidPeer(row, true)) { + } else if (!c.endPoint.equals(host.getEndPoint()) && !isValidPeer(row, true)) { return false; } @@ -623,17 +596,32 @@ private static void updateInfo( // - broadcast_port // - listen_port - InetSocketAddress broadcastAddress = null; + InetSocketAddress broadcastRpcAddress = null; + if (row.getColumnDefinitions().contains("native_address")) { + InetAddress nativeAddress = row.getInet("native_address"); + int nativePort = row.getInt("native_port"); + broadcastRpcAddress = new InetSocketAddress(nativeAddress, nativePort); + } else if (row.getColumnDefinitions().contains("rpc_address")) { + InetAddress rpcAddress = row.getInet("rpc_address"); + broadcastRpcAddress = new InetSocketAddress(rpcAddress, cluster.connectionFactory.getPort()); + } + // Before CASSANDRA-9436, system.local doesn't have rpc_address, so this might be null. It's not + // a big deal because we only use this for server events, and the control node doesn't receive + // events for itself. + host.setBroadcastRpcAddress(broadcastRpcAddress); + + InetSocketAddress broadcastSocketAddress = null; if (row.getColumnDefinitions().contains("peer")) { // system.peers int broadcastPort = row.getColumnDefinitions().contains("peer_port") ? row.getInt("peer_port") : 0; - broadcastAddress = new InetSocketAddress(row.getInet("peer"), broadcastPort); + broadcastSocketAddress = new InetSocketAddress(row.getInet("peer"), broadcastPort); } else if (row.getColumnDefinitions().contains("broadcast_address")) { // system.local int broadcastPort = row.getColumnDefinitions().contains("broadcast_port") ? row.getInt("broadcast_port") : 0; - broadcastAddress = new InetSocketAddress(row.getInet("broadcast_address"), broadcastPort); + broadcastSocketAddress = + new InetSocketAddress(row.getInet("broadcast_address"), broadcastPort); } - host.setBroadcastSocketAddress(broadcastAddress); + host.setBroadcastSocketAddress(broadcastSocketAddress); // in system.local only for C* versions >= 2.0.17, 2.1.8, 2.2.0 rc2, // not yet in system.peers as of C* 3.2 @@ -760,39 +748,53 @@ private void refreshNodeListAndTokenMap( // Update cluster name, DC and rack for the one node we are connected to Row localRow = localFuture.get().one(); - if (localRow != null) { - String clusterName = localRow.getString("cluster_name"); - if (clusterName != null) cluster.metadata.clusterName = clusterName; - - partitioner = localRow.getString("partitioner"); - if (partitioner != null) { - cluster.metadata.partitioner = partitioner; - factory = Token.getFactory(partitioner); - } + if (localRow == null) { + throw new IllegalStateException( + String.format( + "system.local is empty on %s, this should not happen", connection.endPoint)); + } + String clusterName = localRow.getString("cluster_name"); + if (clusterName != null) cluster.metadata.clusterName = clusterName; - Host host = cluster.metadata.getHost(connection.address); - // In theory host can't be null. However there is no point in risking a NPE in case we - // have a race between a node removal and this. - if (host == null) { - logger.debug( - "Host in local system table ({}) unknown to us (ok if said host just got removed)", - connection.address); - } else { - updateInfo(host, localRow, cluster, isInitialConnection); - if (metadataEnabled && factory != null) { - Set tokensStr = localRow.getSet("tokens", String.class); - if (!tokensStr.isEmpty()) { - Set tokens = toTokens(factory, tokensStr); - tokenMap.put(host, tokens); - } + partitioner = localRow.getString("partitioner"); + if (partitioner != null) { + cluster.metadata.partitioner = partitioner; + factory = Token.getFactory(partitioner); + } + + // During init, metadata.allHosts is still empty, the contact points are in + // metadata.contactPoints. We need to copy them over, but we can only do it after having + // called updateInfo, because we need to know the host id. + // This is the same for peer hosts (see further down). + Host controlHost = + isInitialConnection + ? cluster.metadata.getContactPoint(connection.endPoint) + : cluster.metadata.getHost(connection.endPoint); + // In theory host can't be null. However there is no point in risking a NPE in case we + // have a race between a node removal and this. + if (controlHost == null) { + logger.debug( + "Host in local system table ({}) unknown to us (ok if said host just got removed)", + connection.endPoint); + } else { + updateInfo(controlHost, localRow, cluster, isInitialConnection); + if (metadataEnabled && factory != null) { + Set tokensStr = localRow.getSet("tokens", String.class); + if (!tokensStr.isEmpty()) { + Set tokens = toTokens(factory, tokensStr); + tokenMap.put(controlHost, tokens); } } + if (isInitialConnection) { + cluster.metadata.addIfAbsent(controlHost); + } } - List foundHosts = new ArrayList(); + List foundHosts = new ArrayList(); List dcs = new ArrayList(); List racks = new ArrayList(); List cassandraVersions = new ArrayList(); + List broadcastRpcAddresses = new ArrayList(); List broadcastAddresses = new ArrayList(); List listenAddresses = new ArrayList(); List> allTokens = new ArrayList>(); @@ -805,13 +807,27 @@ private void refreshNodeListAndTokenMap( for (Row row : peersFuture.get()) { if (!isValidPeer(row, logInvalidPeers)) continue; - InetSocketAddress rpcAddress = nativeAddressForPeerHost(row, connection.address, cluster); - if (rpcAddress == null) continue; - foundHosts.add(rpcAddress); + EndPoint endPoint = endPointForPeerHost(row, connection.endPoint, cluster); + if (endPoint == null) { + continue; + } + foundHosts.add(endPoint); dcs.add(row.getString("data_center")); racks.add(row.getString("rack")); cassandraVersions.add(row.getString("release_version")); + InetSocketAddress broadcastRpcAddress; + if (row.getColumnDefinitions().contains("native_address")) { + InetAddress nativeAddress = row.getInet("native_address"); + int nativePort = row.getInt("native_port"); + broadcastRpcAddress = new InetSocketAddress(nativeAddress, nativePort); + } else { + InetAddress rpcAddress = row.getInet("rpc_address"); + broadcastRpcAddress = + new InetSocketAddress(rpcAddress, cluster.connectionFactory.getPort()); + } + broadcastRpcAddresses.add(broadcastRpcAddress); + int broadcastPort = row.getColumnDefinitions().contains("peer_port") ? row.getInt("peer_port") : 0; InetSocketAddress broadcastAddress = @@ -850,49 +866,60 @@ private void refreshNodeListAndTokenMap( } for (int i = 0; i < foundHosts.size(); i++) { - Host host = cluster.metadata.getHost(foundHosts.get(i)); + Host peerHost = + isInitialConnection + ? cluster.metadata.getContactPoint(foundHosts.get(i)) + : cluster.metadata.getHost(foundHosts.get(i)); boolean isNew = false; - if (host == null) { + if (peerHost == null) { // We don't know that node, create the Host object but wait until we've set the known // info before signaling the addition. Host newHost = cluster.metadata.newHost(foundHosts.get(i)); + newHost.setHostId(hostIds.get(i)); // we need an id to add to the metadata Host previous = cluster.metadata.addIfAbsent(newHost); if (previous == null) { - host = newHost; + peerHost = newHost; isNew = true; } else { - host = previous; + peerHost = previous; isNew = false; } } if (dcs.get(i) != null || racks.get(i) != null) - updateLocationInfo(host, dcs.get(i), racks.get(i), isInitialConnection, cluster); - if (cassandraVersions.get(i) != null) host.setVersion(cassandraVersions.get(i)); + updateLocationInfo(peerHost, dcs.get(i), racks.get(i), isInitialConnection, cluster); + if (cassandraVersions.get(i) != null) peerHost.setVersion(cassandraVersions.get(i)); + if (broadcastRpcAddresses.get(i) != null) + peerHost.setBroadcastRpcAddress(broadcastRpcAddresses.get(i)); if (broadcastAddresses.get(i) != null) - host.setBroadcastSocketAddress(broadcastAddresses.get(i)); - if (listenAddresses.get(i) != null) host.setListenSocketAddress(listenAddresses.get(i)); - - if (dseVersions.get(i) != null) host.setDseVersion(dseVersions.get(i)); - if (dseWorkloads.get(i) != null) host.setDseWorkload(dseWorkloads.get(i)); - if (dseGraphEnabled.get(i) != null) host.setDseGraphEnabled(dseGraphEnabled.get(i)); - if (hostIds.get(i) != null) { - host.setHostId(hostIds.get(i)); - } + peerHost.setBroadcastSocketAddress(broadcastAddresses.get(i)); + if (listenAddresses.get(i) != null) peerHost.setListenSocketAddress(listenAddresses.get(i)); + + if (dseVersions.get(i) != null) peerHost.setDseVersion(dseVersions.get(i)); + if (dseWorkloads.get(i) != null) peerHost.setDseWorkload(dseWorkloads.get(i)); + if (dseGraphEnabled.get(i) != null) peerHost.setDseGraphEnabled(dseGraphEnabled.get(i)); + peerHost.setHostId(hostIds.get(i)); if (schemaVersions.get(i) != null) { - host.setSchemaVersion(schemaVersions.get(i)); + peerHost.setSchemaVersion(schemaVersions.get(i)); } if (metadataEnabled && factory != null && allTokens.get(i) != null) - tokenMap.put(host, allTokens.get(i)); + tokenMap.put(peerHost, allTokens.get(i)); - if (isNew && !isInitialConnection) cluster.triggerOnAdd(host); + if (!isNew && isInitialConnection) { + // If we're at init and the node already existed, it means it was a contact point, so we + // need to copy it over to the regular host list + cluster.metadata.addIfAbsent(peerHost); + } + if (isNew && !isInitialConnection) { + cluster.triggerOnAdd(peerHost); + } } - // Removes all those that seems to have been removed (since we lost the control connection) - Set foundHostsSet = new HashSet(foundHosts); + // Removes all those that seem to have been removed (since we lost the control connection) + Set foundHostsSet = new HashSet(foundHosts); for (Host host : cluster.metadata.allHosts()) - if (!host.getSocketAddress().equals(connection.address) - && !foundHostsSet.contains(host.getSocketAddress())) + if (!host.getEndPoint().equals(connection.endPoint) + && !foundHostsSet.contains(host.getEndPoint())) cluster.removeHost(host, isInitialConnection); if (metadataEnabled && factory != null && !tokenMap.isEmpty()) @@ -909,19 +936,22 @@ private static Set toTokens(Token.Factory factory, Set tokensStr) private boolean isValidPeer(Row peerRow, boolean logIfInvalid) { boolean isValid = - isPeersV2 - ? peerRow.getColumnDefinitions().contains("native_address") - && peerRow.getColumnDefinitions().contains("native_port") - && !peerRow.isNull("native_address") - && !peerRow.isNull("native_port") - : peerRow.getColumnDefinitions().contains("rpc_address") - && !peerRow.isNull("rpc_address"); + peerRow.getColumnDefinitions().contains("host_id") && !peerRow.isNull("host_id"); + + if (isPeersV2) { + isValid &= + peerRow.getColumnDefinitions().contains("native_address") + && peerRow.getColumnDefinitions().contains("native_port") + && !peerRow.isNull("native_address") + && !peerRow.isNull("native_port"); + } else { + isValid &= + peerRow.getColumnDefinitions().contains("rpc_address") && !peerRow.isNull("rpc_address"); + } if (EXTENDED_PEER_CHECK) { isValid &= - peerRow.getColumnDefinitions().contains("host_id") - && !peerRow.isNull("host_id") - && peerRow.getColumnDefinitions().contains("data_center") + peerRow.getColumnDefinitions().contains("data_center") && !peerRow.isNull("data_center") && peerRow.getColumnDefinitions().contains("rack") && !peerRow.isNull("rack") @@ -1001,10 +1031,10 @@ private static boolean checkSchemaAgreement(Connection connection, Cluster.Manag for (Row row : peersFuture.get()) { - InetSocketAddress addr = nativeAddressForPeerHost(row, connection.address, cluster); - if (addr == null || row.isNull("schema_version")) continue; + UUID hostId = row.getUUID("host_id"); + if (row.isNull("schema_version")) continue; - Host peer = cluster.metadata.getHost(addr); + Host peer = cluster.metadata.getHost(hostId); if (peer != null && peer.isUp()) versions.add(row.getUUID("schema_version")); } logger.debug("Checking for schema agreement: versions are {}", versions); @@ -1040,10 +1070,10 @@ public void onRemove(Host host) { private void onHostGone(Host host) { Connection current = connectionRef.get(); - if (current != null && current.address.equals(host.getSocketAddress())) { + if (current != null && current.endPoint.equals(host.getEndPoint())) { logger.debug( "[Control connection] {} is down/removed and it was the control host, triggering reconnect", - current.address); + current.endPoint); if (!current.isClosed()) current.closeAsync().force(); backgroundReconnect(0); } diff --git a/driver-core/src/main/java/com/datastax/driver/core/DbaasConfigUtil.java b/driver-core/src/main/java/com/datastax/driver/core/DbaasConfigUtil.java new file mode 100644 index 00000000000..c71dfab5686 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/DbaasConfigUtil.java @@ -0,0 +1,185 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.base.Throwables; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.util.ArrayList; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManagerFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class DbaasConfigUtil { + private static final Logger LOGGER = LoggerFactory.getLogger(DbaasConfigUtil.class); + private static final String CONFIG_FILE = "config.json"; + private static final String CONFIG_TRUSTSTORE_FILE = "trustStore.jks"; + private static final String CONFIG_KEYSTORE_FILE = "identity.jks"; + + private static final String METADATA_CONTACT_INFO = "contact_info"; + private static final String METADATA_CONTACT_POINTS = "contact_points"; + private static final String METADATA_LOCAL_DC = "local_dc"; + private static final String METADATA_PROXY_ADDRESS = "sni_proxy_address"; + + private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + + static DbaasConfiguration getConfig(String secureBundlePath) { + try { + File secureBundleFile = new File(secureBundlePath); + DbaasConfiguration dbaasConfig = getBaseConfig(secureBundleFile); + dbaasConfig = getProxyMetadata(dbaasConfig); + return dbaasConfig; + } catch (Exception exception) { + throw new IllegalStateException( + "Unable to construct cloud configuration from url " + secureBundlePath, exception); + } + } + + static DbaasConfiguration getBaseConfig(File secureBundleFile) throws Exception { + + InputStream jsonInputStream = getJsonConfigInputStream(secureBundleFile); + try { + ObjectMapper mapper = new ObjectMapper(); + DbaasConfiguration config = mapper.readValue(jsonInputStream, DbaasConfiguration.class); + config.setSecureBundlePath(secureBundleFile.toString()); + return config; + } finally { + jsonInputStream.close(); + } + } + + private static InputStream getJsonConfigInputStream(File secureBundleFile) throws IOException { + return getZippedFile(secureBundleFile, CONFIG_FILE); + } + + private static InputStream getZippedFile(File secureBundleFile, String innerFileName) + throws IOException { + ZipFile zipFile = new ZipFile(secureBundleFile); + ZipEntry configEntry = zipFile.getEntry(innerFileName); + return zipFile.getInputStream(configEntry); + } + + private static InputStream getZippedFile(String secureBundlePath, String innerFileName) + throws IOException { + return getZippedFile(new File(secureBundlePath), innerFileName); + } + + private static InputStream getTrustStore(DbaasConfiguration config) throws IOException { + return getZippedFile(config.getSecureBundlePath(), CONFIG_TRUSTSTORE_FILE); + } + + private static InputStream getKeyStore(DbaasConfiguration config) throws IOException { + return getZippedFile(config.getSecureBundlePath(), CONFIG_KEYSTORE_FILE); + } + + private static DbaasConfiguration getProxyMetadata(DbaasConfiguration dbaasConfig) + throws Exception { + try { + URL metaDataServiceUrl = + new URL("https://" + dbaasConfig.getHost() + ":" + dbaasConfig.getPort() + "/metadata"); + HttpsURLConnection connection = (HttpsURLConnection) metaDataServiceUrl.openConnection(); + SSLContext sslContext = DbaasConfigUtil.getSSLContext(dbaasConfig); + connection.setSSLSocketFactory(sslContext.getSocketFactory()); + connection.setRequestMethod("GET"); + connection.setRequestProperty("host", "localhost"); + BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream())); + StringBuilder result = new StringBuilder(); + try { + String line; + while ((line = rd.readLine()) != null) { + result.append(line); + } + } finally { + rd.close(); + } + return getConfigFromMetadataJson(dbaasConfig, result.toString()); + } catch (Exception e) { + LOGGER.error("Unable to fetch cluster metadata", e); + throw e; + } + } + + static DbaasConfiguration getConfigFromMetadataJson( + DbaasConfiguration dbaasConfig, String jsonString) throws Exception { + JsonNode json = OBJECT_MAPPER.readTree(jsonString); + JsonNode contactInfo = json.get(METADATA_CONTACT_INFO); + dbaasConfig.setLocalDC(contactInfo.get(METADATA_LOCAL_DC).asText()); + List hostIds = new ArrayList(); + JsonNode hostIdsJSON = contactInfo.get(METADATA_CONTACT_POINTS); + for (int i = 0; i < hostIdsJSON.size(); i++) { + hostIds.add(hostIdsJSON.get(i).asText()); + } + dbaasConfig.setHostIds(hostIds); + String[] sniHostComplete = contactInfo.get(METADATA_PROXY_ADDRESS).asText().split(":"); + dbaasConfig.setSniHost(sniHostComplete[0]); + dbaasConfig.setSniPort(Integer.parseInt(sniHostComplete[1])); + return dbaasConfig; + } + + private static SSLContext getSSLContext(DbaasConfiguration config) throws Exception { + + TrustManagerFactory tmf; + SSLContext context = SSLContext.getInstance("SSL"); + InputStream trustStoreStream = getTrustStore(config); + try { + KeyStore ts = KeyStore.getInstance("JKS"); + char[] trustPassword = config.getTrustStorePassword().toCharArray(); + ts.load(trustStoreStream, trustPassword); + tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + tmf.init(ts); + } finally { + trustStoreStream.close(); + } + + // initialize keystore. + KeyManagerFactory kmf; + InputStream keyStoreStream = getKeyStore(config); + try { + KeyStore ks = KeyStore.getInstance("JKS"); + char[] keyStorePassword = config.getKeyStorePassword().toCharArray(); + ks.load(keyStoreStream, keyStorePassword); + kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); + kmf.init(ks, keyStorePassword); + } finally { + keyStoreStream.close(); + } + + context.init(kmf.getKeyManagers(), tmf.getTrustManagers(), new SecureRandom()); + return context; + } + + static SSLOptions getSSLOptions(DbaasConfiguration dbaasConfig) { + try { + return SniSSLOptions.builder().withSSLContext(getSSLContext(dbaasConfig)).build(); + } catch (Exception e) { + throw Throwables.propagate(e); + } + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/DbaasConfiguration.java b/driver-core/src/main/java/com/datastax/driver/core/DbaasConfiguration.java new file mode 100644 index 00000000000..81863a08c6e --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/DbaasConfiguration.java @@ -0,0 +1,140 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.List; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class DbaasConfiguration { + private String username; + private String password; + private String host; + private int port; + private String sniHost; + private int sniPort; + private List hostIds; + private String keyspace; + private String localDC; + private String keyStorePassword; + private String trustStorePassword; + private String secureBundlePath; + private boolean zip; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } + + public String getSniHost() { + return sniHost; + } + + public void setSniHost(String sniHost) { + this.sniHost = sniHost; + } + + public int getSniPort() { + return sniPort; + } + + public void setSniPort(int sniPort) { + this.sniPort = sniPort; + } + + public List getHostIds() { + return hostIds; + } + + public void setHostIds(List hostIds) { + this.hostIds = hostIds; + } + + public String getKeyspace() { + return keyspace; + } + + public void setKeyspace(String keyspace) { + this.keyspace = keyspace; + } + + public String getLocalDC() { + return localDC; + } + + public void setLocalDC(String localDC) { + this.localDC = localDC; + } + + public String getKeyStorePassword() { + return keyStorePassword; + } + + public void setKeyStorePassword(String keyStorePassword) { + this.keyStorePassword = keyStorePassword; + } + + public String getTrustStorePassword() { + return trustStorePassword; + } + + public void setTrustStorePassword(String trustStorePassword) { + this.trustStorePassword = trustStorePassword; + } + + public String getSecureBundlePath() { + return secureBundlePath; + } + + public void setSecureBundlePath(String secureBundlePath) { + this.secureBundlePath = secureBundlePath; + } + + public boolean isZip() { + return zip; + } + + public void setZip(boolean zip) { + this.zip = zip; + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/DefaultEndPointFactory.java b/driver-core/src/main/java/com/datastax/driver/core/DefaultEndPointFactory.java new file mode 100644 index 00000000000..c1378abf27d --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/DefaultEndPointFactory.java @@ -0,0 +1,69 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.UnknownHostException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DefaultEndPointFactory implements EndPointFactory { + + private static final Logger logger = LoggerFactory.getLogger(ControlConnection.class); + private static final InetAddress BIND_ALL_ADDRESS; + + static { + try { + BIND_ALL_ADDRESS = InetAddress.getByAddress(new byte[4]); + } catch (UnknownHostException e) { + throw new RuntimeException(e); + } + } + + private volatile Cluster cluster; + + @Override + public void init(Cluster cluster) { + this.cluster = cluster; + } + + @Override + public EndPoint create(Row peersRow) { + if (peersRow.getColumnDefinitions().contains("native_address")) { + InetAddress nativeAddress = peersRow.getInet("native_address"); + int nativePort = peersRow.getInt("native_port"); + InetSocketAddress translateAddress = + cluster.manager.translateAddress(new InetSocketAddress(nativeAddress, nativePort)); + return new TranslatedAddressEndPoint(translateAddress); + } else { + InetAddress broadcastAddress = peersRow.getInet("peer"); + InetAddress rpcAddress = peersRow.getInet("rpc_address"); + if (broadcastAddress == null || rpcAddress == null) { + return null; + } else if (rpcAddress.equals(BIND_ALL_ADDRESS)) { + logger.warn( + "Found host with 0.0.0.0 as rpc_address, " + + "using broadcast_address ({}) to contact it instead. " + + "If this is incorrect you should avoid the use of 0.0.0.0 server side.", + broadcastAddress); + rpcAddress = broadcastAddress; + } + InetSocketAddress translateAddress = cluster.manager.translateAddress(rpcAddress); + return new TranslatedAddressEndPoint(translateAddress); + } + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/DefaultResultSetFuture.java b/driver-core/src/main/java/com/datastax/driver/core/DefaultResultSetFuture.java index 068cb582717..13ac90cecac 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/DefaultResultSetFuture.java +++ b/driver-core/src/main/java/com/datastax/driver/core/DefaultResultSetFuture.java @@ -212,24 +212,24 @@ public void run() { } break; case ERROR: - setException(((Responses.Error) response).asException(connection.address)); + setException(((Responses.Error) response).asException(connection.endPoint)); break; default: // This mean we have probably have a bad node, so defunct the connection connection.defunct( new ConnectionException( - connection.address, String.format("Got unexpected %s response", response.type))); + connection.endPoint, String.format("Got unexpected %s response", response.type))); setException( new DriverInternalError( String.format( - "Got unexpected %s response from %s", response.type, connection.address))); + "Got unexpected %s response from %s", response.type, connection.endPoint))); break; } } catch (Throwable e) { // If we get a bug here, the client will not get it, so better forwarding the error setException( new DriverInternalError( - "Unexpected error while processing response from " + connection.address, e)); + "Unexpected error while processing response from " + connection.endPoint, e)); } } @@ -254,7 +254,7 @@ public boolean onTimeout(Connection connection, long latency, int retryCount) { // RequestHandler). // So just set an exception for the final result, which should be handled correctly by said // internal call. - setException(new OperationTimedOutException(connection.address)); + setException(new OperationTimedOutException(connection.endPoint)); return true; } diff --git a/driver-core/src/main/java/com/datastax/driver/core/DelegatingCluster.java b/driver-core/src/main/java/com/datastax/driver/core/DelegatingCluster.java index 881a9ca8633..ad718645e81 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/DelegatingCluster.java +++ b/driver-core/src/main/java/com/datastax/driver/core/DelegatingCluster.java @@ -16,7 +16,6 @@ package com.datastax.driver.core; import com.google.common.util.concurrent.ListenableFuture; -import java.net.InetSocketAddress; import java.util.Collections; /** @@ -47,7 +46,7 @@ protected DelegatingCluster() { // Construct parent class with dummy parameters that will never get used (since super.init() is // never called). - super("delegating_cluster", Collections.emptyList(), null); + super("delegating_cluster", Collections.emptyList(), null); // Immediately close the parent class's internal Manager, to make sure that it will fail fast if // it's ever diff --git a/driver-core/src/main/java/com/datastax/driver/core/EndPoint.java b/driver-core/src/main/java/com/datastax/driver/core/EndPoint.java new file mode 100644 index 00000000000..80eefbce103 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/EndPoint.java @@ -0,0 +1,30 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import java.net.InetSocketAddress; + +/** Encapsulates the information needed by the driver to open connections to a node. */ +public interface EndPoint { + + /** + * Resolves this instance to a socket address. + * + *

    This will be called each time the driver opens a new connection to the node. The returned + * address cannot be null. + */ + InetSocketAddress resolve(); +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/EndPointFactory.java b/driver-core/src/main/java/com/datastax/driver/core/EndPointFactory.java new file mode 100644 index 00000000000..4ef0e4fa1da --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/EndPointFactory.java @@ -0,0 +1,37 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +/** + * Produces {@link EndPoint} instances representing the connection information to every node. + * + *

    This component is reserved for advanced use cases where the driver needs more than an IP + * address to connect. + * + *

    Note that if endpoints do not translate to addresses 1-to-1, the auth provider and SSL options + * should be instances of {@link ExtendedAuthProvider} and {@link + * ExtendedRemoteEndpointAwareSslOptions} respectively. + */ +public interface EndPointFactory { + + void init(Cluster cluster); + + /** + * Creates an instance from a row in {@code system.peers}, or returns {@code null} if there is no + * sufficient information. + */ + EndPoint create(Row peersRow); +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/ExtendedAuthProvider.java b/driver-core/src/main/java/com/datastax/driver/core/ExtendedAuthProvider.java new file mode 100644 index 00000000000..c65baac64b1 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/ExtendedAuthProvider.java @@ -0,0 +1,82 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import com.datastax.driver.core.exceptions.AuthenticationException; +import java.net.InetSocketAddress; + +/** + * An auth provider that represents the host as an {@link EndPoint} instead of a raw {@link + * InetSocketAddress}. + * + *

    This interface exists solely for backward compatibility: it wasn't possible to change {@link + * AuthProvider} directly, because it would have broken every 3rd-party implementation. + * + *

    All built-in providers now implement this interface, and it is recommended that new + * implementations do too. + * + *

    When the driver calls an auth provider, it will check if it implements this interface. If so, + * it will call {@link #newAuthenticator(EndPoint, String)}; otherwise it will convert the endpoint + * into an address with {@link EndPoint#resolve()} and call {@link + * AuthProvider#newAuthenticator(InetSocketAddress, String)}. + */ +public interface ExtendedAuthProvider extends AuthProvider { + + /** + * The {@code Authenticator} to use when connecting to {@code endpoint}. + * + * @param endPoint the Cassandra host to connect to. + * @param authenticator the configured authenticator on the host. + * @return The authentication implementation to use. + */ + Authenticator newAuthenticator(EndPoint endPoint, String authenticator) + throws AuthenticationException; + + /** + * @deprecated the driver will never call this method on {@link ExtendedAuthProvider} instances. + * Implementors should throw {@link AssertionError}. + */ + @Override + @Deprecated + Authenticator newAuthenticator(InetSocketAddress host, String authenticator) + throws AuthenticationException; + + class NoAuthProvider implements ExtendedAuthProvider { + + private static final String DSE_AUTHENTICATOR = + "com.datastax.bdp.cassandra.auth.DseAuthenticator"; + + static final String NO_AUTHENTICATOR_MESSAGE = + "Host %s requires authentication, but no authenticator found in Cluster configuration"; + + @Override + public Authenticator newAuthenticator(EndPoint endPoint, String authenticator) { + if (authenticator.equals(DSE_AUTHENTICATOR)) { + return new TransitionalModePlainTextAuthenticator(); + } + throw new AuthenticationException( + endPoint, String.format(NO_AUTHENTICATOR_MESSAGE, endPoint)); + } + + @Override + public Authenticator newAuthenticator(InetSocketAddress host, String authenticator) + throws AuthenticationException { + throw new AssertionError( + "The driver should never call this method on an object that implements " + + this.getClass().getSimpleName()); + } + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/ExtendedRemoteEndpointAwareSslOptions.java b/driver-core/src/main/java/com/datastax/driver/core/ExtendedRemoteEndpointAwareSslOptions.java new file mode 100644 index 00000000000..cc7eb34ace6 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/ExtendedRemoteEndpointAwareSslOptions.java @@ -0,0 +1,39 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import io.netty.channel.socket.SocketChannel; +import io.netty.handler.ssl.SslHandler; + +public interface ExtendedRemoteEndpointAwareSslOptions extends RemoteEndpointAwareSSLOptions { + + /** + * Creates a new SSL handler for the given Netty channel and the given remote endpoint. + * + *

    This gets called each time the driver opens a new connection to a Cassandra host. The newly + * created handler will be added to the channel's pipeline to provide SSL support for the + * connection. + * + *

    You don't necessarily need to implement this method directly; see the provided + * implementations: {@link RemoteEndpointAwareJdkSSLOptions} and {@link + * RemoteEndpointAwareNettySSLOptions}. + * + * @param channel the channel. + * @param remoteEndpoint the remote endpoint information. + * @return a newly-created {@link SslHandler}. + */ + SslHandler newSSLHandler(SocketChannel channel, EndPoint remoteEndpoint); +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/Host.java b/driver-core/src/main/java/com/datastax/driver/core/Host.java index fea67bade97..e044cf5fea1 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Host.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Host.java @@ -15,7 +15,6 @@ */ package com.datastax.driver.core; -import com.datastax.driver.core.policies.AddressTranslator; import com.google.common.util.concurrent.ListenableFuture; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -38,7 +37,11 @@ public class Host { static final Logger statesLogger = LoggerFactory.getLogger(Host.class.getName() + ".STATES"); // The address we'll use to connect to the node - private final InetSocketAddress address; + private final EndPoint endPoint; + + // The broadcast RPC address, as reported in system tables. + // Note that, unlike previous versions of the driver, this address is NOT TRANSLATED. + private volatile InetSocketAddress broadcastRpcAddress; // The broadcast_address as known by Cassandra. // We use that internally because @@ -84,16 +87,13 @@ enum State { private volatile boolean dseGraphEnabled; private volatile VersionNumber dseVersion; - // ClusterMetadata keeps one Host object per inet address and we rely on this (more precisely, - // we rely on the fact that we can use Object equality as a valid equality), so don't use - // that constructor but ClusterMetadata.getHost instead. Host( - InetSocketAddress address, + EndPoint endPoint, ConvictionPolicy.Factory convictionPolicyFactory, Cluster.Manager manager) { - if (address == null || convictionPolicyFactory == null) throw new NullPointerException(); + if (endPoint == null || convictionPolicyFactory == null) throw new NullPointerException(); - this.address = address; + this.endPoint = endPoint; this.convictionPolicy = convictionPolicyFactory.create(this, manager.reconnectionPolicy()); this.manager = manager; this.defaultExecutionInfo = new ExecutionInfo(this); @@ -118,6 +118,10 @@ void setVersion(String cassandraVersion) { this.cassandraVersion = versionNumber; } + void setBroadcastRpcAddress(InetSocketAddress broadcastRpcAddress) { + this.broadcastRpcAddress = broadcastRpcAddress; + } + void setBroadcastSocketAddress(InetSocketAddress broadcastAddress) { this.broadcastSocketAddress = broadcastAddress; } @@ -159,38 +163,56 @@ boolean supports(ProtocolVersion version) { || version.minCassandraVersion().compareTo(getCassandraVersion().nextStable()) <= 0; } + /** Returns information to connect to the node. */ + public EndPoint getEndPoint() { + return endPoint; + } + /** * Returns the address that the driver will use to connect to the node. * - *

    This is a shortcut for {@code getSocketAddress().getAddress()}. - * - * @return the address. - * @see #getSocketAddress() + * @deprecated This is exposed mainly for historical reasons. Internally, the driver uses {@link + * #getEndPoint()} to establish connections. This is a shortcut for {@code + * getEndPoint().resolve().getAddress()}. */ + @Deprecated public InetAddress getAddress() { - return address.getAddress(); + return endPoint.resolve().getAddress(); } /** * Returns the address and port that the driver will use to connect to the node. * - *

    This is the node's broadcast RPC address, possibly translated if an {@link - * AddressTranslator} has been configured for this cluster. - * - *

    The broadcast RPC address is inferred from the following cassandra.yaml file settings: - * - *

      - *
    1. {@code rpc_address}, {@code rpc_interface} or {@code broadcast_rpc_address} - *
    2. {@code native_transport_port} - *
    - * - * @return the address and port. + * @deprecated This is exposed mainly for historical reasons. Internally, the driver uses {@link + * #getEndPoint()} to establish connections. This is a shortcut for {@code + * getEndPoint().resolve()}. * @see The * cassandra.yaml configuration file */ + @Deprecated public InetSocketAddress getSocketAddress() { - return address; + return endPoint.resolve(); + } + + /** + * Returns the broadcast RPC address, as reported by the node. + * + *

    This is address reported in {@code system.peers.rpc_address} (Cassandra 3) or {@code + * system.peers_v2.native_address/native_port} (Cassandra 4+). + * + *

    Note that this is not necessarily the address that the driver will use to connect: if the + * node is accessed through a proxy, a translation might be necessary; this is handled by {@link + * #getEndPoint()}. + * + *

    For versions of Cassandra less than 2.0.16, 2.1.6 or 2.2.0-rc1, this will be {@code null} + * for the control host. It will get updated if the control connection switches to another host. + * + * @see CASSANDRA-9436 (where the + * information was added for the control host) + */ + public InetSocketAddress getBroadcastRpcAddress() { + return broadcastRpcAddress; } /** @@ -463,14 +485,14 @@ public void tryReconnectOnce() { public boolean equals(Object other) { if (other instanceof Host) { Host that = (Host) other; - return this.address.equals(that.address); + return this.endPoint.equals(that.endPoint); } return false; } @Override public int hashCode() { - return address.hashCode(); + return endPoint.hashCode(); } boolean wasJustAdded() { @@ -479,7 +501,7 @@ boolean wasJustAdded() { @Override public String toString() { - return address.toString(); + return endPoint.toString(); } void setDown() { diff --git a/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java b/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java index c723808bf74..ed6631ec4bf 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java +++ b/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java @@ -170,7 +170,7 @@ public void onSuccess(List l) { if (isClosed()) { initFuture.setException( new ConnectionException( - host.getSocketAddress(), "Pool was closed during initialization")); + host.getEndPoint(), "Pool was closed during initialization")); // we're not sure if closeAsync() saw the connections, so ensure they get closed forceClose(connections); } else { @@ -238,7 +238,7 @@ ListenableFuture borrowConnection(long timeout, TimeUnit unit, int m Phase phase = this.phase.get(); if (phase != Phase.READY) return Futures.immediateFailedFuture( - new ConnectionException(host.getSocketAddress(), "Pool is " + phase)); + new ConnectionException(host.getEndPoint(), "Pool is " + phase)); if (connections.isEmpty()) { if (host.convictionPolicy.canReconnectNow()) { @@ -270,7 +270,7 @@ ListenableFuture borrowConnection(long timeout, TimeUnit unit, int m // We could have raced with a shutdown since the last check if (isClosed()) return Futures.immediateFailedFuture( - new ConnectionException(host.getSocketAddress(), "Pool is shutdown")); + new ConnectionException(host.getEndPoint(), "Pool is shutdown")); // This might maybe happen if the number of core connections per host is 0 and a connection // was trashed between // the previous check to connections and now. But in that case, the line above will have @@ -316,14 +316,14 @@ ListenableFuture borrowConnection(long timeout, TimeUnit unit, int m private ListenableFuture enqueue(long timeout, TimeUnit unit, int maxQueueSize) { if (timeout == 0 || maxQueueSize == 0) { - return Futures.immediateFailedFuture(new BusyPoolException(host.getSocketAddress(), 0)); + return Futures.immediateFailedFuture(new BusyPoolException(host.getEndPoint(), 0)); } while (true) { int count = pendingBorrowCount.get(); if (count >= maxQueueSize) { return Futures.immediateFailedFuture( - new BusyPoolException(host.getSocketAddress(), maxQueueSize)); + new BusyPoolException(host.getEndPoint(), maxQueueSize)); } if (pendingBorrowCount.compareAndSet(count, count + 1)) { break; @@ -337,8 +337,7 @@ private ListenableFuture enqueue(long timeout, TimeUnit unit, int ma // was properly // handled in closeAsync. if (phase.get() == Phase.CLOSING) { - pendingBorrow.setException( - new ConnectionException(host.getSocketAddress(), "Pool is shutdown")); + pendingBorrow.setException(new ConnectionException(host.getEndPoint(), "Pool is shutdown")); } return pendingBorrow.future; @@ -658,8 +657,7 @@ final CloseFuture closeAsync() { phase.set(Phase.CLOSING); for (PendingBorrow pendingBorrow : pendingBorrows) { - pendingBorrow.setException( - new ConnectionException(host.getSocketAddress(), "Pool is shutdown")); + pendingBorrow.setException(new ConnectionException(host.getEndPoint(), "Pool is shutdown")); } future = new CloseFuture.Forwarding(discardAvailableConnections()); @@ -743,8 +741,7 @@ private class PendingBorrow { new Runnable() { @Override public void run() { - future.setException( - new BusyPoolException(host.getSocketAddress(), timeout, unit)); + future.setException(new BusyPoolException(host.getEndPoint(), timeout, unit)); } }, timeout, diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/IgnoreJDK6Requirement.java b/driver-core/src/main/java/com/datastax/driver/core/IgnoreJDK6Requirement.java similarity index 73% rename from driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/IgnoreJDK6Requirement.java rename to driver-core/src/main/java/com/datastax/driver/core/IgnoreJDK6Requirement.java index 665d5cef0af..9fc5f7b0504 100644 --- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/IgnoreJDK6Requirement.java +++ b/driver-core/src/main/java/com/datastax/driver/core/IgnoreJDK6Requirement.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.datastax.driver.extras.codecs.jdk8; +package com.datastax.driver.core; /** - * Annotation used to mark classes in this package as excluded from JDK signature check performed by - * animal-sniffer - * Maven plugin as they require JDK 8 and not the usual JDK 6. + * Maven plugin as they require JDK 8 or higher. */ -@interface IgnoreJDK6Requirement {} +public @interface IgnoreJDK6Requirement {} diff --git a/driver-core/src/main/java/com/datastax/driver/core/Metadata.java b/driver-core/src/main/java/com/datastax/driver/core/Metadata.java index 2db76467155..3bd4f9c31a0 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Metadata.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Metadata.java @@ -31,8 +31,10 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; +import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.locks.ReentrantLock; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,8 +47,10 @@ public class Metadata { final Cluster.Manager cluster; volatile String clusterName; volatile String partitioner; - private final ConcurrentMap hosts = - new ConcurrentHashMap(); + // Holds the contact points until we have a connection to the cluster + private final List contactPoints = new CopyOnWriteArrayList(); + // The hosts, keyed by their host_id + private final ConcurrentMap hosts = new ConcurrentHashMap(); final ConcurrentMap keyspaces = new ConcurrentHashMap(); private volatile TokenMap tokenMap; @@ -146,24 +150,62 @@ void rebuildTokenMap(Token.Factory factory, Map> allTokens) { } } - Host newHost(InetSocketAddress address) { - return new Host(address, cluster.convictionPolicyFactory, cluster); + Host newHost(EndPoint endPoint) { + return new Host(endPoint, cluster.convictionPolicyFactory, cluster); + } + + void addContactPoint(EndPoint contactPoint) { + contactPoints.add(newHost(contactPoint)); + } + + List getContactPoints() { + return contactPoints; + } + + Host getContactPoint(EndPoint endPoint) { + for (Host host : contactPoints) { + if (host.getEndPoint().equals(endPoint)) { + return host; + } + } + return null; } /** - * @return the previous host associated with this socket address, or {@code null} if there was no - * such host. + * @return the previous host associated with this id, or {@code null} if there was no such host. */ Host addIfAbsent(Host host) { - return hosts.putIfAbsent(host.getSocketAddress(), host); + return hosts.putIfAbsent(host.getHostId(), host); } boolean remove(Host host) { - return hosts.remove(host.getSocketAddress()) != null; + return hosts.remove(host.getHostId()) != null; + } + + Host getHost(UUID hostId) { + return hosts.get(hostId); } - Host getHost(InetSocketAddress address) { - return hosts.get(address); + /** + * @param broadcastRpcAddress the untranslated broadcast RPC address, as indicated in + * server events. + */ + Host getHost(InetSocketAddress broadcastRpcAddress) { + for (Host host : hosts.values()) { + if (broadcastRpcAddress.equals(host.getBroadcastRpcAddress())) { + return host; + } + } + return null; + } + + Host getHost(EndPoint endPoint) { + for (Host host : hosts.values()) { + if (host.getEndPoint().equals(endPoint)) { + return host; + } + } + return null; } // For internal use only diff --git a/driver-core/src/main/java/com/datastax/driver/core/MetricsUtil.java b/driver-core/src/main/java/com/datastax/driver/core/MetricsUtil.java index 712244d3646..b3252f63a15 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/MetricsUtil.java +++ b/driver-core/src/main/java/com/datastax/driver/core/MetricsUtil.java @@ -15,12 +15,25 @@ */ package com.datastax.driver.core; +import java.net.InetAddress; + public class MetricsUtil { public static String hostMetricName(String prefix, Host host) { + EndPoint endPoint = host.getEndPoint(); + if (endPoint instanceof TranslatedAddressEndPoint) { + InetAddress address = endPoint.resolve().getAddress(); + return hostMetricNameFromAddress(prefix, address); + } else { + // We have no guarantee that endpoints resolve to unique addresses + return prefix + endPoint.toString(); + } + } + + private static String hostMetricNameFromAddress(String prefix, InetAddress address) { StringBuilder result = new StringBuilder(prefix); boolean first = true; - for (byte b : host.getSocketAddress().getAddress().getAddress()) { + for (byte b : address.getAddress()) { if (first) { first = false; } else { diff --git a/driver-core/src/main/java/com/datastax/driver/core/PlainTextAuthProvider.java b/driver-core/src/main/java/com/datastax/driver/core/PlainTextAuthProvider.java index 341e3d975e4..49030c51084 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/PlainTextAuthProvider.java +++ b/driver-core/src/main/java/com/datastax/driver/core/PlainTextAuthProvider.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core; +import com.datastax.driver.core.exceptions.AuthenticationException; import com.google.common.base.Charsets; import com.google.common.collect.ImmutableMap; import java.net.InetSocketAddress; @@ -27,7 +28,7 @@ * apply to all hosts. The PlainTextAuthenticator instances it returns support SASL authentication * using the PLAIN mechanism for version 2 (or above) of the CQL native protocol. */ -public class PlainTextAuthProvider implements AuthProvider { +public class PlainTextAuthProvider implements ExtendedAuthProvider { private volatile String username; private volatile String password; @@ -74,16 +75,23 @@ public void setPassword(String password) { * behalf of the client */ @Override - public Authenticator newAuthenticator(InetSocketAddress host, String authenticator) { + public Authenticator newAuthenticator(EndPoint host, String authenticator) { return new PlainTextAuthenticator(username, password); } + @Override + public Authenticator newAuthenticator(InetSocketAddress host, String authenticator) + throws AuthenticationException { + throw new AssertionError( + "The driver should never call this method on an object that implements " + + this.getClass().getSimpleName()); + } + /** * Simple implementation of {@link Authenticator} which can perform authentication against * Cassandra servers configured with PasswordAuthenticator. */ - private static class PlainTextAuthenticator extends ProtocolV1Authenticator - implements Authenticator { + static class PlainTextAuthenticator extends ProtocolV1Authenticator implements Authenticator { private final byte[] username; private final byte[] password; diff --git a/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.java b/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.java index 7169a16b710..17db85a42cd 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.java +++ b/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.java @@ -29,7 +29,7 @@ */ @SuppressWarnings("deprecation") public class RemoteEndpointAwareJdkSSLOptions extends JdkSSLOptions - implements RemoteEndpointAwareSSLOptions { + implements ExtendedRemoteEndpointAwareSslOptions { /** * Creates a builder to create a new instance. @@ -57,11 +57,19 @@ public SslHandler newSSLHandler(SocketChannel channel) { } @Override - public SslHandler newSSLHandler(SocketChannel channel, InetSocketAddress remoteEndpoint) { - SSLEngine engine = newSSLEngine(channel, remoteEndpoint); + public SslHandler newSSLHandler(SocketChannel channel, EndPoint remoteEndpoint) { + SSLEngine engine = + newSSLEngine(channel, remoteEndpoint == null ? null : remoteEndpoint.resolve()); return new SslHandler(engine); } + @Override + public SslHandler newSSLHandler(SocketChannel channel, InetSocketAddress remoteEndpoint) { + throw new AssertionError( + "The driver should never call this method on an object that implements " + + this.getClass().getSimpleName()); + } + /** * Creates an SSL engine each time a connection is established. * @@ -75,10 +83,12 @@ public SslHandler newSSLHandler(SocketChannel channel, InetSocketAddress remoteE */ protected SSLEngine newSSLEngine( @SuppressWarnings("unused") SocketChannel channel, InetSocketAddress remoteEndpoint) { - SSLEngine engine = - remoteEndpoint == null - ? context.createSSLEngine() - : context.createSSLEngine(remoteEndpoint.getHostName(), remoteEndpoint.getPort()); + SSLEngine engine; + if (remoteEndpoint == null) { + engine = context.createSSLEngine(); + } else { + engine = context.createSSLEngine(remoteEndpoint.getHostName(), remoteEndpoint.getPort()); + } engine.setUseClientMode(true); if (cipherSuites != null) engine.setEnabledCipherSuites(cipherSuites); return engine; diff --git a/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.java b/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.java index dfc3537ebbd..5bf69ed0517 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.java +++ b/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.java @@ -31,7 +31,7 @@ */ @SuppressWarnings("deprecation") public class RemoteEndpointAwareNettySSLOptions extends NettySSLOptions - implements RemoteEndpointAwareSSLOptions { + implements ExtendedRemoteEndpointAwareSslOptions { /** * Create a new instance from a given context. @@ -49,9 +49,16 @@ public SslHandler newSSLHandler(SocketChannel channel) { "This class implements RemoteEndpointAwareSSLOptions, this method should not be called"); } + @Override + public SslHandler newSSLHandler(SocketChannel channel, EndPoint remoteEndpoint) { + InetSocketAddress address = remoteEndpoint.resolve(); + return context.newHandler(channel.alloc(), address.getHostName(), address.getPort()); + } + @Override public SslHandler newSSLHandler(SocketChannel channel, InetSocketAddress remoteEndpoint) { - return context.newHandler( - channel.alloc(), remoteEndpoint.getHostName(), remoteEndpoint.getPort()); + throw new AssertionError( + "The driver should never call this method on an object that implements " + + this.getClass().getSimpleName()); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java b/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java index 5094c4f1bc7..a6d93770913 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java +++ b/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java @@ -41,7 +41,6 @@ import com.google.common.util.concurrent.ListenableFuture; import io.netty.util.Timeout; import io.netty.util.TimerTask; -import java.net.InetSocketAddress; import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -81,7 +80,7 @@ class RequestHandler { private final io.netty.util.Timer scheduler; private volatile List triedHosts; - private volatile ConcurrentMap errors; + private volatile ConcurrentMap errors; private final Timer.Context timerContext; private final long startTime; @@ -281,7 +280,7 @@ private void reportNoMoreHosts(SpeculativeExecution execution) { execution, null, new NoHostAvailableException( - errors == null ? Collections.emptyMap() : errors)); + errors == null ? Collections.emptyMap() : errors)); } private boolean metricsEnabled() { @@ -418,18 +417,18 @@ public void onSuccess(Connection connection) { // If we have any problem with the connection, move to the next node. if (metricsEnabled()) metrics().getErrorMetrics().getConnectionErrors().inc(); if (connection != null) connection.release(); - logError(host.getSocketAddress(), e); + logError(host.getEndPoint(), e); findNextHostAndQuery(); } catch (BusyConnectionException e) { // The pool shouldn't have give us a busy connection unless we've maxed up the pool, // so move on to the next host. connection.release(true); - logError(host.getSocketAddress(), e); + logError(host.getEndPoint(), e); findNextHostAndQuery(); } catch (RuntimeException e) { if (connection != null) connection.release(); - logger.error("Unexpected error while querying " + host.getAddress(), e); - logError(host.getSocketAddress(), e); + logger.error("Unexpected error while querying " + host.getEndPoint(), e); + logError(host.getEndPoint(), e); findNextHostAndQuery(); } } @@ -437,10 +436,10 @@ public void onSuccess(Connection connection) { @Override public void onFailure(Throwable t) { if (t instanceof BusyPoolException) { - logError(host.getSocketAddress(), t); + logError(host.getEndPoint(), t); } else { - logger.error("Unexpected error while querying " + host.getAddress(), t); - logError(host.getSocketAddress(), t); + logger.error("Unexpected error while querying " + host.getEndPoint(), t); + logError(host.getEndPoint(), t); } findNextHostAndQuery(); } @@ -536,7 +535,7 @@ private void processRetryDecision( retryDecision.getRetryConsistencyLevel()); if (metricsEnabled()) metrics().getErrorMetrics().getRetries().inc(); // log error for the current host if we are switching to another one - if (!retryDecision.isRetryCurrent()) logError(connection.address, exceptionToReport); + if (!retryDecision.isRetryCurrent()) logError(connection.endPoint, exceptionToReport); retry(retryDecision.isRetryCurrent(), retryDecision.getRetryConsistencyLevel()); break; case RETHROW: @@ -558,16 +557,16 @@ private void retry(final boolean retryCurrent, ConsistencyLevel newConsistencyLe if (!retryCurrent || !query(h)) findNextHostAndQuery(); } - private void logError(InetSocketAddress address, Throwable exception) { - logger.debug("[{}] Error querying {} : {}", id, address, exception.toString()); + private void logError(EndPoint endPoint, Throwable exception) { + logger.debug("[{}] Error querying {} : {}", id, endPoint, exception.toString()); if (errors == null) { synchronized (RequestHandler.this) { if (errors == null) { - errors = new ConcurrentHashMap(); + errors = new ConcurrentHashMap(); } } } - errors.put(address, exception); + errors.put(endPoint, exception); } void cancel() { @@ -643,7 +642,7 @@ public void onSet( break; case ERROR: Responses.Error err = (Responses.Error) response; - exceptionToReport = err.asException(connection.address); + exceptionToReport = err.asException(connection.endPoint); RetryPolicy.RetryDecision retry = null; RetryPolicy retryPolicy = retryPolicy(); switch (err.code) { @@ -714,7 +713,7 @@ public void onSet( case OVERLOADED: connection.release(); assert exceptionToReport instanceof OverloadedException; - logger.warn("Host {} is overloaded.", connection.address); + logger.warn("Host {} is overloaded.", connection.endPoint); retry = computeRetryDecisionOnRequestError((OverloadedException) exceptionToReport); break; case SERVER_ERROR: @@ -722,7 +721,7 @@ public void onSet( assert exceptionToReport instanceof ServerError; logger.warn( "{} replied with server error ({}), defuncting connection.", - connection.address, + connection.endPoint, err.message); // Defunct connection connection.defunct(exceptionToReport); @@ -733,11 +732,11 @@ public void onSet( assert exceptionToReport instanceof BootstrappingException; logger.error( "Query sent to {} but it is bootstrapping. This shouldn't happen but trying next host.", - connection.address); + connection.endPoint); if (metricsEnabled()) { metrics().getErrorMetrics().getOthers().inc(); } - logError(connection.address, exceptionToReport); + logError(connection.endPoint, exceptionToReport); retry(false, null); return; case UNPREPARED: @@ -777,7 +776,8 @@ public void onSet( "Query {} is not prepared on {}, preparing before retrying executing. " + "Seeing this message a few times is fine, but seeing it a lot may be source of performance problems", toPrepare.getQueryString(), - connection.address); + toPrepare.getQueryKeyspace(), + connection.endPoint); write(connection, prepareAndRetry(toPrepare.getQueryString())); // we're done for now, the prepareAndRetry callback will handle the rest @@ -869,14 +869,14 @@ public void onSet( retry(true, null); } else { logError( - connection.address, + connection.endPoint, new DriverException("Got unexpected response to prepare message: " + response)); retry(false, null); } break; case ERROR: logError( - connection.address, + connection.endPoint, new DriverException("Error preparing query, got " + response)); if (metricsEnabled()) metrics().getErrorMetrics().getOthers().inc(); retry(false, null); @@ -908,9 +908,9 @@ public boolean onTimeout(Connection connection, long latency, int retryCount) { } connection.release(); logError( - connection.address, + connection.endPoint, new OperationTimedOutException( - connection.address, "Timed out waiting for response to PREPARE message")); + connection.endPoint, "Timed out waiting for response to PREPARE message")); retry(false, null); return true; } @@ -972,7 +972,7 @@ public boolean onTimeout(Connection connection, long latency, int retryCount) { OperationTimedOutException timeoutException = new OperationTimedOutException( - connection.address, "Timed out waiting for server response"); + connection.endPoint, "Timed out waiting for server response"); try { connection.release(); diff --git a/driver-core/src/main/java/com/datastax/driver/core/Responses.java b/driver-core/src/main/java/com/datastax/driver/core/Responses.java index 067a151d84e..b0245f2bfff 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Responses.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Responses.java @@ -44,7 +44,6 @@ import com.datastax.driver.core.utils.Bytes; import io.netty.buffer.ByteBuf; import java.net.InetAddress; -import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.util.ArrayDeque; import java.util.ArrayList; @@ -147,49 +146,51 @@ private Error( this.infos = infos; } - DriverException asException(InetSocketAddress host) { + DriverException asException(EndPoint endPoint) { switch (code) { case SERVER_ERROR: - return new ServerError(host, message); + return new ServerError(endPoint, message); case PROTOCOL_ERROR: - return new ProtocolError(host, message); + return new ProtocolError(endPoint, message); case BAD_CREDENTIALS: - return new AuthenticationException(host, message); + return new AuthenticationException(endPoint, message); case UNAVAILABLE: - return ((UnavailableException) infos).copy(host); // We copy to have a nice stack trace + return ((UnavailableException) infos) + .copy(endPoint); // We copy to have a nice stack trace case OVERLOADED: - return new OverloadedException(host, message); + return new OverloadedException(endPoint, message); case IS_BOOTSTRAPPING: - return new BootstrappingException(host, message); + return new BootstrappingException(endPoint, message); case TRUNCATE_ERROR: - return new TruncateException(host, message); + return new TruncateException(endPoint, message); case WRITE_TIMEOUT: - return ((WriteTimeoutException) infos).copy(host); + return ((WriteTimeoutException) infos).copy(endPoint); case READ_TIMEOUT: - return ((ReadTimeoutException) infos).copy(host); + return ((ReadTimeoutException) infos).copy(endPoint); case WRITE_FAILURE: - return ((WriteFailureException) infos).copy(host); + return ((WriteFailureException) infos).copy(endPoint); case READ_FAILURE: - return ((ReadFailureException) infos).copy(host); + return ((ReadFailureException) infos).copy(endPoint); case FUNCTION_FAILURE: - return new FunctionExecutionException(host, message); + return new FunctionExecutionException(endPoint, message); case SYNTAX_ERROR: - return new SyntaxError(host, message); + return new SyntaxError(endPoint, message); case UNAUTHORIZED: - return new UnauthorizedException(host, message); + return new UnauthorizedException(endPoint, message); case INVALID: - return new InvalidQueryException(host, message); + return new InvalidQueryException(endPoint, message); case CONFIG_ERROR: - return new InvalidConfigurationInQueryException(host, message); + return new InvalidConfigurationInQueryException(endPoint, message); case ALREADY_EXISTS: - return ((AlreadyExistsException) infos).copy(host); + return ((AlreadyExistsException) infos).copy(endPoint); case UNPREPARED: - return new UnpreparedException(host, message); + return new UnpreparedException(endPoint, message); + default: return new DriverInternalError( String.format( "Unknown protocol error code %s returned by %s. The error message was: %s", - code, host, message)); + code, endPoint, message)); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/SSLOptions.java b/driver-core/src/main/java/com/datastax/driver/core/SSLOptions.java index 86b5f34527d..94e003280d1 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/SSLOptions.java +++ b/driver-core/src/main/java/com/datastax/driver/core/SSLOptions.java @@ -17,7 +17,6 @@ import io.netty.channel.socket.SocketChannel; import io.netty.handler.ssl.SslHandler; -import java.net.InetSocketAddress; /** * Defines how the driver configures SSL connections. @@ -44,8 +43,8 @@ public interface SSLOptions { * * @param channel the channel. * @return the handler. - * @deprecated use {@link RemoteEndpointAwareSSLOptions#newSSLHandler(SocketChannel, - * InetSocketAddress)} instead. + * @deprecated use {@link RemoteEndpointAwareSSLOptions#newSSLHandler(SocketChannel, EndPoint)} + * instead. */ @SuppressWarnings("DeprecatedIsStillUsed") @Deprecated diff --git a/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java b/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java index a366dd82f33..0e1ebe98607 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java +++ b/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java @@ -34,7 +34,6 @@ import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.SettableFuture; import com.google.common.util.concurrent.Uninterruptibles; -import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Collection; @@ -234,7 +233,7 @@ public ListenableFuture apply(Response response) { // the nodes of this session. // If that changes, we'll have to make sure this propagate to other sessions // too. - return prepare(stmt, future.getAddress()); + return prepare(stmt, future.getEndPoint()); } else { return Futures.immediateFuture(stmt); } @@ -247,7 +246,7 @@ public ListenableFuture apply(Response response) { } case ERROR: return Futures.immediateFailedFuture( - ((Responses.Error) response).asException(future.getAddress())); + ((Responses.Error) response).asException(future.getEndPoint())); default: return Futures.immediateFailedFuture( new DriverInternalError( @@ -708,11 +707,11 @@ public void run() { } private ListenableFuture prepare( - final PreparedStatement statement, InetSocketAddress toExclude) { + final PreparedStatement statement, EndPoint toExclude) { final String query = statement.getQueryString(); List> futures = Lists.newArrayListWithExpectedSize(pools.size()); for (final Map.Entry entry : pools.entrySet()) { - if (entry.getKey().getSocketAddress().equals(toExclude)) continue; + if (entry.getKey().getEndPoint().equals(toExclude)) continue; try { // Preparing is not critical: if it fails, it will fix itself later when the user tries to diff --git a/driver-core/src/main/java/com/datastax/driver/core/SniEndPoint.java b/driver-core/src/main/java/com/datastax/driver/core/SniEndPoint.java new file mode 100644 index 00000000000..bbd66513de0 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/SniEndPoint.java @@ -0,0 +1,112 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.common.primitives.UnsignedBytes; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.UnknownHostException; +import java.util.Arrays; +import java.util.Comparator; +import java.util.concurrent.atomic.AtomicLong; + +/** An endpoint to access nodes through a proxy that uses SNI routing. */ +public class SniEndPoint implements EndPoint { + + private static final AtomicLong OFFSET = new AtomicLong(); + + private final InetSocketAddress proxyAddress; + private final String serverName; + + /** + * @param proxyAddress the address of the proxy. If it is {@linkplain + * InetSocketAddress#isUnresolved() unresolved}, each call to {@link #resolve()} will + * re-resolve it, fetch all of its A-records, and if there are more than 1 pick one in a + * round-robin fashion. + * @param serverName the SNI server name. In the context of DSOD, this is the string + * representation of the host id. + */ + public SniEndPoint(InetSocketAddress proxyAddress, String serverName) { + Preconditions.checkNotNull(proxyAddress); + Preconditions.checkNotNull(serverName); + this.proxyAddress = proxyAddress; + this.serverName = serverName; + } + + @Override + public InetSocketAddress resolve() { + if (proxyAddress.isUnresolved()) { + try { + InetAddress[] aRecords = InetAddress.getAllByName(proxyAddress.getHostName()); + if (aRecords.length == 0) { + // Probably never happens, but the JDK docs don't explicitly say so + throw new IllegalArgumentException( + "Could not resolve proxy address " + proxyAddress.getHostName()); + } + // The order of the returned address is unspecified. Sort by IP to make sure we get a true + // round-robin + Arrays.sort(aRecords, IP_COMPARATOR); + int index = (aRecords.length == 1) ? 0 : (int) OFFSET.getAndIncrement() % aRecords.length; + return new InetSocketAddress(aRecords[index], proxyAddress.getPort()); + } catch (UnknownHostException e) { + throw new IllegalArgumentException( + "Could not resolve proxy address " + proxyAddress.getHostName(), e); + } + } else { + return proxyAddress; + } + } + + String getServerName() { + return serverName; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } else if (other instanceof SniEndPoint) { + SniEndPoint that = (SniEndPoint) other; + return this.proxyAddress.equals(that.proxyAddress) && this.serverName.equals(that.serverName); + } else { + return false; + } + } + + @Override + public int hashCode() { + return Objects.hashCode(proxyAddress, serverName); + } + + @Override + public String toString() { + // Note that this uses the original proxy address, so if there are multiple A-records it won't + // show which one was selected. If that turns out to be a problem for debugging, we might need + // to store the result of resolve() in Connection and log that instead of the endpoint. + return proxyAddress.toString() + ":" + serverName; + } + + private static final Comparator IP_COMPARATOR = + new Comparator() { + @Override + public int compare(InetAddress address1, InetAddress address2) { + return UnsignedBytes.lexicographicalComparator() + .compare(address1.getAddress(), address2.getAddress()); + } + }; +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/SniEndPointFactory.java b/driver-core/src/main/java/com/datastax/driver/core/SniEndPointFactory.java new file mode 100644 index 00000000000..c173a67d697 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/SniEndPointFactory.java @@ -0,0 +1,37 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import java.net.InetSocketAddress; +import java.util.UUID; + +public class SniEndPointFactory implements EndPointFactory { + + private final InetSocketAddress proxyAddress; + + public SniEndPointFactory(InetSocketAddress proxyAddress) { + this.proxyAddress = proxyAddress; + } + + @Override + public void init(Cluster cluster) {} + + @Override + public EndPoint create(Row peersRow) { + UUID host_id = peersRow.getUUID("host_id"); + return new SniEndPoint(proxyAddress, host_id.toString()); + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/SniSSLOptions.java b/driver-core/src/main/java/com/datastax/driver/core/SniSSLOptions.java new file mode 100644 index 00000000000..ea5ff32b157 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/SniSSLOptions.java @@ -0,0 +1,98 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import com.google.common.collect.ImmutableList; +import io.netty.channel.socket.SocketChannel; +import io.netty.handler.ssl.SslHandler; +import java.net.InetSocketAddress; +import javax.net.ssl.*; + +@IgnoreJDK6Requirement +@SuppressWarnings("deprecation") +public class SniSSLOptions extends JdkSSLOptions implements ExtendedRemoteEndpointAwareSslOptions { + /** + * Creates a new instance. + * + * @param context the SSL context. + * @param cipherSuites the cipher suites to use. + */ + protected SniSSLOptions(SSLContext context, String[] cipherSuites) { + super(context, cipherSuites); + } + + @Override + public SslHandler newSSLHandler(SocketChannel channel) { + throw new AssertionError( + "This class implements RemoteEndpointAwareSSLOptions, this method should not be called"); + } + + @Override + public SslHandler newSSLHandler(SocketChannel channel, EndPoint remoteEndpoint) { + SSLEngine engine = newSSLEngine(channel, remoteEndpoint); + return new SslHandler(engine); + } + + @Override + public SslHandler newSSLHandler(SocketChannel channel, InetSocketAddress remoteEndpoint) { + throw new AssertionError( + "The driver should never call this method on an object that implements " + + this.getClass().getSimpleName()); + } + + protected SSLEngine newSSLEngine( + @SuppressWarnings("unused") SocketChannel channel, EndPoint remoteEndpoint) { + if (!(remoteEndpoint instanceof SniEndPoint)) { + throw new IllegalArgumentException( + String.format( + "Configuration error: can only use %s with SNI end points", + this.getClass().getSimpleName())); + } + SniEndPoint sniEndPoint = (SniEndPoint) remoteEndpoint; + SSLEngine engine = context.createSSLEngine(); + engine.setUseClientMode(true); + SSLParameters parameters = engine.getSSLParameters(); + parameters.setServerNames( + ImmutableList.of(new SNIHostName(sniEndPoint.getServerName()))); + engine.setSSLParameters(parameters); + if (cipherSuites != null) engine.setEnabledCipherSuites(cipherSuites); + return engine; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder extends JdkSSLOptions.Builder { + + @Override + public SniSSLOptions.Builder withSSLContext(SSLContext context) { + super.withSSLContext(context); + return this; + } + + @Override + public SniSSLOptions.Builder withCipherSuites(String[] cipherSuites) { + super.withCipherSuites(cipherSuites); + return this; + } + + @Override + public SniSSLOptions build() { + return new SniSSLOptions(context, cipherSuites); + } + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/TranslatedAddressEndPoint.java b/driver-core/src/main/java/com/datastax/driver/core/TranslatedAddressEndPoint.java new file mode 100644 index 00000000000..54848fd9982 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/TranslatedAddressEndPoint.java @@ -0,0 +1,59 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import com.google.common.base.Objects; +import java.net.InetSocketAddress; + +/** + * An endpoint based on server-reported RPC addresses, that might require translation if they are + * accessed through a proxy. + */ +class TranslatedAddressEndPoint implements EndPoint { + + private final InetSocketAddress translatedAddress; + + TranslatedAddressEndPoint(InetSocketAddress translatedAddress) { + this.translatedAddress = translatedAddress; + } + + @Override + public InetSocketAddress resolve() { + return translatedAddress; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } else if (other instanceof TranslatedAddressEndPoint) { + TranslatedAddressEndPoint that = (TranslatedAddressEndPoint) other; + return Objects.equal(this.translatedAddress, that.translatedAddress); + } else { + return false; + } + } + + @Override + public int hashCode() { + return translatedAddress.hashCode(); + } + + @Override + public String toString() { + return translatedAddress.toString(); + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/AlreadyExistsException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/AlreadyExistsException.java index b019e83a067..b3d3577cb01 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/AlreadyExistsException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/AlreadyExistsException.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -24,7 +25,7 @@ public class AlreadyExistsException extends QueryValidationException private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; private final String keyspace; private final String table; @@ -32,17 +33,17 @@ public AlreadyExistsException(String keyspace, String table) { this(null, keyspace, table); } - public AlreadyExistsException(InetSocketAddress address, String keyspace, String table) { + public AlreadyExistsException(EndPoint endPoint, String keyspace, String table) { super(makeMsg(keyspace, table)); - this.address = address; + this.endPoint = endPoint; this.keyspace = keyspace; this.table = table; } private AlreadyExistsException( - InetSocketAddress address, String msg, Throwable cause, String keyspace, String table) { + EndPoint endPoint, String msg, Throwable cause, String keyspace, String table) { super(msg, cause); - this.address = address; + this.endPoint = endPoint; this.keyspace = keyspace; this.table = table; } @@ -52,16 +53,21 @@ private static String makeMsg(String keyspace, String table) { else return String.format("Table %s.%s already exists", keyspace, table); } - /** {@inheritDoc} */ @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } - /** {@inheritDoc} */ @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } /** @@ -98,7 +104,7 @@ public String getTable() { @Override public DriverException copy() { - return new AlreadyExistsException(getAddress(), getMessage(), this, keyspace, table); + return new AlreadyExistsException(getEndPoint(), getMessage(), this, keyspace, table); } /** @@ -114,11 +120,11 @@ public DriverException copy() { * generally yields a more user-friendly stack trace that the original one. * * - * @param address The full address of the host that caused this exception to be thrown. + * @param endPoint The full address of the host that caused this exception to be thrown. * @return a copy/clone of this exception, but with the given host address instead of the original * one. */ - public AlreadyExistsException copy(InetSocketAddress address) { - return new AlreadyExistsException(address, getMessage(), this, keyspace, table); + public AlreadyExistsException copy(EndPoint endPoint) { + return new AlreadyExistsException(endPoint, getMessage(), this, keyspace, table); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/AuthenticationException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/AuthenticationException.java index 54b20ab1aaf..5b1f6bb3c3b 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/AuthenticationException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/AuthenticationException.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -23,32 +24,43 @@ public class AuthenticationException extends DriverException implements Coordina private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; + public AuthenticationException(EndPoint endPoint, String message) { + super(String.format("Authentication error on host %s: %s", endPoint, message)); + this.endPoint = endPoint; + } + + // Preserve a constructor with InetSocketAddress for backward compatibility, because legacy + // authenticators might use it public AuthenticationException(InetSocketAddress address, String message) { - super(String.format("Authentication error on host %s: %s", address, message)); - this.address = address; + this(new WrappingEndPoint(address), message); } - private AuthenticationException(InetSocketAddress address, String message, Throwable cause) { + private AuthenticationException(EndPoint endPoint, String message, Throwable cause) { super(message, cause); - this.address = address; + this.endPoint = endPoint; } - /** {@inheritDoc} */ @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } - /** {@inheritDoc} */ @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } @Override public DriverException copy() { - return new AuthenticationException(address, getMessage(), this); + return new AuthenticationException(endPoint, getMessage(), this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/BootstrappingException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/BootstrappingException.java index 4f2bbf3adfa..8c5aab0ba3a 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/BootstrappingException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/BootstrappingException.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -24,34 +25,38 @@ public class BootstrappingException extends QueryExecutionException private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; - public BootstrappingException(InetSocketAddress address, String message) { - super(String.format("Queried host (%s) was bootstrapping: %s", address, message)); - this.address = address; + public BootstrappingException(EndPoint endPoint, String message) { + super(String.format("Queried host (%s) was bootstrapping: %s", endPoint, message)); + this.endPoint = endPoint; } /** Private constructor used solely when copying exceptions. */ - private BootstrappingException( - InetSocketAddress address, String message, BootstrappingException cause) { + private BootstrappingException(EndPoint endPoint, String message, BootstrappingException cause) { super(message, cause); - this.address = address; + this.endPoint = endPoint; } - /** {@inheritDoc} */ @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } - /** {@inheritDoc} */ @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } @Override public BootstrappingException copy() { - return new BootstrappingException(address, getMessage(), this); + return new BootstrappingException(endPoint, getMessage(), this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyConnectionException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyConnectionException.java index eae24a386d1..a8bfd67f77a 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyConnectionException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyConnectionException.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -23,30 +24,37 @@ public class BusyConnectionException extends DriverException implements Coordina private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; - public BusyConnectionException(InetSocketAddress address) { - super(String.format("[%s] Connection has run out of stream IDs", address.getAddress())); - this.address = address; + public BusyConnectionException(EndPoint endPoint) { + super(String.format("[%s] Connection has run out of stream IDs", endPoint)); + this.endPoint = endPoint; } - public BusyConnectionException(InetSocketAddress address, Throwable cause) { - super(String.format("[%s] Connection has run out of stream IDs", address.getAddress()), cause); - this.address = address; + public BusyConnectionException(EndPoint endPoint, Throwable cause) { + super(String.format("[%s] Connection has run out of stream IDs", endPoint), cause); + this.endPoint = endPoint; } @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } @Override public BusyConnectionException copy() { - return new BusyConnectionException(address, this); + return new BusyConnectionException(endPoint, this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyPoolException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyPoolException.java index 52586ab194d..94f89b5c0a1 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyPoolException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyPoolException.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import com.datastax.driver.core.HostDistance; import com.datastax.driver.core.Statement; import java.net.InetAddress; @@ -47,45 +48,52 @@ public class BusyPoolException extends DriverException implements CoordinatorExc private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; - public BusyPoolException(InetSocketAddress address, int queueSize) { - this(address, buildMessage(address, queueSize), null); + public BusyPoolException(EndPoint endPoint, int queueSize) { + this(endPoint, buildMessage(endPoint, queueSize), null); } - public BusyPoolException(InetSocketAddress address, long timeout, TimeUnit unit) { - this(address, buildMessage(address, timeout, unit), null); + public BusyPoolException(EndPoint endPoint, long timeout, TimeUnit unit) { + this(endPoint, buildMessage(endPoint, timeout, unit), null); } - private BusyPoolException(InetSocketAddress address, String message, Throwable cause) { + private BusyPoolException(EndPoint endPoint, String message, Throwable cause) { super(message, cause); - this.address = address; + this.endPoint = endPoint; } - private static String buildMessage(InetSocketAddress address, int queueSize) { + private static String buildMessage(EndPoint endPoint, int queueSize) { return String.format( "[%s] Pool is busy (no available connection and the queue has reached its max size %d)", - address.getAddress(), queueSize); + endPoint, queueSize); } - private static String buildMessage(InetSocketAddress address, long timeout, TimeUnit unit) { + private static String buildMessage(EndPoint endPoint, long timeout, TimeUnit unit) { return String.format( "[%s] Pool is busy (no available connection and timed out after %d %s)", - address.getAddress(), timeout, unit); + endPoint, timeout, unit); } @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } @Override public BusyPoolException copy() { - return new BusyPoolException(address, getMessage(), this); + return new BusyPoolException(endPoint, getMessage(), this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ConnectionException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ConnectionException.java index 5e4e0eb4f3f..773eea6da63 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ConnectionException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ConnectionException.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -23,36 +24,43 @@ public class ConnectionException extends DriverException implements CoordinatorE private static final long serialVersionUID = 0; - public final InetSocketAddress address; + private final EndPoint endPoint; - public ConnectionException(InetSocketAddress address, String msg, Throwable cause) { + public ConnectionException(EndPoint endPoint, String msg, Throwable cause) { super(msg, cause); - this.address = address; + this.endPoint = endPoint; } - public ConnectionException(InetSocketAddress address, String msg) { + public ConnectionException(EndPoint endPoint, String msg) { super(msg); - this.address = address; + this.endPoint = endPoint; } @Override - public InetAddress getHost() { - return address == null ? null : address.getAddress(); + public EndPoint getEndPoint() { + return endPoint; } @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } @Override public String getMessage() { - return address == null ? getRawMessage() : String.format("[%s] %s", address, getRawMessage()); + return endPoint == null ? getRawMessage() : String.format("[%s] %s", endPoint, getRawMessage()); } @Override public ConnectionException copy() { - return new ConnectionException(address, getRawMessage(), this); + return new ConnectionException(endPoint, getRawMessage(), this); } String getRawMessage() { diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/CoordinatorException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/CoordinatorException.java index c866dda9804..20fd93a3a3e 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/CoordinatorException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/CoordinatorException.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -25,20 +26,29 @@ public interface CoordinatorException { /** - * The coordinator host that was contacted. - * - *

    This is a shortcut for {@link InetSocketAddress#getAddress() getAddress().getAddress()}. + * The connection information of the coordinator host that was contacted. May be {@code null} if + * the coordinator is not known. + */ + EndPoint getEndPoint(); + + /** + * The coordinator host that was contacted; may be {@code null} if the coordinator is not known. * - * @return The coordinator host that was contacted; may be {@code null} if the coordinator is not - * known. + * @deprecated {@link #getEndPoint()} provides more accurate information if the connection + * information consists of more than a socket address. This method is a shortcut for {@code + * getEndPoint().resolve().getAddress()}. */ + @Deprecated InetAddress getHost(); /** - * The full address of the coordinator host that was contacted. + * The full address of the coordinator host that was contacted; may be {@code null} if the + * coordinator is not known. * - * @return the full address of the coordinator host that was contacted; may be {@code null} if the - * coordinator is not known. + * @deprecated {@link #getEndPoint()} provides more accurate information if the connection + * information consists of more than a socket address. This method is a shortcut for {@code + * getEndPoint().resolve()}. */ + @Deprecated InetSocketAddress getAddress(); } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/FunctionExecutionException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/FunctionExecutionException.java index 89dc194d0cb..98e7d01bdfd 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/FunctionExecutionException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/FunctionExecutionException.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -24,32 +25,37 @@ public class FunctionExecutionException extends QueryExecutionException private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; - public FunctionExecutionException(InetSocketAddress address, String msg) { + public FunctionExecutionException(EndPoint endPoint, String msg) { super(msg); - this.address = address; + this.endPoint = endPoint; } - private FunctionExecutionException(InetSocketAddress address, String msg, Throwable cause) { + private FunctionExecutionException(EndPoint endPoint, String msg, Throwable cause) { super(msg, cause); - this.address = address; + this.endPoint = endPoint; } - /** {@inheritDoc} */ @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } - /** {@inheritDoc} */ @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } @Override public DriverException copy() { - return new FunctionExecutionException(address, getMessage(), this); + return new FunctionExecutionException(endPoint, getMessage(), this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.java index 399dafce313..fa6943e9086 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.java @@ -15,7 +15,7 @@ */ package com.datastax.driver.core.exceptions; -import java.net.InetSocketAddress; +import com.datastax.driver.core.EndPoint; /** * A specific invalid query exception that indicates that the query is invalid because of some @@ -29,12 +29,12 @@ public class InvalidConfigurationInQueryException extends InvalidQueryException private static final long serialVersionUID = 0; - public InvalidConfigurationInQueryException(InetSocketAddress address, String msg) { - super(address, msg); + public InvalidConfigurationInQueryException(EndPoint endPoint, String msg) { + super(endPoint, msg); } @Override public InvalidConfigurationInQueryException copy() { - return new InvalidConfigurationInQueryException(getAddress(), getMessage()); + return new InvalidConfigurationInQueryException(getEndPoint(), getMessage()); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidQueryException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidQueryException.java index cbdff9281ed..860ea260644 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidQueryException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidQueryException.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -24,38 +25,45 @@ public class InvalidQueryException extends QueryValidationException private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; public InvalidQueryException(String msg) { this(null, msg); } - public InvalidQueryException(InetSocketAddress address, String msg) { + public InvalidQueryException(EndPoint endPoint, String msg) { super(msg); - this.address = address; + this.endPoint = endPoint; } public InvalidQueryException(String msg, Throwable cause) { this(null, msg, cause); } - public InvalidQueryException(InetSocketAddress address, String msg, Throwable cause) { + public InvalidQueryException(EndPoint endPoint, String msg, Throwable cause) { super(msg, cause); - this.address = address; + this.endPoint = endPoint; } @Override public DriverException copy() { - return new InvalidQueryException(getAddress(), getMessage(), this); + return new InvalidQueryException(getEndPoint(), getMessage(), this); } @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/NoHostAvailableException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/NoHostAvailableException.java index cc00e5b3ecf..ce9d7e3cad0 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/NoHostAvailableException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/NoHostAvailableException.java @@ -15,9 +15,9 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.io.PrintWriter; import java.io.StringWriter; -import java.net.InetSocketAddress; import java.util.HashMap; import java.util.Map; @@ -40,15 +40,15 @@ public class NoHostAvailableException extends DriverException { private static final int MAX_ERRORS_IN_DEFAULT_MESSAGE = 3; - private final Map errors; + private final Map errors; - public NoHostAvailableException(Map errors) { + public NoHostAvailableException(Map errors) { super(makeMessage(errors, MAX_ERRORS_IN_DEFAULT_MESSAGE, false, false)); this.errors = errors; } private NoHostAvailableException( - String message, Throwable cause, Map errors) { + String message, Throwable cause, Map errors) { super(message, cause); this.errors = errors; } @@ -58,8 +58,8 @@ private NoHostAvailableException( * * @return a map containing for each tried host the error triggered when trying it. */ - public Map getErrors() { - return new HashMap(errors); + public Map getErrors() { + return new HashMap(errors); } /** @@ -84,7 +84,7 @@ public NoHostAvailableException copy() { } private static String makeMessage( - Map errors, + Map errors, int maxErrorsInMessage, boolean formatted, boolean includeStackTraces) { @@ -98,7 +98,7 @@ private static String makeMessage( int n = 0; boolean truncated = false; - for (Map.Entry entry : errors.entrySet()) { + for (Map.Entry entry : errors.entrySet()) { if (n > 0) out.print(formatted ? "\n" : ", "); out.print(entry.getKey()); if (n < maxErrorsInMessage) { diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/OperationTimedOutException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/OperationTimedOutException.java index 21b9ae4f457..a6c4b670fb3 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/OperationTimedOutException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/OperationTimedOutException.java @@ -15,8 +15,8 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import com.datastax.driver.core.SocketOptions; -import java.net.InetSocketAddress; /** * Thrown on a client-side timeout, i.e. when the client didn't hear back from the server within @@ -26,20 +26,20 @@ public class OperationTimedOutException extends ConnectionException { private static final long serialVersionUID = 0; - public OperationTimedOutException(InetSocketAddress address) { - super(address, "Operation timed out"); + public OperationTimedOutException(EndPoint endPoint) { + super(endPoint, "Operation timed out"); } - public OperationTimedOutException(InetSocketAddress address, String msg) { - super(address, msg); + public OperationTimedOutException(EndPoint endPoint, String msg) { + super(endPoint, msg); } - public OperationTimedOutException(InetSocketAddress address, String msg, Throwable cause) { - super(address, msg, cause); + public OperationTimedOutException(EndPoint endPoint, String msg, Throwable cause) { + super(endPoint, msg, cause); } @Override public OperationTimedOutException copy() { - return new OperationTimedOutException(address, getRawMessage(), this); + return new OperationTimedOutException(getEndPoint(), getRawMessage(), this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/OverloadedException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/OverloadedException.java index c5d5ca28f84..27efd6c58cc 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/OverloadedException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/OverloadedException.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -23,34 +24,38 @@ public class OverloadedException extends QueryExecutionException implements Coor private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; - public OverloadedException(InetSocketAddress address, String message) { - super(String.format("Queried host (%s) was overloaded: %s", address, message)); - this.address = address; + public OverloadedException(EndPoint endPoint, String message) { + super(String.format("Queried host (%s) was overloaded: %s", endPoint, message)); + this.endPoint = endPoint; } /** Private constructor used solely when copying exceptions. */ - private OverloadedException( - InetSocketAddress address, String message, OverloadedException cause) { + private OverloadedException(EndPoint endPoint, String message, OverloadedException cause) { super(message, cause); - this.address = address; + this.endPoint = endPoint; } - /** {@inheritDoc} */ @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } - /** {@inheritDoc} */ @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } @Override public OverloadedException copy() { - return new OverloadedException(address, getMessage(), this); + return new OverloadedException(endPoint, getMessage(), this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ProtocolError.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ProtocolError.java index 6a098ab953f..76ab71b1ce3 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ProtocolError.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ProtocolError.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -27,36 +28,41 @@ public class ProtocolError extends DriverInternalError implements CoordinatorExc private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; - public ProtocolError(InetSocketAddress address, String message) { + public ProtocolError(EndPoint endPoint, String message) { super( String.format( "An unexpected protocol error occurred on host %s. This is a bug in this library, please report: %s", - address, message)); - this.address = address; + endPoint, message)); + this.endPoint = endPoint; } /** Private constructor used solely when copying exceptions. */ - private ProtocolError(InetSocketAddress address, String message, ProtocolError cause) { + private ProtocolError(EndPoint endPoint, String message, ProtocolError cause) { super(message, cause); - this.address = address; + this.endPoint = endPoint; } - /** {@inheritDoc} */ @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } - /** {@inheritDoc} */ @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } @Override public ProtocolError copy() { - return new ProtocolError(address, getMessage(), this); + return new ProtocolError(endPoint, getMessage(), this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryConsistencyException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryConsistencyException.java index 3686cce1397..931c519cf4b 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryConsistencyException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryConsistencyException.java @@ -16,6 +16,7 @@ package com.datastax.driver.core.exceptions; import com.datastax.driver.core.ConsistencyLevel; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -37,33 +38,29 @@ public abstract class QueryConsistencyException extends QueryExecutionException implements CoordinatorException { - private final InetSocketAddress address; + private final EndPoint endPoint; private final ConsistencyLevel consistency; private final int received; private final int required; protected QueryConsistencyException( - InetSocketAddress address, - String msg, - ConsistencyLevel consistency, - int received, - int required) { + EndPoint endPoint, String msg, ConsistencyLevel consistency, int received, int required) { super(msg); - this.address = address; + this.endPoint = endPoint; this.consistency = consistency; this.received = received; this.required = required; } protected QueryConsistencyException( - InetSocketAddress address, + EndPoint endPoint, String msg, Throwable cause, ConsistencyLevel consistency, int received, int required) { super(msg, cause); - this.address = address; + this.endPoint = endPoint; this.consistency = consistency; this.received = received; this.required = required; @@ -99,26 +96,25 @@ public int getRequiredAcknowledgements() { } /** - * The coordinator host that caused this exception to be thrown. Note that this is the query - * coordinator host, not the host which timed out. + * {@inheritDoc} * - * @return The coordinator host that caused this exception to be thrown, or {@code null} if this - * exception has been generated driver-side. + *

    Note that this is the information of the host that coordinated the query, not the + * one that timed out. */ @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } - /** - * The full address of the coordinator host that caused this exception to be thrown. Note that - * this is the query coordinator host, not the host which timed out. - * - * @return the full address of the coordinator host that caused this exception to be thrown, or - * {@code null} if this exception has been generated driver-side. - */ @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadFailureException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadFailureException.java index 580b8708adb..b0e366afe74 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadFailureException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadFailureException.java @@ -16,8 +16,8 @@ package com.datastax.driver.core.exceptions; import com.datastax.driver.core.ConsistencyLevel; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; -import java.net.InetSocketAddress; import java.util.Collections; import java.util.Map; @@ -62,7 +62,7 @@ public ReadFailureException( } public ReadFailureException( - InetSocketAddress address, + EndPoint endPoint, ConsistencyLevel consistency, int received, int required, @@ -70,7 +70,7 @@ public ReadFailureException( Map failuresMap, boolean dataPresent) { super( - address, + endPoint, String.format( "Cassandra failure during read query at consistency %s " + "(%d responses were required but only %d replica responded, %d failed)", @@ -86,14 +86,14 @@ public ReadFailureException( /** @deprecated Legacy constructor for backward compatibility. */ @Deprecated public ReadFailureException( - InetSocketAddress address, + EndPoint endPoint, ConsistencyLevel consistency, int received, int required, int failed, boolean dataPresent) { this( - address, + endPoint, consistency, received, required, @@ -103,7 +103,7 @@ public ReadFailureException( } private ReadFailureException( - InetSocketAddress address, + EndPoint endPoint, String msg, Throwable cause, ConsistencyLevel consistency, @@ -112,7 +112,7 @@ private ReadFailureException( int failed, Map failuresMap, boolean dataPresent) { - super(address, msg, cause, consistency, received, required); + super(endPoint, msg, cause, consistency, received, required); this.failed = failed; this.failuresMap = failuresMap; this.dataPresent = dataPresent; @@ -169,7 +169,7 @@ public boolean wasDataRetrieved() { @Override public ReadFailureException copy() { return new ReadFailureException( - getAddress(), + getEndPoint(), getMessage(), this, getConsistencyLevel(), @@ -180,9 +180,9 @@ public ReadFailureException copy() { wasDataRetrieved()); } - public ReadFailureException copy(InetSocketAddress address) { + public ReadFailureException copy(EndPoint endPoint) { return new ReadFailureException( - address, + endPoint, getMessage(), this, getConsistencyLevel(), diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadTimeoutException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadTimeoutException.java index eb8cbf26553..b2bf6f3f416 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadTimeoutException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadTimeoutException.java @@ -16,7 +16,7 @@ package com.datastax.driver.core.exceptions; import com.datastax.driver.core.ConsistencyLevel; -import java.net.InetSocketAddress; +import com.datastax.driver.core.EndPoint; /** A Cassandra timeout during a read query. */ public class ReadTimeoutException extends QueryConsistencyException { @@ -34,13 +34,13 @@ public ReadTimeoutException( } public ReadTimeoutException( - InetSocketAddress address, + EndPoint endPoint, ConsistencyLevel consistency, int received, int required, boolean dataPresent) { super( - address, + endPoint, String.format( "Cassandra timeout during read query at consistency %s (%s)", consistency, formatDetails(received, required, dataPresent)), @@ -51,14 +51,14 @@ consistency, formatDetails(received, required, dataPresent)), } private ReadTimeoutException( - InetSocketAddress address, + EndPoint endPoint, String msg, Throwable cause, ConsistencyLevel consistency, int received, int required, boolean dataPresent) { - super(address, msg, cause, consistency, received, required); + super(endPoint, msg, cause, consistency, received, required); this.dataPresent = dataPresent; } @@ -87,7 +87,7 @@ public boolean wasDataRetrieved() { @Override public ReadTimeoutException copy() { return new ReadTimeoutException( - getAddress(), + getEndPoint(), getMessage(), this, getConsistencyLevel(), @@ -109,13 +109,13 @@ public ReadTimeoutException copy() { * generally yields a more user-friendly stack trace that the original one. * * - * @param address The full address of the host that caused this exception to be thrown. + * @param endPoint The full address of the host that caused this exception to be thrown. * @return a copy/clone of this exception, but with the given host address instead of the original * one. */ - public ReadTimeoutException copy(InetSocketAddress address) { + public ReadTimeoutException copy(EndPoint endPoint) { return new ReadTimeoutException( - address, + endPoint, getMessage(), this, getConsistencyLevel(), diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ServerError.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ServerError.java index 24f040cce76..c96e77a7591 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ServerError.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ServerError.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -26,33 +27,38 @@ public class ServerError extends DriverInternalError implements CoordinatorExcep private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; - public ServerError(InetSocketAddress address, String message) { - super(String.format("An unexpected error occurred server side on %s: %s", address, message)); - this.address = address; + public ServerError(EndPoint endPoint, String message) { + super(String.format("An unexpected error occurred server side on %s: %s", endPoint, message)); + this.endPoint = endPoint; } /** Private constructor used solely when copying exceptions. */ - private ServerError(InetSocketAddress address, String message, ServerError cause) { + private ServerError(EndPoint endPoint, String message, ServerError cause) { super(message, cause); - this.address = address; + this.endPoint = endPoint; } - /** {@inheritDoc} */ @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } - /** {@inheritDoc} */ @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } @Override public ServerError copy() { - return new ServerError(address, getMessage(), this); + return new ServerError(endPoint, getMessage(), this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/SyntaxError.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/SyntaxError.java index 1e2c38140c4..11da48a3dcf 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/SyntaxError.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/SyntaxError.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -23,32 +24,37 @@ public class SyntaxError extends QueryValidationException implements Coordinator private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; - public SyntaxError(InetSocketAddress address, String msg) { + public SyntaxError(EndPoint endPoint, String msg) { super(msg); - this.address = address; + this.endPoint = endPoint; } - private SyntaxError(InetSocketAddress address, String msg, Throwable cause) { + private SyntaxError(EndPoint endPoint, String msg, Throwable cause) { super(msg, cause); - this.address = address; + this.endPoint = endPoint; } - /** {@inheritDoc} */ @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } - /** {@inheritDoc} */ @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } @Override public SyntaxError copy() { - return new SyntaxError(getAddress(), getMessage(), this); + return new SyntaxError(getEndPoint(), getMessage(), this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/TransportException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/TransportException.java index a227745ffb6..6134bbc178b 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/TransportException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/TransportException.java @@ -15,7 +15,7 @@ */ package com.datastax.driver.core.exceptions; -import java.net.InetSocketAddress; +import com.datastax.driver.core.EndPoint; /** * A connection exception that has to do with the transport itself, i.e. that suggests the node is @@ -25,16 +25,16 @@ public class TransportException extends ConnectionException { private static final long serialVersionUID = 0; - public TransportException(InetSocketAddress address, String msg, Throwable cause) { - super(address, msg, cause); + public TransportException(EndPoint endPoint, String msg, Throwable cause) { + super(endPoint, msg, cause); } - public TransportException(InetSocketAddress address, String msg) { - super(address, msg); + public TransportException(EndPoint endPoint, String msg) { + super(endPoint, msg); } @Override public TransportException copy() { - return new TransportException(address, getRawMessage(), this); + return new TransportException(getEndPoint(), getRawMessage(), this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/TruncateException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/TruncateException.java index 604cfe17910..c62627f4c99 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/TruncateException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/TruncateException.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -23,32 +24,37 @@ public class TruncateException extends QueryExecutionException implements Coordi private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; - public TruncateException(InetSocketAddress address, String msg) { + public TruncateException(EndPoint endPoint, String msg) { super(msg); - this.address = address; + this.endPoint = endPoint; } - private TruncateException(InetSocketAddress address, String msg, Throwable cause) { + private TruncateException(EndPoint endPoint, String msg, Throwable cause) { super(msg, cause); - this.address = address; + this.endPoint = endPoint; } - /** {@inheritDoc} */ @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } - /** {@inheritDoc} */ @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } @Override public TruncateException copy() { - return new TruncateException(getAddress(), getMessage(), this); + return new TruncateException(getEndPoint(), getMessage(), this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnauthorizedException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnauthorizedException.java index 64a6f1cfb2a..477756096ad 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnauthorizedException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnauthorizedException.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -27,32 +28,37 @@ public class UnauthorizedException extends QueryValidationException private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; - public UnauthorizedException(InetSocketAddress address, String msg) { + public UnauthorizedException(EndPoint endPoint, String msg) { super(msg); - this.address = address; + this.endPoint = endPoint; } - private UnauthorizedException(InetSocketAddress address, String msg, Throwable cause) { + private UnauthorizedException(EndPoint endPoint, String msg, Throwable cause) { super(msg, cause); - this.address = address; + this.endPoint = endPoint; } - /** {@inheritDoc} */ @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } - /** {@inheritDoc} */ @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } @Override public UnauthorizedException copy() { - return new UnauthorizedException(getAddress(), getMessage(), this); + return new UnauthorizedException(getEndPoint(), getMessage(), this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnavailableException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnavailableException.java index 7c2b72fe942..15f576f44c2 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnavailableException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnavailableException.java @@ -16,6 +16,7 @@ package com.datastax.driver.core.exceptions; import com.datastax.driver.core.ConsistencyLevel; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -27,7 +28,7 @@ public class UnavailableException extends QueryExecutionException implements Coo private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; private final ConsistencyLevel consistency; private final int required; private final int alive; @@ -40,26 +41,26 @@ public UnavailableException(ConsistencyLevel consistency, int required, int aliv } public UnavailableException( - InetSocketAddress address, ConsistencyLevel consistency, int required, int alive) { + EndPoint endPoint, ConsistencyLevel consistency, int required, int alive) { super( String.format( "Not enough replicas available for query at consistency %s (%d required but only %d alive)", consistency, required, alive)); - this.address = address; + this.endPoint = endPoint; this.consistency = consistency; this.required = required; this.alive = alive; } private UnavailableException( - InetSocketAddress address, + EndPoint endPoint, String message, Throwable cause, ConsistencyLevel consistency, int required, int alive) { super(message, cause); - this.address = address; + this.endPoint = endPoint; this.consistency = consistency; this.required = required; this.alive = alive; @@ -95,21 +96,27 @@ public int getAliveReplicas() { return alive; } - /** {@inheritDoc} */ @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } - /** {@inheritDoc} */ @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } @Override public UnavailableException copy() { - return new UnavailableException(getAddress(), getMessage(), this, consistency, required, alive); + return new UnavailableException( + getEndPoint(), getMessage(), this, consistency, required, alive); } /** @@ -125,11 +132,12 @@ public UnavailableException copy() { * generally yields a more user-friendly stack trace that the original one. * * - * @param address The full address of the host that caused this exception to be thrown. + * @param endPoint The full connection information of the host that caused this exception to be + * thrown. * @return a copy/clone of this exception, but with the given host address instead of the original * one. */ - public UnavailableException copy(InetSocketAddress address) { - return new UnavailableException(address, getMessage(), this, consistency, required, alive); + public UnavailableException copy(EndPoint endPoint) { + return new UnavailableException(endPoint, getMessage(), this, consistency, required, alive); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnpreparedException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnpreparedException.java index 05acbec5c0f..8f5b7618573 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnpreparedException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnpreparedException.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -23,37 +24,41 @@ public class UnpreparedException extends QueryValidationException implements Coo private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; - public UnpreparedException(InetSocketAddress address, String message) { + public UnpreparedException(EndPoint endPoint, String message) { super( String.format( "A prepared query was submitted on %s but was not known of that node: %s", - address, message)); - this.address = address; + endPoint, message)); + this.endPoint = endPoint; } /** Private constructor used solely when copying exceptions. */ - private UnpreparedException( - InetSocketAddress address, String message, UnpreparedException cause) { + private UnpreparedException(EndPoint endPoint, String message, UnpreparedException cause) { super(message, cause); - this.address = address; + this.endPoint = endPoint; } - /** {@inheritDoc} */ @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } - /** {@inheritDoc} */ @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } @Override public UnpreparedException copy() { - return new UnpreparedException(address, getMessage(), this); + return new UnpreparedException(endPoint, getMessage(), this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedProtocolVersionException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedProtocolVersionException.java index 2174c3ff86a..be52d5a52a5 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedProtocolVersionException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedProtocolVersionException.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core.exceptions; +import com.datastax.driver.core.EndPoint; import com.datastax.driver.core.ProtocolVersion; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -28,53 +29,56 @@ public class UnsupportedProtocolVersionException extends DriverException private static final long serialVersionUID = 0; - private final InetSocketAddress address; + private final EndPoint endPoint; private final ProtocolVersion unsupportedVersion; private final ProtocolVersion serverVersion; public UnsupportedProtocolVersionException( - InetSocketAddress address, - ProtocolVersion unsupportedVersion, - ProtocolVersion serverVersion) { - super(makeErrorMessage(address, unsupportedVersion, serverVersion)); - this.address = address; + EndPoint endPoint, ProtocolVersion unsupportedVersion, ProtocolVersion serverVersion) { + super(makeErrorMessage(endPoint, unsupportedVersion, serverVersion)); + this.endPoint = endPoint; this.unsupportedVersion = unsupportedVersion; this.serverVersion = serverVersion; } public UnsupportedProtocolVersionException( - InetSocketAddress address, + EndPoint endPoint, ProtocolVersion unsupportedVersion, ProtocolVersion serverVersion, Throwable cause) { - super(makeErrorMessage(address, unsupportedVersion, serverVersion), cause); - this.address = address; + super(makeErrorMessage(endPoint, unsupportedVersion, serverVersion), cause); + this.endPoint = endPoint; this.unsupportedVersion = unsupportedVersion; this.serverVersion = serverVersion; } private static String makeErrorMessage( - InetSocketAddress address, - ProtocolVersion unsupportedVersion, - ProtocolVersion serverVersion) { + EndPoint endPoint, ProtocolVersion unsupportedVersion, ProtocolVersion serverVersion) { return unsupportedVersion == serverVersion ? String.format( - "[%s] Host does not support protocol version %s", address, unsupportedVersion) + "[%s] Host does not support protocol version %s", endPoint, unsupportedVersion) : String.format( "[%s] Host does not support protocol version %s but %s", - address, unsupportedVersion, serverVersion); + endPoint, unsupportedVersion, serverVersion); } @Override - public InetAddress getHost() { - return address != null ? address.getAddress() : null; + public EndPoint getEndPoint() { + return endPoint; } @Override + @Deprecated public InetSocketAddress getAddress() { - return address; + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); } /** @@ -102,6 +106,6 @@ public ProtocolVersion getUnsupportedVersion() { @Override public UnsupportedProtocolVersionException copy() { return new UnsupportedProtocolVersionException( - address, unsupportedVersion, serverVersion, this); + endPoint, unsupportedVersion, serverVersion, this); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/WrappingEndPoint.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/WrappingEndPoint.java new file mode 100644 index 00000000000..f97b6ae36c5 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/WrappingEndPoint.java @@ -0,0 +1,34 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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.exceptions; + +import com.datastax.driver.core.EndPoint; +import java.net.InetSocketAddress; + +// The sole purpose of this class is to allow some exception types to preserve a constructor that +// takes an InetSocketAddress (for backward compatibility). +class WrappingEndPoint implements EndPoint { + private final InetSocketAddress address; + + WrappingEndPoint(InetSocketAddress address) { + this.address = address; + } + + @Override + public InetSocketAddress resolve() { + return address; + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteFailureException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteFailureException.java index 37a5e809ba0..76ef37244af 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteFailureException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteFailureException.java @@ -16,9 +16,9 @@ package com.datastax.driver.core.exceptions; import com.datastax.driver.core.ConsistencyLevel; +import com.datastax.driver.core.EndPoint; import com.datastax.driver.core.WriteType; import java.net.InetAddress; -import java.net.InetSocketAddress; import java.util.Collections; import java.util.Map; @@ -62,7 +62,7 @@ public WriteFailureException( } public WriteFailureException( - InetSocketAddress address, + EndPoint endPoint, ConsistencyLevel consistency, WriteType writeType, int received, @@ -70,7 +70,7 @@ public WriteFailureException( int failed, Map failuresMap) { super( - address, + endPoint, String.format( "Cassandra failure during write query at consistency %s " + "(%d responses were required but only %d replica responded, %d failed)", @@ -86,14 +86,14 @@ public WriteFailureException( /** @deprecated Legacy constructor for backward compatibility. */ @Deprecated public WriteFailureException( - InetSocketAddress address, + EndPoint endPoint, ConsistencyLevel consistency, WriteType writeType, int received, int required, int failed) { this( - address, + endPoint, consistency, writeType, received, @@ -103,7 +103,7 @@ public WriteFailureException( } private WriteFailureException( - InetSocketAddress address, + EndPoint endPoint, String msg, Throwable cause, ConsistencyLevel consistency, @@ -112,7 +112,7 @@ private WriteFailureException( int required, int failed, Map failuresMap) { - super(address, msg, cause, consistency, received, required); + super(endPoint, msg, cause, consistency, received, required); this.writeType = writeType; this.failed = failed; this.failuresMap = failuresMap; @@ -164,7 +164,7 @@ public Map getFailuresMap() { @Override public WriteFailureException copy() { return new WriteFailureException( - getAddress(), + getEndPoint(), getMessage(), this, getConsistencyLevel(), @@ -175,9 +175,9 @@ public WriteFailureException copy() { failuresMap); } - public WriteFailureException copy(InetSocketAddress address) { + public WriteFailureException copy(EndPoint endPoint) { return new WriteFailureException( - address, + endPoint, getMessage(), this, getConsistencyLevel(), diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteTimeoutException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteTimeoutException.java index 3188a5ddb91..52377fd4159 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteTimeoutException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteTimeoutException.java @@ -16,8 +16,8 @@ package com.datastax.driver.core.exceptions; import com.datastax.driver.core.ConsistencyLevel; +import com.datastax.driver.core.EndPoint; import com.datastax.driver.core.WriteType; -import java.net.InetSocketAddress; /** A Cassandra timeout during a write query. */ public class WriteTimeoutException extends QueryConsistencyException { @@ -35,13 +35,13 @@ public WriteTimeoutException( } public WriteTimeoutException( - InetSocketAddress address, + EndPoint endPoint, ConsistencyLevel consistency, WriteType writeType, int received, int required) { super( - address, + endPoint, String.format( "Cassandra timeout during %s write query at consistency %s " + "(%d replica were required but only %d acknowledged the write)", @@ -53,14 +53,14 @@ public WriteTimeoutException( } private WriteTimeoutException( - InetSocketAddress address, + EndPoint endPoint, String msg, Throwable cause, ConsistencyLevel consistency, WriteType writeType, int received, int required) { - super(address, msg, cause, consistency, received, required); + super(endPoint, msg, cause, consistency, received, required); this.writeType = writeType; } @@ -76,7 +76,7 @@ public WriteType getWriteType() { @Override public WriteTimeoutException copy() { return new WriteTimeoutException( - getAddress(), + getEndPoint(), getMessage(), this, getConsistencyLevel(), @@ -102,7 +102,7 @@ public WriteTimeoutException copy() { * @return a copy/clone of this exception, but with the given host address instead of the original * one. */ - public WriteTimeoutException copy(InetSocketAddress address) { + public WriteTimeoutException copy(EndPoint address) { return new WriteTimeoutException( address, getMessage(), diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/Policies.java b/driver-core/src/main/java/com/datastax/driver/core/policies/Policies.java index 2777e929ca2..f74d579c961 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/policies/Policies.java +++ b/driver-core/src/main/java/com/datastax/driver/core/policies/Policies.java @@ -16,6 +16,8 @@ package com.datastax.driver.core.policies; import com.datastax.driver.core.AtomicMonotonicTimestampGenerator; +import com.datastax.driver.core.DefaultEndPointFactory; +import com.datastax.driver.core.EndPointFactory; import com.datastax.driver.core.TimestampGenerator; /** Policies configured for a {@link com.datastax.driver.core.Cluster} instance. */ @@ -43,6 +45,7 @@ public static Builder builder() { private final AddressTranslator addressTranslator; private final TimestampGenerator timestampGenerator; private final SpeculativeExecutionPolicy speculativeExecutionPolicy; + private final EndPointFactory endPointFactory; private Policies( LoadBalancingPolicy loadBalancingPolicy, @@ -50,13 +53,15 @@ private Policies( RetryPolicy retryPolicy, AddressTranslator addressTranslator, TimestampGenerator timestampGenerator, - SpeculativeExecutionPolicy speculativeExecutionPolicy) { + SpeculativeExecutionPolicy speculativeExecutionPolicy, + EndPointFactory endPointFactory) { this.loadBalancingPolicy = loadBalancingPolicy; this.reconnectionPolicy = reconnectionPolicy; this.retryPolicy = retryPolicy; this.addressTranslator = addressTranslator; this.timestampGenerator = timestampGenerator; this.speculativeExecutionPolicy = speculativeExecutionPolicy; + this.endPointFactory = endPointFactory; } /** @@ -134,6 +139,10 @@ public static SpeculativeExecutionPolicy defaultSpeculativeExecutionPolicy() { return DEFAULT_SPECULATIVE_EXECUTION_POLICY; } + public static EndPointFactory defaultEndPointFactory() { + return new DefaultEndPointFactory(); + } + /** * The load balancing policy in use. * @@ -195,6 +204,10 @@ public SpeculativeExecutionPolicy getSpeculativeExecutionPolicy() { return speculativeExecutionPolicy; } + public EndPointFactory getEndPointFactory() { + return endPointFactory; + } + /** A builder to create a new {@code Policies} object. */ public static class Builder { private LoadBalancingPolicy loadBalancingPolicy; @@ -203,6 +216,7 @@ public static class Builder { private AddressTranslator addressTranslator; private TimestampGenerator timestampGenerator; private SpeculativeExecutionPolicy speculativeExecutionPolicy; + private EndPointFactory endPointFactory; /** * Sets the load balancing policy. @@ -271,6 +285,11 @@ public Builder withSpeculativeExecutionPolicy( return this; } + public Builder withEndPointFactory(EndPointFactory endPointFactory) { + this.endPointFactory = endPointFactory; + return this; + } + /** * Builds the final object from this builder. * @@ -287,7 +306,8 @@ public Policies build() { timestampGenerator == null ? defaultTimestampGenerator() : timestampGenerator, speculativeExecutionPolicy == null ? defaultSpeculativeExecutionPolicy() - : speculativeExecutionPolicy); + : speculativeExecutionPolicy, + endPointFactory == null ? defaultEndPointFactory() : endPointFactory); } } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/WhiteListPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/WhiteListPolicy.java index eace6ae8a64..b57bdb4b382 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/policies/WhiteListPolicy.java +++ b/driver-core/src/main/java/com/datastax/driver/core/policies/WhiteListPolicy.java @@ -68,7 +68,10 @@ private static Predicate buildPredicate(Collection whit return new Predicate() { @Override public boolean apply(Host host) { - return hosts.contains(host.getSocketAddress()); + // This policy shouldn't be used with endpoints that don't resolve to unique addresses. This + // should be pretty obvious from the API. We don't really have any way to check it here. + InetSocketAddress socketAddress = host.getEndPoint().resolve(); + return hosts.contains(socketAddress); } }; } @@ -116,7 +119,8 @@ public static WhiteListPolicy ofHosts( new Predicate() { @Override public boolean apply(Host host) { - return addresses.contains(host.getAddress()); + InetSocketAddress socketAddress = host.getEndPoint().resolve(); + return addresses.contains(socketAddress.getAddress()); } }); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/AbstractPoliciesTest.java b/driver-core/src/test/java/com/datastax/driver/core/AbstractPoliciesTest.java index aeb000c05ea..b9f650402fd 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/AbstractPoliciesTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/AbstractPoliciesTest.java @@ -83,7 +83,8 @@ protected void createMultiDCSchema(int dc1RF, int dc2RF) { /** Coordinator management/count */ protected void addCoordinator(ResultSet rs) { - InetAddress coordinator = rs.getExecutionInfo().getQueriedHost().getAddress(); + InetAddress coordinator = + rs.getExecutionInfo().getQueriedHost().getEndPoint().resolve().getAddress(); Integer n = coordinators.get(coordinator); coordinators.put(coordinator, n == null ? 1 : n + 1); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/AbstractReconnectionHandlerTest.java b/driver-core/src/test/java/com/datastax/driver/core/AbstractReconnectionHandlerTest.java index 9b9ebcc0943..0f5b726f777 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/AbstractReconnectionHandlerTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/AbstractReconnectionHandlerTest.java @@ -369,7 +369,8 @@ protected Connection tryReconnect() throws ConnectionException { case THROW_EXCEPTION: logger.debug("simulate reconnection error"); throw new ConnectionException( - new InetSocketAddress(8888), "Simulated exception from mock reconnection"); + EndPoints.forAddress(new InetSocketAddress(8888)), + "Simulated exception from mock reconnection"); default: throw new AssertionError(); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/AbstractReplicationStrategyTest.java b/driver-core/src/test/java/com/datastax/driver/core/AbstractReplicationStrategyTest.java index ba182d50a9f..fd79f333424 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/AbstractReplicationStrategyTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/AbstractReplicationStrategyTest.java @@ -44,7 +44,10 @@ protected static class HostMock extends Host { private final InetSocketAddress address; private HostMock(InetSocketAddress address, Cluster.Manager manager) { - super(address, new ConvictionPolicy.DefaultConvictionPolicy.Factory(), manager); + super( + EndPoints.forAddress(address), + new ConvictionPolicy.DefaultConvictionPolicy.Factory(), + manager); this.address = address; } diff --git a/driver-core/src/test/java/com/datastax/driver/core/AsyncQueryTest.java b/driver-core/src/test/java/com/datastax/driver/core/AsyncQueryTest.java index d59e9829bb1..fe52b343bfd 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/AsyncQueryTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/AsyncQueryTest.java @@ -88,7 +88,7 @@ public void should_init_cluster_and_session_if_needed() throws Exception { Cluster cluster2 = register( Cluster.builder() - .addContactPointsWithPorts(Lists.newArrayList(host.getSocketAddress())) + .addContactPointsWithPorts(Lists.newArrayList(host.getEndPoint().resolve())) .build()); try { Session session2 = cluster2.newSession(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/AuthenticationTest.java b/driver-core/src/test/java/com/datastax/driver/core/AuthenticationTest.java index 53efcbbefc4..07f17101059 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/AuthenticationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/AuthenticationTest.java @@ -62,8 +62,7 @@ public void should_connect_with_credentials() { cluster.connect(); verify(authProvider, atLeastOnce()) .newAuthenticator( - findHost(cluster, 1).getSocketAddress(), - "org.apache.cassandra.auth.PasswordAuthenticator"); + findHost(cluster, 1).getEndPoint(), "org.apache.cassandra.auth.PasswordAuthenticator"); assertThat(cluster.getMetrics().getErrorMetrics().getAuthenticationErrors().getCount()) .isEqualTo(0); } @@ -141,7 +140,7 @@ public SlowAuthProvider() { } @Override - public Authenticator newAuthenticator(InetSocketAddress host, String authenticator) + public Authenticator newAuthenticator(EndPoint host, String authenticator) throws AuthenticationException { simulateBusyServer(); return super.newAuthenticator(host, authenticator); diff --git a/driver-core/src/test/java/com/datastax/driver/core/ClusterAssert.java b/driver-core/src/test/java/com/datastax/driver/core/ClusterAssert.java index 92ca9bfcb5a..deeb591eb70 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ClusterAssert.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ClusterAssert.java @@ -33,7 +33,8 @@ protected ClusterAssert(Cluster actual) { public ClusterAssert usesControlHost(int node) { String expectedAddress = TestUtils.ipOfNode(node); Host controlHost = actual.manager.controlConnection.connectedHost(); - assertThat(controlHost.getAddress().getHostAddress()).isEqualTo(expectedAddress); + assertThat(controlHost.getEndPoint().resolve().getAddress().getHostAddress()) + .isEqualTo(expectedAddress); return this; } diff --git a/driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java b/driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java index 4c0d8ef42ca..dfc538732e0 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java @@ -69,6 +69,7 @@ public void should_handle_failing_or_missing_contact_points() throws UnknownHost // - 1 is an actual Scassandra instance that will accept connections: scassandra = TestUtils.createScassandraServer(); scassandra.start(); + ScassandraCluster.primeSystemLocalRow(scassandra); int port = scassandra.getBinaryPort(); // - the remaining 4 are fake servers that will throw connect timeouts: @@ -183,8 +184,7 @@ public void should_not_schedule_reconnections_before_init_complete() { new FakeHost(TestUtils.ipOfNode(0), 9042, THROWING_CONNECT_TIMEOUTS), new FakeHost(TestUtils.ipOfNode(1), 9042, THROWING_CONNECT_TIMEOUTS)); // Use a low reconnection interval and keep the default connect timeout (5 seconds). So if a - // reconnection was scheduled, - // we would see a call to the reconnection policy. + // reconnection was scheduled, we would see a call to the reconnection policy. CountingReconnectionPolicy reconnectionPolicy = new CountingReconnectionPolicy(new ConstantReconnectionPolicy(100)); Cluster cluster = diff --git a/driver-core/src/test/java/com/datastax/driver/core/ConnectionReleaseTest.java b/driver-core/src/test/java/com/datastax/driver/core/ConnectionReleaseTest.java index e785edddd5e..131fda2e175 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ConnectionReleaseTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ConnectionReleaseTest.java @@ -82,7 +82,7 @@ public void should_release_connection_before_completing_future() throws Exceptio cluster = Cluster.builder() - .addContactPoints(hostAddress.getAddress()) + .addContactPoint(hostEndPoint) .withPort(scassandra.getBinaryPort()) .withPoolingOptions( new PoolingOptions() diff --git a/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java b/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java index d3230177b37..06d5b711f38 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java @@ -43,7 +43,6 @@ import java.util.Iterator; import java.util.Map; import java.util.Set; -import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import org.apache.log4j.Level; @@ -157,8 +156,9 @@ public void should_reestablish_if_control_node_decommissioned() throws Interrupt cluster.init(); // Ensure the control connection host is that of the first node. - InetAddress controlHost = cluster.manager.controlConnection.connectedHost().getAddress(); - assertThat(controlHost).isEqualTo(firstHost.getAddress()); + InetSocketAddress controlHost = + cluster.manager.controlConnection.connectedHost().getEndPoint().resolve(); + assertThat(controlHost).isEqualTo(firstHost); // Decommission the node. ccm().decommission(1); @@ -205,7 +205,14 @@ public void should_randomize_contact_points_when_determining_control_connection( try { cluster.init(); - occurrencesByHost.add(cluster.manager.controlConnection.connectedHost().getAddress()); + occurrencesByHost.add( + cluster + .manager + .controlConnection + .connectedHost() + .getEndPoint() + .resolve() + .getAddress()); } finally { cluster.close(); } @@ -242,17 +249,17 @@ public Integer apply(InetAddress input) { @DataProvider public static Object[][] disallowedNullColumnsInPeerData() { return new Object[][] { - {"host_id", false, true}, + {"host_id", false, false}, // JAVA-2171: host_id does not require extended peer check anymore {"data_center", false, true}, {"rack", false, true}, {"tokens", false, true}, - {"host_id,data_center,rack,tokens", false, true}, + {"data_center,rack,tokens", false, true}, {"rpc_address", false, false}, - {"host_id", true, true}, + {"host_id", true, false}, {"data_center", true, true}, {"rack", true, true}, {"tokens", true, true}, - {"host_id,data_center,rack,tokens", true, true}, + {"data_center,rack,tokens", true, true}, {"native_address", true, false}, {"native_port", true, false}, {"native_address,native_port", true, false}, @@ -408,7 +415,7 @@ public void should_fetch_whole_peers_table_if_broadcast_address_changed() new InetSocketAddress(InetAddress.getByName("1.2.3.4"), scassandras.getBinaryPort()); // host 2 has the old broadcast_address (which is identical to its rpc_broadcast_address) - assertThat(host2.getSocketAddress().getAddress()) + assertThat(host2.getEndPoint().resolve().getAddress()) .isEqualTo(node2OldBroadcastAddress.getAddress()); // simulate a change in host 2 public IP @@ -416,8 +423,13 @@ public void should_fetch_whole_peers_table_if_broadcast_address_changed() ImmutableMap.builder() .put( "peer", node2NewBroadcastAddress.getAddress()) // new broadcast address for host 2 - .put("rpc_address", host2.getAddress()) // rpc_broadcast_address remains unchanged - .put("host_id", UUID.randomUUID()) + .put( + "rpc_address", + host2 + .getEndPoint() + .resolve() + .getAddress()) // rpc_broadcast_address remains unchanged + .put("host_id", host2.getHostId()) .put("data_center", datacenter(1)) .put("rack", "rack1") .put("release_version", "2.1.8") @@ -460,7 +472,7 @@ public void should_fetch_whole_peers_table_if_broadcast_address_changed() .isEqualTo(node2NewBroadcastAddress.getAddress()); // host 2 should keep its old rpc broadcast address - assertThat(host2.getSocketAddress()).isEqualTo(node2RpcAddress); + assertThat(host2.getEndPoint().resolve()).isEqualTo(node2RpcAddress); } finally { cluster.close(); @@ -517,8 +529,8 @@ public void should_use_port_from_peers_v2_table(boolean sharedIP) { } else { assertThat(host).hasNoListenSocketAddress(); } - uniqueAddresses.add(host.getAddress()); - uniqueSocketAddresses.add(host.getSocketAddress()); + uniqueAddresses.add(host.getEndPoint().resolve().getAddress()); + uniqueSocketAddresses.add(host.getEndPoint().resolve()); } if (!sharedIP) { @@ -575,6 +587,7 @@ public QueryPlanCountingPolicy(LoadBalancingPolicy delegate) { super(delegate); } + @Override public Iterator newQueryPlan(String loggedKeyspace, Statement statement) { counter.incrementAndGet(); return super.newQueryPlan(loggedKeyspace, statement); diff --git a/driver-core/src/test/java/com/datastax/driver/core/DbaasConfigUtilTest.java b/driver-core/src/test/java/com/datastax/driver/core/DbaasConfigUtilTest.java new file mode 100644 index 00000000000..24a7c041cee --- /dev/null +++ b/driver-core/src/test/java/com/datastax/driver/core/DbaasConfigUtilTest.java @@ -0,0 +1,59 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import static com.google.common.base.Charsets.UTF_8; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +import com.google.common.io.Resources; +import java.io.File; +import org.testng.annotations.Test; + +public class DbaasConfigUtilTest { + + @Test(groups = "unit") + public void should_load_config_from_zip() { + should_fetch_dbaas_config(new File(getClass().getResource("/dbaas/creds.zip").getPath())); + } + + private void should_fetch_dbaas_config(File fileToLoad) { + try { + // Test yaml loading + DbaasConfiguration dbaasConfig = DbaasConfigUtil.getBaseConfig(fileToLoad); + assertThat(dbaasConfig.getHost()).isEqualTo("127.0.0.1"); + assertThat(dbaasConfig.getUsername()).isEqualTo("driversuser"); + assertThat(dbaasConfig.getPassword()).isEqualTo("driverspass"); + assertThat(dbaasConfig.getPort()).isEqualTo(30443); + assertThat(dbaasConfig.getLocalDC()).isEqualTo("selfservicedc"); + assertThat(dbaasConfig.getKeyStorePassword()).isEqualTo("keystorepass"); + assertThat(dbaasConfig.getTrustStorePassword()).isEqualTo("trustpass"); + String jsonMetadata = + Resources.toString(getClass().getResource("/dbaas/metadata.json"), UTF_8); + dbaasConfig = DbaasConfigUtil.getConfigFromMetadataJson(dbaasConfig, jsonMetadata); + assertThat(dbaasConfig.getLocalDC()).isEqualTo("dc1"); + // Test metadata parsing + assertThat(dbaasConfig.getHostIds().contains("4ac06655-f861-49f9-881e-3fee22e69b94")); + assertThat(dbaasConfig.getHostIds().contains("2af7c253-3394-4a0d-bfac-f1ad81b5154d")); + assertThat(dbaasConfig.getHostIds().contains("b17b6e2a-3f48-4d6a-81c1-20a0a1f3192a")); + assertThat(dbaasConfig.getHostIds().size()).isEqualTo(3); + assertThat(dbaasConfig.getSniHost()).isEqualTo("localhost"); + assertThat(dbaasConfig.getSniPort()).isEqualTo(30002); + } catch (Exception e) { + fail("Exception thrown during configuration generation that was not expected", e); + } + } +} diff --git a/driver-core/src/test/java/com/datastax/driver/core/EndPoints.java b/driver-core/src/test/java/com/datastax/driver/core/EndPoints.java new file mode 100644 index 00000000000..98bf77624b0 --- /dev/null +++ b/driver-core/src/test/java/com/datastax/driver/core/EndPoints.java @@ -0,0 +1,33 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import java.net.InetSocketAddress; + +/** + * Utility class to create endpoints in tests. This serves mainly as a hook to access + * package-private classes. + */ +public class EndPoints { + + public static EndPoint forAddress(InetSocketAddress address) { + return new TranslatedAddressEndPoint(address); + } + + public static EndPoint forAddress(String host, int port) { + return forAddress(new InetSocketAddress(host, port)); + } +} diff --git a/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerIntegrationTest.java index d72bc2a2d07..aa6e8c6bc30 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerIntegrationTest.java @@ -133,7 +133,8 @@ public void init(Cluster cluster, Collection hosts) { public void onDown(Host host) { if (!init) onDownCalledBeforeInit = true; super.onDown(host); - if (host.getAddress().toString().contains(ipOfNode(3))) onDownCalled.countDown(); + if (host.getEndPoint().resolve().getAddress().toString().contains(ipOfNode(3))) + onDownCalled.countDown(); } void stop() throws InterruptedException { diff --git a/driver-core/src/test/java/com/datastax/driver/core/HeartbeatTest.java b/driver-core/src/test/java/com/datastax/driver/core/HeartbeatTest.java index c4de31642ef..a111466108d 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/HeartbeatTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/HeartbeatTest.java @@ -65,7 +65,7 @@ public void stopCapturingLogs() { public void should_send_heartbeat_when_connection_is_inactive() throws InterruptedException { Cluster cluster = Cluster.builder() - .addContactPoints(hostAddress.getAddress()) + .addContactPoint(hostEndPoint) .withPort(scassandra.getBinaryPort()) .withPoolingOptions(new PoolingOptions().setHeartbeatIntervalSeconds(3)) .build(); @@ -156,7 +156,7 @@ public void should_send_heartbeat_when_requests_being_written_but_nothing_receiv throws Exception { Cluster cluster = Cluster.builder() - .addContactPoints(hostAddress.getAddress()) + .addContactPoint(hostEndPoint) .withPort(scassandra.getBinaryPort()) .withPoolingOptions( new PoolingOptions() @@ -264,7 +264,7 @@ public void run() { public void should_not_send_heartbeat_when_disabled() throws InterruptedException { Cluster cluster = Cluster.builder() - .addContactPoints(hostAddress.getAddress()) + .addContactPoint(hostEndPoint) .withPort(scassandra.getBinaryPort()) .withPoolingOptions(new PoolingOptions().setHeartbeatIntervalSeconds(0)) .build(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/HostAssert.java b/driver-core/src/test/java/com/datastax/driver/core/HostAssert.java index 381a5c49735..2bf5568e871 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/HostAssert.java +++ b/driver-core/src/test/java/com/datastax/driver/core/HostAssert.java @@ -188,7 +188,7 @@ public HostAssert hasNoDseGraph() { } public HostAssert hasSocketAddress(InetSocketAddress address) { - assertThat(actual.getSocketAddress()).isNotNull().isEqualTo(address); + assertThat(actual.getEndPoint().resolve()).isNotNull().isEqualTo(address); return this; } diff --git a/driver-core/src/test/java/com/datastax/driver/core/HostTargetingTest.java b/driver-core/src/test/java/com/datastax/driver/core/HostTargetingTest.java index fcaa3dafc15..fa2d3cc5b10 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/HostTargetingTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/HostTargetingTest.java @@ -46,7 +46,7 @@ public class HostTargetingTest { new Predicate() { @Override public boolean apply(Host host) { - return !host.getAddress().getHostAddress().endsWith("4"); + return !host.getEndPoint().resolve().getAddress().getHostAddress().endsWith("4"); } })); @@ -70,8 +70,12 @@ public void setUp() { @AfterMethod(groups = "short") public void tearDown() { - cluster.close(); - sCluster.stop(); + if (cluster != null) { + cluster.close(); + } + if (sCluster != null) { + sCluster.stop(); + } } private void verifyNoLbpInteractions() { diff --git a/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyRefreshTest.java b/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyRefreshTest.java index 16deec726c2..fc1a6bc0437 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyRefreshTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyRefreshTest.java @@ -41,33 +41,43 @@ public void changeTheHost(Host theNewHost) { cluster.getConfiguration().getPoolingOptions().refreshConnectedHosts(); } + @Override public void init(Cluster cluster, Collection hosts) { this.cluster = cluster; try { for (Host h : hosts) - if (h.getAddress().equals(InetAddress.getByName(TestUtils.IP_PREFIX + '1'))) - this.theHost = h; + if (h.getEndPoint() + .resolve() + .getAddress() + .equals(InetAddress.getByName(TestUtils.IP_PREFIX + '1'))) this.theHost = h; } catch (Exception e) { throw new RuntimeException(e); } } + @Override public HostDistance distance(Host host) { return host == theHost ? HostDistance.LOCAL : HostDistance.IGNORED; } + @Override public Iterator newQueryPlan(String loggedKeyspace, Statement statement) { return Iterators.singletonIterator(theHost); } + @Override public void onAdd(Host h) {} + @Override public void onRemove(Host h) {} + @Override public void onUp(Host h) {} + @Override public void onDown(Host h) {} + @Override public void close() {} } @@ -77,7 +87,7 @@ public void refreshTest() throws Throwable { // Ugly Host[] hosts = new Host[2]; for (Host h : cluster().getMetadata().getAllHosts()) { - if (h.getAddress().equals(ccm().addressOfNode(1).getAddress())) hosts[0] = h; + if (h.getEndPoint().resolve().equals(ccm().addressOfNode(1))) hosts[0] = h; else hosts[1] = h; } diff --git a/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerErrorsTest.java b/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerErrorsTest.java index 4add41fa5fe..031d6516eef 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerErrorsTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerErrorsTest.java @@ -243,7 +243,7 @@ public void should_log_exception_from_the_given_result( } else if (expectedException == BootstrappingException.class) { // Special case BootstrappingException, it's wrapped in NHAE since it's always retried. assertThat(e).isInstanceOf(NoHostAvailableException.class); - assertThat(((NoHostAvailableException) e).getErrors().get(hostAddress)) + assertThat(((NoHostAvailableException) e).getErrors().get(hostEndPoint)) .isInstanceOf(expectedException); } else { assertThat(e).isInstanceOf(expectedException); diff --git a/driver-core/src/test/java/com/datastax/driver/core/QueryTracker.java b/driver-core/src/test/java/com/datastax/driver/core/QueryTracker.java index 3ab852a3b8a..9d7e9ddddef 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/QueryTracker.java +++ b/driver-core/src/test/java/com/datastax/driver/core/QueryTracker.java @@ -92,7 +92,8 @@ public void query( for (ListenableFuture future : futures) { try { ResultSet result = Uninterruptibles.getUninterruptibly(future, 1, TimeUnit.SECONDS); - InetSocketAddress address = result.getExecutionInfo().getQueriedHost().getSocketAddress(); + InetSocketAddress address = + result.getExecutionInfo().getQueriedHost().getEndPoint().resolve(); InetAddress coordinator = address.getAddress(); Integer n = coordinators.get(coordinator); coordinators.put(coordinator, n == null ? 1 : n + 1); @@ -108,7 +109,8 @@ public void query( } if (cause instanceof CoordinatorException) { - assertThat(((CoordinatorException) cause).getAddress()).isEqualTo(expectedHost); + assertThat(((CoordinatorException) cause).getEndPoint().resolve()) + .isEqualTo(expectedHost); } } } diff --git a/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java b/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java index 9362653e6d7..c9733b7b078 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java @@ -31,7 +31,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.Uninterruptibles; import java.io.IOException; -import java.net.InetSocketAddress; import java.util.Collections; import java.util.Iterator; import java.util.concurrent.ConcurrentHashMap; @@ -284,7 +283,7 @@ static class CountingAuthProvider extends PlainTextAuthProvider { } @Override - public Authenticator newAuthenticator(InetSocketAddress host, String authenticator) { + public Authenticator newAuthenticator(EndPoint host, String authenticator) { count.incrementAndGet(); return super.newAuthenticator(host, authenticator); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java b/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java index bd9e62be7cd..e281720f8a5 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java @@ -34,13 +34,16 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import com.google.common.collect.Sets; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.TreeSet; import java.util.concurrent.TimeUnit; import org.scassandra.Scassandra; @@ -49,6 +52,7 @@ import org.scassandra.http.client.PrimingClient; import org.scassandra.http.client.PrimingRequest; import org.scassandra.http.client.Result; +import org.scassandra.http.client.types.ColumnMetadata; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -231,7 +235,7 @@ public InetSocketAddress listenAddress(int dc, int node) { public Host host(Cluster cluster, int dc, int node) { InetSocketAddress address = address(dc, node); for (Host host : cluster.getMetadata().getAllHosts()) { - if (host.getSocketAddress().equals(address)) { + if (host.getEndPoint().resolve().equals(address)) { return host; } } @@ -254,7 +258,11 @@ public void init() { public void stop() { logger.debug("Stopping ScassandraCluster."); for (Scassandra node : instances) { - node.stop(); + try { + node.stop(); + } catch (Exception e) { + logger.error("Could not stop node " + node, e); + } } } @@ -298,7 +306,11 @@ public void stopDC(Cluster cluster, int dc) { public void stop(Cluster cluster, int node) { logger.debug("Stopping node {}.", node); Scassandra scassandra = node(node); - scassandra.stop(); + try { + scassandra.stop(); + } catch (Exception e) { + logger.error("Could not stop node " + scassandra, e); + } assertThat(cluster).host(node).goesDownWithin(10, TimeUnit.SECONDS); } @@ -719,6 +731,24 @@ private Object getPeerInfo(int dc, int node, String property, Object defaultValu column("validator", TEXT), }; + // Primes a minimal system.local row on an Scassandra node. + // We need a host_id so that the driver can store it in Metadata.hosts + public static void primeSystemLocalRow(Scassandra scassandra) { + Set localMetadata = Sets.newHashSet(SELECT_LOCAL); + Map row = new HashMap(); + row.put("host_id", java.util.UUID.randomUUID()); + scassandra + .primingClient() + .prime( + PrimingRequest.queryBuilder() + .withQuery("SELECT * FROM system.local WHERE key='local'") + .withThen( + then() + .withColumnTypes( + localMetadata.toArray(new ColumnMetadata[localMetadata.size()])) + .withRows(Collections.>singletonList(row)))); + } + public static ScassandraClusterBuilder builder() { return new ScassandraClusterBuilder(); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/ScassandraTestBase.java b/driver-core/src/test/java/com/datastax/driver/core/ScassandraTestBase.java index 50e488547f2..4c115120c61 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ScassandraTestBase.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ScassandraTestBase.java @@ -22,6 +22,8 @@ import org.scassandra.http.client.ActivityClient; import org.scassandra.http.client.CurrentClient; import org.scassandra.http.client.PrimingClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -36,9 +38,11 @@ */ public abstract class ScassandraTestBase { + private static final Logger logger = LoggerFactory.getLogger(ScassandraTestBase.class); + protected Scassandra scassandra; - protected InetSocketAddress hostAddress; + protected EndPoint hostEndPoint; protected PrimingClient primingClient; @@ -55,12 +59,19 @@ public void beforeTestClass() { primingClient = scassandra.primingClient(); activityClient = scassandra.activityClient(); currentClient = scassandra.currentClient(); - hostAddress = new InetSocketAddress(ip, scassandra.getBinaryPort()); + hostEndPoint = + new TranslatedAddressEndPoint(new InetSocketAddress(ip, scassandra.getBinaryPort())); } @AfterClass(groups = {"short", "long"}) public void afterTestClass() { - if (scassandra != null) scassandra.stop(); + if (scassandra != null) { + try { + scassandra.stop(); + } catch (Exception e) { + logger.error("Could not stop node " + scassandra, e); + } + } } @BeforeMethod(groups = {"short", "long"}) @@ -69,12 +80,13 @@ public void resetClients() { activityClient.clearAllRecordedActivity(); primingClient.clearAllPrimes(); currentClient.enableListener(); + ScassandraCluster.primeSystemLocalRow(scassandra); } protected Cluster.Builder createClusterBuilder() { return Cluster.builder() .withPort(scassandra.getBinaryPort()) - .addContactPoints(hostAddress.getAddress()) + .addContactPoint(hostEndPoint) .withPort(scassandra.getBinaryPort()) .withPoolingOptions( new PoolingOptions() @@ -84,7 +96,7 @@ protected Cluster.Builder createClusterBuilder() { } protected Host retrieveSingleHost(Cluster cluster) { - Host host = cluster.getMetadata().getHost(hostAddress); + Host host = cluster.getMetadata().getHost(hostEndPoint); if (host == null) { fail("Unable to retrieve host"); } @@ -103,15 +115,18 @@ public abstract static class PerClassCluster extends ScassandraTestBase { protected Host host; + @Override @BeforeClass(groups = {"short", "long"}) public void beforeTestClass() { super.beforeTestClass(); + ScassandraCluster.primeSystemLocalRow(scassandra); Cluster.Builder builder = createClusterBuilder(); cluster = builder.build(); host = retrieveSingleHost(cluster); session = cluster.connect(); } + @Override @AfterClass(groups = {"short", "long"}) public void afterTestClass() { if (cluster != null) cluster.close(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/SortingLoadBalancingPolicy.java b/driver-core/src/test/java/com/datastax/driver/core/SortingLoadBalancingPolicy.java index 9a46325db63..64b78da333b 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/SortingLoadBalancingPolicy.java +++ b/driver-core/src/test/java/com/datastax/driver/core/SortingLoadBalancingPolicy.java @@ -34,8 +34,8 @@ public class SortingLoadBalancingPolicy implements LoadBalancingPolicy { new Comparator() { @Override public int compare(Host host1, Host host2) { - byte[] address1 = host1.getAddress().getAddress(); - byte[] address2 = host2.getAddress().getAddress(); + byte[] address1 = host1.getEndPoint().resolve().getAddress().getAddress(); + byte[] address2 = host2.getEndPoint().resolve().getAddress().getAddress(); return UnsignedBytes.compare( address1[address1.length - 1], address2[address2.length - 1]); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java b/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java index 363bf5e9e29..234a5531f82 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java +++ b/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java @@ -657,7 +657,7 @@ public static Host findOrWaitForHost( new StateListenerBase() { @Override public void onAdd(Host host) { - if (host.getAddress().getHostAddress().equals(address)) { + if (host.getEndPoint().resolve().getAddress().getHostAddress().equals(address)) { // for a new node, because of this we also listen for add events. addSignal.countDown(); } @@ -689,7 +689,7 @@ public static Host findHost(Cluster cluster, String address) { // create the Cluster // (JAVA-860 will solve that) for (Host host : cluster.getMetadata().allHosts()) { - if (host.getAddress().getHostAddress().equals(address)) return host; + if (host.getEndPoint().resolve().getAddress().getHostAddress().equals(address)) return host; } return null; } @@ -814,9 +814,9 @@ public static boolean pingPort(InetAddress address, int port) { public static Cluster buildControlCluster(Cluster cluster, CCMAccess ccm) { Host controlHost = cluster.manager.controlConnection.connectedHost(); List singleAddress = - Collections.singletonList(controlHost.getSocketAddress()); + Collections.singletonList(controlHost.getEndPoint().resolve()); return Cluster.builder() - .addContactPoints(controlHost.getSocketAddress().getAddress()) + .addContactPoints(controlHost.getEndPoint().resolve().getAddress()) .withPort(ccm.getBinaryPort()) .withLoadBalancingPolicy(new WhiteListPolicy(new RoundRobinPolicy(), singleAddress)) .build(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/TokenIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TokenIntegrationTest.java index d491b34e04b..7fb139624f4 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/TokenIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/TokenIntegrationTest.java @@ -298,8 +298,8 @@ public void should_expose_tokens_per_host() { // Note that this relies on all queries going to node 1, which is why we use a WhiteList LBP // in setup(). boolean isControlHost = - host.getSocketAddress() - .equals(cluster().manager.controlConnection.connectionRef.get().address); + host.getEndPoint() + .equals(cluster().manager.controlConnection.connectionRef.get().endPoint); Row row; if (isControlHost) { row = session().execute("select tokens from system.local").one(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/cloud/DbaasTest.java b/driver-core/src/test/java/com/datastax/driver/core/cloud/DbaasTest.java new file mode 100644 index 00000000000..b4e58581a9d --- /dev/null +++ b/driver-core/src/test/java/com/datastax/driver/core/cloud/DbaasTest.java @@ -0,0 +1,99 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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 java.lang.System.clearProperty; +import static java.lang.System.setProperty; +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.ResultSet; +import com.datastax.driver.core.Session; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class DbaasTest { + + SniProxyServer proxy = new SniProxyServer(); + + @BeforeClass(groups = "short") + public void startProxy() { + proxy.startProxy(); + } + + @AfterClass(groups = "short", alwaysRun = true) + public void stopProxy() throws Exception { + proxy.stopProxy(); + } + + @Test(groups = "short") + public void should_connect_to_proxy() { + Session session = + Cluster.builder() + .withCloudSecureConnectBundle(proxy.getSecureBundlePath()) + .build() + .connect(); + ResultSet set = session.execute("select * from system.local"); + assertThat(set).isNotNull(); + } + + @Test(groups = "short") + public void should_connect_to_proxy_typesafe_creds() { + try { + setProperty("advanced.auth-provider.username", "cassandra"); + setProperty("advanced.auth-provider.password", "cassandra"); + Session session = + Cluster.builder() + .withCloudSecureConnectBundle(proxy.getSecureBundlePath()) + .build() + .connect(); + ResultSet set = session.execute("select * from system.local"); + assertThat(set).isNotNull(); + } finally { + clearProperty("advanced.auth-provider.username"); + clearProperty("advanced.auth-provider.password"); + } + } + // TODO Add this test when sni_endpoint is fixed + public void should_not_connect_to_proxy_bad_creds() { + try { + Session session = + Cluster.builder() + .withCloudSecureConnectBundle(proxy.getSecureBundleNoCredsPath()) + .build() + .connect(); + fail("Expected an IllegalStateException"); + } catch (IllegalStateException e) { + assertThat(e).hasMessageStartingWith("Unable to construct cloud configuration"); + } + } + + @Test(groups = "short") + public void should_not_connect_to_proxy() { + try { + Session session = + Cluster.builder() + .withCloudSecureConnectBundle(proxy.getSecureBundleUnreachable()) + .build() + .connect(); + fail("Expected an IllegalStateException"); + } catch (IllegalStateException e) { + assertThat(e).hasMessageStartingWith("Unable to construct cloud configuration"); + } + } +} 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 new file mode 100644 index 00000000000..497b6d0013e --- /dev/null +++ b/driver-core/src/test/java/com/datastax/driver/core/cloud/SniProxyServer.java @@ -0,0 +1,106 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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 String proxyPath; + private boolean isRunning = false; + + public SniProxyServer() { + proxyPath = 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 String getSecureBundlePath() { + return proxyPath + "/certs/bundles/creds-v1.zip"; + } + + public String getSecureBundleNoCredsPath() { + return proxyPath + "/certs/bundles/creds-v1-wo-creds.zip"; + } + + public String getSecureBundleUnreachable() { + return 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(new File(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/java/com/datastax/driver/core/exceptions/ConnectionExceptionTest.java b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ConnectionExceptionTest.java index ddaac252e5b..afb679ac4af 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ConnectionExceptionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ConnectionExceptionTest.java @@ -18,7 +18,7 @@ import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNull; -import java.net.InetSocketAddress; +import com.datastax.driver.core.EndPoints; import org.testng.annotations.Test; public class ConnectionExceptionTest { @@ -26,7 +26,7 @@ public class ConnectionExceptionTest { /** @jira_ticket JAVA-1139 */ @Test(groups = "unit") public void getHost_should_return_null_if_address_is_null() { - assertNull(new ConnectionException(null, "Test message").getHost()); + assertNull(new ConnectionException(null, "Test message").getEndPoint()); } /** @jira_ticket JAVA-1139 */ @@ -39,17 +39,16 @@ public void getMessage_should_return_message_if_address_is_null() { @Test(groups = "unit") public void getMessage_should_return_message_if_address_is_unresolved() { assertEquals( - new ConnectionException( - InetSocketAddress.createUnresolved("127.0.0.1", 9042), "Test message") + new ConnectionException(EndPoints.forAddress("127.0.0.1", 9042), "Test message") .getMessage(), - "[127.0.0.1:9042] Test message"); + "[/127.0.0.1:9042] Test message"); } /** @jira_ticket JAVA-1139 */ @Test(groups = "unit") public void getMessage_should_return_message_if_address_is_resolved() { assertEquals( - new ConnectionException(new InetSocketAddress("127.0.0.1", 9042), "Test message") + new ConnectionException(EndPoints.forAddress("127.0.0.1", 9042), "Test message") .getMessage(), "[/127.0.0.1:9042] Test message"); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsScassandraTest.java b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsScassandraTest.java index e3326b1d1a7..1e9b6cbc1ff 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsScassandraTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsScassandraTest.java @@ -27,59 +27,34 @@ import com.datastax.driver.core.Host; import com.datastax.driver.core.Metrics; import com.datastax.driver.core.ResultSet; -import com.datastax.driver.core.ScassandraCluster; +import com.datastax.driver.core.ScassandraTestBase; import com.datastax.driver.core.Session; import com.datastax.driver.core.TestUtils; import com.datastax.driver.core.WriteType; import com.datastax.driver.core.policies.FallthroughRetryPolicy; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.List; -import java.util.Map; -import org.scassandra.Scassandra; import org.scassandra.http.client.PrimingRequest; import org.scassandra.http.client.Result; -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 ExceptionsScassandraTest { +public class ExceptionsScassandraTest extends ScassandraTestBase { - protected ScassandraCluster scassandras; protected Cluster cluster; protected Metrics.Errors errors; protected Host host1; protected Session session; - @BeforeClass(groups = "short") - public void beforeClass() { - scassandras = ScassandraCluster.builder().withNodes(1).build(); - scassandras.init(); - } - @BeforeMethod(groups = "short") public void beforeMethod() { - cluster = - Cluster.builder() - .addContactPoints(scassandras.address(1).getAddress()) - .withPort(scassandras.getBinaryPort()) - .withRetryPolicy(FallthroughRetryPolicy.INSTANCE) - .build(); + cluster = createClusterBuilder().withRetryPolicy(FallthroughRetryPolicy.INSTANCE).build(); session = cluster.connect(); host1 = TestUtils.findHost(cluster, 1); errors = cluster.getMetrics().getErrorMetrics(); - - for (Scassandra node : scassandras.nodes()) { - node.primingClient().clearAllPrimes(); - node.activityClient().clearAllRecordedActivity(); - } } @Test(groups = "short") public void should_throw_proper_unavailable_exception() { - simulateError(1, unavailable); + simulateError(unavailable); try { query(); fail("expected an UnavailableException"); @@ -90,14 +65,13 @@ public void should_throw_proper_unavailable_exception() { assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_ONE); assertThat(e.getAliveReplicas()).isEqualTo(0); assertThat(e.getRequiredReplicas()).isEqualTo(1); - assertThat(e.getAddress()).isEqualTo(host1.getSocketAddress()); - assertThat(e.getHost()).isEqualTo(host1.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(host1.getEndPoint()); } } @Test(groups = "short") public void should_throw_proper_read_timeout_exception() { - simulateError(1, read_request_timeout); + simulateError(read_request_timeout); try { query(); fail("expected a ReadTimeoutException"); @@ -108,14 +82,13 @@ public void should_throw_proper_read_timeout_exception() { assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_ONE); assertThat(e.getReceivedAcknowledgements()).isEqualTo(0); assertThat(e.getRequiredAcknowledgements()).isEqualTo(1); - assertThat(e.getAddress()).isEqualTo(host1.getSocketAddress()); - assertThat(e.getHost()).isEqualTo(host1.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(host1.getEndPoint()); } } @Test(groups = "short") public void should_throw_proper_write_timeout_exception() { - simulateError(1, write_request_timeout); + simulateError(write_request_timeout); try { query(); fail("expected a WriteTimeoutException"); @@ -127,44 +100,19 @@ public void should_throw_proper_write_timeout_exception() { assertThat(e.getReceivedAcknowledgements()).isEqualTo(0); assertThat(e.getRequiredAcknowledgements()).isEqualTo(1); assertThat(e.getWriteType()).isEqualTo(WriteType.SIMPLE); - assertThat(e.getAddress()).isEqualTo(host1.getSocketAddress()); - assertThat(e.getHost()).isEqualTo(host1.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(host1.getEndPoint()); } } - protected void simulateError(int hostNumber, Result result) { - scassandras - .node(hostNumber) - .primingClient() - .prime( - PrimingRequest.queryBuilder() - .withQuery("mock query") - .withThen(then().withResult(result)) - .build()); - } - - private static List> row(String key, String value) { - return ImmutableList.>of(ImmutableMap.of(key, value)); + private void simulateError(Result result) { + primingClient.prime( + PrimingRequest.queryBuilder() + .withQuery("mock query") + .withThen(then().withResult(result)) + .build()); } protected ResultSet query() { - return query(session); - } - - protected ResultSet query(Session session) { return session.execute("mock query"); } - - @AfterMethod(groups = "short", alwaysRun = true) - public void afterMethod() { - for (Scassandra node : scassandras.nodes()) { - node.primingClient().clearAllPrimes(); - } - if (cluster != null) cluster.close(); - } - - @AfterClass(groups = "short", alwaysRun = true) - public void afterClass() { - if (scassandras != null) scassandras.stop(); - } } diff --git a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsTest.java b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsTest.java index 1f7552bba3b..31f3c958227 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsTest.java @@ -22,16 +22,17 @@ import com.datastax.driver.core.CCMTestsSupport; import com.datastax.driver.core.Cluster; +import com.datastax.driver.core.EndPoint; +import com.datastax.driver.core.EndPoints; import com.datastax.driver.core.TestUtils; import com.datastax.driver.core.WriteType; -import java.net.InetSocketAddress; import org.testng.annotations.Test; /** Tests Exception classes with separate clusters per test, when applicable */ public class ExceptionsTest extends CCMTestsSupport { - private InetSocketAddress address1 = new InetSocketAddress("127.0.0.1", 9042); - private InetSocketAddress address2 = new InetSocketAddress("127.0.0.2", 9042); + private EndPoint endPoint1 = EndPoints.forAddress("127.0.0.1", 9042); + private EndPoint endPoint2 = EndPoints.forAddress("127.0.0.2", 9042); /** * Tests the AlreadyExistsException. Create a keyspace twice and a table twice. Catch and test all @@ -63,8 +64,8 @@ public void alreadyExistsException() throws Throwable { assertEquals(e.getKeyspace(), keyspace.toLowerCase()); assertEquals(e.getTable(), null); assertEquals(e.wasTableCreation(), false); - assertEquals(e.getHost(), ccm().addressOfNode(1).getAddress()); - assertEquals(e.getAddress(), ccm().addressOfNode(1)); + assertEquals(e.getEndPoint().resolve().getAddress(), ccm().addressOfNode(1).getAddress()); + assertEquals(e.getEndPoint().resolve(), ccm().addressOfNode(1)); } session().execute(cqlCommands[1]); @@ -77,8 +78,8 @@ public void alreadyExistsException() throws Throwable { assertEquals(e.getKeyspace(), keyspace.toLowerCase()); assertEquals(e.getTable(), table.toLowerCase()); assertEquals(e.wasTableCreation(), true); - assertEquals(e.getHost(), ccm().addressOfNode(1).getAddress()); - assertEquals(e.getAddress(), ccm().addressOfNode(1)); + assertEquals(e.getEndPoint().resolve().getAddress(), ccm().addressOfNode(1).getAddress()); + assertEquals(e.getEndPoint().resolve(), ccm().addressOfNode(1)); } } @@ -127,48 +128,42 @@ public void driverInternalError() throws Exception { @Test(groups = "unit") public void should_create_proper_already_exists_exception_for_keyspaces() { - AlreadyExistsException e = new AlreadyExistsException(address1, "keyspace1", ""); + AlreadyExistsException e = new AlreadyExistsException(endPoint1, "keyspace1", ""); assertThat(e.getMessage()).isEqualTo("Keyspace keyspace1 already exists"); assertThat(e.getKeyspace()).isEqualTo("keyspace1"); assertThat(e.getTable()).isNull(); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); - e = e.copy(address2); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); + e = e.copy(endPoint2); assertThat(e.getMessage()).isEqualTo("Keyspace keyspace1 already exists"); assertThat(e.getKeyspace()).isEqualTo("keyspace1"); assertThat(e.getTable()).isNull(); - assertThat(e.getAddress()).isEqualTo(address2); - assertThat(e.getHost()).isEqualTo(address2.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(endPoint2); } @Test(groups = "unit") public void should_create_proper_already_exists_exception_for_tables() { - AlreadyExistsException e = new AlreadyExistsException(address1, "keyspace1", "table1"); + AlreadyExistsException e = new AlreadyExistsException(endPoint1, "keyspace1", "table1"); assertThat(e.getMessage()).isEqualTo("Table keyspace1.table1 already exists"); assertThat(e.getKeyspace()).isEqualTo("keyspace1"); assertThat(e.getTable()).isEqualTo("table1"); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); - e = e.copy(address2); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); + e = e.copy(endPoint2); assertThat(e.getMessage()).isEqualTo("Table keyspace1.table1 already exists"); assertThat(e.getKeyspace()).isEqualTo("keyspace1"); assertThat(e.getTable()).isEqualTo("table1"); - assertThat(e.getAddress()).isEqualTo(address2); - assertThat(e.getHost()).isEqualTo(address2.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(endPoint2); } @Test(groups = "unit") public void should_create_proper_bootstrapping_exception() { - BootstrappingException e = new BootstrappingException(address1, "Sorry mate"); + BootstrappingException e = new BootstrappingException(endPoint1, "Sorry mate"); assertThat(e.getMessage()) - .isEqualTo("Queried host (" + address1 + ") was bootstrapping: Sorry mate"); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); + .isEqualTo("Queried host (" + endPoint1 + ") was bootstrapping: Sorry mate"); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); e = e.copy(); assertThat(e.getMessage()) - .isEqualTo("Queried host (" + address1 + ") was bootstrapping: Sorry mate"); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); + .isEqualTo("Queried host (" + endPoint1 + ") was bootstrapping: Sorry mate"); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); } @Test(groups = "unit") @@ -197,109 +192,96 @@ public void should_create_proper_paging_state_exception() { @Test(groups = "unit") public void should_create_proper_invalid_configuration_in_query_exception() { InvalidConfigurationInQueryException e = - new InvalidConfigurationInQueryException(address1, "Bad, really bad"); + new InvalidConfigurationInQueryException(endPoint1, "Bad, really bad"); assertThat(e.getMessage()).isEqualTo("Bad, really bad"); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); InvalidQueryException e1 = (InvalidQueryException) e.copy(); assertThat(e1.getMessage()).isEqualTo("Bad, really bad"); } @Test(groups = "unit") public void should_create_proper_overloaded_exception() { - OverloadedException e = new OverloadedException(address1, "I'm busy"); + OverloadedException e = new OverloadedException(endPoint1, "I'm busy"); assertThat(e.getMessage()) - .isEqualTo("Queried host (" + address1 + ") was overloaded: I'm busy"); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); + .isEqualTo("Queried host (" + endPoint1 + ") was overloaded: I'm busy"); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); e = e.copy(); assertThat(e.getMessage()) - .isEqualTo("Queried host (" + address1 + ") was overloaded: I'm busy"); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); + .isEqualTo("Queried host (" + endPoint1 + ") was overloaded: I'm busy"); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); } @Test(groups = "unit") public void should_create_proper_syntax_error() { - SyntaxError e = new SyntaxError(address1, "Missing ) at EOF"); + SyntaxError e = new SyntaxError(endPoint1, "Missing ) at EOF"); assertThat(e.getMessage()).isEqualTo("Missing ) at EOF"); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); e = (SyntaxError) e.copy(); assertThat(e.getMessage()).isEqualTo("Missing ) at EOF"); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); } @Test(groups = "unit") public void should_create_proper_truncate_exception() { - TruncateException e = new TruncateException(address1, "I'm running headless now"); + TruncateException e = new TruncateException(endPoint1, "I'm running headless now"); assertThat(e.getMessage()).isEqualTo("I'm running headless now"); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); e = (TruncateException) e.copy(); assertThat(e.getMessage()).isEqualTo("I'm running headless now"); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); } @Test(groups = "unit") public void should_create_proper_unauthorized_exception() { - UnauthorizedException e = new UnauthorizedException(address1, "You talking to me?"); + UnauthorizedException e = new UnauthorizedException(endPoint1, "You talking to me?"); assertThat(e.getMessage()).isEqualTo("You talking to me?"); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); e = (UnauthorizedException) e.copy(); assertThat(e.getMessage()).isEqualTo("You talking to me?"); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); } @Test(groups = "unit") public void should_create_proper_unavailable_exception() { - UnavailableException e = new UnavailableException(address1, LOCAL_QUORUM, 3, 2); + UnavailableException e = new UnavailableException(endPoint1, LOCAL_QUORUM, 3, 2); assertThat(e.getMessage()) .isEqualTo( "Not enough replicas available for query at consistency LOCAL_QUORUM (3 required but only 2 alive)"); assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_QUORUM); assertThat(e.getAliveReplicas()).isEqualTo(2); assertThat(e.getRequiredReplicas()).isEqualTo(3); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); - e = e.copy(address2); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); + e = e.copy(endPoint2); assertThat(e.getMessage()) .isEqualTo( "Not enough replicas available for query at consistency LOCAL_QUORUM (3 required but only 2 alive)"); assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_QUORUM); assertThat(e.getAliveReplicas()).isEqualTo(2); assertThat(e.getRequiredReplicas()).isEqualTo(3); - assertThat(e.getAddress()).isEqualTo(address2); - assertThat(e.getHost()).isEqualTo(address2.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(endPoint2); } @Test(groups = "unit") public void should_create_proper_unprepared_exception() { - UnpreparedException e = new UnpreparedException(address1, "Caught me unawares"); + UnpreparedException e = new UnpreparedException(endPoint1, "Caught me unawares"); assertThat(e.getMessage()) .isEqualTo( "A prepared query was submitted on " - + address1 + + endPoint1 + " but was not known of that node: Caught me unawares"); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); e = e.copy(); assertThat(e.getMessage()) .isEqualTo( "A prepared query was submitted on " - + address1 + + endPoint1 + " but was not known of that node: Caught me unawares"); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); } @Test(groups = "unit") public void should_create_proper_read_timeout_exception() { - ReadTimeoutException e = new ReadTimeoutException(address1, LOCAL_QUORUM, 2, 3, true); + ReadTimeoutException e = new ReadTimeoutException(endPoint1, LOCAL_QUORUM, 2, 3, true); assertThat(e.getMessage()) .isEqualTo( "Cassandra timeout during read query at consistency LOCAL_QUORUM (3 responses were required but only 2 replica responded)"); @@ -307,9 +289,8 @@ public void should_create_proper_read_timeout_exception() { assertThat(e.getReceivedAcknowledgements()).isEqualTo(2); assertThat(e.getRequiredAcknowledgements()).isEqualTo(3); assertThat(e.wasDataRetrieved()).isTrue(); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); - e = e.copy(address2); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); + e = e.copy(endPoint2); assertThat(e.getMessage()) .isEqualTo( "Cassandra timeout during read query at consistency LOCAL_QUORUM (3 responses were required but only 2 replica responded)"); @@ -317,14 +298,13 @@ public void should_create_proper_read_timeout_exception() { assertThat(e.getReceivedAcknowledgements()).isEqualTo(2); assertThat(e.getRequiredAcknowledgements()).isEqualTo(3); assertThat(e.wasDataRetrieved()).isTrue(); - assertThat(e.getAddress()).isEqualTo(address2); - assertThat(e.getHost()).isEqualTo(address2.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(endPoint2); } @Test(groups = "unit") public void should_create_proper_write_timeout_exception() { WriteTimeoutException e = - new WriteTimeoutException(address1, LOCAL_QUORUM, WriteType.BATCH, 2, 3); + new WriteTimeoutException(endPoint1, LOCAL_QUORUM, WriteType.BATCH, 2, 3); assertThat(e.getMessage()) .isEqualTo( "Cassandra timeout during BATCH write query at consistency LOCAL_QUORUM (3 replica were required but only 2 acknowledged the write)"); @@ -332,9 +312,8 @@ public void should_create_proper_write_timeout_exception() { assertThat(e.getReceivedAcknowledgements()).isEqualTo(2); assertThat(e.getRequiredAcknowledgements()).isEqualTo(3); assertThat(e.getWriteType()).isEqualTo(WriteType.BATCH); - assertThat(e.getAddress()).isEqualTo(address1); - assertThat(e.getHost()).isEqualTo(address1.getAddress()); - e = e.copy(address2); + assertThat(e.getEndPoint()).isEqualTo(endPoint1); + e = e.copy(endPoint2); assertThat(e.getMessage()) .isEqualTo( "Cassandra timeout during BATCH write query at consistency LOCAL_QUORUM (3 replica were required but only 2 acknowledged the write)"); @@ -342,7 +321,6 @@ public void should_create_proper_write_timeout_exception() { assertThat(e.getReceivedAcknowledgements()).isEqualTo(2); assertThat(e.getRequiredAcknowledgements()).isEqualTo(3); assertThat(e.getWriteType()).isEqualTo(WriteType.BATCH); - assertThat(e.getAddress()).isEqualTo(address2); - assertThat(e.getHost()).isEqualTo(address2.getAddress()); + assertThat(e.getEndPoint()).isEqualTo(endPoint2); } } diff --git a/driver-core/src/test/java/com/datastax/driver/core/exceptions/NoHostAvailableExceptionTest.java b/driver-core/src/test/java/com/datastax/driver/core/exceptions/NoHostAvailableExceptionTest.java index 9e7569fd9d8..d3d22628122 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/exceptions/NoHostAvailableExceptionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/exceptions/NoHostAvailableExceptionTest.java @@ -17,8 +17,9 @@ import static org.assertj.core.api.Assertions.assertThat; +import com.datastax.driver.core.EndPoint; +import com.datastax.driver.core.EndPoints; import java.io.PrintWriter; -import java.net.InetSocketAddress; import java.util.HashMap; import java.util.Map; import org.testng.annotations.Test; @@ -84,10 +85,10 @@ public void should_build_formatted_message_with_stack_traces() { assertThat(message).contains("/127.0.0.2:9042\nmock stack trace 2\n"); } - private static Map buildMockErrors(int count) { - Map errors = new HashMap(); + private static Map buildMockErrors(int count) { + Map errors = new HashMap(); for (int i = 1; i <= count; i++) { - errors.put(new InetSocketAddress("127.0.0." + i, 9042), new MockError(i)); + errors.put(EndPoints.forAddress("127.0.0." + i, 9042), new MockError(i)); } return errors; } diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/CustomRetryPolicyIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/CustomRetryPolicyIntegrationTest.java index 37b87e91e00..a870e73baf2 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/policies/CustomRetryPolicyIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/policies/CustomRetryPolicyIntegrationTest.java @@ -100,7 +100,7 @@ public void should_rethrow_on_client_timeouts() { assertThat(e.getMessage()) .isEqualTo( String.format( - "[%s] Timed out waiting for server response", host1.getSocketAddress())); + "[%s] Timed out waiting for server response", host1.getEndPoint().resolve())); } assertOnRequestErrorWasCalled(1, OperationTimedOutException.class); assertThat(errors.getRetries().getCount()).isEqualTo(0); @@ -144,7 +144,8 @@ public void should_rethrow_on_connection_error(CloseType closeType) { fail("expected a TransportException"); } catch (TransportException e) { assertThat(e.getMessage()) - .isEqualTo(String.format("[%s] Connection has been closed", host1.getSocketAddress())); + .isEqualTo( + String.format("[%s] Connection has been closed", host1.getEndPoint().resolve())); } assertOnRequestErrorWasCalled(1, TransportException.class); assertThat(errors.getRetries().getCount()).isEqualTo(0); diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/DefaultRetryPolicyIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/DefaultRetryPolicyIntegrationTest.java index 516b8629462..35cde59535f 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/policies/DefaultRetryPolicyIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/policies/DefaultRetryPolicyIntegrationTest.java @@ -137,7 +137,7 @@ public void should_rethrow_unavailable_in_no_host_available_exception() { LoadBalancingPolicy firstHostOnlyPolicy = new WhiteListPolicy( Policies.defaultLoadBalancingPolicy(), - Collections.singletonList(host1.getSocketAddress())); + Collections.singletonList(host1.getEndPoint().resolve())); Cluster whiteListedCluster = Cluster.builder() @@ -161,7 +161,7 @@ public void should_rethrow_unavailable_in_no_host_available_exception() { fail("expected an NoHostAvailableException"); } catch (NoHostAvailableException e) { // ok - Throwable error = e.getErrors().get(host1.getSocketAddress()); + Throwable error = e.getErrors().get(host1.getEndPoint()); assertThat(error).isNotNull(); assertThat(error).isInstanceOf(UnavailableException.class); } @@ -212,18 +212,14 @@ public void should_try_next_host_on_client_timeouts() { } catch (NoHostAvailableException e) { assertThat(e.getErrors().keySet()) .hasSize(3) - .containsOnly( - host1.getSocketAddress(), host2.getSocketAddress(), host3.getSocketAddress()); + .containsOnly(host1.getEndPoint(), host2.getEndPoint(), host3.getEndPoint()); assertThat(e.getErrors().values()) .hasOnlyElementsOfType(OperationTimedOutException.class) .extractingResultOf("getMessage") .containsOnlyOnce( - String.format( - "[%s] Timed out waiting for server response", host1.getSocketAddress()), - String.format( - "[%s] Timed out waiting for server response", host2.getSocketAddress()), - String.format( - "[%s] Timed out waiting for server response", host3.getSocketAddress())); + String.format("[%s] Timed out waiting for server response", host1.getEndPoint()), + String.format("[%s] Timed out waiting for server response", host2.getEndPoint()), + String.format("[%s] Timed out waiting for server response", host3.getEndPoint())); } assertOnRequestErrorWasCalled(3, OperationTimedOutException.class); assertThat(errors.getRetries().getCount()).isEqualTo(3); @@ -252,8 +248,7 @@ public void should_try_next_host_on_server_side_error( } catch (NoHostAvailableException e) { assertThat(e.getErrors().keySet()) .hasSize(3) - .containsOnly( - host1.getSocketAddress(), host2.getSocketAddress(), host3.getSocketAddress()); + .containsOnly(host1.getEndPoint(), host2.getEndPoint(), host3.getEndPoint()); assertThat(e.getErrors().values()).hasOnlyElementsOfType(exception); } assertOnRequestErrorWasCalled(3, exception); @@ -316,8 +311,7 @@ public void should_try_next_host_on_connection_error(ClosedConnectionConfig.Clos } catch (NoHostAvailableException e) { assertThat(e.getErrors().keySet()) .hasSize(3) - .containsOnly( - host1.getSocketAddress(), host2.getSocketAddress(), host3.getSocketAddress()); + .containsOnly(host1.getEndPoint(), host2.getEndPoint(), host3.getEndPoint()); assertThat(e.getErrors().values()).hasOnlyElementsOfType(TransportException.class); } assertOnRequestErrorWasCalled(3, TransportException.class); diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/DowngradingConsistencyRetryPolicyIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/DowngradingConsistencyRetryPolicyIntegrationTest.java index 16efd0fe331..23bba580019 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/policies/DowngradingConsistencyRetryPolicyIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/policies/DowngradingConsistencyRetryPolicyIntegrationTest.java @@ -409,18 +409,14 @@ public void should_try_next_host_on_client_timeouts() { } catch (NoHostAvailableException e) { assertThat(e.getErrors().keySet()) .hasSize(3) - .containsOnly( - host1.getSocketAddress(), host2.getSocketAddress(), host3.getSocketAddress()); + .containsOnly(host1.getEndPoint(), host2.getEndPoint(), host3.getEndPoint()); assertThat(e.getErrors().values()) .hasOnlyElementsOfType(OperationTimedOutException.class) .extractingResultOf("getMessage") .containsOnlyOnce( - String.format( - "[%s] Timed out waiting for server response", host1.getSocketAddress()), - String.format( - "[%s] Timed out waiting for server response", host2.getSocketAddress()), - String.format( - "[%s] Timed out waiting for server response", host3.getSocketAddress())); + String.format("[%s] Timed out waiting for server response", host1.getEndPoint()), + String.format("[%s] Timed out waiting for server response", host2.getEndPoint()), + String.format("[%s] Timed out waiting for server response", host3.getEndPoint())); } assertOnRequestErrorWasCalled(3, OperationTimedOutException.class); assertThat(errors.getRetries().getCount()).isEqualTo(3); @@ -459,8 +455,7 @@ public void should_try_next_host_on_server_side_error( } catch (NoHostAvailableException e) { assertThat(e.getErrors().keySet()) .hasSize(3) - .containsOnly( - host1.getSocketAddress(), host2.getSocketAddress(), host3.getSocketAddress()); + .containsOnly(host1.getEndPoint(), host2.getEndPoint(), host3.getEndPoint()); assertThat(e.getErrors().values()).hasOnlyElementsOfType(exception); } assertOnRequestErrorWasCalled(3, exception); @@ -489,8 +484,7 @@ public void should_try_next_host_on_connection_error(ClosedConnectionConfig.Clos } catch (NoHostAvailableException e) { assertThat(e.getErrors().keySet()) .hasSize(3) - .containsOnly( - host1.getSocketAddress(), host2.getSocketAddress(), host3.getSocketAddress()); + .containsOnly(host1.getEndPoint(), host2.getEndPoint(), host3.getEndPoint()); assertThat(e.getErrors().values()).hasOnlyElementsOfType(TransportException.class); } assertOnRequestErrorWasCalled(3, TransportException.class); diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/FallthroughRetryPolicyIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/FallthroughRetryPolicyIntegrationTest.java index 514fc2f9dd9..43f269d8061 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/policies/FallthroughRetryPolicyIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/policies/FallthroughRetryPolicyIntegrationTest.java @@ -115,7 +115,7 @@ public void should_rethrow_on_client_timeouts() { assertThat(e.getMessage()) .isEqualTo( String.format( - "[%s] Timed out waiting for server response", host1.getSocketAddress())); + "[%s] Timed out waiting for server response", host1.getEndPoint().resolve())); } assertOnRequestErrorWasCalled(1, OperationTimedOutException.class); assertThat(errors.getRetries().getCount()).isEqualTo(0); @@ -159,7 +159,8 @@ public void should_rethrow_on_connection_error(CloseType closeType) { Fail.fail("expected a TransportException"); } catch (TransportException e) { assertThat(e.getMessage()) - .isEqualTo(String.format("[%s] Connection has been closed", host1.getSocketAddress())); + .isEqualTo( + String.format("[%s] Connection has been closed", host1.getEndPoint().resolve())); } assertOnRequestErrorWasCalled(1, TransportException.class); assertThat(errors.getRetries().getCount()).isEqualTo(0); diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/HostFilterPolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/HostFilterPolicyTest.java index 5203c4b173e..af9a52e95c4 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/policies/HostFilterPolicyTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/policies/HostFilterPolicyTest.java @@ -31,7 +31,6 @@ import com.google.common.base.Predicates; import com.google.common.collect.Iterators; import com.google.common.collect.Lists; -import java.net.InetSocketAddress; import java.util.Collection; import org.mockito.ArgumentCaptor; import org.mockito.Captor; @@ -45,10 +44,6 @@ public class HostFilterPolicyTest { @Mock Host host1, host2, host3; - InetSocketAddress address1 = InetSocketAddress.createUnresolved("192.168.1.1", 2345); - InetSocketAddress address2 = InetSocketAddress.createUnresolved("192.168.1.2", 9876); - InetSocketAddress address3 = InetSocketAddress.createUnresolved("192.168.1.3", 6666); - @Mock LoadBalancingPolicy wrappedPolicy; @Captor ArgumentCaptor> hostsCaptor; @@ -56,11 +51,6 @@ public class HostFilterPolicyTest { @BeforeMethod(groups = "unit") public void setup() { MockitoAnnotations.initMocks(this); - - when(host1.getSocketAddress()).thenReturn(address1); - when(host2.getSocketAddress()).thenReturn(address2); - when(host3.getSocketAddress()).thenReturn(address3); - when(wrappedPolicy.distance(any(Host.class))).thenReturn(HostDistance.LOCAL); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/IdempotenceAwareRetryPolicyIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/IdempotenceAwareRetryPolicyIntegrationTest.java index 101e0fb6d60..1b2b5ad5696 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/policies/IdempotenceAwareRetryPolicyIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/policies/IdempotenceAwareRetryPolicyIntegrationTest.java @@ -105,7 +105,7 @@ public void should_not_retry_on_client_timeout_if_statement_non_idempotent() { assertThat(e.getMessage()) .isEqualTo( String.format( - "[%s] Timed out waiting for server response", host1.getSocketAddress())); + "[%s] Timed out waiting for server response", host1.getEndPoint().resolve())); } // Should not have even been called as statement was not idempotent. assertOnRequestErrorWasCalled(0, OperationTimedOutException.class); @@ -184,8 +184,7 @@ public void should_retry_on_server_error_if_statement_idempotent( } catch (NoHostAvailableException e) { assertThat(e.getErrors().keySet()) .hasSize(3) - .containsOnly( - host1.getSocketAddress(), host2.getSocketAddress(), host3.getSocketAddress()); + .containsOnly(host1.getEndPoint(), host2.getEndPoint(), host3.getEndPoint()); assertThat(e.getErrors().values()).hasOnlyElementsOfType(exception); } assertOnRequestErrorWasCalled(3, exception); @@ -208,7 +207,8 @@ public void should_not_retry_on_connection_error_if_statement_non_idempotent( Fail.fail("expected a TransportException"); } catch (TransportException e) { assertThat(e.getMessage()) - .isEqualTo(String.format("[%s] Connection has been closed", host1.getSocketAddress())); + .isEqualTo( + String.format("[%s] Connection has been closed", host1.getEndPoint().resolve())); } // Should not have even been called as statement was not idempotent. assertOnRequestErrorWasCalled(0, TransportException.class); @@ -233,8 +233,7 @@ public void should_retry_on_connection_error_if_statement_idempotent( } catch (NoHostAvailableException e) { assertThat(e.getErrors().keySet()) .hasSize(3) - .containsOnly( - host1.getSocketAddress(), host2.getSocketAddress(), host3.getSocketAddress()); + .containsOnly(host1.getEndPoint(), host2.getEndPoint(), host3.getEndPoint()); assertThat(e.getErrors().values()).hasOnlyElementsOfType(TransportException.class); } assertOnRequestErrorWasCalled(3, TransportException.class); diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/LatencyAwarePolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/LatencyAwarePolicyTest.java index 5ec652238ad..ebbeb686e48 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/policies/LatencyAwarePolicyTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/policies/LatencyAwarePolicyTest.java @@ -121,7 +121,7 @@ public void should_discard_latency_when_unavailable() throws Exception { fail("Should have thrown NoHostAvailableException"); } catch (NoHostAvailableException e) { // ok - Throwable error = e.getErrors().get(hostAddress); + Throwable error = e.getErrors().get(hostEndPoint); assertThat(error).isNotNull(); assertThat(error).isInstanceOf(UnavailableException.class); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/LoggingRetryPolicyIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/LoggingRetryPolicyIntegrationTest.java index 8ab0cb000a8..b0fc7f3065d 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/policies/LoggingRetryPolicyIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/policies/LoggingRetryPolicyIntegrationTest.java @@ -161,7 +161,7 @@ public void should_log_ignored_request_error() throws InterruptedException { IGNORING_REQUEST_ERROR, defaultCL, 0, - new ServerError(host1.getSocketAddress(), "Server Error").toString())); + new ServerError(host1.getEndPoint(), "Server Error").toString())); } @Test(groups = "short") @@ -178,7 +178,7 @@ public void should_log_retried_request_error() throws InterruptedException { LOCAL_ONE, defaultCL, 0, - new ServerError(host1.getSocketAddress(), "Server Error").toString())); + new ServerError(host1.getEndPoint(), "Server Error").toString())); } @Test(groups = "short") diff --git a/driver-core/src/test/resources/dbaas/creds.zip b/driver-core/src/test/resources/dbaas/creds.zip new file mode 100644 index 0000000000000000000000000000000000000000..9a11b1126efd49c5e932730f03da247512fbf3a2 GIT binary patch literal 389 zcmWIWW@Zs#-~hr?#qa$XpkO^C0|PgM0z-0sURq|lURH5_UT6p}1G~=^omdzyt>9*0 zWO>2NzyKz4CmiHDWWdw*zPjt;<}<$RP2sjx0yRyS+}4~6os^^WX!q@$<}!`FwekP# zP2TIA4|Q)?yRZ4yvr~&+GkQ*l>Zr+BwA_8RhvVWs6-k0uvx28Q3=KZE_(5sp_1BDd z9*731-8~?%s5xiP#j|zleG4qx&+au&IGfRXkMWb@nGK)U@`!pb=57wQ3OS$35d6uU z-SgEExx{yKTc^qH?|R+)toZm7u1}JQA9;FYKhEEGA~`uF^SMLv!i9DBQcSa_*6s`N zX6I0P5yY|==zoyk1H2iTM3@obf-DCL7Z_O52x5^CN&()iY#=R+Ko|+6#ekMEFaQ7y Cmx~kt literal 0 HcmV?d00001 diff --git a/driver-core/src/test/resources/dbaas/metadata.json b/driver-core/src/test/resources/dbaas/metadata.json new file mode 100644 index 00000000000..9573731ac3e --- /dev/null +++ b/driver-core/src/test/resources/dbaas/metadata.json @@ -0,0 +1 @@ +{"region":"local","contact_info":{"type":"sni_proxy","local_dc":"dc1","contact_points":["4ac06655-f861-49f9-881e-3fee22e69b94","2af7c253-3394-4a0d-bfac-f1ad81b5154d","b17b6e2a-3f48-4d6a-81c1-20a0a1f3192a"],"sni_proxy_address":"localhost:30002"}} \ No newline at end of file diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 8208c9eee4c..865ee69a530 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.3-SNAPSHOT + 3.8.0-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 1af15d90505..dd6927b8a1d 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.3-SNAPSHOT + 3.8.0-SNAPSHOT cassandra-driver-examples diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/basic/ReadTopologyAndSchemaMetadata.java b/driver-examples/src/main/java/com/datastax/driver/examples/basic/ReadTopologyAndSchemaMetadata.java index e151ac02858..f9de539be19 100644 --- a/driver-examples/src/main/java/com/datastax/driver/examples/basic/ReadTopologyAndSchemaMetadata.java +++ b/driver-examples/src/main/java/com/datastax/driver/examples/basic/ReadTopologyAndSchemaMetadata.java @@ -49,7 +49,7 @@ public static void main(String[] args) { for (Host host : metadata.getAllHosts()) { System.out.printf( "Datatacenter: %s; Host: %s; Rack: %s%n", - host.getDatacenter(), host.getAddress(), host.getRack()); + host.getDatacenter(), host.getEndPoint(), host.getRack()); } for (KeyspaceMetadata keyspace : metadata.getKeyspaces()) { diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 68d4be996bb..1c831052efa 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.3-SNAPSHOT + 3.8.0-SNAPSHOT cassandra-driver-extras diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/InstantCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/InstantCodec.java index dfb0efff179..3adef009bc8 100644 --- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/InstantCodec.java +++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/InstantCodec.java @@ -22,6 +22,7 @@ import static java.lang.Long.parseLong; import com.datastax.driver.core.DataType; +import com.datastax.driver.core.IgnoreJDK6Requirement; import com.datastax.driver.core.ProtocolVersion; import com.datastax.driver.core.TypeCodec; import com.datastax.driver.core.exceptions.InvalidTypeException; diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.java index 1a9a8d95865..674c926fb8e 100644 --- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.java +++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.java @@ -25,6 +25,7 @@ import static java.lang.Long.parseLong; import com.datastax.driver.core.DataType; +import com.datastax.driver.core.IgnoreJDK6Requirement; import com.datastax.driver.core.ProtocolVersion; import com.datastax.driver.core.TypeCodec; import com.datastax.driver.core.exceptions.InvalidTypeException; diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalDateTimeCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalDateTimeCodec.java index 8e2e37826dc..361be052893 100644 --- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalDateTimeCodec.java +++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalDateTimeCodec.java @@ -19,6 +19,7 @@ import static com.datastax.driver.core.ParseUtils.quote; import com.datastax.driver.core.DataType; +import com.datastax.driver.core.IgnoreJDK6Requirement; import com.datastax.driver.core.ParseUtils; import com.datastax.driver.core.ProtocolVersion; import com.datastax.driver.core.TypeCodec; diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.java index 9a20dcced68..db0afcc5404 100644 --- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.java +++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.java @@ -18,6 +18,7 @@ import static com.datastax.driver.core.ParseUtils.quote; import com.datastax.driver.core.DataType; +import com.datastax.driver.core.IgnoreJDK6Requirement; import com.datastax.driver.core.ParseUtils; import com.datastax.driver.core.ProtocolVersion; import com.datastax.driver.core.TypeCodec; diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.java index 54d3a510401..824fdee5d29 100644 --- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.java +++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.extras.codecs.jdk8; +import com.datastax.driver.core.IgnoreJDK6Requirement; import com.datastax.driver.core.TypeCodec; import com.datastax.driver.extras.codecs.MappingCodec; import com.google.common.reflect.TypeParameter; diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZoneIdCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZoneIdCodec.java index 1e32f9adc40..a68d43ee61a 100644 --- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZoneIdCodec.java +++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZoneIdCodec.java @@ -16,6 +16,7 @@ package com.datastax.driver.extras.codecs.jdk8; import com.datastax.driver.core.DataType; +import com.datastax.driver.core.IgnoreJDK6Requirement; import com.datastax.driver.core.ProtocolVersion; import com.datastax.driver.core.TypeCodec; import com.datastax.driver.core.exceptions.InvalidTypeException; diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.java index 8736b47620f..0888f12b60a 100644 --- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.java +++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.java @@ -20,6 +20,7 @@ import static com.google.common.base.Preconditions.checkArgument; import com.datastax.driver.core.DataType; +import com.datastax.driver.core.IgnoreJDK6Requirement; import com.datastax.driver.core.ParseUtils; import com.datastax.driver.core.ProtocolVersion; import com.datastax.driver.core.TupleType; diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 366710a64f8..c2aadb9c004 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.3-SNAPSHOT + 3.8.0-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index aef04ea0831..596d132d517 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.3-SNAPSHOT + 3.8.0-SNAPSHOT cassandra-driver-tests-osgi @@ -177,6 +177,8 @@ ${metrics.version} ${testng.version} ${jsr353-api.version} + ${jackson.version} + ${jackson-databind.version} ${ipprefix} diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java index a60944b7e61..45cfcbb4b23 100644 --- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java +++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java @@ -165,6 +165,7 @@ public Option[] getOptions() { mavenBundle("ch.qos.logback", "logback-classic", getVersion("logback.version")), mavenBundle("ch.qos.logback", "logback-core", getVersion("logback.version")), mavenBundle("io.dropwizard.metrics", "metrics-core", getVersion("metrics.version")), + mavenBundle("org.yaml", "snakeyaml", getVersion("snakeyaml.version")), mavenBundle("org.testng", "testng", getVersion("testng.version")), systemPackages( "org.testng", diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 06200c1faa5..16ed5166acf 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.3-SNAPSHOT + 3.8.0-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index b2ba844fa51..34d518627e7 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.3-SNAPSHOT + 3.8.0-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index f0224505576..e86f966347e 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.7.3-SNAPSHOT + 3.8.0-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 5eef7a87041..1334509b394 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.7.3-SNAPSHOT + 3.8.0-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index c95d319f824..a19d51c4e97 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.7.3-SNAPSHOT + 3.8.0-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index dfc10e796cf..ec92e7c450c 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.7.3-SNAPSHOT + 3.8.0-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -725,8 +725,7 @@ limitations under the License. 1.0 - com.datastax.driver.extras.codecs.jdk8.IgnoreJDK6Requirement - + com.datastax.driver.core.IgnoreJDK6Requirement @@ -1141,7 +1140,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.7.2-cloud-01 From 0041b939f7aa32b85c7429c612913088aa2e37a3 Mon Sep 17 00:00:00 2001 From: Tomasz Lelek Date: Wed, 16 Oct 2019 13:31:32 +0200 Subject: [PATCH 053/211] JAVA-2483 && JAVA-2499: Allow to provide secureBundle via URL && Allow to read the secure bundle from an InputStream (#16) --- changelog/README.md | 2 + driver-core/pom.xml | 6 + .../com/datastax/driver/core/CloudConfig.java | 70 +++++ .../driver/core/CloudConfigFactory.java | 267 ++++++++++++++++++ .../com/datastax/driver/core/Cluster.java | 114 +++++++- .../datastax/driver/core/DbaasConfigUtil.java | 185 ------------ .../driver/core/DbaasConfiguration.java | 140 --------- .../driver/core/CloudConfigFactoryTest.java | 249 ++++++++++++++++ .../driver/core/DbaasConfigUtilTest.java | 59 ---- .../datastax/driver/core/cloud/CloudTest.java | 174 ++++++++++++ .../datastax/driver/core/cloud/DbaasTest.java | 99 ------- .../driver/core/cloud/SniProxyServer.java | 24 +- .../src/test/resources/cloud/creds.zip | Bin 0 -> 9805 bytes .../src/test/resources/cloud/identity.jks | Bin 0 -> 2413 bytes .../resources/{dbaas => cloud}/metadata.json | 0 .../src/test/resources/cloud/trustStore.jks | Bin 0 -> 956 bytes .../src/test/resources/dbaas/creds.zip | Bin 389 -> 0 bytes pom.xml | 7 + 18 files changed, 889 insertions(+), 507 deletions(-) create mode 100644 driver-core/src/main/java/com/datastax/driver/core/CloudConfig.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/CloudConfigFactory.java delete mode 100644 driver-core/src/main/java/com/datastax/driver/core/DbaasConfigUtil.java delete mode 100644 driver-core/src/main/java/com/datastax/driver/core/DbaasConfiguration.java create mode 100644 driver-core/src/test/java/com/datastax/driver/core/CloudConfigFactoryTest.java delete mode 100644 driver-core/src/test/java/com/datastax/driver/core/DbaasConfigUtilTest.java create mode 100644 driver-core/src/test/java/com/datastax/driver/core/cloud/CloudTest.java delete mode 100644 driver-core/src/test/java/com/datastax/driver/core/cloud/DbaasTest.java create mode 100644 driver-core/src/test/resources/cloud/creds.zip create mode 100644 driver-core/src/test/resources/cloud/identity.jks rename driver-core/src/test/resources/{dbaas => cloud}/metadata.json (100%) create mode 100644 driver-core/src/test/resources/cloud/trustStore.jks delete mode 100644 driver-core/src/test/resources/dbaas/creds.zip diff --git a/changelog/README.md b/changelog/README.md index f1075b5a975..2820c8d08c8 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -4,6 +4,8 @@ ## DataStax Cloud (in progress) - [new feature] JAVA-2355: CaaS Enablement +- [improvement] JAVA-2483: Allow to provide secureBundle via URL +- [improvement] JAVA-2499: Allow to read the secure bundle from an InputStream ### 3.7.2 diff --git a/driver-core/pom.xml b/driver-core/pom.xml index b4344336fcc..6e7e2056496 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -142,6 +142,12 @@ test + + com.github.tomakehurst + wiremock + test + + org.jboss.byteman byteman-bmunit diff --git a/driver-core/src/main/java/com/datastax/driver/core/CloudConfig.java b/driver-core/src/main/java/com/datastax/driver/core/CloudConfig.java new file mode 100644 index 00000000000..7f9c3878c18 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/CloudConfig.java @@ -0,0 +1,70 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import com.google.common.collect.ImmutableList; +import java.net.InetSocketAddress; +import java.util.List; + +class CloudConfig { + + private final InetSocketAddress proxyAddress; + private final List endPoints; + private final String localDatacenter; + private final SSLOptions sslOptions; + private final AuthProvider authProvider; + + CloudConfig( + InetSocketAddress proxyAddress, + List endPoints, + String localDatacenter, + SSLOptions sslOptions, + AuthProvider authProvider) { + this.proxyAddress = proxyAddress; + this.endPoints = ImmutableList.copyOf(endPoints); + this.localDatacenter = localDatacenter; + this.sslOptions = sslOptions; + this.authProvider = authProvider; + } + + /** @return not null proxy Address */ + InetSocketAddress getProxyAddress() { + return proxyAddress; + } + + /** @return not null endpoints */ + List getEndPoints() { + return endPoints; + } + + /** @return not null local data center */ + String getLocalDatacenter() { + return localDatacenter; + } + + /** @return not null ssl options that can be used to connect to SniProxy */ + SSLOptions getSslOptions() { + return sslOptions; + } + + /** + * @return nullable AuthProvider that can be used to connect to proxy or null if there was not + * username/password provided in the secure bundle + */ + AuthProvider getAuthProvider() { + return authProvider; + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/CloudConfigFactory.java b/driver-core/src/main/java/com/datastax/driver/core/CloudConfigFactory.java new file mode 100644 index 00000000000..98faf16c956 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/CloudConfigFactory.java @@ -0,0 +1,267 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import static com.google.common.base.Charsets.UTF_8; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.base.Throwables; +import com.google.common.io.ByteStreams; +import com.google.common.net.HostAndPort; +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.InetSocketAddress; +import java.net.MalformedURLException; +import java.net.URL; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManagerFactory; + +class CloudConfigFactory { + + /** + * Creates a {@link CloudConfig} with information fetched from the specified {@link InputStream}. + * + *

    The stream must contain a valid secure connect bundle archive in ZIP format. Note that the + * stream will be closed after a call to that method and cannot be used anymore. + * + * @param cloudConfig the stream to read the Cloud configuration from; cannot be null. + * @throws IOException If the Cloud configuration cannot be read. + * @throws GeneralSecurityException If the Cloud SSL context cannot be created. + */ + CloudConfig createCloudConfig(InputStream cloudConfig) + throws IOException, GeneralSecurityException { + checkNotNull(cloudConfig, "cloudConfig cannot be null"); + JsonNode configJson = null; + ByteArrayOutputStream keyStoreOutputStream = null; + ByteArrayOutputStream trustStoreOutputStream = null; + ObjectMapper mapper = new ObjectMapper().configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, false); + ZipInputStream zipInputStream = null; + try { + zipInputStream = new ZipInputStream(cloudConfig); + ZipEntry entry; + while ((entry = zipInputStream.getNextEntry()) != null) { + String fileName = entry.getName(); + if (fileName.equals("config.json")) { + configJson = mapper.readTree(zipInputStream); + } else if (fileName.equals("identity.jks")) { + keyStoreOutputStream = new ByteArrayOutputStream(); + ByteStreams.copy(zipInputStream, keyStoreOutputStream); + } else if (fileName.equals("trustStore.jks")) { + trustStoreOutputStream = new ByteArrayOutputStream(); + ByteStreams.copy(zipInputStream, trustStoreOutputStream); + } + } + } finally { + if (zipInputStream != null) { + zipInputStream.close(); + } + } + + if (configJson == null) { + throw new IllegalStateException("Invalid bundle: missing file config.json"); + } + if (keyStoreOutputStream == null) { + throw new IllegalStateException("Invalid bundle: missing file identity.jks"); + } + if (trustStoreOutputStream == null) { + throw new IllegalStateException("Invalid bundle: missing file trustStore.jks"); + } + char[] keyStorePassword = getKeyStorePassword(configJson); + char[] trustStorePassword = getTrustStorePassword(configJson); + ByteArrayInputStream keyStoreInputStream = + new ByteArrayInputStream(keyStoreOutputStream.toByteArray()); + ByteArrayInputStream trustStoreInputStream = + new ByteArrayInputStream(trustStoreOutputStream.toByteArray()); + SSLContext sslContext = + createSslContext( + keyStoreInputStream, keyStorePassword, trustStoreInputStream, trustStorePassword); + URL metadataServiceUrl = getMetadataServiceUrl(configJson); + JsonNode proxyMetadataJson; + BufferedReader proxyMetadata = null; + try { + proxyMetadata = fetchProxyMetadata(metadataServiceUrl, sslContext); + proxyMetadataJson = mapper.readTree(proxyMetadata); + } finally { + if (proxyMetadata != null) { + proxyMetadata.close(); + } + } + InetSocketAddress sniProxyAddress = getSniProxyAddress(proxyMetadataJson); + List endPoints = getEndPoints(proxyMetadataJson, sniProxyAddress); + String localDatacenter = getLocalDatacenter(proxyMetadataJson); + SSLOptions sslOptions = getSSLOptions(sslContext); + AuthProvider authProvider = getAuthProvider(configJson); + return new CloudConfig(sniProxyAddress, endPoints, localDatacenter, sslOptions, authProvider); + } + + protected char[] getKeyStorePassword(JsonNode configFile) { + if (configFile.has("keyStorePassword")) { + return configFile.get("keyStorePassword").asText().toCharArray(); + } else { + throw new IllegalStateException("Invalid config.json: missing field keyStorePassword"); + } + } + + protected char[] getTrustStorePassword(JsonNode configFile) { + if (configFile.has("trustStorePassword")) { + return configFile.get("trustStorePassword").asText().toCharArray(); + } else { + throw new IllegalStateException("Invalid config.json: missing field trustStorePassword"); + } + } + + protected URL getMetadataServiceUrl(JsonNode configFile) throws MalformedURLException { + if (configFile.has("host")) { + String metadataServiceHost = configFile.get("host").asText(); + if (configFile.has("port")) { + int metadataServicePort = configFile.get("port").asInt(); + return new URL("https", metadataServiceHost, metadataServicePort, "/metadata"); + } else { + throw new IllegalStateException("Invalid config.json: missing field port"); + } + } else { + throw new IllegalStateException("Invalid config.json: missing field host"); + } + } + + protected AuthProvider getAuthProvider(JsonNode configFile) { + if (configFile.has("username")) { + String username = configFile.get("username").asText(); + if (configFile.has("password")) { + String password = configFile.get("password").asText(); + return new PlainTextAuthProvider(username, password); + } + } + return null; + } + + protected SSLContext createSslContext( + ByteArrayInputStream keyStoreInputStream, + char[] keyStorePassword, + ByteArrayInputStream trustStoreInputStream, + char[] trustStorePassword) + throws IOException, GeneralSecurityException { + KeyManagerFactory kmf = createKeyManagerFactory(keyStoreInputStream, keyStorePassword); + TrustManagerFactory tmf = createTrustManagerFactory(trustStoreInputStream, trustStorePassword); + SSLContext sslContext = SSLContext.getInstance("SSL"); + sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), new SecureRandom()); + return sslContext; + } + + protected KeyManagerFactory createKeyManagerFactory( + InputStream keyStoreInputStream, char[] keyStorePassword) + throws IOException, GeneralSecurityException { + KeyStore ks = KeyStore.getInstance("JKS"); + ks.load(keyStoreInputStream, keyStorePassword); + KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); + kmf.init(ks, keyStorePassword); + Arrays.fill(keyStorePassword, (char) 0); + return kmf; + } + + protected TrustManagerFactory createTrustManagerFactory( + InputStream trustStoreInputStream, char[] trustStorePassword) + throws IOException, GeneralSecurityException { + KeyStore ts = KeyStore.getInstance("JKS"); + ts.load(trustStoreInputStream, trustStorePassword); + TrustManagerFactory tmf = + TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + tmf.init(ts); + Arrays.fill(trustStorePassword, (char) 0); + return tmf; + } + + protected BufferedReader fetchProxyMetadata(URL metadataServiceUrl, SSLContext sslContext) + throws IOException { + HttpsURLConnection connection = (HttpsURLConnection) metadataServiceUrl.openConnection(); + connection.setSSLSocketFactory(sslContext.getSocketFactory()); + connection.setRequestMethod("GET"); + connection.setRequestProperty("host", "localhost"); + return new BufferedReader(new InputStreamReader(connection.getInputStream(), UTF_8)); + } + + protected String getLocalDatacenter(JsonNode proxyMetadata) { + JsonNode contactInfo = getContactInfo(proxyMetadata); + if (contactInfo.has("local_dc")) { + return contactInfo.get("local_dc").asText(); + } else { + throw new IllegalStateException("Invalid proxy metadata: missing field local_dc"); + } + } + + protected InetSocketAddress getSniProxyAddress(JsonNode proxyMetadata) { + JsonNode contactInfo = getContactInfo(proxyMetadata); + if (contactInfo.has("sni_proxy_address")) { + HostAndPort sniProxyHostAndPort = + HostAndPort.fromString(contactInfo.get("sni_proxy_address").asText()); + if (!sniProxyHostAndPort.hasPort()) { + throw new IllegalStateException( + "Invalid proxy metadata: missing port from field sni_proxy_address"); + } + return InetSocketAddress.createUnresolved( + sniProxyHostAndPort.getHostText(), sniProxyHostAndPort.getPort()); + } else { + throw new IllegalStateException("Invalid proxy metadata: missing field sni_proxy_address"); + } + } + + protected List getEndPoints(JsonNode proxyMetadata, InetSocketAddress sniProxyAddress) { + JsonNode contactInfo = getContactInfo(proxyMetadata); + if (contactInfo.has("contact_points")) { + List endPoints = new ArrayList(); + JsonNode hostIdsJson = contactInfo.get("contact_points"); + for (int i = 0; i < hostIdsJson.size(); i++) { + endPoints.add(new SniEndPoint(sniProxyAddress, hostIdsJson.get(i).asText())); + } + return endPoints; + } else { + throw new IllegalStateException("Invalid proxy metadata: missing field contact_points"); + } + } + + protected JsonNode getContactInfo(JsonNode proxyMetadata) { + if (proxyMetadata.has("contact_info")) { + return proxyMetadata.get("contact_info"); + } else { + throw new IllegalStateException("Invalid proxy metadata: missing field contact_info"); + } + } + + protected SSLOptions getSSLOptions(SSLContext sslContext) { + try { + return SniSSLOptions.builder().withSSLContext(sslContext).build(); + } catch (Exception e) { + throw Throwables.propagate(e); + } + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java index b0a5679d867..8f6ec8579b0 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java @@ -53,9 +53,15 @@ import com.google.common.util.concurrent.SettableFuture; import com.google.common.util.concurrent.Uninterruptibles; import java.io.Closeable; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; import java.net.InetAddress; import java.net.InetSocketAddress; +import java.net.MalformedURLException; +import java.net.URL; import java.net.UnknownHostException; +import java.security.GeneralSecurityException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -1366,25 +1372,103 @@ public Builder withNoCompact() { } /** - * Creates a {@link Builder} pre-configured for a specific DBaaS endpoint or configuration file. - * Currently this supports the format provided by DBaaS cloud provider, a creds.zip file. In the - * future this will be extended to work with DBaaS service provider endpoints. + * Configures this Builder for Cloud deployments by retrieving connection information from the + * provided {@link String}. * - * @param secureBundlePath Absolute path to secure bundle zip file. - * @return a preconfigured {@link Builder} ready for use. + *

    To connect to a Cloud database, you must first download the secure database bundle from + * the DataStax Constellation console that contains the connection information, then instruct + * the driver to read its contents using either this method or one if its variants. + * + *

    For more information, please refer to the DataStax Constellation documentation. + * + *

    Note that the provided stream will be consumed and closed when this method will + * return; attempting to reuse it afterwards will result in an error being thrown. + * + * @param cloudConfigFile File that contains secure connect bundle zip file. + * @see #withCloudSecureConnectBundle(URL) + * @see #withCloudSecureConnectBundle(InputStream) */ - public Builder withCloudSecureConnectBundle(String secureBundlePath) { - DbaasConfiguration dbaasConfig = DbaasConfigUtil.getConfig(secureBundlePath); - SSLOptions sslOptions = DbaasConfigUtil.getSSLOptions(dbaasConfig); - InetSocketAddress proxyAddress = - new InetSocketAddress(dbaasConfig.getSniHost(), dbaasConfig.getSniPort()); + public Builder withCloudSecureConnectBundle(File cloudConfigFile) { + try { + return withCloudSecureConnectBundle(cloudConfigFile.toURI().toURL()); + } catch (MalformedURLException e) { + throw new IllegalArgumentException( + "The cloudConfigFile URL " + cloudConfigFile + " is in the wrong format.", e); + } + } + + /** + * Configures this Builder for Cloud deployments by retrieving connection information from the + * provided {@link URL}. + * + *

    To connect to a Cloud database, you must first download the secure database bundle from + * the DataStax Constellation console that contains the connection information, then instruct + * the driver to read its contents using either this method or one if its variants. + * + *

    For more information, please refer to the DataStax Constellation documentation. + * + *

    Note that the provided stream will be consumed and closed when this method will + * return; attempting to reuse it afterwards will result in an error being thrown. + * + * @param cloudConfigUrl URL to the secure connect bundle zip file. + * @see #withCloudSecureConnectBundle(File) + * @see #withCloudSecureConnectBundle(InputStream) + */ + public Builder withCloudSecureConnectBundle(URL cloudConfigUrl) { + CloudConfig cloudConfig; + try { + cloudConfig = new CloudConfigFactory().createCloudConfig(cloudConfigUrl.openStream()); + } catch (GeneralSecurityException e) { + throw new IllegalStateException( + "Cannot construct cloud config from the cloudConfigUrl: " + cloudConfigUrl, e); + } catch (IOException e) { + throw new IllegalStateException( + "Cannot construct cloud config from the cloudConfigUrl: " + cloudConfigUrl, e); + } + + return addCloudConfigToBuilder(cloudConfig); + } + + /** + * Configures this Builder for Cloud deployments by retrieving connection information from the + * provided {@link InputStream}. + * + *

    To connect to a Cloud database, you must first download the secure database bundle from + * the DataStax Constellation console that contains the connection information, then instruct + * the driver to read its contents using either this method or one if its variants. + * + *

    For more information, please refer to the DataStax Constellation documentation. + * + *

    Note that the provided stream will be consumed and closed when this method will + * return; attempting to reuse it afterwards will result in an error being thrown. + * + * @param cloudConfigInputStream A stream containing the secure connect bundle zip file. + * @see #withCloudSecureConnectBundle(File) + * @see #withCloudSecureConnectBundle(URL) + */ + public Builder withCloudSecureConnectBundle(InputStream cloudConfigInputStream) { + CloudConfig cloudConfig; + try { + cloudConfig = new CloudConfigFactory().createCloudConfig(cloudConfigInputStream); + } catch (GeneralSecurityException e) { + throw new IllegalStateException("Cannot construct cloud config from the InputStream.", e); + } catch (IOException e) { + throw new IllegalStateException("Cannot construct cloud config from the InputStream.", e); + } + + return addCloudConfigToBuilder(cloudConfig); + } + + private Builder addCloudConfigToBuilder(CloudConfig cloudConfig) { Builder builder = - withEndPointFactory(new SniEndPointFactory(proxyAddress)).withSSL(sslOptions); - if (dbaasConfig.getUsername() != null && dbaasConfig.getPassword() != null) { - builder = builder.withCredentials(dbaasConfig.getUsername(), dbaasConfig.getPassword()); + withEndPointFactory(new SniEndPointFactory(cloudConfig.getProxyAddress())) + .withSSL(cloudConfig.getSslOptions()); + + if (cloudConfig.getAuthProvider() != null) { + builder = builder.withAuthProvider(cloudConfig.getAuthProvider()); } - for (String hostID : dbaasConfig.getHostIds()) { - builder.addContactPoint(new SniEndPoint(proxyAddress, hostID)); + for (EndPoint endPoint : cloudConfig.getEndPoints()) { + builder.addContactPoint(endPoint); } return builder; } diff --git a/driver-core/src/main/java/com/datastax/driver/core/DbaasConfigUtil.java b/driver-core/src/main/java/com/datastax/driver/core/DbaasConfigUtil.java deleted file mode 100644 index c71dfab5686..00000000000 --- a/driver-core/src/main/java/com/datastax/driver/core/DbaasConfigUtil.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright DataStax, Inc. - * - * Licensed 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; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.base.Throwables; -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URL; -import java.security.KeyStore; -import java.security.SecureRandom; -import java.util.ArrayList; -import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManagerFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -class DbaasConfigUtil { - private static final Logger LOGGER = LoggerFactory.getLogger(DbaasConfigUtil.class); - private static final String CONFIG_FILE = "config.json"; - private static final String CONFIG_TRUSTSTORE_FILE = "trustStore.jks"; - private static final String CONFIG_KEYSTORE_FILE = "identity.jks"; - - private static final String METADATA_CONTACT_INFO = "contact_info"; - private static final String METADATA_CONTACT_POINTS = "contact_points"; - private static final String METADATA_LOCAL_DC = "local_dc"; - private static final String METADATA_PROXY_ADDRESS = "sni_proxy_address"; - - private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - - static DbaasConfiguration getConfig(String secureBundlePath) { - try { - File secureBundleFile = new File(secureBundlePath); - DbaasConfiguration dbaasConfig = getBaseConfig(secureBundleFile); - dbaasConfig = getProxyMetadata(dbaasConfig); - return dbaasConfig; - } catch (Exception exception) { - throw new IllegalStateException( - "Unable to construct cloud configuration from url " + secureBundlePath, exception); - } - } - - static DbaasConfiguration getBaseConfig(File secureBundleFile) throws Exception { - - InputStream jsonInputStream = getJsonConfigInputStream(secureBundleFile); - try { - ObjectMapper mapper = new ObjectMapper(); - DbaasConfiguration config = mapper.readValue(jsonInputStream, DbaasConfiguration.class); - config.setSecureBundlePath(secureBundleFile.toString()); - return config; - } finally { - jsonInputStream.close(); - } - } - - private static InputStream getJsonConfigInputStream(File secureBundleFile) throws IOException { - return getZippedFile(secureBundleFile, CONFIG_FILE); - } - - private static InputStream getZippedFile(File secureBundleFile, String innerFileName) - throws IOException { - ZipFile zipFile = new ZipFile(secureBundleFile); - ZipEntry configEntry = zipFile.getEntry(innerFileName); - return zipFile.getInputStream(configEntry); - } - - private static InputStream getZippedFile(String secureBundlePath, String innerFileName) - throws IOException { - return getZippedFile(new File(secureBundlePath), innerFileName); - } - - private static InputStream getTrustStore(DbaasConfiguration config) throws IOException { - return getZippedFile(config.getSecureBundlePath(), CONFIG_TRUSTSTORE_FILE); - } - - private static InputStream getKeyStore(DbaasConfiguration config) throws IOException { - return getZippedFile(config.getSecureBundlePath(), CONFIG_KEYSTORE_FILE); - } - - private static DbaasConfiguration getProxyMetadata(DbaasConfiguration dbaasConfig) - throws Exception { - try { - URL metaDataServiceUrl = - new URL("https://" + dbaasConfig.getHost() + ":" + dbaasConfig.getPort() + "/metadata"); - HttpsURLConnection connection = (HttpsURLConnection) metaDataServiceUrl.openConnection(); - SSLContext sslContext = DbaasConfigUtil.getSSLContext(dbaasConfig); - connection.setSSLSocketFactory(sslContext.getSocketFactory()); - connection.setRequestMethod("GET"); - connection.setRequestProperty("host", "localhost"); - BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream())); - StringBuilder result = new StringBuilder(); - try { - String line; - while ((line = rd.readLine()) != null) { - result.append(line); - } - } finally { - rd.close(); - } - return getConfigFromMetadataJson(dbaasConfig, result.toString()); - } catch (Exception e) { - LOGGER.error("Unable to fetch cluster metadata", e); - throw e; - } - } - - static DbaasConfiguration getConfigFromMetadataJson( - DbaasConfiguration dbaasConfig, String jsonString) throws Exception { - JsonNode json = OBJECT_MAPPER.readTree(jsonString); - JsonNode contactInfo = json.get(METADATA_CONTACT_INFO); - dbaasConfig.setLocalDC(contactInfo.get(METADATA_LOCAL_DC).asText()); - List hostIds = new ArrayList(); - JsonNode hostIdsJSON = contactInfo.get(METADATA_CONTACT_POINTS); - for (int i = 0; i < hostIdsJSON.size(); i++) { - hostIds.add(hostIdsJSON.get(i).asText()); - } - dbaasConfig.setHostIds(hostIds); - String[] sniHostComplete = contactInfo.get(METADATA_PROXY_ADDRESS).asText().split(":"); - dbaasConfig.setSniHost(sniHostComplete[0]); - dbaasConfig.setSniPort(Integer.parseInt(sniHostComplete[1])); - return dbaasConfig; - } - - private static SSLContext getSSLContext(DbaasConfiguration config) throws Exception { - - TrustManagerFactory tmf; - SSLContext context = SSLContext.getInstance("SSL"); - InputStream trustStoreStream = getTrustStore(config); - try { - KeyStore ts = KeyStore.getInstance("JKS"); - char[] trustPassword = config.getTrustStorePassword().toCharArray(); - ts.load(trustStoreStream, trustPassword); - tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - tmf.init(ts); - } finally { - trustStoreStream.close(); - } - - // initialize keystore. - KeyManagerFactory kmf; - InputStream keyStoreStream = getKeyStore(config); - try { - KeyStore ks = KeyStore.getInstance("JKS"); - char[] keyStorePassword = config.getKeyStorePassword().toCharArray(); - ks.load(keyStoreStream, keyStorePassword); - kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); - kmf.init(ks, keyStorePassword); - } finally { - keyStoreStream.close(); - } - - context.init(kmf.getKeyManagers(), tmf.getTrustManagers(), new SecureRandom()); - return context; - } - - static SSLOptions getSSLOptions(DbaasConfiguration dbaasConfig) { - try { - return SniSSLOptions.builder().withSSLContext(getSSLContext(dbaasConfig)).build(); - } catch (Exception e) { - throw Throwables.propagate(e); - } - } -} diff --git a/driver-core/src/main/java/com/datastax/driver/core/DbaasConfiguration.java b/driver-core/src/main/java/com/datastax/driver/core/DbaasConfiguration.java deleted file mode 100644 index 81863a08c6e..00000000000 --- a/driver-core/src/main/java/com/datastax/driver/core/DbaasConfiguration.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright DataStax, Inc. - * - * Licensed 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; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -public class DbaasConfiguration { - private String username; - private String password; - private String host; - private int port; - private String sniHost; - private int sniPort; - private List hostIds; - private String keyspace; - private String localDC; - private String keyStorePassword; - private String trustStorePassword; - private String secureBundlePath; - private boolean zip; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } - - public String getSniHost() { - return sniHost; - } - - public void setSniHost(String sniHost) { - this.sniHost = sniHost; - } - - public int getSniPort() { - return sniPort; - } - - public void setSniPort(int sniPort) { - this.sniPort = sniPort; - } - - public List getHostIds() { - return hostIds; - } - - public void setHostIds(List hostIds) { - this.hostIds = hostIds; - } - - public String getKeyspace() { - return keyspace; - } - - public void setKeyspace(String keyspace) { - this.keyspace = keyspace; - } - - public String getLocalDC() { - return localDC; - } - - public void setLocalDC(String localDC) { - this.localDC = localDC; - } - - public String getKeyStorePassword() { - return keyStorePassword; - } - - public void setKeyStorePassword(String keyStorePassword) { - this.keyStorePassword = keyStorePassword; - } - - public String getTrustStorePassword() { - return trustStorePassword; - } - - public void setTrustStorePassword(String trustStorePassword) { - this.trustStorePassword = trustStorePassword; - } - - public String getSecureBundlePath() { - return secureBundlePath; - } - - public void setSecureBundlePath(String secureBundlePath) { - this.secureBundlePath = secureBundlePath; - } - - public boolean isZip() { - return zip; - } - - public void setZip(boolean zip) { - this.zip = zip; - } -} diff --git a/driver-core/src/test/java/com/datastax/driver/core/CloudConfigFactoryTest.java b/driver-core/src/test/java/com/datastax/driver/core/CloudConfigFactoryTest.java new file mode 100644 index 00000000000..b0dd487ee51 --- /dev/null +++ b/driver-core/src/test/java/com/datastax/driver/core/CloudConfigFactoryTest.java @@ -0,0 +1,249 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +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.client.WireMock.urlPathEqualTo; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; +import static org.apache.commons.codec.CharEncoding.UTF_8; +import static org.assertj.core.api.Assertions.assertThat; + +import com.fasterxml.jackson.core.JsonParseException; +import com.github.tomakehurst.wiremock.WireMockServer; +import com.github.tomakehurst.wiremock.common.JettySettings; +import com.github.tomakehurst.wiremock.core.Options; +import com.github.tomakehurst.wiremock.http.AdminRequestHandler; +import com.github.tomakehurst.wiremock.http.HttpServer; +import com.github.tomakehurst.wiremock.http.HttpServerFactory; +import com.github.tomakehurst.wiremock.http.StubRequestHandler; +import com.github.tomakehurst.wiremock.jetty9.JettyHttpServer; +import com.google.common.base.Joiner; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.URL; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.SSLSession; +import org.apache.commons.io.FileUtils; +import org.eclipse.jetty.io.NetworkTrafficListener; +import org.eclipse.jetty.server.ConnectionFactory; +import org.eclipse.jetty.server.ServerConnector; +import org.eclipse.jetty.server.SslConnectionFactory; +import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class CloudConfigFactoryTest { + + private static final String BUNDLE_PATH = "/cloud/creds.zip"; + + private WireMockServer wireMockServer; + + @BeforeMethod + public void startWireMock() { + wireMockServer = + new WireMockServer( + wireMockConfig() + .httpsPort(30443) + .dynamicPort() + .httpServerFactory(new HttpsServerFactory()) + .needClientAuth(true) + .keystorePath(path("/cloud/identity.jks")) + .keystorePassword("XS78x3GuBWas1OoA5") + .trustStorePath(path("/cloud/trustStore.jks")) + .trustStorePassword("48ZY5r06BmpVLKxPg")); + wireMockServer.start(); + } + + @AfterMethod + public void stopWireMock() { + wireMockServer.stop(); + } + + @Test + public void should_load_config_from_local_filesystem() throws Exception { + // given + URL configFile = getClass().getResource(BUNDLE_PATH); + mockProxyMetadataService(jsonMetadata()); + // when + CloudConfigFactory cloudConfigFactory = new CloudConfigFactory(); + CloudConfig cloudConfig = cloudConfigFactory.createCloudConfig(configFile.openStream()); + // then + assertCloudConfig(cloudConfig); + } + + @Test + public void should_load_config_from_external_location() throws Exception { + // given + mockHttpSecureBundle(secureBundle()); + mockProxyMetadataService(jsonMetadata()); + // when + URL configFile = new URL("http", "localhost", wireMockServer.port(), BUNDLE_PATH); + CloudConfigFactory cloudConfigFactory = new CloudConfigFactory(); + CloudConfig cloudConfig = cloudConfigFactory.createCloudConfig(configFile.openStream()); + // then + assertCloudConfig(cloudConfig); + } + + @Test + public void should_throw_when_bundle_not_found() throws Exception { + // given + wireMockServer.stubFor(any(urlEqualTo(BUNDLE_PATH)).willReturn(aResponse().withStatus(404))); + // when + URL configFile = new URL("http", "localhost", wireMockServer.port(), BUNDLE_PATH); + CloudConfigFactory cloudConfigFactory = new CloudConfigFactory(); + try { + cloudConfigFactory.createCloudConfig(configFile.openStream()); + } catch (FileNotFoundException ex) { + assertThat(ex).hasMessageContaining(configFile.toExternalForm()); + } + } + + @Test + public void should_throw_when_bundle_not_readable() throws Exception { + // given + mockHttpSecureBundle("not a zip file".getBytes(UTF_8)); + // when + URL configFile = new URL("http", "localhost", wireMockServer.port(), BUNDLE_PATH); + CloudConfigFactory cloudConfigFactory = new CloudConfigFactory(); + try { + cloudConfigFactory.createCloudConfig(configFile.openStream()); + } catch (IllegalStateException ex) { + assertThat(ex).hasMessageContaining("Invalid bundle: missing file config.json"); + } + } + + @Test + public void should_throw_when_metadata_not_found() throws Exception { + // given + mockHttpSecureBundle(secureBundle()); + wireMockServer.stubFor( + any(urlPathEqualTo("/metadata")).willReturn(aResponse().withStatus(404))); + // when + URL configFile = new URL("http", "localhost", wireMockServer.port(), BUNDLE_PATH); + CloudConfigFactory cloudConfigFactory = new CloudConfigFactory(); + try { + cloudConfigFactory.createCloudConfig(configFile.openStream()); + } catch (FileNotFoundException ex) { + assertThat(ex).hasMessageContaining("metadata"); + } + } + + @Test + public void should_throw_when_metadata_not_readable() throws Exception { + // given + mockHttpSecureBundle(secureBundle()); + mockProxyMetadataService("not a valid json payload"); + // when + URL configFile = new URL("http", "localhost", wireMockServer.port(), BUNDLE_PATH); + CloudConfigFactory cloudConfigFactory = new CloudConfigFactory(); + try { + cloudConfigFactory.createCloudConfig(configFile.openStream()); + } catch (JsonParseException ex) { + assertThat(ex).hasMessageContaining("Unrecognized token"); + } + } + + private void mockHttpSecureBundle(byte[] body) { + wireMockServer.stubFor( + any(urlEqualTo(BUNDLE_PATH)) + .willReturn( + aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/octet-stream") + .withBody(body))); + } + + private void mockProxyMetadataService(String jsonMetadata) { + wireMockServer.stubFor( + any(urlPathEqualTo("/metadata")) + .willReturn( + aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(jsonMetadata))); + } + + private byte[] secureBundle() throws IOException { + return FileUtils.readFileToByteArray(new File(path(BUNDLE_PATH))); + } + + private String jsonMetadata() throws IOException { + return Joiner.on('\n').join(FileUtils.readLines(new File(path("/cloud/metadata.json")))); + } + + private String path(String resource) { + return getClass().getResource(resource).getFile(); + } + + private void assertCloudConfig(CloudConfig config) { + InetSocketAddress expectedProxyAddress = InetSocketAddress.createUnresolved("localhost", 30002); + assertThat(config.getLocalDatacenter()).isEqualTo("dc1"); + assertThat(config.getProxyAddress()).isEqualTo(expectedProxyAddress); + assertThat(config.getEndPoints()).extracting("proxyAddress").containsOnly(expectedProxyAddress); + assertThat(config.getEndPoints()) + .extracting("serverName") + .containsExactly( + "4ac06655-f861-49f9-881e-3fee22e69b94", + "2af7c253-3394-4a0d-bfac-f1ad81b5154d", + "b17b6e2a-3f48-4d6a-81c1-20a0a1f3192a"); + assertThat(config.getSslOptions()).isNotNull().isInstanceOf(SSLOptions.class); + } + + static { + javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier( + new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession sslSession) { + return hostname.equals("localhost"); + } + }); + } + + // see https://github.com/tomakehurst/wiremock/issues/874 + private static class HttpsServerFactory implements HttpServerFactory { + @Override + public HttpServer buildHttpServer( + final Options options, + AdminRequestHandler adminRequestHandler, + StubRequestHandler stubRequestHandler) { + return new JettyHttpServer(options, adminRequestHandler, stubRequestHandler) { + @Override + protected ServerConnector createServerConnector( + String bindAddress, + JettySettings jettySettings, + int port, + NetworkTrafficListener listener, + ConnectionFactory... connectionFactories) { + if (port == options.httpsSettings().port()) { + SslConnectionFactory sslConnectionFactory = + (SslConnectionFactory) connectionFactories[0]; + SslContextFactory sslContextFactory = sslConnectionFactory.getSslContextFactory(); + sslContextFactory.setKeyStorePassword(options.httpsSettings().keyStorePassword()); + connectionFactories = + new ConnectionFactory[] {sslConnectionFactory, connectionFactories[1]}; + } + return super.createServerConnector( + bindAddress, jettySettings, port, listener, connectionFactories); + } + }; + } + } +} diff --git a/driver-core/src/test/java/com/datastax/driver/core/DbaasConfigUtilTest.java b/driver-core/src/test/java/com/datastax/driver/core/DbaasConfigUtilTest.java deleted file mode 100644 index 24a7c041cee..00000000000 --- a/driver-core/src/test/java/com/datastax/driver/core/DbaasConfigUtilTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright DataStax, Inc. - * - * Licensed 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; - -import static com.google.common.base.Charsets.UTF_8; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.fail; - -import com.google.common.io.Resources; -import java.io.File; -import org.testng.annotations.Test; - -public class DbaasConfigUtilTest { - - @Test(groups = "unit") - public void should_load_config_from_zip() { - should_fetch_dbaas_config(new File(getClass().getResource("/dbaas/creds.zip").getPath())); - } - - private void should_fetch_dbaas_config(File fileToLoad) { - try { - // Test yaml loading - DbaasConfiguration dbaasConfig = DbaasConfigUtil.getBaseConfig(fileToLoad); - assertThat(dbaasConfig.getHost()).isEqualTo("127.0.0.1"); - assertThat(dbaasConfig.getUsername()).isEqualTo("driversuser"); - assertThat(dbaasConfig.getPassword()).isEqualTo("driverspass"); - assertThat(dbaasConfig.getPort()).isEqualTo(30443); - assertThat(dbaasConfig.getLocalDC()).isEqualTo("selfservicedc"); - assertThat(dbaasConfig.getKeyStorePassword()).isEqualTo("keystorepass"); - assertThat(dbaasConfig.getTrustStorePassword()).isEqualTo("trustpass"); - String jsonMetadata = - Resources.toString(getClass().getResource("/dbaas/metadata.json"), UTF_8); - dbaasConfig = DbaasConfigUtil.getConfigFromMetadataJson(dbaasConfig, jsonMetadata); - assertThat(dbaasConfig.getLocalDC()).isEqualTo("dc1"); - // Test metadata parsing - assertThat(dbaasConfig.getHostIds().contains("4ac06655-f861-49f9-881e-3fee22e69b94")); - assertThat(dbaasConfig.getHostIds().contains("2af7c253-3394-4a0d-bfac-f1ad81b5154d")); - assertThat(dbaasConfig.getHostIds().contains("b17b6e2a-3f48-4d6a-81c1-20a0a1f3192a")); - assertThat(dbaasConfig.getHostIds().size()).isEqualTo(3); - assertThat(dbaasConfig.getSniHost()).isEqualTo("localhost"); - assertThat(dbaasConfig.getSniPort()).isEqualTo(30002); - } catch (Exception e) { - fail("Exception thrown during configuration generation that was not expected", e); - } - } -} 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 new file mode 100644 index 00000000000..8d9df92d81a --- /dev/null +++ b/driver-core/src/test/java/com/datastax/driver/core/cloud/CloudTest.java @@ -0,0 +1,174 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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.PlainTextAuthProvider; +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.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()) + .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)).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).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()).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")) + .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()) + .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()) + .build() + .connect(); + fail("Expected an IllegalStateException"); + } catch (IllegalStateException e) { + assertThat(e).hasMessageStartingWith("Cannot construct cloud config from the cloudConfigUrl"); + } + } +} diff --git a/driver-core/src/test/java/com/datastax/driver/core/cloud/DbaasTest.java b/driver-core/src/test/java/com/datastax/driver/core/cloud/DbaasTest.java deleted file mode 100644 index b4e58581a9d..00000000000 --- a/driver-core/src/test/java/com/datastax/driver/core/cloud/DbaasTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright DataStax, Inc. - * - * Licensed 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 java.lang.System.clearProperty; -import static java.lang.System.setProperty; -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.ResultSet; -import com.datastax.driver.core.Session; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -public class DbaasTest { - - SniProxyServer proxy = new SniProxyServer(); - - @BeforeClass(groups = "short") - public void startProxy() { - proxy.startProxy(); - } - - @AfterClass(groups = "short", alwaysRun = true) - public void stopProxy() throws Exception { - proxy.stopProxy(); - } - - @Test(groups = "short") - public void should_connect_to_proxy() { - Session session = - Cluster.builder() - .withCloudSecureConnectBundle(proxy.getSecureBundlePath()) - .build() - .connect(); - ResultSet set = session.execute("select * from system.local"); - assertThat(set).isNotNull(); - } - - @Test(groups = "short") - public void should_connect_to_proxy_typesafe_creds() { - try { - setProperty("advanced.auth-provider.username", "cassandra"); - setProperty("advanced.auth-provider.password", "cassandra"); - Session session = - Cluster.builder() - .withCloudSecureConnectBundle(proxy.getSecureBundlePath()) - .build() - .connect(); - ResultSet set = session.execute("select * from system.local"); - assertThat(set).isNotNull(); - } finally { - clearProperty("advanced.auth-provider.username"); - clearProperty("advanced.auth-provider.password"); - } - } - // TODO Add this test when sni_endpoint is fixed - public void should_not_connect_to_proxy_bad_creds() { - try { - Session session = - Cluster.builder() - .withCloudSecureConnectBundle(proxy.getSecureBundleNoCredsPath()) - .build() - .connect(); - fail("Expected an IllegalStateException"); - } catch (IllegalStateException e) { - assertThat(e).hasMessageStartingWith("Unable to construct cloud configuration"); - } - } - - @Test(groups = "short") - public void should_not_connect_to_proxy() { - try { - Session session = - Cluster.builder() - .withCloudSecureConnectBundle(proxy.getSecureBundleUnreachable()) - .build() - .connect(); - fail("Expected an IllegalStateException"); - } catch (IllegalStateException e) { - assertThat(e).hasMessageStartingWith("Unable to construct cloud configuration"); - } - } -} 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 index 497b6d0013e..ca61c2b8f59 100644 --- 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 @@ -32,11 +32,13 @@ public class SniProxyServer { private static final Logger logger = LoggerFactory.getLogger(SniProxyServer.class); - private final String proxyPath; + private final File proxyPath; private boolean isRunning = false; + static final String CERTS_BUNDLE_SUFFIX = "/certs/bundles/creds-v1.zip"; + public SniProxyServer() { - proxyPath = System.getProperty("proxy.path", "./"); + proxyPath = new File(System.getProperty("proxy.path", "./")); } public void startProxy() { @@ -60,16 +62,20 @@ public boolean isRunning() { return isRunning; } - public String getSecureBundlePath() { - return proxyPath + "/certs/bundles/creds-v1.zip"; + public File getProxyRootPath() { + return proxyPath; + } + + public File getSecureBundleFile() { + return new File(proxyPath + CERTS_BUNDLE_SUFFIX); } - public String getSecureBundleNoCredsPath() { - return proxyPath + "/certs/bundles/creds-v1-wo-creds.zip"; + public File getSecureBundleNoCredsPath() { + return new File(proxyPath + "/certs/bundles/creds-v1-wo-creds.zip"); } - public String getSecureBundleUnreachable() { - return proxyPath + "/certs/bundles/creds-v1-unreachable.zip"; + public File getSecureBundleUnreachable() { + return new File(proxyPath + "/certs/bundles/creds-v1-unreachable.zip"); } private String execute(CommandLine cli) { @@ -88,7 +94,7 @@ protected void processLine(String line, int logLevel) { ExecuteStreamHandler streamHandler = new PumpStreamHandler(outStream, errStream); executor.setStreamHandler(streamHandler); executor.setWatchdog(watchDog); - executor.setWorkingDirectory(new File(proxyPath)); + executor.setWorkingDirectory(proxyPath); int retValue = executor.execute(cli); if (retValue != 0) { logger.error( diff --git a/driver-core/src/test/resources/cloud/creds.zip b/driver-core/src/test/resources/cloud/creds.zip new file mode 100644 index 0000000000000000000000000000000000000000..3b5d1cb1cbd9d1d805eb3aaf06ace9b224d45b87 GIT binary patch literal 9805 zcmaiabx>UWw(Q^*oFKuS;4Z-f3GNQT-Q8V-6EwJMu;A|QI@sXu4ukW^Iq%;0o%5ah zZcY8FX8zb+d+n)SyLp|D}4MJ^3*vigABbd^|T&p-c3Kr zKKTJguMiP&29mSA#;dJK^|K7X*6gvRiYuNYUmU0oA1X^_4V$Fdh+Y(62uP(Nank$1 z-yN!m35hff2o~i)CJ7QZ9z{@l*s{tFs3>H$o(h8e{rGV*mP^&0^Lm|-EQc&`z2yg# zFf^tiT`!u^r!8tG07l77*eI!7!0z>&&Ty3X!AyAhY<(T(s)vhPzYpo3UINt6h zmAPE*t#jYS!Hxh`b41t(Q7?E@4W8gD5e50TSE(((&nS7_Mr04qJC5y<*_%vQI@PJo zj~u&QqI{Rr=W!`t@qW0utY=^)4VvD>dk36eW@FgGuJ6~i&D8E!=lT&ZAf&nbLC3HFw3fM_ zHmH2jmO6#=Z*q>nmBN-7CyfGU&hIbdJ$+~T18x;L%RF_J_R^WIfBf7~9CN9% zdrEuM(HjhY)wOs9$p1G@N8V_zj;i~`tv@k~lVd41 zca6SlT90z&EannIWQHb|?XB_mEBYy095@;hr&JK7g?{{QYN*T#hpo3Ah8~)B^b2(Z zB31(}+A7HJ8QWkq`;u=*Y`9)!cfn`uRzSgOEr~!>XMpMWAu4P+Yh9)C)#B{6aqDGl z)weNi%2aOImIE|*HvWU4$23|1=>}eeowb~k3Yfs-XP{jKNTd|-W6G>QpYiSQ_d8gs<@P*itc8j=^Yar8Js zoxr8Ppn71ElQCNKTDz3Yy`yBcj*D$;;m%_=jQ)i12GIOf6loPr-%<9gg3F8IC@ z=ne0Zl!vG263eDKd@jw(dhrEBSgCACivhzWd^3~QHfv*gF)Nh*2|;bz z{Q4$&p8DLwZ_jZV?|VjPa_0=!z<0}&B;8qcrgY0$4N{(%Uh|($6gBzE5T75}q=7e* zc4~;k3{VSnff%L|oFm{xAWwHI^H1cZ0->s>yxPXwKtIF%Ygd0h!#g~iq)!V9D>c8C zIba_>1|1?g5c5QrO$QL>3OV9f6~?pB+%?11Br4b~gqcQq`b16dInorWxk;vQ#ryk_YBE9G>K!_*;R0D$kX007h*y%;&`aiX8jSUlG8h0R#vRl%1tPul=mmH zI?#+&xL)n~H;6$%sIH%{EZcX2y~NuEN0%h~xg@x8>x13Fo-3sEva$D8kw3Y&Rp85q z9YWjm3!OjKo|$FRc{_bPm#7!IHa&0FnaKMH_|$!cX|1lEuxC%-$X#Am+-xGdw0jjaP6Em_PFQT zHwlk>PUPk8O1Bw6w45&4Hf7Z)srcUdz3aW{Qt*e28aqijQ@lZPM8@Q0jL@uQaIr#a zNy{uWmpU3~FR|;=tl0e9od=}D@c;2F(m7WU|d$GauK8xF9lQWM}{_q+mUyvPK*QCU6 z*iZ$dq9aCeAyxJ@?%qO*cs^0U4D9t1t-8tLGqt#)=c6-zURSU`>qkML^g>jv+*jRc zdfN_1PX)ov!yy*Cy5QSYAx3K3h9XdL>-CB5L!$HWj^puj$^%ob5<@wj^J(!>Ty=)m zN7qEtD&=qF2y01UB~n!`yYOI(EUBMl?OQ(#vkb8_WLm)3EUZV;z+{({^bmbA9B8o0 z@{e*?kv;1K>ABdN0CTuaTP~R-Z#zOIqgScO3z6tzi>fpS?gM@eDF>m{QRYvanJ+6e zL%s|uyY~ahoFo2@a{WjLHm;YM(bb6!Ao<+Ks*tn4gm3nFDT&w@k7KG#ik(Ug)m@*s_dplbWun`| zA%Edx+jLOyoYrTL6@xCA(+LzE&RxnkVh#%LqMOu<&Jc)NLSrrBwMfZApm9s?V);(H zz0!9H0$KE*-HCJyAqA7Cd}ql{JT}{O4NcmXpF|;!d>BA2Av5Txv`j0{=oiXvbbH-k zQ~sgt#5#lBg(6axKysr@E!DZv@T|i=APykEJR%?HOfQKiTnRh~;4*YMTI|*OVvik`kW;dkEDM*bcCb$+m=v)UKiR((rI-tAWxflBE=ASe>da>Ha{( zN~SIVaq5ykQ(!!jk8Kr|$v=|0J16nGN~*%A%Z~a~Ag(_ABWcXq6BoB>l7Ekgz^ z!{dp|GDGTw^5d4#NN;!aVa>UIR#FaJ(jcReI7$snGLLGRATE>03_ey2%Icd^M<3AR zR;K6aUgqQ8o+pcF5HUP_KN@Rg>D$WZ^3}N@EtW2?RL-F7Q~UJfX9pKf>@a%vu!1eu7HnIdUJMg{Bq5# zMaxj}b$h=#RO#VJ{6?x$pR@1<(0WRb1F>w)4YGFu!$n_qHaERud4s1-1(tT9!7KJ> z26^8JXJWiAy!9l;xUTj9xpI$30XWapN+M_+UtxM#gH)eW1U87>^s0*}CD@Z_>W-}# zH4uE%3^G!{5b2IQ0^%yK{`P&ygBx3gO^|7kBKt;td4)-t0PbY$gK7&Utmi%s$dbsF ziK6I7)<~A*epO9W-ts;@-Qm_GgjB`ak5wq7k*_;#dGaoar}9>#j+j9D7#3k~h7%E9 zU$c*AoFKMKba};3Zx2Lvvz!u}t$JUcmq!BQT_)NbE6G?#_Hmg#VttITT8}X5n+DMR z_+lCn4gL7r9^Mj$0r4Ob!QrGO^Pr+iBO7W@;USGJ_h&<}7{b297+D}B`KqEBq zy;k(hZI^wvRCzerrugt=ru`LawXvL!nStTQYKIA@I`{K354~aLko(awpgz6l1GLQt z;KKd0IHSX{A&w|brmT;7V;vXB zHVGZ_no8KgYA`$Q89_h1C|t|f1zI*3GlYL<61G8_zmr_ht#$0EekCDP%QIoBOsM3* z4`FhOJ5mAKcB7GMzWyd6>-iic{?cn8C6f<7rmu)~cLK`wzeT_QO)j==DB@O3w zy$HNF=0S=r*sI88e|CKqlv2kg#5_RiLa;LmS2!KLy~LjpG=Ul5Q>J>XNr~zU&Yo z9zK}Qak6ThkxT-c4lLw^!?B}`D4VL`(K|=mf~~iVmL-Y(S^W}xeJy$c)lUIj2(6fj z=TnAjX&~aWpX|jIfj>O6V4M=#Ix3!S4=4C{%6qsaK*N?`MNMTpA1GDcb{hD{c8q&Y zczsiR9sG`_xs)Qk%PNqk;Zn&Kr+!N0^qFhR*}3K%ZrkcQ3QyhFPVY}P_D|!+5k#Y% z1X^-34`vfEro?~;_tbf0S&A)5ND+zU3HP{5h3iJ;;ybB?3Zi2TJL6pGrk8FNpdiTN zsD*zDdm0L0mwra}G=xHL3OjZm^amitZlC>z{ z+S{V*x20Zv2lU>w_@b3xp>nH}8G{Bp2Jb1LvOAg%v@r^1pjf;dGC5$#T8KlfOsgBu zz~@V`^=Oj{McZ%mB63$&!oK)rJ$RI)c@5#-lt_1dnrY%o>gfsTY_kR1ZM6=>V z;InIP9PJ0wN+LEt%}{%DhN}*HD>FO83&&U!@W9Y-6FC46riL}OfQrSGzh znRqY<)ccF5Xk5xj8d!+n!RkO^8hF28kll1{ah)jCbO!qF@!f$fqN7}G8caoXF>zh$ z@2LC4=vT;p6>K-->J-O0kd4huB+?nKI{CFUGCdw{vL$kAGTqz3z+q-%VP&yrrT20^KdW?a z9)fMPO4qa|vR-q?!)wyOdl!J*gv`B|ETXXxl=69l0ELLkR7?aNiWKd8#&=$BmP!hR zE*|PCnko57KVpjEzMhRZ^*G#baq9Ymrkzk2o4fkX<3mg`EI%;!IBMB{v$Jxsb8@iM zMq=!7K-$Y>e_K*t>MagB=J~1$yG!-e2R54 z=AEx){CtZAsJ-bliJ$95d+qnZT`&2o?HbMk7A86m|K(P%tMCogz-pTdkEiDKx;9sm z*bPSv)63Qr*J&EYk1-uzCi{!p!KDZ53~eN-xYsecViaSamxoKLXUx@iS3dL$thSdq zwS(bL7RC+IV6N^90$!gKhoBTKY8Z3xWT!Ee?t^g@m%a~uXO~4mNzY1Z$eSzbh9ob~ zeiIM7{Su{7Zr8-4pcdPsYfEoD#+tx0{FW^B=KHp*YKM^CXi6SK@F8(W`(dVfA~&6F?QLS+ywkn)Wqh&8`I zFtf3~h)KzhW@qa-57B5H%+I|99H2^hxdvr4@WoP3>=f82JQ*CO8_~5xH9XD_-5Wh? zWcwV306V} zPyDK>)W!-w;#UuRMtMa)lS2h1r#MX-*Dq;JEh$No#WrM#xp167{bkPk$2F;c=W>aA z3upG<4$_}FudR)VxhbQCqpi(9Ow%9sm81MElPOiDWsqeUmKv2&saBMil%;2s9hLeh zsXVP9PYZAuzKT#}reM8{kP-^uxgQGS(L)h;_CXh)TI z0A}K|a6hNtedh1SOTJLvMU}z)rL57n@inolEHu%AppEE_Ur~u5OrRh>n&6^fL7xiKAD~d zj3h-qn2qxqaaUp_|H?EA1%3XkN%#s5`mu%c049C6E*9zsBYI8DTs!)+z+VVLfDBKR zR5OIAg$56(W{CAEFm|rP+E;I~pWx<4+$Xn``LPJ!K7_{VEW4^N+Mc@DHBFGf1LM9D zj6BTe5m$9BqYXDg%}>Ty;c(PbT+HQ~sF|I5c)mNKbPRXJ*jBL z)ztM6RrFNQ4)>v1u~Wjk;vO9HoFe})ok`|C*L2C=BCh4a+BT0Uh?tg6A-h z9}x3!SlDTn6+OJ2AR1$kAtz!x`)*HCY{p*BuS4OyGM7iONEG zKHm>9*B6kdAe`t$I^_Um)jIV>R~lr2CH&U zx^fGmu^hov=0>%nvwP&EkO-I1Vl+lhw77kROnDdX0sPfa_j&_|QTLw+*C9a=v`5hucXn1`oG%ck3gN#3C6p^`-ih0LwUwh?CeXryP1zl-q$S@n^Es$}%RP#~RDYL3dPy1OIj{7K`+z zcH}-w!1~xdb28;~cM193B~tzIWuIWr1C-zq`k4XC!WncyTLZbq&6V{yju|Cp;Jl&6 z96d;RWdQ2~|E0E!(w+OG)J&GKd%Td&qK3kqs58>JbUJ1F_L{pSmD>yS(QE8ScCx~5Xg`H4BKG>ATVQ`U&i z864Ni0b45hmkf87@t4c&IDuHR##aAJ_enF;n=q;qDT(H1uesvC7`xj`z{8#=d8bk6)mMWw*L9 z(=0EJp>S8bPlPcn4R-CN9`5hxaBRx@E)0fdsHXl_$*ma-szd-UVU zK275xZ*uRaZ}f$PrLJ(#gNz)Pxx~s+C>SX6gS7w64no4klm6=XJzc4=z6K`F2nGnz z;X#`fvQCBt2AyQ?@5-;vmdTo9UM&T`R`21OjOZb+_JC5 z?3Ap!JQWTs(hJ|&gN9sE;50r3qzrW^`W=TbTe zH||ZYND`fBj?0C5hc~ih9Rm6lxr+L;9Zv9tZdclOcnY8eKWN6U&&Zo1puzLoWh1ni zig=W%_DA$};Hcm@T9Azfztwcu6O|KFa3t1Il4D=4RDS^SM|0`t$t3VXU)Ex|S1nHufVg+AS8Hddbs3ul_o3e#Tr7(@)c*>F}q7!l+ zpI5CeC$KF%2#cZrT%Jj#b1z%?jh?m} zk-7e&cW_IaXYoant8ZB^QW(Fnd7ulmhn@C{q_8euEbln%v#nJH^HW|3^-hH$*D+Cx z#NvR_r{db?-bSI5zO*5moVGxJ`wd<*wJ^qK?DZVt--Cs}vRAUdlFSL5Eju9`UU z5MyjH*p#MP*Wx4=zOrF*4wJBuFB^{E^Vd3-;?dgBtC437L^^(58Y5&@i}3LJI+|%B z%Jy^Yb4rD^M&n+e;bfL8sK&c$L$flF0|H@SiUZ<%SQIXw&9}_OBTse1rv0TGIP8?1 z(REtfE0YpX+!8<67bV<~JUU^n)V$V-DRXQqT=u)mDSy8Pk@;q{4ec#cXP{c{0YleO z#Dg+^ciya|64Tj|MXXVQ8(iUy4s#_HU7qDx8-@RS&fQ6Q( z3EqP6kThAH4CY=@v7FYg~?O65jHlYQE18CQOi5AOy;;*4Vg1|3@;waXj zG03wo3#4_3?}cnf5sV7J2D3MKmh$c@SNAC^ndzRdQY5rKDCw{f!&S=OtH(QYI>L%j zRg|#sPrm1mnTrTFH#uLqRR~NVAs_2%hfV9SEF#s2wd*{WExA70S9+;zqn}?AC0wfw zA@m8;5{P3jcwoFhHEA>ae*F0~X}&fuf7dbkYp>SRMLGM!=O?&wt8P4sI$WXdavYGP zL&gzsfWm4IZeY3yBga*z-l&rbzIrXV-;1__vUn@cdAU3h90`NT&6@@MY|wX)e;v*8 z`oTCf#?4Pybs+RgzNO~tGWzzqbr@SjXK*}A1dRwkkAc1#3GM!+(GOMzUVF?QCKJ5e zU%srU+eKm8m2E!~NY1ai)$+y_y&+PF^95>9TWD#4sGiydOj(^@V|rN4B1>txQfHQJ z7wzDG-jKL#RGStr$6bGx<4O+cC$h57Q;s;NHQXky9VnS5qE z{u1~+&pO|zm?M4a)b~}p)=V&h-BNk`S6uhaNa-Qon)1p?Ha!6oQt2vCMVR2(mJU(! zkO)$$HJVP`wI!=#CthCdCxkWhe!6KRi4%G_ys%GbAv`<{)CQE4*Gxqv1e50q+^skh zbS0G-LcJen7i6)TAi=J=vwjEY;w|`ufFy$YpO%7f-?S(I@V5Q~$oK#A?Y~xpVE(xx z^l$4yf5rOy=E7gGir$RoKld2kkpAp3{4YrV8p!??=>r_#pYiM)(4Tnr{{!^*XyTth ze+tX@*LVl`x1iz;@jrwVe=YJ4;=g+5zak=H1ODcu-!T7!i~e`af3*UCEjI@5?ZN%k v82s;me;46@y-AY~|NJNZDaqf^{z&q_Jw%wdARGXId;3s80sxp4e}4TRshKzN literal 0 HcmV?d00001 diff --git a/driver-core/src/test/resources/cloud/identity.jks b/driver-core/src/test/resources/cloud/identity.jks new file mode 100644 index 0000000000000000000000000000000000000000..8aac969133a5c9da7aa5b6b1f9ed25bb6df3650f GIT binary patch literal 2413 zcmY+FX*3iH8^>o~nz5CwG4^Y@*0B@HR`y+E#=hJLWi4xCnUETc5JIwL$&#!I5nWj$ z++mE}*T!h@WM5a6}F3fItX9 zEE$}ZD5+B%p17ZLD5{;J4H@!MsLQpD^!JfaH9a7s*G@<)rLO19(YE2D+vO@Vr=8_{ z&ySN<-x^JrNIueA%`p?Pr-Ens+YUlvDwmGtQ6{b8Vnx>bI8i9#hHsTQ6(*8h(d6A% zKw(`>-qZ+~thE#;Q?)Z6SF3I?D2144t9ONe#jpRB8f5|Ho$xD@4Si1ptZ8`Z_*&RM zLQB9sJr=xqc(F06{ALa^&yp)`CL&UM>ZkQADlbojs!tZy1jJUhM1oa@;k}0AAjX!U z)5dr;#^K5xuG3p3puBza7de?(5}YoRS-JVJIt{_xl{F$#Iiy>1KXS&JLTbMeA<3B$ z6k;`?M@n%t?eCIWxaSs0JcIerf4`=)MH(YEAjr60iNoX!`ldd5(CDc*ylHbuh~q?d ze!OV-J+MRmKqqX6CB}Zi$0**aN*w2c%15?S*Gu4p}Wduag(3v{e;4{i#w_2&i-wCU98Whl$tnTOjaYbmbd zVbS{|BWv4Baq#+X z1BXXEeX#y2TjceI(9PvZ#*^6ZS}YBYN>j}Wznz>!f*-9(sUhmO75kyUFMy*JYI8&Cgw=?jHbMPWomK#s>r5XDP;$3pG13*pikB>L>g6=;1x z-2S4C>y`Znse~#OTUmu%joA=lzJpA+vTg&84AuA_feXn{DF_)V{u7J*903^WKRTZR zf(pry6&x9|^naFve_4*LoA&$YwX5~ZatImHbyr@J{=4p|Hg ze)6sl)exm5j}K9`(}*Y|pOP4R&1FeTeKjgrMR$v|(Y?X0(x9)7&5}MS8+H9L#kXq= zy=*Vazt`-P6xxahOGtm^jU>S_&u?O1(&>u&v4uw*P9~H?8H&lpegd=LShhy?!)woy zrfNyzX@b~Oq7yD4!zXZ)#64b)7&-R7x&85eQJwM{2(|Z_PfOABEAzKkf9@%69ma@T zmtVV=)TBi4>9g4J#z0y36{xpCNE_?W>e$WI_8d8*kDZ?D(++L7Ny}7>Zm-LIyVuf& z*tI%W=&4l_;nQ&w{yT>?wm%JbY&kjMr8yUvc>w6;YFyJh5sxYI52kQF=Ss-M&|{Ke zqAxMpI`C(K}TgO)~MnXgV#hsObXme z7BMi&)Uefc_DADpwiMI_9FJ=?tCa6Km?>b(7|~bNwgt4X<}eVSH_u&!dj2O2S^X40zm9i9Db#H**Bv z-BZu3uMmg1Jsrg0heEX;_erQ|ZjHvQcV`)~ zFZw(NudeqzlJ=WY_`tqXI~;^!7Z~4JBz)QmXWE$P7+&qpi#pRJC>>0DlP|1Na;M6P z4WTqz7OTMQDC^Jj`94u<3en=V{^-F3}%M{gKYFBQwf|onZR2xPIe9Oj?qZ+wDTNZ6@ z7vcJDjHvj8vAgy`Mo|U6R{@oYPjrdJYJ5E#?N{h0v>Y|{Ubc&qOVNLSGdz`zTJv0nnO`WO_x%i6 zYT3tmKM#k{x2S%d2@|3w$PW*Yf^i}?9P@pl&Xx7#j{@C0(J9Y{n0Jnw%=%`NxHiXc zV}7{p&Gmr^YhSNpob=xD^Ar?+fVD0L;yaZVQ8I?t*;xZVHzl_)E)YBy16J8g^9Vd# z3R(@?qN;{GLByEyp}~!tXtofSu6pm>^oSUz&xh7KnDM=>ThObP#78`F^~( zP{;e(V>Aj@Y8gNbR_M98b>10t-5W|W7 zw-u3G3fvIR>01vegrc0Uf84ICONKWB<%#upoB~c5hlD|;S-~I-6aeAWpD-(EE>eSb driD1-Km9$tu_xRKK`1TiMy$kb<9@Z{zW{*EV7veT literal 0 HcmV?d00001 diff --git a/driver-core/src/test/resources/dbaas/metadata.json b/driver-core/src/test/resources/cloud/metadata.json similarity index 100% rename from driver-core/src/test/resources/dbaas/metadata.json rename to driver-core/src/test/resources/cloud/metadata.json diff --git a/driver-core/src/test/resources/cloud/trustStore.jks b/driver-core/src/test/resources/cloud/trustStore.jks new file mode 100644 index 0000000000000000000000000000000000000000..8c389a5dd00557119a0dbf55f383c04057875832 GIT binary patch literal 956 zcmezO_TO6u1_mY|W(3o0MX9;@C8*41x{04LI4DLs{5_nL^Yb53GWqM@JxKS-2|hr=bYBr&)ovBHqgfCnVR&BN-PlV6%*AScdi zXlY<+WNv6|YGP;^CC+OE;+jCYw6U~_Q3=^|jI0dIO^o~u22G4yOihf842K?hSg%`} zw}<(RS%&xQNN(Mj4|gtmosjsp!I^)B%aP7)ocAUvoOl{*y=sXfLr8+ci7UnS-NKv_ zTjnPgXh&bq`#LR7GyJVhUhk@H`{ue^_T2b)eZ!{X6Oa7AeP3WxOhn}L$d41>1=X7z zd-vMq>}k=1cimVX)z>_}_>V{5xNk~8HhcZO#KqGhYwNdlb}cMP{x?6NI+XeO>&u(; zPk1xT`>|llyvc{sA}jK%mEAJk-w4NZ?D%EM5oT_k6r}ZG(lu8Jr#m~?6>Ai~%byZj z_D@|kh<9U+f%x|WKI@wsC#^Q((SI;+@4l_muk~fP%nrV9?0#bD=J(Fa$}QJFeH0qN zv(u@I1X?Rz=hsX1Qm7_;+e> zWQ4pAe6Z!Ee3;Z3`L7|h46nk2X5Q(s z@l$obwD?J}SL-IMZRGk{b@sK3LUFwZYp~zpKjQuAVH-1(4!X=%dn;OdN=YR0_VdWD GrhNbrbz1xY literal 0 HcmV?d00001 diff --git a/driver-core/src/test/resources/dbaas/creds.zip b/driver-core/src/test/resources/dbaas/creds.zip deleted file mode 100644 index 9a11b1126efd49c5e932730f03da247512fbf3a2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 389 zcmWIWW@Zs#-~hr?#qa$XpkO^C0|PgM0z-0sURq|lURH5_UT6p}1G~=^omdzyt>9*0 zWO>2NzyKz4CmiHDWWdw*zPjt;<}<$RP2sjx0yRyS+}4~6os^^WX!q@$<}!`FwekP# zP2TIA4|Q)?yRZ4yvr~&+GkQ*l>Zr+BwA_8RhvVWs6-k0uvx28Q3=KZE_(5sp_1BDd z9*731-8~?%s5xiP#j|zleG4qx&+au&IGfRXkMWb@nGK)U@`!pb=57wQ3OS$35d6uU z-SgEExx{yKTc^qH?|R+)toZm7u1}JQA9;FYKhEEGA~`uF^SMLv!i9DBQcSa_*6s`N zX6I0P5yY|==zoyk1H2iTM3@obf-DCL7Z_O52x5^CN&()iY#=R+Ko|+6#ekMEFaQ7y Cmx~kt diff --git a/pom.xml b/pom.xml index ec92e7c450c..4cd74029778 100644 --- a/pom.xml +++ b/pom.xml @@ -78,6 +78,7 @@ 6.8.8 1.7.0 1.10.8 + 2.25.0 1.3 1.1.2 1.2.3 @@ -323,6 +324,12 @@ ${mockito.version} + + com.github.tomakehurst + wiremock + ${wiremock.version} + + org.scassandra java-client From 6adfbf5008916f13244a93c064aa9fbc36f92a9c Mon Sep 17 00:00:00 2001 From: Greg Bestland Date: Wed, 16 Oct 2019 12:42:41 -0500 Subject: [PATCH 054/211] JAVA-2457: Detect CaaS and change default consistency level (3.x) (#13) * JAVA-2457: Detect CaaS and change default consistency level. --- changelog/README.md | 1 + .../com/datastax/driver/core/Cluster.java | 4 +- .../com/datastax/driver/core/Connection.java | 37 +++++++++++++++++++ .../driver/core/ControlConnection.java | 10 ++++- .../datastax/driver/core/QueryOptions.java | 6 +++ 5 files changed, 56 insertions(+), 2 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 2820c8d08c8..66432878502 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -6,6 +6,7 @@ - [new feature] JAVA-2355: CaaS Enablement - [improvement] JAVA-2483: Allow to provide secureBundle via URL - [improvement] JAVA-2499: Allow to read the secure bundle from an InputStream +- [improvement] JAVA-2457: Detect CaaS and change default consistency ### 3.7.2 diff --git a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java index 8f6ec8579b0..a8ef85cadc7 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java @@ -1706,7 +1706,9 @@ long delayMs() { } // Initialize the control connection: negotiateProtocolVersionAndConnect(); - + if (controlConnection.isCloud() && !configuration.getQueryOptions().isConsistencySet()) { + configuration.getQueryOptions().setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM); + } // The control connection: // - marked contact points down if they couldn't be reached // - triggered an initial full refresh of metadata.allHosts. If any contact points weren't diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java index 4049c349349..583147783ab 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java @@ -268,6 +268,12 @@ private static String extractMessage(Throwable t) { return " (" + msg + ')'; } + public ListenableFuture optionsQuery() { + Future startupOptionsFuture = write(new Requests.Options()); + + return GuavaCompatibility.INSTANCE.transformAsync(startupOptionsFuture, onSupportedResponse()); + } + private AsyncFunction onChannelReady( final ProtocolVersion protocolVersion, final Executor initExecutor) { return new AsyncFunction() { @@ -284,6 +290,28 @@ public ListenableFuture apply(Void input) throws Exception { }; } + private AsyncFunction onSupportedResponse() { + return new AsyncFunction() { + @Override + public ListenableFuture apply(Message.Response response) throws Exception { + switch (response.type) { + case SUPPORTED: + return getProductType((Responses.Supported) response); + case ERROR: + Responses.Error error = (Responses.Error) response; + throw new TransportException( + endPoint, String.format("Error initializing connection: %s", error.message)); + default: + throw new TransportException( + endPoint, + String.format( + "Unexpected %s response message from server to a STARTUP message", + response.type)); + } + } + }; + } + private AsyncFunction onStartupResponse( final ProtocolVersion protocolVersion, final Executor initExecutor) { return new AsyncFunction() { @@ -382,6 +410,15 @@ public ListenableFuture apply(ResultSet rs) throws Exception { } } + private ListenableFuture getProductType(Responses.Supported response) { + if (response.supported.containsKey("PRODUCT_TYPE") + && response.supported.get("PRODUCT_TYPE").size() > 0) { + return Futures.immediateFuture(response.supported.get("PRODUCT_TYPE").get(0)); + } else { + return Futures.immediateFuture(""); + } + } + private void markInitialized() { isInitialized = true; Host.statesLogger.debug("[{}] {} Transport initialized, connection ready", endPoint, this); diff --git a/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java b/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java index b16bbfaf92a..6ba401c5687 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java @@ -90,6 +90,7 @@ class ControlConnection implements Connection.Owner { // set to true initially, if ever fails will be set to false and peers table will be used // from here on out. private volatile boolean isPeersV2 = true; + private volatile boolean isCloud = false; public ControlConnection(Cluster.Manager manager) { this.cluster = manager; @@ -291,7 +292,10 @@ private Connection tryConnect(Host host, boolean isInitialConnection) throws ConnectionException, ExecutionException, InterruptedException, UnsupportedProtocolVersionException, ClusterNameMismatchException { Connection connection = cluster.connectionFactory.open(host); - + String productType = connection.optionsQuery().get(); + if (productType.equals("DATASTAX_APOLLO")) { + isCloud = true; + } // If no protocol version was specified, set the default as soon as a connection succeeds (it's // needed to parse UDTs in refreshSchema) if (cluster.connectionFactory.protocolVersion == null) @@ -1055,6 +1059,10 @@ boolean isOpen() { return c != null && !c.isClosed(); } + boolean isCloud() { + return isCloud; + } + public void onUp(Host host) {} public void onAdd(Host host) {} diff --git a/driver-core/src/main/java/com/datastax/driver/core/QueryOptions.java b/driver-core/src/main/java/com/datastax/driver/core/QueryOptions.java index c1fb785ab04..556ee0a8a01 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/QueryOptions.java +++ b/driver-core/src/main/java/com/datastax/driver/core/QueryOptions.java @@ -53,6 +53,7 @@ public class QueryOptions { private volatile int fetchSize = DEFAULT_FETCH_SIZE; private volatile boolean defaultIdempotence = DEFAULT_IDEMPOTENCE; + private volatile boolean consistencySet = false; private volatile boolean metadataEnabled = true; private volatile int maxPendingRefreshNodeListRequests = @@ -89,6 +90,7 @@ void register(Cluster.Manager manager) { * @return this {@code QueryOptions} instance. */ public QueryOptions setConsistencyLevel(ConsistencyLevel consistencyLevel) { + this.consistencySet = true; this.consistency = consistencyLevel; return this; } @@ -515,4 +517,8 @@ public int hashCode() { reprepareOnUp, prepareOnAllHosts); } + + public boolean isConsistencySet() { + return consistencySet; + } } From a6bf5a11c74d9ad917fe3873d5e9e12026498e7a Mon Sep 17 00:00:00 2001 From: Greg Bestland Date: Fri, 18 Oct 2019 15:26:43 -0500 Subject: [PATCH 055/211] JAVA-2485 Add errors for cloud misconfiguration (#18) * JAVA-2485 Add errors for cloud misconfiguration --- changelog/README.md | 1 + .../com/datastax/driver/core/Cluster.java | 21 +++++++ .../datastax/driver/core/cloud/CloudTest.java | 62 +++++++++++++++++++ 3 files changed, 84 insertions(+) diff --git a/changelog/README.md b/changelog/README.md index 66432878502..c7ca3decd2a 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -7,6 +7,7 @@ - [improvement] JAVA-2483: Allow to provide secureBundle via URL - [improvement] JAVA-2499: Allow to read the secure bundle from an InputStream - [improvement] JAVA-2457: Detect CaaS and change default consistency +- [improvement] JAVA-2485: Add errors for cloud misconfiguration ### 3.7.2 diff --git a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java index a8ef85cadc7..4161dbb8514 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java @@ -740,6 +740,7 @@ public static class Builder implements Initializer { private boolean jmxEnabled = true; private boolean allowBetaProtocolVersion = false; private boolean noCompact = false; + private boolean isCloud = false; private Collection listeners; @@ -934,6 +935,7 @@ public Builder addContactPoint(String address) { // We explicitly check for nulls because InetAdress.getByName() will happily // accept it and use localhost (while a null here almost likely mean a user error, // not "connect to localhost") + failIfCloud(); if (address == null) throw new NullPointerException(); try { @@ -953,6 +955,7 @@ public Builder addContactPoint(String address) { * host-and-port-based variants such as {@link #addContactPoint(String)}. */ public Builder addContactPoint(EndPoint contactPoint) { + failIfCloud(); contactPoints.add(contactPoint); return this; } @@ -993,6 +996,7 @@ public Builder addContactPoints(String... addresses) { * @see Builder#addContactPoint */ public Builder addContactPoints(InetAddress... addresses) { + failIfCloud(); Collections.addAll(this.rawHostContactPoints, addresses); return this; } @@ -1007,6 +1011,7 @@ public Builder addContactPoints(InetAddress... addresses) { * @see Builder#addContactPoint */ public Builder addContactPoints(Collection addresses) { + failIfCloud(); this.rawHostContactPoints.addAll(addresses); return this; } @@ -1030,6 +1035,7 @@ public Builder addContactPoints(Collection addresses) { * @see Builder#addContactPoint */ public Builder addContactPointsWithPorts(InetSocketAddress... addresses) { + failIfCloud(); Collections.addAll(this.rowHostAndPortContactPoints, addresses); return this; } @@ -1053,6 +1059,7 @@ public Builder addContactPointsWithPorts(InetSocketAddress... addresses) { * @see Builder#addContactPoint */ public Builder addContactPointsWithPorts(Collection addresses) { + failIfCloud(); this.rowHostAndPortContactPoints.addAll(addresses); return this; } @@ -1467,12 +1474,26 @@ private Builder addCloudConfigToBuilder(CloudConfig cloudConfig) { if (cloudConfig.getAuthProvider() != null) { builder = builder.withAuthProvider(cloudConfig.getAuthProvider()); } + if (builder.rawHostContactPoints.size() > 0 + || builder.rowHostAndPortContactPoints.size() > 0 + || builder.contactPoints.size() > 0) { + throw new IllegalStateException( + "Can't use withCloudSecureConnectBundle if you've already called addContactPoint(s)"); + } for (EndPoint endPoint : cloudConfig.getEndPoints()) { builder.addContactPoint(endPoint); } + isCloud = true; return builder; } + private void failIfCloud() { + if (isCloud) { + throw new IllegalStateException( + "Can't use addContactPoint(s) if you've already called withCloudSecureConnectBundle"); + } + } + /** * The configuration that will be used for the new cluster. * 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 index 8d9df92d81a..edf41534221 100644 --- 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 @@ -24,6 +24,7 @@ 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.ResultSet; import com.datastax.driver.core.Session; @@ -31,6 +32,7 @@ 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; @@ -171,4 +173,64 @@ public void should_not_connect_to_proxy() { 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") + .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") + .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") + .build() + .connect(); + fail("Expected an IllegalStateException"); + } catch (IllegalStateException e) { + assertThat(e) + .hasMessageStartingWith( + "Can't use addContactPoint(s) if you've already called withCloudSecureConnectBundle"); + } + } } From d95388b72ec04451626d22a6bb8b8de89eb5b1f7 Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Mon, 21 Oct 2019 08:00:29 -0500 Subject: [PATCH 056/211] JAVA-2504: Migrate Cloud "getting started" page to driver manual (#19) --- changelog/README.md | 15 +-- .../apollo/ApolloReadCassandraVersion.java | 90 ++++++++++++++++++ manual/cloud/README.md | 92 +++++++++++++++++++ 3 files changed, 190 insertions(+), 7 deletions(-) create mode 100644 driver-examples/src/main/java/com/datastax/driver/examples/apollo/ApolloReadCassandraVersion.java create mode 100644 manual/cloud/README.md diff --git a/changelog/README.md b/changelog/README.md index c7ca3decd2a..d7c30f30781 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -1,13 +1,14 @@ ## Changelog -## DataStax Cloud (in progress) - -- [new feature] JAVA-2355: CaaS Enablement -- [improvement] JAVA-2483: Allow to provide secureBundle via URL -- [improvement] JAVA-2499: Allow to read the secure bundle from an InputStream -- [improvement] JAVA-2457: Detect CaaS and change default consistency -- [improvement] JAVA-2485: Add errors for cloud misconfiguration +## 3.8.0 (in progress) + +- [new feature] JAVA-2356: Support for DataStax Cloud API. +- [improvement] JAVA-2483: Allow to provide secure bundle via URL. +- [improvement] JAVA-2499: Allow to read the secure bundle from an InputStream. +- [improvement] JAVA-2457: Detect CaaS and change default consistency. +- [improvement] JAVA-2485: Add errors for Cloud misconfiguration. +- [documentation] JAVA-2504: Migrate Cloud "getting started" page to driver manual. ### 3.7.2 diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/apollo/ApolloReadCassandraVersion.java b/driver-examples/src/main/java/com/datastax/driver/examples/apollo/ApolloReadCassandraVersion.java new file mode 100644 index 00000000000..18ee0ae907d --- /dev/null +++ b/driver-examples/src/main/java/com/datastax/driver/examples/apollo/ApolloReadCassandraVersion.java @@ -0,0 +1,90 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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.examples.apollo; + +import com.datastax.driver.core.Cluster; +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.Row; +import com.datastax.driver.core.Session; +import java.io.File; + +/** + * Connects to a DataStax Apollo cluster and extracts basic information from it. + * + *

    Preconditions: + * + *

      + *
    • A DataStax Apollo cluster is running and accessible. + *
    • A DataStax Apollo secure connect bundle for the running cluster. + *
    + * + *

    Side effects: none. + * + * @see + * Creating an Apollo Database + * @see + * Providing access to Apollo databases + * @see + * Obtaining Apollo secure connect bundle + * @see Java driver online manual + */ +public class ApolloReadCassandraVersion { + + public static void main(String[] args) { + + Cluster cluster = null; + try { + // The Cluster object is the main entry point of the driver. + // It holds the known state of the actual Cassandra cluster (notably the Metadata). + // This class is thread-safe, you should create a single instance (per target Cassandra + // cluster), and share it throughout your application. + // Change the path here to the secure connect bundle location (see javadocs above) + cluster = + Cluster.builder() + // Change the path here to the secure connect bundle location (see javadocs above) + .withCloudSecureConnectBundle(new File("/path/to/secure-connect-database_name.zip")) + // Change the user_name and password here for the Apollo instance + .withCredentials("user_name", "password") + // Uncomment the next line to use a specific keyspace + // .withKeyspace("keyspace_name") + .build(); + + // The Session is what you use to execute queries. Likewise, it is thread-safe and should be + // reused. + Session session = cluster.connect(); + + // We use execute to send a query to Cassandra. This returns a ResultSet, which is essentially + // a collection of Row objects. + ResultSet rs = session.execute("select release_version from system.local"); + // Extract the first row (which is the only one in this case). + Row row = rs.one(); + + // Extract the value of the first (and only) column from the row. + String releaseVersion = row.getString("release_version"); + System.out.printf("Cassandra version is: %s%n", releaseVersion); + + } finally { + // Close the cluster after we’re done with it. This will also close any session that was + // created from this cluster. + // This step is important because it frees underlying resources (TCP connections, thread + // pools...). In a real application, you would typically do this at shutdown (for example, + // when undeploying your webapp). + if (cluster != null) cluster.close(); + } + } +} diff --git a/manual/cloud/README.md b/manual/cloud/README.md new file mode 100644 index 00000000000..be7d15920e6 --- /dev/null +++ b/manual/cloud/README.md @@ -0,0 +1,92 @@ + +## Connecting to Apollo (Cloud) + +Using the DataStax Java Driver to connect to a DataStax Apollo database is almost identical to using +the driver to connect to any normal Apache Cassandra® database. The only differences are in how the +driver is configured in an application and that you will need to obtain a `secure connect bundle`. + +The following is a Quick Start guide to writing a simple application that can connect to an Apollo +database. + +### Prerequisites + +1. [Download][Download Maven] and [install][Install Maven] Maven. +1. Create an Apollo database on [GCP][Create an Apollo database - GCP] or + [AWS][Create an Apollo database - AWS]; alternatively, have a team member provide access to their + Apollo database (instructions for [GCP][Access an Apollo database - GCP] and + [AWS][Access an Apollo database - AWS]) to obtain database connection details. +1. Download the secure connect bundle (instructions for + [GCP][Download the secure connect bundle - GCP] and + [AWS][Download the secure connect bundle - AWS]) to obtain connection credentials for your + database. + +### Procedure + +1. Include the driver artifacts in your `pom.xml` file according to this [pom.xml dependency]. + +1. Initialize the DataStax Java Driver. + + a. Create a `ConnectDatabase.java` file in the `/src/main/java` directory for your Java project. + + ```sh + $ cd javaProject/src/main/java + ``` + ```sh + $ touch ConnectDatabase.java + ``` + + b. Copy the following code for your DataStax Driver into the `ConnectDatabase.java` file. + The following example implements a `ConnectDatabase` class to connect to your Apollo database, + runs a CQL query, and prints the output to the console. + + **Note:** With the `Cluster.builder()` object, make sure to set the path to the secure + connect bundle for your Apollo database (**"/path/to/secure-connect-database_name.zip"**) in + the `withCloudSecureConnectBundle()` method as shown in the following example. + * DataStax Java Driver for Apache Cassandra 3.x + + ```java + import com.datastax.driver.core.Cluster; + import com.datastax.driver.core.ResultSet; + import com.datastax.driver.core.Row; + import com.datastax.driver.core.Session; + import java.io.File; + + public class ConnectDatabase { + + public static void main(String[] args) { + // Create the Cluster object: + Cluster cluster = null; + try { + cluster = Cluster.builder() + // make sure you change the path to the secure connect bundle below + .withCloudSecureConnectBundle(new File("/path/to/secure-connect-database_name.zip")) + .withCredentials("user_name", "password") + .build(); + Session session = cluster.connect(); + // Select the release_version from the system.local table: + ResultSet rs = session.execute("select release_version from system.local"); + Row row = rs.one(); + //Print the results of the CQL query to the console: + if (row != null) { + System.out.println(row.getString("release_version")); + } else { + System.out.println("An error occurred."); + } + } finally { + if (cluster != null) cluster.close(); + } + } + } + ``` + + c. Save and close the ConnectDatabase.java file. + +[Download Maven]: https://maven.apache.org/download.cgi +[Install Maven]: https://maven.apache.org/install.html +[Create an Apollo database - GCP]: https://helpdocs.datastax.com/gcp/dscloud/apollo/dscloudGettingStarted.html#dscloudCreateCluster +[Create an Apollo database - AWS]: https://helpdocs.datastax.com/aws/dscloud/apollo/dscloudGettingStarted.html#dscloudCreateCluster +[Access an Apollo database - GCP]: https://helpdocs.datastax.com/gcp/dscloud/apollo/dscloudShareClusterDetails.html +[Access an Apollo database - AWS]: https://helpdocs.datastax.com/aws/dscloud/apollo/dscloudShareClusterDetails.html +[Download the secure connect bundle - GCP]: https://helpdocs.datastax.com/gcp/dscloud/apollo/dscloudObtainingCredentials.html +[Download the secure connect bundle - AWS]: https://helpdocs.datastax.com/aws/dscloud/apollo/dscloudObtainingCredentials.html +[pom.xml dependency]: ../../#getting-the-driver From cc60a8911f575b77d11cc6da7776545ddc7002d9 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 21 Oct 2019 20:14:53 +0300 Subject: [PATCH 057/211] Fix incorrect SCM tag --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4cd74029778..6a232407546 100644 --- a/pom.xml +++ b/pom.xml @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.7.2-cloud-01 + HEAD From 1f38111213773c22acd7fbaee84abeef40d0292a Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 21 Oct 2019 20:17:43 +0300 Subject: [PATCH 058/211] Fix typo in variable name and remove unused field --- .../main/java/com/datastax/driver/core/Cluster.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java index 4161dbb8514..8d8b22fe984 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java @@ -67,7 +67,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.Iterator; -import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; @@ -719,11 +718,9 @@ public interface Initializer { public static class Builder implements Initializer { private String clusterName; - private final List rowHostAndPortContactPoints = + private final List rawHostAndPortContactPoints = new ArrayList(); private final List rawHostContactPoints = new ArrayList(); - private final Map> resolvedContactPoints = - new LinkedHashMap>(); private final List contactPoints = new ArrayList(); private int port = ProtocolOptions.DEFAULT_PORT; private int maxSchemaAgreementWaitSeconds = @@ -758,7 +755,7 @@ public List getContactPoints() { for (InetAddress address : rawHostContactPoints) { allContactPoints.add(new TranslatedAddressEndPoint(new InetSocketAddress(address, port))); } - for (InetSocketAddress socketAddress : rowHostAndPortContactPoints) { + for (InetSocketAddress socketAddress : rawHostAndPortContactPoints) { allContactPoints.add(new TranslatedAddressEndPoint(socketAddress)); } return new ArrayList(allContactPoints); @@ -1036,7 +1033,7 @@ public Builder addContactPoints(Collection addresses) { */ public Builder addContactPointsWithPorts(InetSocketAddress... addresses) { failIfCloud(); - Collections.addAll(this.rowHostAndPortContactPoints, addresses); + Collections.addAll(this.rawHostAndPortContactPoints, addresses); return this; } @@ -1060,7 +1057,7 @@ public Builder addContactPointsWithPorts(InetSocketAddress... addresses) { */ public Builder addContactPointsWithPorts(Collection addresses) { failIfCloud(); - this.rowHostAndPortContactPoints.addAll(addresses); + this.rawHostAndPortContactPoints.addAll(addresses); return this; } @@ -1475,7 +1472,7 @@ private Builder addCloudConfigToBuilder(CloudConfig cloudConfig) { builder = builder.withAuthProvider(cloudConfig.getAuthProvider()); } if (builder.rawHostContactPoints.size() > 0 - || builder.rowHostAndPortContactPoints.size() > 0 + || builder.rawHostAndPortContactPoints.size() > 0 || builder.contactPoints.size() > 0) { throw new IllegalStateException( "Can't use withCloudSecureConnectBundle if you've already called addContactPoint(s)"); From c8a49bf85ace9f9705d07772c71ed2814e2a982e Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Thu, 24 Oct 2019 10:37:44 +0300 Subject: [PATCH 059/211] Prime system local to fix failing test in RequestHandlerTest --- .../test/java/com/datastax/driver/core/RequestHandlerTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/driver-core/src/test/java/com/datastax/driver/core/RequestHandlerTest.java b/driver-core/src/test/java/com/datastax/driver/core/RequestHandlerTest.java index 22d7aad2dc8..9ec2acc00ab 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/RequestHandlerTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/RequestHandlerTest.java @@ -30,7 +30,7 @@ public class RequestHandlerTest { - @Test(groups = "long") + @Test(groups = "short") public void should_handle_race_between_response_and_cancellation() { final Scassandra scassandra = TestUtils.createScassandraServer(); Cluster cluster = null; @@ -38,6 +38,7 @@ public void should_handle_race_between_response_and_cancellation() { try { // Use a mock server that takes a constant time to reply scassandra.start(); + ScassandraCluster.primeSystemLocalRow(scassandra); List> rows = Collections.>singletonList(ImmutableMap.of("key", 1)); scassandra From c969a638e6a7f9e3f59c8f13213b923dfd11e6db Mon Sep 17 00:00:00 2001 From: olim7t Date: Fri, 25 Oct 2019 10:42:58 -0700 Subject: [PATCH 060/211] JAVA-2516: Enable hostname validation with Cloud --- changelog/README.md | 1 + .../datastax/driver/core/SniSSLOptions.java | 43 +++++++++++++++++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index d7c30f30781..f089f898867 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -9,6 +9,7 @@ - [improvement] JAVA-2457: Detect CaaS and change default consistency. - [improvement] JAVA-2485: Add errors for Cloud misconfiguration. - [documentation] JAVA-2504: Migrate Cloud "getting started" page to driver manual. +- [improvement] JAVA-2516: Enable hostname validation with Cloud ### 3.7.2 diff --git a/driver-core/src/main/java/com/datastax/driver/core/SniSSLOptions.java b/driver-core/src/main/java/com/datastax/driver/core/SniSSLOptions.java index ea5ff32b157..a22b876c810 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/SniSSLOptions.java +++ b/driver-core/src/main/java/com/datastax/driver/core/SniSSLOptions.java @@ -19,11 +19,23 @@ import io.netty.channel.socket.SocketChannel; import io.netty.handler.ssl.SslHandler; import java.net.InetSocketAddress; -import javax.net.ssl.*; +import java.util.concurrent.CopyOnWriteArrayList; +import javax.net.ssl.SNIHostName; +import javax.net.ssl.SNIServerName; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLParameters; @IgnoreJDK6Requirement @SuppressWarnings("deprecation") public class SniSSLOptions extends JdkSSLOptions implements ExtendedRemoteEndpointAwareSslOptions { + + // An offset that gets added to our "fake" ports (see below). We pick this value because it is the + // start of the ephemeral port range. + private static final int FAKE_PORT_OFFSET = 49152; + + private final CopyOnWriteArrayList fakePorts = new CopyOnWriteArrayList(); + /** * Creates a new instance. * @@ -62,16 +74,39 @@ protected SSLEngine newSSLEngine( this.getClass().getSimpleName())); } SniEndPoint sniEndPoint = (SniEndPoint) remoteEndpoint; - SSLEngine engine = context.createSSLEngine(); + InetSocketAddress address = sniEndPoint.resolve(); + String sniServerName = sniEndPoint.getServerName(); + + // When hostname verification is enabled (with setEndpointIdentificationAlgorithm), the SSL + // engine will try to match the server's certificate against the SNI host name; if that doesn't + // work, it will fall back to the "advisory peer host" passed to createSSLEngine. + // + // In our case, the first check will never succeed because our SNI host name is not the DNS name + // (we use the Cassandra host_id instead). So we *must* set the advisory peer information. + // + // However if we use the address as-is, this leads to another issue: the advisory peer + // information is also used to cache SSL sessions internally. All of our nodes share the same + // proxy address, so the JDK tries to reuse SSL sessions across nodes. But it doesn't update the + // SNI host name every time, so it ends up opening connections to the wrong node. + // + // To avoid that, we create a unique "fake" port for every node. We still get session reuse for + // a given node, but not across nodes. This is safe because the advisory port is only used for + // session caching. + SSLEngine engine = context.createSSLEngine(address.getHostName(), getFakePort(sniServerName)); engine.setUseClientMode(true); SSLParameters parameters = engine.getSSLParameters(); - parameters.setServerNames( - ImmutableList.of(new SNIHostName(sniEndPoint.getServerName()))); + parameters.setServerNames(ImmutableList.of(new SNIHostName(sniServerName))); + parameters.setEndpointIdentificationAlgorithm("HTTPS"); engine.setSSLParameters(parameters); if (cipherSuites != null) engine.setEnabledCipherSuites(cipherSuites); return engine; } + private int getFakePort(String sniServerName) { + fakePorts.addIfAbsent(sniServerName); + return FAKE_PORT_OFFSET + fakePorts.indexOf(sniServerName); + } + public static Builder builder() { return new Builder(); } From 7573debde952317e85446dced6482f52bef04685 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Thu, 24 Oct 2019 14:52:46 +0300 Subject: [PATCH 061/211] JAVA-2515: Process REMOVED_NODE as an individual host event Revert the cloud changes that had turned it into a full list refresh. On the other hand, NEW_NODE has to be processed as a full refresh because we don't have a host_id to build a new instance; fix NodeRefreshDebouncerTest that was failing because of that. --- changelog/README.md | 1 + .../com/datastax/driver/core/Cluster.java | 35 ++++++++++++++++--- .../driver/core/NodeRefreshDebouncerTest.java | 21 +++++++---- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index f089f898867..5648ad9801e 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -10,6 +10,7 @@ - [improvement] JAVA-2485: Add errors for Cloud misconfiguration. - [documentation] JAVA-2504: Migrate Cloud "getting started" page to driver manual. - [improvement] JAVA-2516: Enable hostname validation with Cloud +- [bug] JAVA-2515: NEW_NODE and REMOVED_NODE events should trigger ADDED and REMOVED. ### 3.7.2 diff --git a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java index 8d8b22fe984..0af1b9eb9e6 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java @@ -2735,9 +2735,18 @@ public void handle(Message.Response response) { case TOPOLOGY_CHANGE: ProtocolEvent.TopologyChange tpc = (ProtocolEvent.TopologyChange) event; Host.statesLogger.debug("[{}] received event {}", tpc.node, tpc.change); - // Always do a full refresh for topology changes. This is simpler than trying to infer a - // new EndPoint from the rpc_address only. - submitNodeListRefresh(); + // Do NOT translate the address, it will be matched against Host.getBroadcastRpcAddress() + // to find the target host. + switch (tpc.change) { + case REMOVED_NODE: + submitNodeRefresh(tpc.node, HostEvent.REMOVED); + break; + default: + // If a node was added, we don't have enough information to create a new Host (we are + // missing it's ID) so trigger a full refresh + submitNodeListRefresh(); + break; + } break; case STATUS_CHANGE: ProtocolEvent.StatusChange stc = (ProtocolEvent.StatusChange) event; @@ -3070,6 +3079,8 @@ public ListenableFuture deliver(List events) { case UP: Host upHost = metadata.getHost(address); if (upHost == null) { + // We don't have enough information to create a new Host (we are missing it's ID) + // so trigger a full node refresh submitNodeListRefresh(); } else { futures.add(schedule(hostUp(upHost))); @@ -3096,6 +3107,10 @@ public ListenableFuture deliver(List events) { } } break; + case REMOVED: + Host removedHost = metadata.getHost(address); + if (removedHost != null) futures.add(execute(hostRemoved(removedHost))); + break; } } return Futures.allAsList(futures); @@ -3165,6 +3180,19 @@ public void runMayThrow() throws Exception { } }; } + + private ExceptionCatchingRunnable hostRemoved(final Host host) { + return new ExceptionCatchingRunnable() { + @Override + public void runMayThrow() throws Exception { + if (metadata.remove(host)) { + logger.info("Cassandra host {} removed", host); + onRemove(host); + submitNodeListRefresh(); + } + } + }; + } } private class NodeListRefreshRequest { @@ -3195,7 +3223,6 @@ public void runMayThrow() throws InterruptedException, ExecutionException { private enum HostEvent { UP, DOWN, - ADDED, REMOVED } diff --git a/driver-core/src/test/java/com/datastax/driver/core/NodeRefreshDebouncerTest.java b/driver-core/src/test/java/com/datastax/driver/core/NodeRefreshDebouncerTest.java index 9142290ff15..6b2c1a87680 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/NodeRefreshDebouncerTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/NodeRefreshDebouncerTest.java @@ -20,8 +20,8 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.timeout; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoMoreInteractions; +import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; import org.mockito.ArgumentCaptor; import org.testng.annotations.Test; @@ -31,8 +31,8 @@ public class NodeRefreshDebouncerTest extends CCMTestsSupport { /** * Ensures that when a new node is bootstrapped into the cluster, stopped, and then subsequently - * started within {@link QueryOptions#setRefreshNodeIntervalMillis(int)} that an 'onAdd' event - * event is the only one processed and that the {@link Host} is marked up. + * started within {@link QueryOptions#setRefreshNodeIntervalMillis(int)}, then an 'onAdd' event is + * emitted and the {@link Host} is marked up. * *

    Since NEW_NODE_DELAY_SECONDS is typically configured with a high value (60 seconds default * in the maven profile) this test can take a very long time. @@ -62,16 +62,23 @@ public void should_call_onAdd_with_bootstrap_stop_start() { ArgumentCaptor captor = forClass(Host.class); - // Only register and onAdd should be called, since stop and start should be discarded. verify(listener).onRegister(cluster); long addDelay = refreshNodeInterval + TimeUnit.MILLISECONDS.convert(Cluster.NEW_NODE_DELAY_SECONDS, TimeUnit.SECONDS); verify(listener, timeout(addDelay)).onAdd(captor.capture()); - verifyNoMoreInteractions(listener); - // The hosts state should be UP. - assertThat(captor.getValue().getState()).isEqualTo("UP"); + // The host should eventually come UP + final Host host = captor.getValue(); + ConditionChecker.check() + .that( + new Callable() { + @Override + public Boolean call() { + return host.getState().equals("UP"); + } + }) + .becomesTrue(); assertThat(cluster).host(2).hasState(Host.State.UP); } } From 0c5756590ed11da1ce9b69067d4049682683eaad Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Tue, 29 Oct 2019 15:45:15 -0500 Subject: [PATCH 062/211] Update version in docs --- README.md | 20 ++++---- changelog/README.md | 2 +- faq/README.md | 4 +- faq/osgi/README.md | 2 +- manual/README.md | 30 +++++------ manual/address_resolution/README.md | 4 +- manual/async/README.md | 8 +-- manual/auth/README.md | 8 +-- manual/compression/README.md | 2 +- manual/control_connection/README.md | 2 +- manual/custom_codecs/README.md | 38 +++++++------- manual/custom_codecs/extras/README.md | 48 ++++++++--------- manual/custom_payloads/README.md | 4 +- manual/idempotence/README.md | 6 +-- manual/load_balancing/README.md | 34 ++++++------ manual/logging/README.md | 10 ++-- manual/metadata/README.md | 38 +++++++------- manual/metrics/README.md | 12 ++--- manual/native_protocol/README.md | 10 ++-- manual/object_mapper/README.md | 2 +- manual/object_mapper/creating/README.md | 26 +++++----- manual/object_mapper/custom_codecs/README.md | 6 +-- manual/object_mapper/using/README.md | 18 +++---- manual/paging/README.md | 8 +-- manual/pooling/README.md | 26 +++++----- manual/query_timestamps/README.md | 8 +-- manual/reconnection/README.md | 8 +-- manual/retries/README.md | 54 ++++++++++---------- manual/shaded_jar/README.md | 8 +-- manual/socket_options/README.md | 24 ++++----- manual/speculative_execution/README.md | 22 ++++---- manual/ssl/README.md | 10 ++-- manual/statements/README.md | 16 +++--- manual/statements/batch/README.md | 6 +-- manual/statements/built/README.md | 10 ++-- manual/statements/prepared/README.md | 12 ++--- manual/statements/simple/README.md | 2 +- manual/tuples/README.md | 8 +-- manual/udts/README.md | 4 +- pom.xml | 2 +- 40 files changed, 281 insertions(+), 281 deletions(-) diff --git a/README.md b/README.md index 7739d69a5e4..ee84dfd8278 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ not yet have been released. You can find the documentation for the latest version through the [Java driver docs](http://docs.datastax.com/en/developer/java-driver/latest/index.html) or via the release tags, [e.g. -3.7.2](https://github.com/datastax/java-driver/tree/3.7.2).* +3.8.0](https://github.com/datastax/java-driver/tree/3.8.0).* A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol @@ -50,12 +50,12 @@ The driver contains the following modules: driver releases and important announcements (low frequency). [@DataStaxEng](https://twitter.com/datastaxeng) has more news including other drivers, Cassandra, and DSE. -- DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.7/manual/) has quick +- DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.8/manual/) has quick start material and technical details about the driver and its features. -- API: http://www.datastax.com/drivers/java/3.7 +- API: http://docs.datastax.com/en/drivers/java/3.8 - GITHUB REPOSITORY: https://github.com/datastax/java-driver - [changelog](changelog/) -- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.7.2.tar.gz) +- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.8.0.tar.gz) ## Getting the driver @@ -67,7 +67,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-dri com.datastax.cassandra cassandra-driver-core - 3.7.2 + 3.8.0 ``` @@ -77,7 +77,7 @@ Note that the object mapper is published as a separate artifact: com.datastax.cassandra cassandra-driver-mapping - 3.7.2 + 3.8.0 ``` @@ -87,7 +87,7 @@ The 'extras' module is also published as a separate artifact: com.datastax.cassandra cassandra-driver-extras - 3.7.2 + 3.8.0 ``` @@ -96,12 +96,12 @@ 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](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.7.2.tar.gz) +[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.8.0.tar.gz) is available for download. ## Compatibility -The Java client driver 3.7.2 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache +The Java client driver 3.8.0 ([branch 3.x](https://github.com/datastax/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/latest/manual/native_protocol/) for the most up-to-date compatibility information). @@ -145,4 +145,4 @@ 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. -[dse-driver]: http://docs.datastax.com/en/developer/java-driver-dse/latest +[dse-driver]: http://docs.datastax.com/en/developer/java-driver-dse/1.9/ diff --git a/changelog/README.md b/changelog/README.md index 5648ad9801e..375f10ab035 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -1,7 +1,7 @@ ## Changelog -## 3.8.0 (in progress) +## 3.8.0 - [new feature] JAVA-2356: Support for DataStax Cloud API. - [improvement] JAVA-2483: Allow to provide secure bundle via URL. diff --git a/faq/README.md b/faq/README.md index b9d2122796a..19514553dcf 100644 --- a/faq/README.md +++ b/faq/README.md @@ -35,7 +35,7 @@ row.getBool(0); // this is equivalent row.getBool("applied") Note that, unlike manual inspection, `wasApplied` does not consume the first row. -[wasApplied]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ResultSet.html#wasApplied-- +[wasApplied]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ResultSet.html#wasApplied-- ### What is a parameterized statement and how can I use it? @@ -289,7 +289,7 @@ version is available, you may want to reach out to the maintainer of that tool t an update with compatibility to this driver version. -[Blobs.java]: https://github.com/datastax/java-driver/tree/3.7.2/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java +[Blobs.java]: https://github.com/datastax/java-driver/tree/3.8.0/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304 [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding [Mapper options]: ../manual/object_mapper/using/#mapper-options diff --git a/faq/osgi/README.md b/faq/osgi/README.md index 18e1cfb831b..ddfddf21c23 100644 --- a/faq/osgi/README.md +++ b/faq/osgi/README.md @@ -157,7 +157,7 @@ it is also normal to see the following log lines when starting the driver: [BND]:http://bnd.bndtools.org/ [Maven bundle plugin]:https://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Maven+Bundle+Plugin+%28BND%29 [OSGi examples repository]:https://github.com/datastax/java-driver-examples-osgi -[without metrics]:http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- +[without metrics]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- [SLF4J]:http://www.slf4j.org/ [Logback]:http://logback.qos.ch/ [Tycho]:https://eclipse.org/tycho/ diff --git a/manual/README.md b/manual/README.md index 283d835933a..43311b12d7a 100644 --- a/manual/README.md +++ b/manual/README.md @@ -209,7 +209,7 @@ String firstName = row.getString("first_name"); blob getBytes java.nio.ByteBuffer boolean getBool boolean counter getLong long - date getDate LocalDate + date getDate LocalDate decimal getDecimal java.math.BigDecimal double getDouble double float getFloat float @@ -291,17 +291,17 @@ menu on the left hand side to navigate sub-sections. If you're [browsing the sou github.com](https://github.com/datastax/java-driver/tree/3.x/manual), simply navigate to each sub-directory. -[Cluster]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.html -[Cluster.Builder]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.Builder.html -[Initializer]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.Initializer.html -[Session]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Session.html -[ResultSet]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ResultSet.html -[Row]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Row.html -[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/NettyOptions.html -[QueryOptions]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/QueryOptions.html -[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/SocketOptions.html -[Host.StateListener]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Host.StateListener.html -[LatencyTracker]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/LatencyTracker.html -[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/SchemaChangeListener.html -[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/exceptions/NoHostAvailableException.html -[LocalDate]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/LocalDate.html \ No newline at end of file +[Cluster]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.html +[Cluster.Builder]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html +[Initializer]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Initializer.html +[Session]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html +[ResultSet]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ResultSet.html +[Row]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Row.html +[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/NettyOptions.html +[QueryOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/QueryOptions.html +[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html +[Host.StateListener]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Host.StateListener.html +[LatencyTracker]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/LatencyTracker.html +[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SchemaChangeListener.html +[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[LocalDate]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/LocalDate.html \ No newline at end of file diff --git a/manual/address_resolution/README.md b/manual/address_resolution/README.md index 2f55461bd96..63afcdb42e1 100644 --- a/manual/address_resolution/README.md +++ b/manual/address_resolution/README.md @@ -102,8 +102,8 @@ private/public switch automatically based on location). -[AddressTranslator]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/AddressTranslator.html -[EC2MultiRegionAddressTranslator]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslator.html +[AddressTranslator]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/AddressTranslator.html +[EC2MultiRegionAddressTranslator]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslator.html [cassandra.yaml]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html [rpc_address]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html?scroll=configCassandra_yaml__rpc_address diff --git a/manual/async/README.md b/manual/async/README.md index a50d3180bbb..1adf82324d6 100644 --- a/manual/async/README.md +++ b/manual/async/README.md @@ -51,8 +51,8 @@ to the current page, and [fetchMoreResults] to get a future to the next page (see also the section on [paging](../paging/)). Here is a full example: -[getAvailableWithoutFetching]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ResultSet.html#getAvailableWithoutFetching-- -[fetchMoreResults]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ResultSet.html#fetchMoreResults-- +[getAvailableWithoutFetching]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ResultSet.html#getAvailableWithoutFetching-- +[fetchMoreResults]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ResultSet.html#fetchMoreResults-- ```java Statement statement = new SimpleStatement("select * from foo").setFetchSize(20); @@ -134,5 +134,5 @@ There are still a few places where the driver will block internally hasn't been fetched already. [ListenableFuture]: https://github.com/google/guava/wiki/ListenableFutureExplained -[init]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.html#init-- -[query trace]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/QueryTrace.html +[init]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.html#init-- +[query trace]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/QueryTrace.html diff --git a/manual/auth/README.md b/manual/auth/README.md index 50fdaf3bf3b..9d8b363e7a6 100644 --- a/manual/auth/README.md +++ b/manual/auth/README.md @@ -28,7 +28,7 @@ You can also write your own provider; it must implement [AuthProvider]. [SASL]: https://en.wikipedia.org/wiki/Simple_Authentication_and_Security_Layer -[Cluster.Builder.withCredentials]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.Builder.html#withCredentials-java.lang.String-java.lang.String- -[AuthProvider]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/AuthProvider.html -[Cluster.Builder.withAuthProvider]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.Builder.html#withAuthProvider-com.datastax.driver.core.AuthProvider- -[PlainTextAuthProvider]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/PlainTextAuthProvider.html +[Cluster.Builder.withCredentials]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withCredentials-java.lang.String-java.lang.String- +[AuthProvider]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/AuthProvider.html +[Cluster.Builder.withAuthProvider]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withAuthProvider-com.datastax.driver.core.AuthProvider- +[PlainTextAuthProvider]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PlainTextAuthProvider.html diff --git a/manual/compression/README.md b/manual/compression/README.md index 899ec68d167..9a5018c890b 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -88,4 +88,4 @@ cluster = Cluster.builder() .build(); ``` -[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.7.2/cassandra-driver-parent-3.7.2.pom +[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.8.0/cassandra-driver-parent-3.8.0.pom diff --git a/manual/control_connection/README.md b/manual/control_connection/README.md index 6b6385fd30a..a4cc732b247 100644 --- a/manual/control_connection/README.md +++ b/manual/control_connection/README.md @@ -18,4 +18,4 @@ used exclusively for administrative requests. It is included in [Session.State.g as well as the `open-connections` [metric](../metrics); for example, if you've configured a pool size of 2, the control node will have 3 connections. -[Session.State.getOpenConnections]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Session.State.html#getOpenConnections-com.datastax.driver.core.Host- \ No newline at end of file +[Session.State.getOpenConnections]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.State.html#getOpenConnections-com.datastax.driver.core.Host- \ No newline at end of file diff --git a/manual/custom_codecs/README.md b/manual/custom_codecs/README.md index 15e90d48a3f..d844e278fab 100644 --- a/manual/custom_codecs/README.md +++ b/manual/custom_codecs/README.md @@ -447,26 +447,26 @@ Beware that in these cases, the lookup performs in average 10x worse. If perform consider using prepared statements all the time. [JAVA-721]: https://datastax-oss.atlassian.net/browse/JAVA-721 -[TypeCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TypeCodec.html -[LocalDate]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/LocalDate.html +[TypeCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TypeCodec.html +[LocalDate]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/LocalDate.html [ByteBuffer]: http://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html -[serialize]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TypeCodec.html#serialize-T-com.datastax.driver.core.ProtocolVersion- -[deserialize]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TypeCodec.html#deserialize-java.nio.ByteBuffer-com.datastax.driver.core.ProtocolVersion- -[TypeCodec.format]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TypeCodec.html#format-T- -[TypeCodec.parse]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TypeCodec.html#parse-java.lang.String- -[accepts]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TypeCodec.html#accepts-com.datastax.driver.core.DataType- -[CodecRegistry]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/CodecRegistry.html -[CodecNotFoundException]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/exceptions/CodecNotFoundException.html +[serialize]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TypeCodec.html#serialize-T-com.datastax.driver.core.ProtocolVersion- +[deserialize]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TypeCodec.html#deserialize-java.nio.ByteBuffer-com.datastax.driver.core.ProtocolVersion- +[TypeCodec.format]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TypeCodec.html#format-T- +[TypeCodec.parse]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TypeCodec.html#parse-java.lang.String- +[accepts]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TypeCodec.html#accepts-com.datastax.driver.core.DataType- +[CodecRegistry]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/CodecRegistry.html +[CodecNotFoundException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/CodecNotFoundException.html [Jackson]: https://github.com/FasterXML/jackson [AbstractType]: https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/marshal/AbstractType.java -[UserType]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/UserType.html -[UDTValue]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/UDTValue.html -[TupleType]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TupleType.html -[TupleValue]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TupleValue.html -[CustomType]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/DataType.CustomType.html +[UserType]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/UserType.html +[UDTValue]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/UDTValue.html +[TupleType]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TupleType.html +[TupleValue]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TupleValue.html +[CustomType]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/DataType.CustomType.html [TypeToken]: https://google.github.io/guava/releases/19.0/api/docs/com/google/common/reflect/TypeToken.html -[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/SimpleStatement.html -[BuiltStatement]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/querybuilder/BuiltStatement.html -[setList]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/SettableByIndexData.html#setList-int-java.util.List- -[setSet]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/SettableByIndexData.html#setSet-int-java.util.Set- -[setMap]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/SettableByIndexData.html#setMap-int-java.util.Map- +[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SimpleStatement.html +[BuiltStatement]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/querybuilder/BuiltStatement.html +[setList]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SettableByIndexData.html#setList-int-java.util.List- +[setSet]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SettableByIndexData.html#setSet-int-java.util.Set- +[setMap]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SettableByIndexData.html#setMap-int-java.util.Map- diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index ddff801aca5..07f1378408b 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -10,7 +10,7 @@ The module is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-extras - 3.7.2 + 3.8.0 ``` @@ -73,12 +73,12 @@ session.execute("INSERT INTO example (id, t) VALUES (1, ?)", ZoneId.of("GMT+07:00")); ``` -[InstantCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/InstantCodec.html -[LocalDateCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.html -[LocalDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/LocalDateTimeCodec.html -[LocalTimeCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.html -[ZonedDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.html -[ZoneIdCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/ZoneIdCodec.html +[InstantCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/jdk8/InstantCodec.html +[LocalDateCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.html +[LocalDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/jdk8/LocalDateTimeCodec.html +[LocalTimeCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.html +[ZonedDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.html +[ZoneIdCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/jdk8/ZoneIdCodec.html [Instant]: https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html [LocalDate]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html [LocalDateTime]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html @@ -130,10 +130,10 @@ session.execute("INSERT INTO example (id, t) VALUES (1, ?)", DateTime.parse("2010-06-30T01:20:47.999+01:00")); ``` -[InstantCodec_joda]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/joda/InstantCodec.html -[LocalDateCodec_joda]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/joda/LocalDateCodec.html -[LocalTimeCodec_joda]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.html -[DateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/joda/DateTimeCodec.html +[InstantCodec_joda]: http://docs.datastax.com/en/drivers/java/87/com/datastax/driver/extras/codecs/joda/InstantCodec.html +[LocalDateCodec_joda]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/joda/LocalDateCodec.html +[LocalTimeCodec_joda]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.html +[DateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/joda/DateTimeCodec.html [DateTime]: http://www.joda.org/joda-time/apidocs/org/joda/time/DateTime.html [Instant_joda]: http://www.joda.org/joda-time/apidocs/org/joda/time/Instant.html [LocalDate_joda]: http://www.joda.org/joda-time/apidocs/org/joda/time/LocalDate.html @@ -151,8 +151,8 @@ Time can also be expressed as simple durations: There is no extra codec for `time`, because by default the driver already maps that type to a `long` representing the number of nanoseconds since midnight. -[SimpleTimestampCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.html -[SimpleDateCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/date/SimpleDateCodec.html +[SimpleTimestampCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.html +[SimpleDateCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/date/SimpleDateCodec.html ### Enums @@ -190,8 +190,8 @@ Note that if you registered an `EnumNameCodec` and an `EnumOrdinalCodec` _for th In practice, this is unlikely to happen, because you'll probably stick to a single CQL type for a given enum type; however, if you ever run into that issue, the workaround is to use [prepared statements](../../statements/prepared/), for which the driver knows the CQL type and can pick the exact codec. -[EnumNameCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/enums/EnumNameCodec.html -[EnumOrdinalCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.html +[EnumNameCodec]: http://docs.datastax.com/en/drivers/java/8/com/datastax/driver/extras/codecs/enums/EnumNameCodec.html +[EnumOrdinalCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.html [name]: https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name-- [ordinal]: https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal-- @@ -236,7 +236,7 @@ session.execute("insert into example (id, owner) values (1, ?)", // owner saved as '{"id":1,"name":"root"}' ``` -[JacksonJsonCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.html +[JacksonJsonCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.html [Jackson]: https://github.com/FasterXML/jackson @@ -275,7 +275,7 @@ session.execute("insert into example (id, owner) values (1, ?)", ``` -[Jsr353JsonCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.html +[Jsr353JsonCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.html [JsonStructure]: https://docs.oracle.com/javaee/7/tutorial/jsonp002.htm @@ -328,7 +328,7 @@ For the same reason, we need to give a type hint when setting "v", in the form o anonymous inner class; we recommend storing these tokens as constants in a utility class, to avoid creating them too often. -[OptionalCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.html +[OptionalCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.html [Optional]: https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html [TypeToken]: http://google.github.io/guava/releases/19.0/api/docs/com/google/common/reflect/TypeToken.html @@ -372,7 +372,7 @@ session.execute(pst.bind() See the JDK8 Optional section above for explanations about [TypeToken]. -[OptionalCodec_guava]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/guava/OptionalCodec.html +[OptionalCodec_guava]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/guava/OptionalCodec.html [Optional_guava]: http://google.github.io/guava/releases/19.0/api/docs/com/google/common/base/Optional.html @@ -397,9 +397,9 @@ session.execute("insert into example (i, l) values (1, ?)", Package [com.datastax.driver.extras.codecs.arrays][arrays] contains similar codecs for all primitive types, and [ObjectArrayCodec] to map arrays of objects. -[IntArrayCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.html -[ObjectArrayCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.html -[arrays]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/arrays/package-summary.html +[IntArrayCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.html +[ObjectArrayCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.html +[arrays]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/arrays/package-summary.html ### Abstract utilities @@ -429,5 +429,5 @@ These two classes are convenient, but since they perform conversions in two step optimal approach. If performance is paramount, it's better to start from scratch and convert your objects to `ByteBuffer` directly. -[MappingCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/MappingCodec.html -[ParsingCodec]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/extras/codecs/ParsingCodec.html +[MappingCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/MappingCodec.html +[ParsingCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/ParsingCodec.html diff --git a/manual/custom_payloads/README.md b/manual/custom_payloads/README.md index 924c97ee188..89e3d245c58 100644 --- a/manual/custom_payloads/README.md +++ b/manual/custom_payloads/README.md @@ -241,8 +241,8 @@ The log message contains a pretty-printed version of the payload itself, and its [CASSANDRA-8553]: https://issues.apache.org/jira/browse/CASSANDRA-8553 [v4spec]: https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec [qh]: https://issues.apache.org/jira/browse/CASSANDRA-6659 -[nhae]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[nhae]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/NoHostAvailableException.html [chm]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html [immutablemap]: http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/ImmutableMap.html -[ufe]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/UnsupportedFeatureException.html +[ufe]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/UnsupportedFeatureException.html diff --git a/manual/idempotence/README.md b/manual/idempotence/README.md index a130a6952cd..d7bd8d1b6f1 100644 --- a/manual/idempotence/README.md +++ b/manual/idempotence/README.md @@ -125,8 +125,8 @@ broke linearizability by doing a transparent retry at step 6. If linearizability is important for you, you should ensure that lightweight transactions are appropriately flagged as not idempotent. -[isIdempotent]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Statement.html#isIdempotent-- -[setDefaultIdempotence]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/QueryOptions.html#setDefaultIdempotence-boolean- -[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/querybuilder/QueryBuilder.html +[isIdempotent]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Statement.html#isIdempotent-- +[setDefaultIdempotence]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/QueryOptions.html#setDefaultIdempotence-boolean- +[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/querybuilder/QueryBuilder.html [linearizability]: https://en.wikipedia.org/wiki/Linearizability#Definition_of_linearizability \ No newline at end of file diff --git a/manual/load_balancing/README.md b/manual/load_balancing/README.md index 40ac9bd3f34..701336936dd 100644 --- a/manual/load_balancing/README.md +++ b/manual/load_balancing/README.md @@ -277,11 +277,11 @@ For any host, the distance returned by the policy is always the same as its chil Query plans are based on the child policy's, except that hosts that are currently excluded for being too slow are moved to the end of the plan. -[withExclusionThreshold]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withExclusionThreshold-double- -[withMininumMeasurements]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withMininumMeasurements-int- -[withRetryPeriod]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withRetryPeriod-long-java.util.concurrent.TimeUnit- -[withScale]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withScale-long-java.util.concurrent.TimeUnit- -[withUpdateRate]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withUpdateRate-long-java.util.concurrent.TimeUnit- +[withExclusionThreshold]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withExclusionThreshold-double- +[withMininumMeasurements]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withMininumMeasurements-int- +[withRetryPeriod]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withRetryPeriod-long-java.util.concurrent.TimeUnit- +[withScale]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withScale-long-java.util.concurrent.TimeUnit- +[withUpdateRate]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withUpdateRate-long-java.util.concurrent.TimeUnit- ### Filtering policies @@ -299,15 +299,15 @@ studying the existing implementations first: `RoundRobinPolicy` is a good place complex ones like `DCAwareRoundRobinPolicy`. -[LoadBalancingPolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/LoadBalancingPolicy.html -[RoundRobinPolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/RoundRobinPolicy.html -[DCAwareRoundRobinPolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.html -[TokenAwarePolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/TokenAwarePolicy.html -[LatencyAwarePolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/LatencyAwarePolicy.html -[HostFilterPolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/HostFilterPolicy.html -[WhiteListPolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/WhiteListPolicy.html -[HostDistance]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/HostDistance.html -[refreshConnectedHosts]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PoolingOptions.html#refreshConnectedHosts-- -[setMetadataEnabled]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/QueryOptions.html#setMetadataEnabled-boolean- -[Statement#getKeyspace]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Statement.html#getKeyspace-- -[Statement#getRoutingKey]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Statement.html#getRoutingKey-- +[LoadBalancingPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LoadBalancingPolicy.html +[RoundRobinPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RoundRobinPolicy.html +[DCAwareRoundRobinPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.html +[TokenAwarePolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/TokenAwarePolicy.html +[LatencyAwarePolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LatencyAwarePolicy.html +[HostFilterPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/HostFilterPolicy.html +[WhiteListPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/WhiteListPolicy.html +[HostDistance]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/HostDistance.html +[refreshConnectedHosts]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PoolingOptions.html#refreshConnectedHosts-- +[setMetadataEnabled]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/QueryOptions.html#setMetadataEnabled-boolean- +[Statement#getKeyspace]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Statement.html#getKeyspace-- +[Statement#getRoutingKey]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Statement.html#getRoutingKey-- diff --git a/manual/logging/README.md b/manual/logging/README.md index 86edf1943c5..fff6897bb92 100644 --- a/manual/logging/README.md +++ b/manual/logging/README.md @@ -208,12 +208,12 @@ Aggregation query used without partition key ``` These -[query warnings](http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) +[query warnings](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) are available programmatically from the -[ExecutionInfo](https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ExecutionInfo.html) +[ExecutionInfo](https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ExecutionInfo.html) via -[ResultSet](https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ResultSet.html)'s -[getExecutionInfo()](https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PagingIterable.html#getExecutionInfo--) +[ResultSet](https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ResultSet.html)'s +[getExecutionInfo()](https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PagingIterable.html#getExecutionInfo--) method. They are also logged by the driver: ``` @@ -340,4 +340,4 @@ It also turns on slow query tracing as described above. ``` -[query_logger]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/QueryLogger.html +[query_logger]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/QueryLogger.html diff --git a/manual/metadata/README.md b/manual/metadata/README.md index 0155bb82882..6fc2f60e520 100644 --- a/manual/metadata/README.md +++ b/manual/metadata/README.md @@ -4,7 +4,7 @@ The driver maintains global information about the Cassandra cluster it is connected to. It is available via [Cluster#getMetadata()][getMetadata]. -[getMetadata]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.html#getMetadata-- +[getMetadata]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.html#getMetadata-- ### Schema metadata @@ -12,8 +12,8 @@ Use [getKeyspace(String)][getKeyspace] or [getKeyspaces()][getKeyspaces] to get keyspace-level metadata. From there you can access the keyspace's objects (tables, and UDTs and UDFs if relevant). -[getKeyspace]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Metadata.html#getKeyspace-java.lang.String- -[getKeyspaces]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Metadata.html#getKeyspaces-- +[getKeyspace]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#getKeyspace-java.lang.String- +[getKeyspaces]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#getKeyspaces-- #### Refreshes @@ -47,8 +47,8 @@ Note that it is preferable to register a listener only *after* the cluster is fu otherwise the listener could be notified with a great deal of "Added" events as the driver builds the schema metadata from scratch for the first time. -[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/SchemaChangeListener.html -[registerListener]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.html#register-com.datastax.driver.core.SchemaChangeListener- +[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SchemaChangeListener.html +[registerListener]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.html#register-com.datastax.driver.core.SchemaChangeListener- #### Schema agreement @@ -135,9 +135,9 @@ custom executor). Check out the API docs for the features in this section: -* [withMaxSchemaAgreementWaitSeconds(int)](http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.Builder.html#withMaxSchemaAgreementWaitSeconds-int-) -* [isSchemaInAgreement()](http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ExecutionInfo.html#isSchemaInAgreement--) -* [checkSchemaAgreement()](http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Metadata.html#checkSchemaAgreement--) +* [withMaxSchemaAgreementWaitSeconds(int)](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withMaxSchemaAgreementWaitSeconds-int-) +* [isSchemaInAgreement()](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ExecutionInfo.html#isSchemaInAgreement--) +* [checkSchemaAgreement()](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#checkSchemaAgreement--) ### Token metadata @@ -181,14 +181,14 @@ Starting with Cassandra 2.1.5, this information is available in a system table (see [CASSANDRA-7688](https://issues.apache.org/jira/browse/CASSANDRA-7688)). -[metadata]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Metadata.html -[getTokenRanges]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Metadata.html#getTokenRanges-- -[getTokenRanges2]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Metadata.html#getTokenRanges-java.lang.String-com.datastax.driver.core.Host- -[getReplicas]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Metadata.html#getReplicas-java.lang.String-com.datastax.driver.core.TokenRange- -[newToken]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Metadata.html#newToken-java.lang.String- -[newTokenRange]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Metadata.html#newTokenRange-com.datastax.driver.core.Token-com.datastax.driver.core.Token- -[TokenRange]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TokenRange.html -[getTokens]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Host.html#getTokens-- -[setToken]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/BoundStatement.html#setToken-int-com.datastax.driver.core.Token- -[getToken]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Row.html#getToken-int- -[getPKToken]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Row.html#getPartitionKeyToken-- +[metadata]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html +[getTokenRanges]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#getTokenRanges-- +[getTokenRanges2]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#getTokenRanges-java.lang.String-com.datastax.driver.core.Host- +[getReplicas]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#getReplicas-java.lang.String-com.datastax.driver.core.TokenRange- +[newToken]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#newToken-java.lang.String- +[newTokenRange]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#newTokenRange-com.datastax.driver.core.Token-com.datastax.driver.core.Token- +[TokenRange]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TokenRange.html +[getTokens]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Host.html#getTokens-- +[setToken]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/BoundStatement.html#setToken-int-com.datastax.driver.core.Token- +[getToken]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Row.html#getToken-int- +[getPKToken]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Row.html#getPartitionKeyToken-- diff --git a/manual/metrics/README.md b/manual/metrics/README.md index 634a32c0069..0c6730735ef 100644 --- a/manual/metrics/README.md +++ b/manual/metrics/README.md @@ -38,7 +38,7 @@ To do this in a maven project: com.datastax.cassandra cassandra-driver-core - 3.7.2 + 3.8.0 io.dropwizard.metrics @@ -146,8 +146,8 @@ reporter.start(); [Reporters]: http://metrics.dropwizard.io/3.2.2/manual/core.html#reporters [MetricRegistry]: http://metrics.dropwizard.io/3.2.2/apidocs/com/codahale/metrics/MetricRegistry.html [MXBeans]: https://docs.oracle.com/javase/tutorial/jmx/mbeans/mxbeans.html -[withClusterName]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.Builder.html#withClusterName-java.lang.String- -[withoutMetrics]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- -[withoutJMXReporting]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.Builder.html#withoutJMXReporting-- -[getMetrics]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Cluster.html#getMetrics-- -[Metrics]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Metrics.html +[withClusterName]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withClusterName-java.lang.String- +[withoutMetrics]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- +[withoutJMXReporting]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withoutJMXReporting-- +[getMetrics]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.html#getMetrics-- +[Metrics]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metrics.html diff --git a/manual/native_protocol/README.md b/manual/native_protocol/README.md index 7ee0f4414fb..dff2330b207 100644 --- a/manual/native_protocol/README.md +++ b/manual/native_protocol/README.md @@ -64,7 +64,7 @@ All host(s) tried for query failed [/127.0.0.1:9042] Host /127.0.0.1:9042 does not support protocol version V3 but V2)) ``` -[gpv]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- +[gpv]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- #### Protocol version with mixed clusters @@ -95,19 +95,19 @@ To avoid this issue, you can use one the following workarounds: #### v1 to v2 * bound variables in simple statements - ([Session#execute(String, Object...)](http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Session.html#execute-java.lang.String-java.lang.Object...-)) -* [batch statements](http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/BatchStatement.html) + ([Session#execute(String, Object...)](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html#execute-java.lang.String-java.lang.Object...-)) +* [batch statements](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/BatchStatement.html) * [query paging](../paging/) #### v2 to v3 * the number of stream ids per connection goes from 128 to 32768 (see [Connection pooling](../pooling/)) -* [serial consistency on batch statements](http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/BatchStatement.html#setSerialConsistencyLevel-com.datastax.driver.core.ConsistencyLevel-) +* [serial consistency on batch statements](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/BatchStatement.html#setSerialConsistencyLevel-com.datastax.driver.core.ConsistencyLevel-) * [client-side timestamps](../query_timestamps/) #### v3 to v4 -* [query warnings](http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) +* [query warnings](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) * allowed unset values in bound statements * [Custom payloads](../custom_payloads/) diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md index d1acb1e6f72..3f866382417 100644 --- a/manual/object_mapper/README.md +++ b/manual/object_mapper/README.md @@ -11,7 +11,7 @@ The mapper is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-mapping - 3.7.2 + 3.8.0 ``` diff --git a/manual/object_mapper/creating/README.md b/manual/object_mapper/creating/README.md index ab337e071e3..67384a514a4 100644 --- a/manual/object_mapper/creating/README.md +++ b/manual/object_mapper/creating/README.md @@ -149,9 +149,9 @@ User user = new User() .setName("John Doe"); ``` -[table]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/Table.html +[table]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Table.html [case-sensitive]:http://docs.datastax.com/en/cql/3.3/cql/cql_reference/ucase-lcase_r.html -[consistency level]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ConsistencyLevel.html +[consistency level]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ConsistencyLevel.html [java-beans]:https://docs.oracle.com/javase/tutorial/javabeans/writing/properties.html [set-accessible]:https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/AccessibleObject.html#setAccessible-boolean- @@ -189,7 +189,7 @@ CREATE TABLE users(id uuid PRIMARY KEY, "userName" text); private String userName; ``` -[column]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/Column.html +[column]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Column.html #### Primary key fields @@ -213,8 +213,8 @@ private String areaCode; The order of the indices must match that of the columns in the table declaration. -[pk]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/PartitionKey.html -[cc]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/ClusteringColumn.html +[pk]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/PartitionKey.html +[cc]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/ClusteringColumn.html [pks]:http://thelastpickle.com/blog/2013/01/11/primary-keys-in-cql.html #### Computed fields @@ -250,7 +250,7 @@ version (see [JAVA-832](https://datastax-oss.atlassian.net/browse/JAVA-832)). [User Defined Functions]:http://www.planetcassandra.org/blog/user-defined-functions-in-cassandra-3-0/ -[computed]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/Computed.html +[computed]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Computed.html #### Transient properties @@ -259,7 +259,7 @@ to table columns. [@Transient][transient] can be used to prevent a field or a Java bean property from being mapped. Like other column-level annotations, it should be placed on either the field declaration or the property getter method. -[transient]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/Transient.html +[transient]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Transient.html ### Mapping User Types @@ -322,8 +322,8 @@ This also works with UDTs inside collections or other UDTs, with any arbitrary nesting level. [User Defined Types]: ../../udts/ -[udt]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/UDT.html -[field]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/Field.html +[udt]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/UDT.html +[field]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Field.html ### Mapping collections @@ -381,10 +381,10 @@ to figure out how to appropriately handle UDT conversion, i.e.: mappingManager.udtCodec(Address.class); ``` -[frozen]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/Frozen.html -[frozenkey]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/FrozenKey.html -[frozenvalue]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/FrozenValue.html -[udtCodec]:https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/MappingManager.html#udtCodec-java.lang.Class- +[frozen]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Frozen.html +[frozenkey]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/FrozenKey.html +[frozenvalue]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/FrozenValue.html +[udtCodec]:https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/MappingManager.html#udtCodec-java.lang.Class- #### Prefer Frozen Collections diff --git a/manual/object_mapper/custom_codecs/README.md b/manual/object_mapper/custom_codecs/README.md index e423b3bae79..b8871734c9d 100644 --- a/manual/object_mapper/custom_codecs/README.md +++ b/manual/object_mapper/custom_codecs/README.md @@ -98,9 +98,9 @@ instance (one per column) and cache it for future use. This also works with [@Field][field] and [@Param][param] annotations. -[column]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/Column.html -[field]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/Field.html -[param]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/mapping/annotations/Param.html +[column]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Column.html +[field]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Field.html +[param]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Param.html ## Implicit UDT codecs diff --git a/manual/object_mapper/using/README.md b/manual/object_mapper/using/README.md index f55c19e843e..0d55cad1585 100644 --- a/manual/object_mapper/using/README.md +++ b/manual/object_mapper/using/README.md @@ -28,9 +28,9 @@ Mapper mapper = manager.mapper(User.class); calling `manager#mapper` more than once for the same class will return the previously generated mapper. -[Mapper]:http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/Mapper.html -[MappingManager]:http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/MappingManager.html -[Session]:http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Session.html +[Mapper]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/Mapper.html +[MappingManager]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/MappingManager.html +[Session]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html #### Basic CRUD operations @@ -179,7 +179,7 @@ It provides methods `one()`, `all()`, `iterator()`, `getExecutionInfo()` and `isExhausted()`. Note that iterating the `Result` will consume the `ResultSet`, and vice-versa. -[Result]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/Result.html +[Result]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/Result.html ### Accessors @@ -229,7 +229,7 @@ corresponds to which marker: ResultSet insert(@Param("u") UUID userId, @Param("n") String name); ``` -[param]:http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/annotations/Param.html +[param]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Param.html If a method argument is a Java enumeration, it must be annotated with `@Enumerated` to indicate how to convert it to a CQL type (the rules are @@ -301,7 +301,7 @@ query with the annotation [@QueryParameters]. Then, options like public ListenableFuture> getAllAsync(); ``` -[@QueryParameters]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/annotations/QueryParameters.html +[@QueryParameters]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/QueryParameters.html ### Mapping configuration @@ -345,6 +345,6 @@ PropertyMapper propertyMapper = new DefaultPropertyMapper() There is more to `DefaultPropertyMapper`; see the Javadocs and implementation for details. -[MappingConfiguration]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/MappingConfiguration.html -[PropertyMapper]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/PropertyMapper.html -[DefaultPropertyMapper]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/mapping/DefaultPropertyMapper.html +[MappingConfiguration]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/MappingConfiguration.html +[PropertyMapper]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/PropertyMapper.html +[DefaultPropertyMapper]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/DefaultPropertyMapper.html diff --git a/manual/paging/README.md b/manual/paging/README.md index ea4e9febf15..9e49347e6b5 100644 --- a/manual/paging/README.md +++ b/manual/paging/README.md @@ -176,8 +176,8 @@ if (nextPage != null) { } ``` -[result_set]:http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ResultSet.html -[paging_state]:http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/PagingState.html +[result_set]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ResultSet.html +[paging_state]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PagingState.html Due to internal implementation details, `PagingState` instances are not @@ -239,8 +239,8 @@ There are two situations where you might want to use the unsafe API: implementing your own validation logic (for example, signing the raw state with a private key). -[gpsu]: https://www.datastax.com/drivers/java/3.7/com/datastax/driver/core/ExecutionInfo.html#getPagingStateUnsafe-- -[spsu]: https://www.datastax.com/drivers/java/3.6/com/datastax/driver/core/Statement.html#setPagingStateUnsafe-byte:A- +[gpsu]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ExecutionInfo.html#getPagingStateUnsafe-- +[spsu]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Statement.html#setPagingStateUnsafe-byte:A- ### Offset queries diff --git a/manual/pooling/README.md b/manual/pooling/README.md index 1838e2f926b..e66c3b26dbb 100644 --- a/manual/pooling/README.md +++ b/manual/pooling/README.md @@ -285,16 +285,16 @@ either: [newConnectionThreshold][nct] so that enough connections are added by the time you reach the bottleneck. -[result_set_future]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ResultSetFuture.html -[pooling_options]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PoolingOptions.html -[lbp]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/LoadBalancingPolicy.html -[nct]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PoolingOptions.html#setNewConnectionThreshold-com.datastax.driver.core.HostDistance-int- -[mrpc]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PoolingOptions.html#setMaxRequestsPerConnection-com.datastax.driver.core.HostDistance-int- -[sits]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PoolingOptions.html#setIdleTimeoutSeconds-int- -[rtm]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SocketOptions.html#getReadTimeoutMillis-- -[smqs]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PoolingOptions.html#setMaxQueueSize-int- -[sptm]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PoolingOptions.html#setPoolTimeoutMillis-int- -[nhae]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/NoHostAvailableException.html -[getErrors]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- -[get_state]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Session.html#getState-- -[BusyPoolException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/BusyPoolException.html +[result_set_future]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ResultSetFuture.html +[pooling_options]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PoolingOptions.html +[lbp]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LoadBalancingPolicy.html +[nct]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PoolingOptions.html#setNewConnectionThreshold-com.datastax.driver.core.HostDistance-int- +[mrpc]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PoolingOptions.html#setMaxRequestsPerConnection-com.datastax.driver.core.HostDistance-int- +[sits]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PoolingOptions.html#setIdleTimeoutSeconds-int- +[rtm]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#getReadTimeoutMillis-- +[smqs]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PoolingOptions.html#setMaxQueueSize-int- +[sptm]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PoolingOptions.html#setPoolTimeoutMillis-int- +[nhae]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[getErrors]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- +[get_state]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html#getState-- +[BusyPoolException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/BusyPoolException.html diff --git a/manual/query_timestamps/README.md b/manual/query_timestamps/README.md index fcdc66c7189..4b4f5e22c7a 100644 --- a/manual/query_timestamps/README.md +++ b/manual/query_timestamps/README.md @@ -140,10 +140,10 @@ following: Steps 2 and 3 only apply if native protocol v3 or above is in use. -[TimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/TimestampGenerator.html -[AtomicMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.html -[ThreadLocalMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.html -[ServerSideTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/ServerSideTimestampGenerator.html +[TimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TimestampGenerator.html +[AtomicMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.html +[ThreadLocalMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.html +[ServerSideTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ServerSideTimestampGenerator.html [gettimeofday]: http://man7.org/linux/man-pages/man2/settimeofday.2.html [JNR]: https://github.com/jnr/jnr-ffi diff --git a/manual/reconnection/README.md b/manual/reconnection/README.md index ee078e61751..1fc7c6a6ad1 100644 --- a/manual/reconnection/README.md +++ b/manual/reconnection/README.md @@ -29,7 +29,7 @@ You can also write your own policy; it must implement [ReconnectionPolicy]. For best results, use reasonable values: very low values (for example a constant delay of 10 milliseconds) will quickly saturate your system. -[ReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/policies/ReconnectionPolicy.html -[Cluster.Builder.withReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Cluster.Builder.html#withReconnectionPolicy-com.datastax.driver.core.policies.ReconnectionPolicy- -[ExponentialReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.html -[ConstantReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/policies/ConstantReconnectionPolicy.html +[ReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/ReconnectionPolicy.html +[Cluster.Builder.withReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withReconnectionPolicy-com.datastax.driver.core.policies.ReconnectionPolicy- +[ExponentialReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.html +[ConstantReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/ConstantReconnectionPolicy.html diff --git a/manual/retries/README.md b/manual/retries/README.md index 5c450ce1ebd..ed514f4879d 100644 --- a/manual/retries/README.md +++ b/manual/retries/README.md @@ -146,33 +146,33 @@ implementations to handle idempotence (the new behavior is equivalent to what yo `IdempotenceAwareRetryPolicy` before). -[RetryDecision]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html -[retry()]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#retry-com.datastax.driver.core.ConsistencyLevel- -[tryNextHost()]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#tryNextHost-com.datastax.driver.core.ConsistencyLevel- -[rethrow()]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#rethrow-- -[ignore()]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#ignore-- -[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/NoHostAvailableException.html -[getErrors()]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- -[RetryPolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/RetryPolicy.html -[DefaultRetryPolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/DefaultRetryPolicy.html -[onReadTimeout]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- -[onWriteTimeout]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onWriteTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.WriteType-int-int-int- -[onUnavailable]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onUnavailable-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-int- -[onRequestError]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- -[UnavailableException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/UnavailableException.html -[ReadTimeoutException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/ReadTimeoutException.html -[WriteTimeoutException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/WriteTimeoutException.html -[OverloadedException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/OverloadedException.html -[ServerError]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/ServerError.html -[OperationTimedOutException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/OperationTimedOutException.html -[ConnectionException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/ConnectionException.html -[QueryValidationException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/QueryValidationException.html -[InvalidQueryException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/InvalidQueryException.html -[InvalidConfigurationInQueryException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.html -[UnauthorizedException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/UnauthorizedException.html -[SyntaxError]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/SyntaxError.html -[AlreadyExistsException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/AlreadyExistsException.html -[TruncateException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/TruncateException.html +[RetryDecision]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html +[retry()]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#retry-com.datastax.driver.core.ConsistencyLevel- +[tryNextHost()]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#tryNextHost-com.datastax.driver.core.ConsistencyLevel- +[rethrow()]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#rethrow-- +[ignore()]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#ignore-- +[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[getErrors()]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- +[RetryPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.html +[DefaultRetryPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/DefaultRetryPolicy.html +[onReadTimeout]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- +[onWriteTimeout]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onWriteTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.WriteType-int-int-int- +[onUnavailable]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onUnavailable-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-int- +[onRequestError]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- +[UnavailableException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/UnavailableException.html +[ReadTimeoutException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/ReadTimeoutException.html +[WriteTimeoutException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/WriteTimeoutException.html +[OverloadedException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/OverloadedException.html +[ServerError]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/ServerError.html +[OperationTimedOutException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/OperationTimedOutException.html +[ConnectionException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/ConnectionException.html +[QueryValidationException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/QueryValidationException.html +[InvalidQueryException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/InvalidQueryException.html +[InvalidConfigurationInQueryException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.html +[UnauthorizedException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/UnauthorizedException.html +[SyntaxError]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/SyntaxError.html +[AlreadyExistsException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/AlreadyExistsException.html +[TruncateException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/TruncateException.html [query plan]: ../load_balancing/#query-plan [connection pool]: ../pooling/ diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md index 74a83505f1d..44b32016e33 100644 --- a/manual/shaded_jar/README.md +++ b/manual/shaded_jar/README.md @@ -12,7 +12,7 @@ package name: com.datastax.cassandra cassandra-driver-core - 3.7.2 + 3.8.0 shaded @@ -32,7 +32,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-core - 3.7.2 + 3.8.0 shaded @@ -44,7 +44,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-mapping - 3.7.2 + 3.8.0 com.datastax.cassandra @@ -74,5 +74,5 @@ detects that shaded Netty classes are being used: Detected shaded Netty classes in the classpath; native epoll transport will not work properly, defaulting to NIO. -[NettyOptions]:http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/NettyOptions.html +[NettyOptions]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/NettyOptions.html [Netty native transports]:http://netty.io/wiki/native-transports.html diff --git a/manual/socket_options/README.md b/manual/socket_options/README.md index 26e5fdad733..7b342fa75f6 100644 --- a/manual/socket_options/README.md +++ b/manual/socket_options/README.md @@ -117,15 +117,15 @@ To clarify: We might rename `SocketOptions.setReadTimeoutMillis` in a future version to clear up any confusion. -[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SocketOptions.html -[setReadTimeoutMillis]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SocketOptions.html#setReadTimeoutMillis-int- -[setConnectTimeoutMillis]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SocketOptions.html#setConnectTimeoutMillis-int- -[setKeepAlive]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SocketOptions.html#setKeepAlive-boolean- -[setReceiveBufferSize]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SocketOptions.html#setReceiveBufferSize-int- -[setReuseAddress]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SocketOptions.html#setReuseAddress-boolean- -[setSendBufferSize]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SocketOptions.html#setSendBufferSize-int- -[setSoLinger]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SocketOptions.html#setSoLinger-int- -[setTcpNoDelay]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SocketOptions.html#setTcpNoDelay-boolean- -[onReadTimeout]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/RetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- -[onRequestError]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/RetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- -[OperationTimedOutException]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/exceptions/OperationTimedOutException.html \ No newline at end of file +[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html +[setReadTimeoutMillis]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setReadTimeoutMillis-int- +[setConnectTimeoutMillis]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setConnectTimeoutMillis-int- +[setKeepAlive]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setKeepAlive-boolean- +[setReceiveBufferSize]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setReceiveBufferSize-int- +[setReuseAddress]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setReuseAddress-boolean- +[setSendBufferSize]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setSendBufferSize-int- +[setSoLinger]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setSoLinger-int- +[setTcpNoDelay]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setTcpNoDelay-boolean- +[onReadTimeout]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- +[onRequestError]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- +[OperationTimedOutException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/OperationTimedOutException.html \ No newline at end of file diff --git a/manual/speculative_execution/README.md b/manual/speculative_execution/README.md index 157cfae3b6c..5864c0e1bbe 100644 --- a/manual/speculative_execution/README.md +++ b/manual/speculative_execution/README.md @@ -73,7 +73,7 @@ Speculative executions are controlled by an instance of `Cluster`. This policy defines the threshold after which a new speculative execution will be triggered. -[SpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html +[SpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html Two implementations are provided with the driver: @@ -101,7 +101,7 @@ way: * if no response has been received at t0 + 1000 milliseconds, start another speculative execution on a third node. -[ConstantSpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/ConstantSpeculativeExecutionPolicy.html +[ConstantSpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/ConstantSpeculativeExecutionPolicy.html #### [PercentileSpeculativeExecutionPolicy] @@ -160,10 +160,10 @@ Note that `PercentileTracker` may also be used with a slow query logger (see the [Logging](../logging/) section). In that case, you would create a single tracker object and share it with both components. -[PercentileSpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/PercentileSpeculativeExecutionPolicy.html -[PercentileTracker]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PercentileTracker.html -[ClusterWidePercentileTracker]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ClusterWidePercentileTracker.html -[PerHostPercentileTracker]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PerHostPercentileTracker.html +[PercentileSpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/PercentileSpeculativeExecutionPolicy.html +[PercentileTracker]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PercentileTracker.html +[ClusterWidePercentileTracker]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ClusterWidePercentileTracker.html +[PerHostPercentileTracker]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PerHostPercentileTracker.html [hdr]: http://hdrhistogram.github.io/HdrHistogram/ #### Using your own @@ -210,7 +210,7 @@ client driver exec1 exec2 The only impact is that all executions of the same query always share the same query plan, so each host will be used by at most one execution. -[retry_policy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/RetryPolicy.html +[retry_policy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.html ### Tuning and practical details @@ -225,8 +225,8 @@ You can monitor how many speculative executions were triggered with the It should only be a few percents of the total number of requests ([cluster.getMetrics().getRequestsTimer().getCount()][request_metric]). -[se_metric]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Metrics.Errors.html#getSpeculativeExecutions-- -[request_metric]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Metrics.html#getRequestsTimer-- +[se_metric]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metrics.Errors.html#getSpeculativeExecutions-- +[request_metric]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metrics.html#getRequestsTimer-- #### Stream id exhaustion @@ -255,8 +255,8 @@ sustained. If you're unsure of which native protocol version you're using, you can check with [cluster.getConfiguration().getProtocolOptions().getProtocolVersion()][protocol_version]. -[session_state]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Session.State.html -[protocol_version]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- +[session_state]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.State.html +[protocol_version]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- #### Request ordering and client timestamps diff --git a/manual/ssl/README.md b/manual/ssl/README.md index 6cf2b892603..69054b4f147 100644 --- a/manual/ssl/README.md +++ b/manual/ssl/README.md @@ -207,8 +207,8 @@ Cluster cluster = Cluster.builder() .build(); ``` -[RemoteEndpointAwareSSLOptions]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.html -[RemoteEndpointAwareJdkSSLOptions]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html -[newSSLEngine]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html#newSSLEngine-io.netty.channel.socket.SocketChannel-java.net.InetSocketAddress- -[RemoteEndpointAwareNettySSLOptions]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.html -[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/NettyOptions.html +[RemoteEndpointAwareSSLOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.html +[RemoteEndpointAwareJdkSSLOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html +[newSSLEngine]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html#newSSLEngine-io.netty.channel.socket.SocketChannel-java.net.InetSocketAddress- +[RemoteEndpointAwareNettySSLOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.html +[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/NettyOptions.html diff --git a/manual/statements/README.md b/manual/statements/README.md index d06f5f33387..f1e6d194978 100644 --- a/manual/statements/README.md +++ b/manual/statements/README.md @@ -32,11 +32,11 @@ If you use custom policies ([RetryPolicy], [LoadBalancingPolicy], properties that influence statement execution. To achieve this, you can wrap your statements in a custom [StatementWrapper] implementation. -[Statement]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Statement.html -[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/querybuilder/QueryBuilder.html -[StatementWrapper]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/StatementWrapper.html -[RetryPolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/RetryPolicy.html -[LoadBalancingPolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/LoadBalancingPolicy.html -[SpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html -[execute]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- -[executeAsync]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- +[Statement]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Statement.html +[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/querybuilder/QueryBuilder.html +[StatementWrapper]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/StatementWrapper.html +[RetryPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.html +[LoadBalancingPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LoadBalancingPolicy.html +[SpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html +[execute]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- +[executeAsync]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- diff --git a/manual/statements/batch/README.md b/manual/statements/batch/README.md index fd8e50b9f41..e962084e27f 100644 --- a/manual/statements/batch/README.md +++ b/manual/statements/batch/README.md @@ -34,9 +34,9 @@ In addition, simple statements with named parameters are currently not supported due to a [protocol limitation][CASSANDRA-10246] that will be fixed in a future version). If you try to execute such a batch, an `IllegalArgumentException` is thrown. -[BatchStatement]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/BatchStatement.html +[BatchStatement]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/BatchStatement.html [batch_dse]: http://docs.datastax.com/en/dse/5.1/cql/cql/cql_using/useBatch.html -[LOGGED]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/BatchStatement.Type.html#LOGGED -[UNLOGGED]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/BatchStatement.Type.html#UNLOGGED +[LOGGED]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/BatchStatement.Type.html#LOGGED +[UNLOGGED]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/BatchStatement.Type.html#UNLOGGED [batch_size_fail_threshold]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html#configCassandra_yaml__batch_size_fail_threshold_in_kb [CASSANDRA-10246]: https://issues.apache.org/jira/browse/CASSANDRA-10246 diff --git a/manual/statements/built/README.md b/manual/statements/built/README.md index bafc20f3eeb..ed79b5d065d 100644 --- a/manual/statements/built/README.md +++ b/manual/statements/built/README.md @@ -76,7 +76,7 @@ BuiltStatement ttlAndWriteTime = QueryBuilder.select().column("id").column("t") ``` You can also cast the value of the given column to another type by using the `cast` function, -[specifying](https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/querybuilder/QueryBuilder.html#cast-java.lang.Object-com.datastax.driver.core.DataType-) +[specifying](https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/querybuilder/QueryBuilder.html#cast-java.lang.Object-com.datastax.driver.core.DataType-) the column for which it should be performed, and to what type it should be casted. #### Specifying conditions @@ -92,7 +92,7 @@ BuiltStatement selectOne = QueryBuilder.select().from("test", "test") The `where` function accepts the `Clause` object that is generated by calling `QueryBuilder`'s -[functions](https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/querybuilder/QueryBuilder.html#eq-java.lang.Iterable-java.lang.Iterable-), +[functions](https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/querybuilder/QueryBuilder.html#eq-java.lang.Iterable-java.lang.Iterable-), such as, `eq`, `ne`, `lt`, `in`, `contains`, `notNull`, etc. In most cases, these functions receive 2 arguments: the name of the column, and the value to compare, but there are also variants that receive 2 iterables for columns and values correspondingly. @@ -263,6 +263,6 @@ Note: the call to these functions changes the object type from `BuiltStatement` -[QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/querybuilder/QueryBuilder.html -[TableMetadata]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TableMetadata.html -[SchemaBuilder]: https://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/schemabuilder/SchemaBuilder.html +[QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/querybuilder/QueryBuilder.html +[TableMetadata]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TableMetadata.html +[SchemaBuilder]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/schemabuilder/SchemaBuilder.html diff --git a/manual/statements/prepared/README.md b/manual/statements/prepared/README.md index a1556b8c2c1..59a12aeda44 100644 --- a/manual/statements/prepared/README.md +++ b/manual/statements/prepared/README.md @@ -256,11 +256,11 @@ relying on `SELECT *`. This will be addressed in a future release of both Cassandra and the driver. Follow [CASSANDRA-10786] and [JAVA-1196] for more information. -[PreparedStatement]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/PreparedStatement.html -[BoundStatement]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/BoundStatement.html -[setPrepareOnAllHosts]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/QueryOptions.html#setPrepareOnAllHosts-boolean- -[setReprepareOnUp]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/QueryOptions.html#setReprepareOnUp-boolean- -[execute]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- -[executeAsync]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- +[PreparedStatement]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PreparedStatement.html +[BoundStatement]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/BoundStatement.html +[setPrepareOnAllHosts]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/QueryOptions.html#setPrepareOnAllHosts-boolean- +[setReprepareOnUp]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/QueryOptions.html#setReprepareOnUp-boolean- +[execute]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- +[executeAsync]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- [CASSANDRA-10786]: https://issues.apache.org/jira/browse/CASSANDRA-10786 [JAVA-1196]: https://datastax-oss.atlassian.net/browse/JAVA-1196 diff --git a/manual/statements/simple/README.md b/manual/statements/simple/README.md index 386937c1ec2..e021072e6d3 100644 --- a/manual/statements/simple/README.md +++ b/manual/statements/simple/README.md @@ -128,4 +128,4 @@ session.execute( 1, bytes); ``` -[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/SimpleStatement.html +[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SimpleStatement.html diff --git a/manual/tuples/README.md b/manual/tuples/README.md index b524a634100..898b0819c1b 100644 --- a/manual/tuples/README.md +++ b/manual/tuples/README.md @@ -96,7 +96,7 @@ bs.setList("l", Arrays.asList(oneTimeUsageTuple.newValue("1", "1"), oneTimeUsage session.execute(bs); ``` -[TupleType]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TupleType.html -[TupleValue]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TupleValue.html -[newValueVararg]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TupleType.html#newValue-java.lang.Object...- -[newValue]: http://docs.datastax.com/en/drivers/java/3.6/com/datastax/driver/core/TupleType.html#newValue-- +[TupleType]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TupleType.html +[TupleValue]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TupleValue.html +[newValueVararg]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TupleType.html#newValue-java.lang.Object...- +[newValue]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TupleType.html#newValue-- diff --git a/manual/udts/README.md b/manual/udts/README.md index 87090aa5901..5bbb020276e 100644 --- a/manual/udts/README.md +++ b/manual/udts/README.md @@ -95,5 +95,5 @@ session.execute(bs); [cql_doc]: https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlRefUDType.html -[UDTValue]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/UDTValue.html -[UserType]: https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/UserType.html +[UDTValue]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/UDTValue.html +[UserType]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/UserType.html diff --git a/pom.xml b/pom.xml index 6a232407546..472c21e1748 100644 --- a/pom.xml +++ b/pom.xml @@ -641,7 +641,7 @@ - 3.7.1 + 3.7.2 ../clirr-ignores.xml com/datastax/shaded/** From 42d1a7174e39ad4f21d2446823e7e60a27081e84 Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Tue, 29 Oct 2019 15:56:47 -0500 Subject: [PATCH 063/211] [maven-release-plugin] prepare release 3.8.0 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 6e7e2056496..3ae309e124f 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.0-SNAPSHOT + 3.8.0 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 865ee69a530..d6215e148a9 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.0-SNAPSHOT + 3.8.0 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index dd6927b8a1d..c6aa3b780f9 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.0-SNAPSHOT + 3.8.0 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 1c831052efa..b821f0069a2 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.0-SNAPSHOT + 3.8.0 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index c2aadb9c004..b9110ee9c11 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.0-SNAPSHOT + 3.8.0 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 596d132d517..90ee25cf313 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.8.0-SNAPSHOT + 3.8.0 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 16ed5166acf..0f482810e69 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.0-SNAPSHOT + 3.8.0 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 34d518627e7..12c296d5ed5 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.8.0-SNAPSHOT + 3.8.0 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index e86f966347e..92ae51fe81b 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.8.0-SNAPSHOT + 3.8.0 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 1334509b394..6beffaa19eb 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.8.0-SNAPSHOT + 3.8.0 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index a19d51c4e97..b6f50b72466 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.8.0-SNAPSHOT + 3.8.0 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 472c21e1748..06aff436c5f 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.0-SNAPSHOT + 3.8.0 pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.8.0 From c889cab7f8cd8655c8933ba552f934bfefeef1c6 Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Tue, 29 Oct 2019 16:41:38 -0500 Subject: [PATCH 064/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 3ae309e124f..53c0c4e7cee 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.0 + 3.8.1-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index d6215e148a9..42b7a1f1269 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.0 + 3.8.1-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index c6aa3b780f9..a6113c2e6ed 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.0 + 3.8.1-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index b821f0069a2..207c59594bc 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.0 + 3.8.1-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index b9110ee9c11..4e63f03fc18 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.0 + 3.8.1-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 90ee25cf313..39a38540bc3 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.8.0 + 3.8.1-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 0f482810e69..d9174bc31a4 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.0 + 3.8.1-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 12c296d5ed5..9b6d5650d42 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.8.0 + 3.8.1-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 92ae51fe81b..2c5c54bf246 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.8.0 + 3.8.1-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 6beffaa19eb..d3dd8de56ab 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.8.0 + 3.8.1-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index b6f50b72466..74ef598517e 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.8.0 + 3.8.1-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 06aff436c5f..c67ff316083 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.0 + 3.8.1-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.8.0 + HEAD From 9d3f18181e056d5af7ac868e35fc2dbe8786b117 Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Wed, 30 Oct 2019 09:29:40 -0500 Subject: [PATCH 065/211] Fix broken links in 3.8.0 manual --- manual/custom_codecs/extras/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index 07f1378408b..470466ebf4b 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -130,7 +130,7 @@ session.execute("INSERT INTO example (id, t) VALUES (1, ?)", DateTime.parse("2010-06-30T01:20:47.999+01:00")); ``` -[InstantCodec_joda]: http://docs.datastax.com/en/drivers/java/87/com/datastax/driver/extras/codecs/joda/InstantCodec.html +[InstantCodec_joda]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/joda/InstantCodec.html [LocalDateCodec_joda]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/joda/LocalDateCodec.html [LocalTimeCodec_joda]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.html [DateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/joda/DateTimeCodec.html @@ -190,7 +190,7 @@ Note that if you registered an `EnumNameCodec` and an `EnumOrdinalCodec` _for th In practice, this is unlikely to happen, because you'll probably stick to a single CQL type for a given enum type; however, if you ever run into that issue, the workaround is to use [prepared statements](../../statements/prepared/), for which the driver knows the CQL type and can pick the exact codec. -[EnumNameCodec]: http://docs.datastax.com/en/drivers/java/8/com/datastax/driver/extras/codecs/enums/EnumNameCodec.html +[EnumNameCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/enums/EnumNameCodec.html [EnumOrdinalCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.html [name]: https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name-- [ordinal]: https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal-- From 760e4d13fa6676d7f00cf34c369f1ede8571433b Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Wed, 30 Oct 2019 13:44:56 -0500 Subject: [PATCH 066/211] Fix Apollo example in manual --- manual/cloud/README.md | 45 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/manual/cloud/README.md b/manual/cloud/README.md index be7d15920e6..1f5ff307558 100644 --- a/manual/cloud/README.md +++ b/manual/cloud/README.md @@ -1,4 +1,3 @@ - ## Connecting to Apollo (Cloud) Using the DataStax Java Driver to connect to a DataStax Apollo database is almost identical to using @@ -8,6 +7,10 @@ driver is configured in an application and that you will need to obtain a `secur The following is a Quick Start guide to writing a simple application that can connect to an Apollo database. + **Tip**: DataStax recommends using the DataStax Java Driver for Apache Cassandra. You can also + use the DataStax Enterprise (DSE) Java Driver, which exposes the same API for connecting to + Cassandra databases. + ### Prerequisites 1. [Download][Download Maven] and [install][Install Maven] Maven. @@ -41,7 +44,9 @@ database. **Note:** With the `Cluster.builder()` object, make sure to set the path to the secure connect bundle for your Apollo database (**"/path/to/secure-connect-database_name.zip"**) in - the `withCloudSecureConnectBundle()` method as shown in the following example. + the `withCloudSecureConnectBundle()` method as shown in the following example. If converting + from using the open source Cassandra Java Driver to the DSE Java Driver, ensure that you + change `Cluster` to `DseCluster`. * DataStax Java Driver for Apache Cassandra 3.x ```java @@ -78,6 +83,42 @@ database. } } ``` + * DataStax Java Driver for DataStax Enterprise (DSE) 1.x + + ```java + import com.datastax.driver.core.ResultSet; + import com.datastax.driver.core.Row; + import com.datastax.driver.core.Session; + import com.datastax.driver.dse.DseCluster; + import java.io.File; + + public class ConnectDatabase { + + public static void main(String[] args) { + // Create the DseCluster object: + DseCluster cluster = null; + try { + cluster = DseCluster.builder() + // make sure you change the path to the secure connect bundle below + .withCloudSecureConnectBundle(new File("/path/to/secure-connect-database_name.zip")) + .withCredentials("user_name", "password") + .build(); + Session session = cluster.connect(); + // Select the release_version from the system.local table: + ResultSet rs = session.execute("select release_version from system.local"); + Row row = rs.one(); + //Print the results of the CQL query to the console: + if (row != null) { + System.out.println(row.getString("release_version")); + } else { + System.out.println("An error occurred."); + } + } finally { + if (cluster != null) cluster.close(); + } + } + } + ``` c. Save and close the ConnectDatabase.java file. From 03c72cd6dcd1c06b22ea8fa93e693af6d78d8a13 Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Wed, 30 Oct 2019 16:18:19 -0500 Subject: [PATCH 067/211] Fix Apollo example in manual --- manual/cloud/README.md | 44 +----------------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/manual/cloud/README.md b/manual/cloud/README.md index 1f5ff307558..1bcdd4c8de7 100644 --- a/manual/cloud/README.md +++ b/manual/cloud/README.md @@ -7,10 +7,6 @@ driver is configured in an application and that you will need to obtain a `secur The following is a Quick Start guide to writing a simple application that can connect to an Apollo database. - **Tip**: DataStax recommends using the DataStax Java Driver for Apache Cassandra. You can also - use the DataStax Enterprise (DSE) Java Driver, which exposes the same API for connecting to - Cassandra databases. - ### Prerequisites 1. [Download][Download Maven] and [install][Install Maven] Maven. @@ -44,9 +40,7 @@ database. **Note:** With the `Cluster.builder()` object, make sure to set the path to the secure connect bundle for your Apollo database (**"/path/to/secure-connect-database_name.zip"**) in - the `withCloudSecureConnectBundle()` method as shown in the following example. If converting - from using the open source Cassandra Java Driver to the DSE Java Driver, ensure that you - change `Cluster` to `DseCluster`. + the `withCloudSecureConnectBundle()` method as shown in the following example. * DataStax Java Driver for Apache Cassandra 3.x ```java @@ -83,42 +77,6 @@ database. } } ``` - * DataStax Java Driver for DataStax Enterprise (DSE) 1.x - - ```java - import com.datastax.driver.core.ResultSet; - import com.datastax.driver.core.Row; - import com.datastax.driver.core.Session; - import com.datastax.driver.dse.DseCluster; - import java.io.File; - - public class ConnectDatabase { - - public static void main(String[] args) { - // Create the DseCluster object: - DseCluster cluster = null; - try { - cluster = DseCluster.builder() - // make sure you change the path to the secure connect bundle below - .withCloudSecureConnectBundle(new File("/path/to/secure-connect-database_name.zip")) - .withCredentials("user_name", "password") - .build(); - Session session = cluster.connect(); - // Select the release_version from the system.local table: - ResultSet rs = session.execute("select release_version from system.local"); - Row row = rs.one(); - //Print the results of the CQL query to the console: - if (row != null) { - System.out.println(row.getString("release_version")); - } else { - System.out.println("An error occurred."); - } - } finally { - if (cluster != null) cluster.close(); - } - } - } - ``` c. Save and close the ConnectDatabase.java file. From a971b58253faa2119cb869de51dc8d930ed09eed Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Thu, 31 Oct 2019 09:05:09 -0500 Subject: [PATCH 068/211] JAVA-2522: Update Apollo manual section to specify limitations --- manual/cloud/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/manual/cloud/README.md b/manual/cloud/README.md index 1bcdd4c8de7..fdfbf26702b 100644 --- a/manual/cloud/README.md +++ b/manual/cloud/README.md @@ -80,6 +80,22 @@ database. c. Save and close the ConnectDatabase.java file. +### Apollo Differences + +In most circumstances, the client code for interacting with an Apollo cluster will be the same as +interacting with any other Cassandra cluster. The exceptions being: + + * An SSL connection will be established automatically. Manual SSL configuration is not allowed, + and setting SSLOptions will result in an exception (i.e. don't use `withSSL()` or + `withSSL(SSLOptions)` on the Builder) + + * A Cluster’s contact points attribute should not be used. The cloud config contains all of the + necessary contact information (i.e. don't use any of the `addContactPoint()` or + `addContactPoints()` methods on the Builder) + + * If a consistency level is not specified for an execution profile or query, then + `ConsistencyLevel.LOCAL_QUORUM` will be used as the default. + [Download Maven]: https://maven.apache.org/download.cgi [Install Maven]: https://maven.apache.org/install.html [Create an Apollo database - GCP]: https://helpdocs.datastax.com/gcp/dscloud/apollo/dscloudGettingStarted.html#dscloudCreateCluster From 7b1f6a8753de66f59bbf1a0b3b1fe16ece3210a0 Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Thu, 31 Oct 2019 11:30:31 -0500 Subject: [PATCH 069/211] Adjust SSL warning in manual --- manual/cloud/README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/manual/cloud/README.md b/manual/cloud/README.md index fdfbf26702b..e94300c9018 100644 --- a/manual/cloud/README.md +++ b/manual/cloud/README.md @@ -85,9 +85,7 @@ database. In most circumstances, the client code for interacting with an Apollo cluster will be the same as interacting with any other Cassandra cluster. The exceptions being: - * An SSL connection will be established automatically. Manual SSL configuration is not allowed, - and setting SSLOptions will result in an exception (i.e. don't use `withSSL()` or - `withSSL(SSLOptions)` on the Builder) + * An SSL connection will be established automatically. Manual SSL configuration is not necessary. * A Cluster’s contact points attribute should not be used. The cloud config contains all of the necessary contact information (i.e. don't use any of the `addContactPoint()` or From 3c0c068ba6b459f7dce723500331d0bcca74453e Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Mon, 4 Nov 2019 14:23:25 -0600 Subject: [PATCH 070/211] JAVA-2518: Reduce nightly build matrix --- build.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build.yaml b/build.yaml index ff82e80b49c..7e15bd3e98a 100644 --- a/build.yaml +++ b/build.yaml @@ -21,6 +21,16 @@ schedules: nightly: # Run full suite nightly on change for all primary branches if they have changes. schedule: nightly + matrix: + exclude: + # exclude builds for newer Cassandra versions and older JDKs + - java: openjdk6 + cassandra: ['2.2', '3.0', '3.11'] + - java: openjdk7 + cassandra: ['2.1', '3.0', '3.11'] + # exclude builds for older Cassandra versions and newer JDKs + - java: openjdk11 + cassandra: ['2.1', '2.2'] branches: # regex matches primary branch format (2.1, 3.x, 3.0.x, 3.1.x, etc). include: ["/\\d+(\\.[\\dx]+)+/"] From c6de8beb51a5e43edb67cc03b9e83218dde06107 Mon Sep 17 00:00:00 2001 From: Greg Bestland Date: Wed, 8 Jan 2020 14:14:25 -0600 Subject: [PATCH 071/211] JAVA-2544: Document incompatibility of Cloud API with Java 6 and 7 (#1375) --- manual/cloud/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manual/cloud/README.md b/manual/cloud/README.md index e94300c9018..5b9268643a2 100644 --- a/manual/cloud/README.md +++ b/manual/cloud/README.md @@ -10,14 +10,15 @@ database. ### Prerequisites 1. [Download][Download Maven] and [install][Install Maven] Maven. -1. Create an Apollo database on [GCP][Create an Apollo database - GCP] or +1. Create an Apollo database on [GCP][Create an Apollo database - GCP] or [AWS][Create an Apollo database - AWS]; alternatively, have a team member provide access to their Apollo database (instructions for [GCP][Access an Apollo database - GCP] and [AWS][Access an Apollo database - AWS]) to obtain database connection details. -1. Download the secure connect bundle (instructions for +1. Download the secure connect bundle (instructions for [GCP][Download the secure connect bundle - GCP] and [AWS][Download the secure connect bundle - AWS]) to obtain connection credentials for your database. +1. Ensure you are using Java 8 or higher. The cloud connect api does not support java 6 or 7. ### Procedure From 5d6c974dd0ea0115e3abb569e818a15fd4ace848 Mon Sep 17 00:00:00 2001 From: olim7t Date: Tue, 14 Jan 2020 09:38:51 -0800 Subject: [PATCH 072/211] Add note to changelog about replicating to 4.x --- changelog/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog/README.md b/changelog/README.md index 375f10ab035..a69db96e110 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -1,5 +1,9 @@ ## Changelog + ## 3.8.0 From c510543ee1e85327c52abeacb1a061b2751c4f85 Mon Sep 17 00:00:00 2001 From: Ted Petersson Date: Fri, 24 Jan 2020 11:16:41 +0100 Subject: [PATCH 073/211] JAVA-2627: Avoid logging error message including stack trace in request handler Avoid logging error messages inluding stack trace from within SpeculativeExecution, when the request "continues" by querying the next host. Logging level is changed to WARNING and the stack trace is removed. The stack trace is logged in the debug message instead. --- changelog/README.md | 5 +++++ .../java/com/datastax/driver/core/RequestHandler.java | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index a69db96e110..f8499f41f92 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,6 +5,11 @@ 3.x versions get published. --> +## 3.9.0 (in progress) + +- [bug] JAVA-2627: Avoid logging error message including stack trace in request handler. + + ## 3.8.0 - [new feature] JAVA-2356: Support for DataStax Cloud API. diff --git a/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java b/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java index a6d93770913..3731b0949cd 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java +++ b/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java @@ -427,7 +427,10 @@ public void onSuccess(Connection connection) { findNextHostAndQuery(); } catch (RuntimeException e) { if (connection != null) connection.release(); - logger.error("Unexpected error while querying " + host.getEndPoint(), e); + logger.warn( + "Unexpected error while querying {} - [{}]. Find next host to query.", + host.getEndPoint(), + e.toString()); logError(host.getEndPoint(), e); findNextHostAndQuery(); } @@ -438,7 +441,10 @@ public void onFailure(Throwable t) { if (t instanceof BusyPoolException) { logError(host.getEndPoint(), t); } else { - logger.error("Unexpected error while querying " + host.getEndPoint(), t); + logger.warn( + "Unexpected error while querying {} - [{}]. Find next host to query.", + host.getEndPoint(), + t.toString()); logError(host.getEndPoint(), t); } findNextHostAndQuery(); From c69b5ddaa4eb4ec597a0f53a2ecc5f4d5b174507 Mon Sep 17 00:00:00 2001 From: olim7t Date: Mon, 6 Apr 2020 10:36:40 -0700 Subject: [PATCH 074/211] JAVA-2706: Add now_in_seconds to protocol v5 query messages --- changelog/README.md | 1 + .../com/datastax/driver/core/Requests.java | 67 +++++++++++++----- .../datastax/driver/core/SessionManager.java | 15 +++- .../com/datastax/driver/core/Statement.java | 18 +++++ .../driver/core/StatementWrapper.java | 11 +++ .../driver/core/NowInSecondsTest.java | 69 +++++++++++++++++++ 6 files changed, 160 insertions(+), 21 deletions(-) create mode 100644 driver-core/src/test/java/com/datastax/driver/core/NowInSecondsTest.java diff --git a/changelog/README.md b/changelog/README.md index f8499f41f92..8bb056be2bd 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -8,6 +8,7 @@ ## 3.9.0 (in progress) - [bug] JAVA-2627: Avoid logging error message including stack trace in request handler. +- [new feature] JAVA-2706: Add now_in_seconds to protocol v5 query messages. ## 3.8.0 diff --git a/driver-core/src/main/java/com/datastax/driver/core/Requests.java b/driver-core/src/main/java/com/datastax/driver/core/Requests.java index df16bf8d425..3cd15773eb8 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Requests.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Requests.java @@ -19,7 +19,11 @@ import com.google.common.collect.ImmutableMap; import io.netty.buffer.ByteBuf; import java.nio.ByteBuffer; -import java.util.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; class Requests { @@ -250,27 +254,33 @@ public String toString() { } enum QueryFlag { - // The order of that enum matters!! - VALUES, - SKIP_METADATA, - PAGE_SIZE, - PAGING_STATE, - SERIAL_CONSISTENCY, - DEFAULT_TIMESTAMP, - VALUE_NAMES; + VALUES(0x00000001), + SKIP_METADATA(0x00000002), + PAGE_SIZE(0x00000004), + PAGING_STATE(0x00000008), + SERIAL_CONSISTENCY(0x00000010), + DEFAULT_TIMESTAMP(0x00000020), + VALUE_NAMES(0x00000040), + NOW_IN_SECONDS(0x00000100), + ; + + private int mask; + + QueryFlag(int mask) { + this.mask = mask; + } static EnumSet deserialize(int flags) { EnumSet set = EnumSet.noneOf(QueryFlag.class); - QueryFlag[] values = QueryFlag.values(); - for (int n = 0; n < values.length; n++) { - if ((flags & (1 << n)) != 0) set.add(values[n]); + for (QueryFlag flag : values()) { + if ((flags & flag.mask) != 0) set.add(flag); } return set; } static void serialize(EnumSet flags, ByteBuf dest, ProtocolVersion version) { int i = 0; - for (QueryFlag flag : flags) i |= 1 << flag.ordinal(); + for (QueryFlag flag : flags) i |= flag.mask; if (version.compareTo(ProtocolVersion.V5) >= 0) { dest.writeInt(i); } else { @@ -295,7 +305,8 @@ static class QueryProtocolOptions { -1, null, ConsistencyLevel.SERIAL, - Long.MIN_VALUE); + Long.MIN_VALUE, + Integer.MIN_VALUE); private final EnumSet flags = EnumSet.noneOf(QueryFlag.class); private final Message.Request.Type requestType; @@ -307,6 +318,7 @@ static class QueryProtocolOptions { final ByteBuffer pagingState; final ConsistencyLevel serialConsistency; final long defaultTimestamp; + final int nowInSeconds; QueryProtocolOptions( Message.Request.Type requestType, @@ -317,7 +329,8 @@ static class QueryProtocolOptions { int pageSize, ByteBuffer pagingState, ConsistencyLevel serialConsistency, - long defaultTimestamp) { + long defaultTimestamp, + int nowInSeconds) { Preconditions.checkArgument(positionalValues.length == 0 || namedValues.isEmpty()); @@ -330,6 +343,7 @@ static class QueryProtocolOptions { this.pagingState = pagingState; this.serialConsistency = serialConsistency; this.defaultTimestamp = defaultTimestamp; + this.nowInSeconds = nowInSeconds; // Populate flags if (positionalValues.length > 0) { @@ -344,6 +358,7 @@ static class QueryProtocolOptions { if (pagingState != null) flags.add(QueryFlag.PAGING_STATE); if (serialConsistency != ConsistencyLevel.SERIAL) flags.add(QueryFlag.SERIAL_CONSISTENCY); if (defaultTimestamp != Long.MIN_VALUE) flags.add(QueryFlag.DEFAULT_TIMESTAMP); + if (nowInSeconds != Integer.MIN_VALUE) flags.add(QueryFlag.NOW_IN_SECONDS); } QueryProtocolOptions copy(ConsistencyLevel newConsistencyLevel) { @@ -356,7 +371,8 @@ QueryProtocolOptions copy(ConsistencyLevel newConsistencyLevel) { pageSize, pagingState, serialConsistency, - defaultTimestamp); + defaultTimestamp, + nowInSeconds); } void encode(ByteBuf dest, ProtocolVersion version) { @@ -388,6 +404,8 @@ void encode(ByteBuf dest, ProtocolVersion version) { CBUtil.writeConsistencyLevel(serialConsistency, dest); if (version.compareTo(ProtocolVersion.V3) >= 0 && flags.contains(QueryFlag.DEFAULT_TIMESTAMP)) dest.writeLong(defaultTimestamp); + if (version.compareTo(ProtocolVersion.V5) >= 0 + && flags.contains(QueryFlag.NOW_IN_SECONDS)) dest.writeInt(nowInSeconds); break; default: throw version.unsupported(); @@ -424,6 +442,8 @@ int encodedSize(ProtocolVersion version) { size += CBUtil.sizeOfConsistencyLevel(serialConsistency); if (version.compareTo(ProtocolVersion.V3) >= 0 && flags.contains(QueryFlag.DEFAULT_TIMESTAMP)) size += 8; + if (version.compareTo(ProtocolVersion.V5) >= 0 + && flags.contains(QueryFlag.NOW_IN_SECONDS)) size += 4; return size; default: throw version.unsupported(); @@ -546,19 +566,26 @@ static class BatchProtocolOptions { final ConsistencyLevel consistency; final ConsistencyLevel serialConsistency; final long defaultTimestamp; + final int nowInSeconds; BatchProtocolOptions( - ConsistencyLevel consistency, ConsistencyLevel serialConsistency, long defaultTimestamp) { + ConsistencyLevel consistency, + ConsistencyLevel serialConsistency, + long defaultTimestamp, + int nowInSeconds) { this.consistency = consistency; this.serialConsistency = serialConsistency; this.defaultTimestamp = defaultTimestamp; + this.nowInSeconds = nowInSeconds; if (serialConsistency != ConsistencyLevel.SERIAL) flags.add(QueryFlag.SERIAL_CONSISTENCY); if (defaultTimestamp != Long.MIN_VALUE) flags.add(QueryFlag.DEFAULT_TIMESTAMP); + if (nowInSeconds != Integer.MIN_VALUE) flags.add(QueryFlag.NOW_IN_SECONDS); } BatchProtocolOptions copy(ConsistencyLevel newConsistencyLevel) { - return new BatchProtocolOptions(newConsistencyLevel, serialConsistency, defaultTimestamp); + return new BatchProtocolOptions( + newConsistencyLevel, serialConsistency, defaultTimestamp, nowInSeconds); } void encode(ByteBuf dest, ProtocolVersion version) { @@ -574,6 +601,8 @@ void encode(ByteBuf dest, ProtocolVersion version) { if (flags.contains(QueryFlag.SERIAL_CONSISTENCY)) CBUtil.writeConsistencyLevel(serialConsistency, dest); if (flags.contains(QueryFlag.DEFAULT_TIMESTAMP)) dest.writeLong(defaultTimestamp); + if (version.compareTo(ProtocolVersion.V5) >= 0 + && flags.contains(QueryFlag.NOW_IN_SECONDS)) dest.writeInt(nowInSeconds); break; default: throw version.unsupported(); @@ -593,6 +622,8 @@ int encodedSize(ProtocolVersion version) { if (flags.contains(QueryFlag.SERIAL_CONSISTENCY)) size += CBUtil.sizeOfConsistencyLevel(serialConsistency); if (flags.contains(QueryFlag.DEFAULT_TIMESTAMP)) size += 8; + if (version.compareTo(ProtocolVersion.V5) >= 0 + && flags.contains(QueryFlag.NOW_IN_SECONDS)) size += 4; return size; default: throw version.unsupported(); diff --git a/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java b/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java index 0e1ebe98607..c096d3232e5 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java +++ b/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java @@ -580,6 +580,12 @@ else if (fetchSize != Integer.MAX_VALUE) usedPagingState = statement.getPagingState(); } + int nowInSeconds = statement.getNowInSeconds(); + if (nowInSeconds != Integer.MIN_VALUE && protocolVersion.compareTo(ProtocolVersion.V5) < 0) { + throw new UnsupportedFeatureException( + protocolVersion, "Now in seconds is only supported since native protocol V5"); + } + if (statement instanceof StatementWrapper) statement = ((StatementWrapper) statement).getWrappedStatement(); @@ -623,7 +629,8 @@ else if (fetchSize != Integer.MAX_VALUE) fetchSize, usedPagingState, serialConsistency, - defaultTimestamp); + defaultTimestamp, + nowInSeconds); request = new Requests.Query(qString, options, statement.isTracing()); } else if (statement instanceof BoundStatement) { BoundStatement bs = (BoundStatement) statement; @@ -652,7 +659,8 @@ else if (fetchSize != Integer.MAX_VALUE) fetchSize, usedPagingState, serialConsistency, - defaultTimestamp); + defaultTimestamp, + nowInSeconds); request = new Requests.Execute( bs.statement.getPreparedId().boundValuesMetadata.id, @@ -671,7 +679,8 @@ else if (fetchSize != Integer.MAX_VALUE) if (protocolVersion.compareTo(ProtocolVersion.V4) < 0) bs.ensureAllSet(); BatchStatement.IdAndValues idAndVals = bs.getIdAndValues(protocolVersion, codecRegistry); Requests.BatchProtocolOptions options = - new Requests.BatchProtocolOptions(consistency, serialConsistency, defaultTimestamp); + new Requests.BatchProtocolOptions( + consistency, serialConsistency, defaultTimestamp, nowInSeconds); request = new Requests.Batch( bs.batchType, idAndVals.ids, idAndVals.values, options, statement.isTracing()); diff --git a/driver-core/src/main/java/com/datastax/driver/core/Statement.java b/driver-core/src/main/java/com/datastax/driver/core/Statement.java index 56ffdcbc1bf..48f98cf5c94 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Statement.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Statement.java @@ -74,6 +74,7 @@ public ConsistencyLevel getConsistencyLevel() { protected volatile Boolean idempotent; private volatile Map outgoingPayload; private volatile Host host; + private volatile int nowInSeconds = Integer.MIN_VALUE; // We don't want to expose the constructor, because the code relies on this being only sub-classed // by RegularStatement, BoundStatement and BatchStatement @@ -648,4 +649,21 @@ public Statement setHost(Host host) { this.host = host; return this; } + + /** + * @return a custom "now in seconds" to use when applying the request (for testing purposes). + * {@link Integer#MIN_VALUE} means "no value". + */ + public int getNowInSeconds() { + return nowInSeconds; + } + + /** + * Sets the "now in seconds" to use when applying the request (for testing purposes). {@link + * Integer#MIN_VALUE} means "no value". + */ + public Statement setNowInSeconds(int nowInSeconds) { + this.nowInSeconds = nowInSeconds; + return this; + } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/StatementWrapper.java b/driver-core/src/main/java/com/datastax/driver/core/StatementWrapper.java index 89903f97c5c..06bc5e86336 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/StatementWrapper.java +++ b/driver-core/src/main/java/com/datastax/driver/core/StatementWrapper.java @@ -233,4 +233,15 @@ public Statement setHost(Host host) { wrapped.setHost(host); return this; } + + @Override + public int getNowInSeconds() { + return wrapped.getNowInSeconds(); + } + + @Override + public Statement setNowInSeconds(int nowInSeconds) { + wrapped.setNowInSeconds(nowInSeconds); + return this; + } } diff --git a/driver-core/src/test/java/com/datastax/driver/core/NowInSecondsTest.java b/driver-core/src/test/java/com/datastax/driver/core/NowInSecondsTest.java new file mode 100644 index 00000000000..3bbee412b33 --- /dev/null +++ b/driver-core/src/test/java/com/datastax/driver/core/NowInSecondsTest.java @@ -0,0 +1,69 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.datastax.driver.core.utils.CassandraVersion; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +@CassandraVersion("4.0") +public class NowInSecondsTest extends CCMTestsSupport { + + private static final String WRITE_QUERY = "INSERT INTO test (k,v) VALUES (1,1) USING TTL 20"; + private static final Statement READ_STATEMENT = + new SimpleStatement("SELECT TTL(v) FROM test WHERE k = 1"); + + @Override + public Cluster.Builder createClusterBuilder() { + return super.createClusterBuilder().allowBetaProtocolVersion(); + } + + @BeforeMethod(groups = "short") + public void setup() { + execute("DROP TABLE IF EXISTS test", "CREATE TABLE test(k int PRIMARY KEY, v int)"); + } + + @Test(groups = "short") + public void should_use_now_in_seconds_with_simple_statement() { + should_use_now_in_seconds(new SimpleStatement(WRITE_QUERY)); + } + + @Test(groups = "short") + public void should_use_now_in_seconds_with_bound_statement() { + PreparedStatement preparedStatement = session().prepare(WRITE_QUERY); + should_use_now_in_seconds(preparedStatement.bind()); + } + + @Test(groups = "short") + public void should_use_now_in_seconds_with_batch_statement() { + should_use_now_in_seconds( + new BatchStatement(BatchStatement.Type.LOGGED).add(new SimpleStatement(WRITE_QUERY))); + } + + private void should_use_now_in_seconds(Statement writeStatement) { + // When + // insert at t = 0 with TTL 20 + session().execute(writeStatement.setNowInSeconds(0)); + // read TTL at t = 10 + ResultSet rs = session().execute(READ_STATEMENT.setNowInSeconds(10)); + int remainingTtl = rs.one().getInt(0); + + // Then + assertThat(remainingTtl).isEqualTo(10); + } +} From 18abff3305bdfe39123a6f69b5467b967198be8c Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Wed, 1 Apr 2020 11:24:57 -0500 Subject: [PATCH 075/211] JAVA-2717: Migrate from Job Creator to Jenkins Pipelines --- Jenkinsfile | 545 ++++++++++++++++++++++++++++++++++++++++++++++++++++ build.yaml | 106 ---------- 2 files changed, 545 insertions(+), 106 deletions(-) create mode 100644 Jenkinsfile delete mode 100644 build.yaml diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000000..0a721b5b00f --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,545 @@ +#!groovy + +def initializeEnvironment() { + env.DRIVER_DISPLAY_NAME = 'CassandraⓇ Java Driver 3.x' + env.DRIVER_METRIC_TYPE = 'oss' + if (env.GIT_URL.contains('riptano/java-driver')) { + env.DRIVER_DISPLAY_NAME = 'private ' + env.DRIVER_DISPLAY_NAME + env.DRIVER_METRIC_TYPE = 'oss-private' + } else if (env.GIT_URL.contains('java-dse-driver')) { + env.DRIVER_DISPLAY_NAME = 'DSE Java Driver 1.x' + env.DRIVER_METRIC_TYPE = 'dse' + } + + env.GIT_SHA = "${env.GIT_COMMIT.take(7)}" + env.GITHUB_PROJECT_URL = "https://${GIT_URL.replaceFirst(/(git@|http:\/\/|https:\/\/)/, '').replace(':', '/').replace('.git', '')}" + env.GITHUB_BRANCH_URL = "${GITHUB_PROJECT_URL}/tree/${env.BRANCH_NAME}" + env.GITHUB_COMMIT_URL = "${GITHUB_PROJECT_URL}/commit/${env.GIT_COMMIT}" + + env.MAVEN_HOME = "${env.HOME}/.mvn/apache-maven-3.2.5" + env.PATH = "${env.MAVEN_HOME}/bin:${env.PATH}" + env.JAVA_HOME = sh(label: 'Get JAVA_HOME',script: '''#!/bin/bash -le + . ${JABBA_SHELL} + jabba which ${JABBA_VERSION}''', returnStdout: true).trim() + env.JAVA8_HOME = sh(label: 'Get JAVA8_HOME',script: '''#!/bin/bash -le + . ${JABBA_SHELL} + jabba which 1.8''', returnStdout: true).trim() + + sh label: 'Download Apache CassandraⓇ',script: '''#!/bin/bash -le + . ${JABBA_SHELL} + jabba use ${JABBA_VERSION} + . ${CCM_ENVIRONMENT_SHELL} ${SERVER_VERSION} + ''' + + sh label: 'Display Java and environment information',script: '''#!/bin/bash -le + # Load CCM environment variables + set -o allexport + . ${HOME}/environment.txt + set +o allexport + + . ${JABBA_SHELL} + jabba use ${JABBA_VERSION} + + java -version + mvn -v + printenv | sort + ''' +} + +def buildDriver(jabbaVersion) { + withEnv(["BUILD_JABBA_VERSION=${jabbaVersion}"]) { + sh label: 'Build driver', script: '''#!/bin/bash -le + . ${JABBA_SHELL} + jabba use ${BUILD_JABBA_VERSION} + + mvn -B -V install -DskipTests + ''' + } +} + +def executeTests() { + sh label: 'Execute tests', script: '''#!/bin/bash -le + # Load CCM environment variables + set -o allexport + . ${HOME}/environment.txt + set +o allexport + + . ${JABBA_SHELL} + jabba use ${JABBA_VERSION} + + printenv | sort + + mvn -B -V verify \ + -fail-never -P${TEST_PROFILE} \ + -Dcom.datastax.driver.TEST_BASE_NODE_WAIT=120 \ + -Dcom.datastax.driver.NEW_NODE_DELAY_SECONDS=100 \ + -Dcassandra.version=${CCM_CASSANDRA_VERSION} \ + -Dccm.java.home=${CCM_JAVA_HOME} \ + -Dccm.path=${CCM_JAVA_HOME}/bin \ + -Dccm.maxNumberOfNodes=3 \ + -DfailIfNoTests=false \ + -Dmaven.test.failure.ignore=true \ + -Dmaven.javadoc.skip=true \ + -Dproxy.path=${HOME}/proxy + + # run isolated tests + mvn -B -V verify \ + -fail-never -Pisolated \ + -Dcom.datastax.driver.TEST_BASE_NODE_WAIT=120 \ + -Dcom.datastax.driver.NEW_NODE_DELAY_SECONDS=100 \ + -Dcassandra.version=${CCM_CASSANDRA_VERSION} \ + -Dccm.java.home=${CCM_JAVA_HOME} \ + -Dccm.path=${CCM_JAVA_HOME}/bin \ + -Dccm.maxNumberOfNodes=3 \ + -DfailIfNoTests=false \ + -Dmaven.test.failure.ignore=true \ + -Dmaven.javadoc.skip=true + ''' +} + +def executeCodeCoverage() { + jacoco( + execPattern: '**/target/jacoco.exec', + classPattern: '**/classes', + sourcePattern: '**/src/main/java' + ) +} + +def notifySlack(status = 'started') { + // Notify Slack channel for every build except adhoc executions + if (params.ADHOC_BUILD_TYPE != 'BUILD-AND-EXECUTE-TESTS') { + // Set the global pipeline scoped environment (this is above each matrix) + env.BUILD_STATED_SLACK_NOTIFIED = 'true' + + def buildType = 'Commit' + if (params.CI_SCHEDULE != 'DO-NOT-CHANGE-THIS-SELECTION') { + buildType = "${params.CI_SCHEDULE.toLowerCase().capitalize()}" + } + + def color = 'good' // Green + if (status.equalsIgnoreCase('aborted')) { + color = '808080' // Grey + } else if (status.equalsIgnoreCase('unstable')) { + color = 'warning' // Orange + } else if (status.equalsIgnoreCase('failed')) { + color = 'danger' // Red + } + + def message = """Build ${status} for ${env.DRIVER_DISPLAY_NAME} [${buildType}] +<${env.GITHUB_BRANCH_URL}|${env.BRANCH_NAME}> - <${env.RUN_DISPLAY_URL}|#${env.BUILD_NUMBER}> - <${env.GITHUB_COMMIT_URL}|${env.GIT_SHA}>""" + if (!status.equalsIgnoreCase('Started')) { + message += """ +${status} after ${currentBuild.durationString - ' and counting'}""" + } + + slackSend color: "${color}", + channel: "#java-driver-dev-bots", + message: "${message}" + } +} + +def submitCIMetrics(buildType) { + long durationMs = currentBuild.duration + long durationSec = durationMs / 1000 + long nowSec = (currentBuild.startTimeInMillis + durationMs) / 1000 + def branchNameNoPeriods = env.BRANCH_NAME.replaceAll('\\.', '_') + def durationMetric = "okr.ci.java.${env.DRIVER_METRIC_TYPE}.${buildType}.${branchNameNoPeriods} ${durationSec} ${nowSec}" + + timeout(time: 1, unit: 'MINUTES') { + withCredentials([string(credentialsId: 'lab-grafana-address', variable: 'LAB_GRAFANA_ADDRESS'), + string(credentialsId: 'lab-grafana-port', variable: 'LAB_GRAFANA_PORT')]) { + withEnv(["DURATION_METRIC=${durationMetric}"]) { + sh label: 'Send runtime metrics to labgrafana', script: '''#!/bin/bash -le + echo "${DURATION_METRIC}" | nc -q 5 ${LAB_GRAFANA_ADDRESS} ${LAB_GRAFANA_PORT} + ''' + } + } + } +} + +def describePerCommitStage() { + script { + currentBuild.displayName = "Per-Commit build" + currentBuild.description = 'Per-Commit build and testing of development Apache CassandraⓇ against Oracle JDK 8' + } +} + +def describeAdhocAndScheduledTestingStage() { + script { + if (params.CI_SCHEDULE == 'DO-NOT-CHANGE-THIS-SELECTION') { + // Ad-hoc build + currentBuild.displayName = "Adhoc testing" + currentBuild.description = "Testing ${params.ADHOC_BUILD_AND_EXECUTE_TESTS_SERVER_VERSION} against JDK version ${params.ADHOC_BUILD_AND_EXECUTE_TESTS_JABBA_VERSION}" + } else { + // Scheduled build + currentBuild.displayName = "${params.CI_SCHEDULE.toLowerCase().replaceAll('_', ' ').capitalize()} schedule" + currentBuild.description = "Testing server versions [${params.CI_SCHEDULE_SERVER_VERSIONS}] against JDK version ${params.CI_SCHEDULE_JABBA_VERSION}" + } + } +} + +// branch pattern for cron +// should match 3.x, 4.x, 4.5.x, etc +def branchPatternCron = ~"((\\d+(\\.[\\dx]+)+))" + +pipeline { + agent none + + // Global pipeline timeout + options { + timeout(time: 10, unit: 'HOURS') + buildDiscarder(logRotator(artifactNumToKeepStr: '10', // Keep only the last 10 artifacts + numToKeepStr: '50')) // Keep only the last 50 build records + } + + parameters { + choice( + name: 'ADHOC_BUILD_TYPE', + choices: ['BUILD', 'BUILD-AND-EXECUTE-TESTS'], + description: '''

    Perform a adhoc build operation

    + + + + + + + + + + + + + + + +
    ChoiceDescription
    BUILDPerforms a Per-Commit build
    BUILD-AND-EXECUTE-TESTSPerforms a build and executes the integration and unit tests
    ''') + 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Ⓡ + 'ALL'], + description: '''Apache Cassandra® server version to use for adhoc BUILD-AND-EXECUTE-TESTS builds + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ChoiceDescription
    2.1Apache Cassandra® v2.1.x
    2.2Apache Cassandra® v2.2.x
    3.0Apache Cassandra® v3.0.x
    3.11Apache Cassandra® v3.11.x
    4.0Apache Cassandra® v4.x (CURRENTLY UNDER DEVELOPMENT)
    ''') + 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 + description: '''JDK version to use for TESTING when running adhoc BUILD-AND-EXECUTE-TESTS builds. All builds will use JDK8 for building the driver + + + + + + + + + + + + + + + + + + + + + + + +
    ChoiceDescription
    zulu@1.6Zulu JDK version 1.6
    zulu@1.7Zulu JDK version 1.7
    1.8Oracle JDK version 1.8 (Used for compiling regardless of choice)
    openjdk@1.11OpenJDK version 11
    ''') + choice( + name: 'ADHOC_BUILD_AND_EXECUTE_TESTS_TEST_PROFILE', + choices: ['short', 'long'], + description: 'Test profile to execute during test phase of the build') + choice( + name: 'CI_SCHEDULE', + choices: ['DO-NOT-CHANGE-THIS-SELECTION', 'WEEKNIGHTS', 'WEEKENDS', 'MONTHLY'], + description: 'CI testing schedule to execute periodically scheduled builds and tests of the driver (DO NOT CHANGE THIS SELECTION)') + string( + name: 'CI_SCHEDULE_SERVER_VERSIONS', + defaultValue: 'DO-NOT-CHANGE-THIS-SELECTION', + description: 'CI testing server version(s) to utilize for scheduled test runs of the driver (DO NOT CHANGE THIS SELECTION)') + string( + name: 'CI_SCHEDULE_JABBA_VERSION', + defaultValue: 'DO-NOT-CHANGE-THIS-SELECTION', + description: 'CI testing JDK version(s) to utilize for scheduled test runs of the driver (DO NOT CHANGE THIS SELECTION)') + string( + name: 'CI_SCHEDULE_TEST_PROFILE', + defaultValue: 'DO-NOT-CHANGE-THIS-SELECTION', + description: 'CI testing profile to execute (DO NOT CHANGE THIS SELECTION)') + } + + triggers { + // schedules only run against release branches (i.e. 3.x, 4.x, 4.5.x, etc.) + parameterizedCron(branchPatternCron.matcher(env.BRANCH_NAME).matches() ? """ + # Every weeknight (Monday - Friday) around 3:00 AM + ### JDK8 tests against 2.1, 3.0, 3.11 and 4.0 + H 3 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=2.1 3.0 3.11 4.0;CI_SCHEDULE_JABBA_VERSION=1.8;CI_SCHEDULE_TEST_PROFILE=long + # Every weekend (Sunday) around 2:00 PM + ### JDK11 tests against 2.1, 3.0, 3.11 and 4.0 + H 14 * * 0 %CI_SCHEDULE=WEEKENDS;CI_SCHEDULE_SERVER_VERSIONS=2.1 3.0 3.11 4.0;CI_SCHEDULE_JABBA_VERSION=openjdk@1.11;CI_SCHEDULE_TEST_PROFILE=long + """ : "") + } + + environment { + OS_VERSION = 'ubuntu/bionic64/java-driver' + JABBA_SHELL = '/usr/lib/jabba/jabba.sh' + CCM_ENVIRONMENT_SHELL = '/usr/local/bin/ccm_environment.sh' + } + + stages { + stage ('Per-Commit') { + options { + timeout(time: 2, unit: 'HOURS') + } + when { + beforeAgent true + allOf { + expression { params.ADHOC_BUILD_TYPE == 'BUILD' } + expression { params.CI_SCHEDULE == 'DO-NOT-CHANGE-THIS-SELECTION' } + expression { params.CI_SCHEDULE_SERVER_VERSIONS == 'DO-NOT-CHANGE-THIS-SELECTION' } + expression { params.CI_SCHEDULE_JABBA_VERSION == 'DO-NOT-CHANGE-THIS-SELECTION' } + expression { params.CI_SCHEDULE_TEST_PROFILE == 'DO-NOT-CHANGE-THIS-SELECTION' } + not { buildingTag() } + } + } + + matrix { + axes { + axis { + name 'SERVER_VERSION' + values '3.11', // Current Apache CassandraⓇ + '4.0' // Development Apache CassandraⓇ + } + } + + agent { + label "${OS_VERSION}" + } + environment { + // Per-commit builds are only going to run against JDK8 + JABBA_VERSION = '1.8' + TEST_PROFILE = 'short' + } + + stages { + stage('Initialize-Environment') { + steps { + initializeEnvironment() + script { + if (env.BUILD_STATED_SLACK_NOTIFIED != 'true') { + notifySlack() + } + } + } + } + stage('Describe-Build') { + steps { + describePerCommitStage() + } + } + stage('Build-Driver') { + steps { + buildDriver(env.JABBA_VERSION) + } + } + stage('Execute-Tests') { + steps { + catchError { + // Use the matrix JDK for testing + executeTests() + } + } + post { + always { + /* + * Empty results are possible + * + * - Build failures during mvn verify may exist so report may not be available + */ + junit testResults: '**/target/surefire-reports/TEST-*.xml', allowEmptyResults: true + junit testResults: '**/target/failsafe-reports/TEST-*.xml', allowEmptyResults: true + } + } + } + stage('Execute-Code-Coverage') { + // Ensure the code coverage is run only once per-commit + when { environment name: 'SERVER_VERSION', value: '4.0' } + steps { + executeCodeCoverage() + } + } + } + } + post { + always { + node('master') { + submitCIMetrics('commit') + } + } + aborted { + notifySlack('aborted') + } + success { + notifySlack('completed') + } + unstable { + notifySlack('unstable') + } + failure { + notifySlack('FAILED') + } + } + } + + stage('Adhoc-And-Scheduled-Testing') { + when { + beforeAgent true + allOf { + expression { (params.ADHOC_BUILD_TYPE == 'BUILD' && params.CI_SCHEDULE != 'DO-NOT-CHANGE-THIS-SELECTION') || + params.ADHOC_BUILD_TYPE == 'BUILD-AND-EXECUTE-TESTS' } + not { buildingTag() } + anyOf { + expression { params.ADHOC_BUILD_TYPE == 'BUILD-AND-EXECUTE-TESTS' } + allOf { + expression { params.ADHOC_BUILD_TYPE == 'BUILD' } + expression { params.CI_SCHEDULE != 'DO-NOT-CHANGE-THIS-SELECTION' } + expression { params.CI_SCHEDULE_SERVER_VERSIONS != 'DO-NOT-CHANGE-THIS-SELECTION' } + } + } + } + } + + environment { + SERVER_VERSIONS = "${params.CI_SCHEDULE_SERVER_VERSIONS == 'DO-NOT-CHANGE-THIS-SELECTION' ? params.ADHOC_BUILD_AND_EXECUTE_TESTS_SERVER_VERSION : params.CI_SCHEDULE_SERVER_VERSIONS}" + JABBA_VERSION = "${params.CI_SCHEDULE_JABBA_VERSION == 'DO-NOT-CHANGE-THIS-SELECTION' ? params.ADHOC_BUILD_AND_EXECUTE_TESTS_JABBA_VERSION : params.CI_SCHEDULE_JABBA_VERSION}" + TEST_PROFILE = "${params.CI_SCHEDULE_TEST_PROFILE == 'DO-NOT-CHANGE-THIS-SELECTION' ? params.ADHOC_BUILD_AND_EXECUTE_TESTS_TEST_PROFILE : params.CI_SCHEDULE_TEST_PROFILE}" + } + + matrix { + 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Ⓡ + } + } + when { + beforeAgent true + allOf { + expression { return env.SERVER_VERSIONS.split(' ').any { it =~ /(ALL|${env.SERVER_VERSION})/ } } + } + } + agent { + label "${env.OS_VERSION}" + } + + stages { + stage('Initialize-Environment') { + steps { + initializeEnvironment() + script { + if (env.BUILD_STATED_SLACK_NOTIFIED != 'true') { + notifySlack() + } + } + } + } + stage('Describe-Build') { + steps { + describeAdhocAndScheduledTestingStage() + } + } + stage('Build-Driver') { + steps { + // Jabba default should be a JDK8 for now + buildDriver('default') + } + } + stage('Execute-Tests') { + steps { + catchError { + // Use the matrix JDK for testing + executeTests() + } + } + post { + always { + /* + * Empty results are possible + * + * - Build failures during mvn verify may exist so report may not be available + * - With boolean parameters to skip tests a failsafe report may not be available + */ + junit testResults: '**/target/surefire-reports/TEST-*.xml', allowEmptyResults: true + junit testResults: '**/target/failsafe-reports/TEST-*.xml', allowEmptyResults: true + } + } + } + stage('Execute-Code-Coverage') { + // Ensure the code coverage is run only once per-commit + when { + allOf { + environment name: 'SERVER_VERSION', value: '4.0' + environment name: 'JABBA_VERSION', value: '1.8' + } + } + steps { + executeCodeCoverage() + } + } + } + } + post { + aborted { + notifySlack('aborted') + } + success { + notifySlack('completed') + } + unstable { + notifySlack('unstable') + } + failure { + notifySlack('FAILED') + } + } + } + } +} diff --git a/build.yaml b/build.yaml deleted file mode 100644 index 7e15bd3e98a..00000000000 --- a/build.yaml +++ /dev/null @@ -1,106 +0,0 @@ -schedules: - commit: - # Run short suite on commit with enough C* versions to get full protocol version coverage. - schedule: per_commit - matrix: - exclude: - # Exclude all builds on old jdk versions - - java: ['openjdk6','openjdk7'] - # Exclude java8 with all versions except latest - - java: openjdk8 - cassandra: ['2.2', '3.0'] - # Exclude java11 with all versions except latest - - java: openjdk11 - cassandra: ['2.1', '2.2', '3.0'] - env_vars: | - TEST_GROUP="short" - disable_commit_status: true - disable_pull_requests: true - notify: - slack: java-driver-dev-bots - nightly: - # Run full suite nightly on change for all primary branches if they have changes. - schedule: nightly - matrix: - exclude: - # exclude builds for newer Cassandra versions and older JDKs - - java: openjdk6 - cassandra: ['2.2', '3.0', '3.11'] - - java: openjdk7 - cassandra: ['2.1', '3.0', '3.11'] - # exclude builds for older Cassandra versions and newer JDKs - - java: openjdk11 - cassandra: ['2.1', '2.2'] - branches: - # regex matches primary branch format (2.1, 3.x, 3.0.x, 3.1.x, etc). - include: ["/\\d+(\\.[\\dx]+)+/"] - env_vars: | - TEST_GROUP="long" - disable_commit_status: true - disable_pull_requests: true - notify: - slack: java-driver-dev-bots - adhoc: - # Adhoc job for non-primary braches that doesn't have a schedule but may be used to run all configs. - schedule: adhoc - branches: - # regex matches primary branch format (2.1, 3.x, 3.0.x, 3.1.x, etc). - exclude: ["/\\d+(\\.[\\dx]+)+/"] - env_vars: | - TEST_GROUP="long" - disable_commit_status: true - disable_pull_requests: true - notify: - slack: java-driver-dev-bots -java: - - openjdk6 - - openjdk7 - - openjdk8 - - openjdk11 -os: - - ubuntu/bionic64/java-driver -cassandra: - - '2.1' - - '2.2' - - '3.0' - - '3.11' -build: - - script: | - . /usr/local/bin/jdk_switcher.sh - jdk_switcher use openjdk8 - export MAVEN_HOME=/home/jenkins/.mvn/apache-maven-3.2.5 - export PATH=$MAVEN_HOME/bin:$PATH - mvn -B -V install -DskipTests - - script: | - . /usr/local/bin/jdk_switcher.sh - jdk_switcher use $JAVA_VERSION - - type: maven - version: 3.2.5 - goals: verify --fail-never -P$TEST_GROUP - properties: | - com.datastax.driver.TEST_BASE_NODE_WAIT=120 - com.datastax.driver.NEW_NODE_DELAY_SECONDS=100 - cassandra.version=$CCM_CASSANDRA_VERSION - ccm.java.home=$CCM_JAVA_HOME - ccm.path=$CCM_JAVA_HOME/bin - ccm.maxNumberOfNodes=3 - failIfNoTests=false - maven.test.failure.ignore=true - maven.javadoc.skip=true - proxy.path=$HOME/proxy - - type: maven - version: 3.2.5 - goals: verify --fail-never -Pisolated - properties: | - com.datastax.driver.TEST_BASE_NODE_WAIT=120 - com.datastax.driver.NEW_NODE_DELAY_SECONDS=100 - cassandra.version=$CCM_CASSANDRA_VERSION - ccm.java.home=$CCM_JAVA_HOME - ccm.path=$CCM_JAVA_HOME/bin - ccm.maxNumberOfNodes=3 - failIfNoTests=false - maven.test.failure.ignore=true - maven.javadoc.skip=true - - xunit: - - "**/target/surefire-reports/TEST-*.xml" - - "**/target/failsafe-reports/TEST-*.xml" From e48ca9e8d4dd9b212b4ff55bee439d030b403ace Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Fri, 17 Apr 2020 15:32:18 -0500 Subject: [PATCH 076/211] JAVA-2730: Add support for Cassandra 4.0 table options --- changelog/README.md | 1 + .../driver/core/AbstractTableMetadata.java | 16 +- .../driver/core/TableOptionsMetadata.java | 66 +++++-- .../com/datastax/driver/core/CCMBridge.java | 19 +- .../driver/core/ExportAsStringTest.java | 4 +- .../driver/core/MissingRpcAddressTest.java | 8 + .../driver/core/SchemaChangesTest.java | 8 +- .../driver/core/TableMetadataTest.java | 82 +++++++- .../com/datastax/driver/core/TestUtils.java | 2 +- .../QueryBuilderExecutionTest.java | 2 +- .../resources/export_as_string_test_4.0.cql | 185 ++++++++++++++++++ .../mapping/MapperMaterializedViewTest.java | 8 +- .../driver/mapping/MapperUDTTest.java | 17 +- .../datastax/driver/osgi/BundleOptions.java | 11 +- 14 files changed, 392 insertions(+), 37 deletions(-) create mode 100644 driver-core/src/test/resources/export_as_string_test_4.0.cql diff --git a/changelog/README.md b/changelog/README.md index 8bb056be2bd..cce2be8dfcd 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -9,6 +9,7 @@ - [bug] JAVA-2627: Avoid logging error message including stack trace in request handler. - [new feature] JAVA-2706: Add now_in_seconds to protocol v5 query messages. +- [improvement] JAVA-2730: Add support for Cassandra® 4.0 table options ## 3.8.0 diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractTableMetadata.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractTableMetadata.java index 5a375e2d958..46c86c11d28 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/AbstractTableMetadata.java +++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractTableMetadata.java @@ -258,14 +258,22 @@ protected StringBuilder appendOptions(StringBuilder sb, boolean formatted) { sb.append("WITH "); if (options.isCompactStorage()) and(sb.append("COMPACT STORAGE"), formatted); if (!clusteringOrder.isEmpty()) and(appendClusteringOrder(sb), formatted); - sb.append("read_repair_chance = ").append(options.getReadRepairChance()); - and(sb, formatted) - .append("dclocal_read_repair_chance = ") - .append(options.getLocalReadRepairChance()); + if (cassandraVersion.getMajor() < 4) + sb.append("read_repair_chance = ").append(options.getReadRepairChance()); + else sb.append("read_repair = '").append(options.getReadRepair()).append('\''); + if (cassandraVersion.getMajor() < 4) + and(sb, formatted) + .append("dclocal_read_repair_chance = ") + .append(options.getLocalReadRepairChance()); if (cassandraVersion.getMajor() < 2 || (cassandraVersion.getMajor() == 2 && cassandraVersion.getMinor() == 0)) and(sb, formatted).append("replicate_on_write = ").append(options.getReplicateOnWrite()); and(sb, formatted).append("gc_grace_seconds = ").append(options.getGcGraceInSeconds()); + if (cassandraVersion.getMajor() > 3) + and(sb, formatted) + .append("additional_write_policy = '") + .append(options.getAdditionalWritePolicy()) + .append('\''); and(sb, formatted) .append("bloom_filter_fp_chance = ") .append(options.getBloomFilterFalsePositiveChance()); diff --git a/driver-core/src/main/java/com/datastax/driver/core/TableOptionsMetadata.java b/driver-core/src/main/java/com/datastax/driver/core/TableOptionsMetadata.java index ccfed3bba29..cf8424e7ac0 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/TableOptionsMetadata.java +++ b/driver-core/src/main/java/com/datastax/driver/core/TableOptionsMetadata.java @@ -23,9 +23,10 @@ public class TableOptionsMetadata { private static final String COMMENT = "comment"; - private static final String READ_REPAIR = "read_repair_chance"; - private static final String DCLOCAL_READ_REPAIR = "dclocal_read_repair_chance"; - private static final String LOCAL_READ_REPAIR = "local_read_repair_chance"; + private static final String READ_REPAIR_CHANCE = "read_repair_chance"; + private static final String DCLOCAL_READ_REPAIR_CHANCE = "dclocal_read_repair_chance"; + private static final String READ_REPAIR = "read_repair"; + private static final String LOCAL_READ_REPAIR_CHANCE = "local_read_repair_chance"; private static final String REPLICATE_ON_WRITE = "replicate_on_write"; private static final String GC_GRACE = "gc_grace_seconds"; private static final String BF_FP_CHANCE = "bloom_filter_fp_chance"; @@ -45,6 +46,7 @@ public class TableOptionsMetadata { private static final String CRC_CHECK_CHANCE = "crc_check_chance"; private static final String EXTENSIONS = "extensions"; private static final String CDC = "cdc"; + private static final String ADDITIONAL_WRITE_POLICY = "additional_write_policy"; private static final boolean DEFAULT_REPLICATE_ON_WRITE = true; private static final double DEFAULT_BF_FP_CHANCE = 0.01; @@ -57,12 +59,15 @@ public class TableOptionsMetadata { private static final int DEFAULT_MAX_INDEX_INTERVAL = 2048; private static final double DEFAULT_CRC_CHECK_CHANCE = 1.0; private static final boolean DEFAULT_CDC = false; + private static final String DEFAULT_READ_REPAIR = "BLOCKING"; + private static final String DEFAULT_ADDITIONAL_WRITE_POLICY = "99p"; private final boolean isCompactStorage; private final String comment; - private final double readRepair; - private final double localReadRepair; + private final double readRepairChance; + private final double localReadRepairChance; + private final String readRepair; private final boolean replicateOnWrite; private final int gcGrace; private final double bfFpChance; @@ -79,6 +84,7 @@ public class TableOptionsMetadata { private final Double crcCheckChance; private final Map extensions; private final boolean cdc; + private final String additionalWritePolicy; TableOptionsMetadata(Row row, boolean isCompactStorage, VersionNumber version) { @@ -92,10 +98,13 @@ public class TableOptionsMetadata { this.isCompactStorage = isCompactStorage; this.comment = isNullOrAbsent(row, COMMENT) ? "" : row.getString(COMMENT); - this.readRepair = row.getDouble(READ_REPAIR); + this.readRepairChance = row.getDouble(READ_REPAIR_CHANCE); - if (is300OrHigher) this.localReadRepair = row.getDouble(DCLOCAL_READ_REPAIR); - else this.localReadRepair = row.getDouble(LOCAL_READ_REPAIR); + if (is400OrHigher) this.readRepair = row.getString(READ_REPAIR); + else this.readRepair = DEFAULT_READ_REPAIR; + + if (is300OrHigher) this.localReadRepairChance = row.getDouble(DCLOCAL_READ_REPAIR_CHANCE); + else this.localReadRepairChance = row.getDouble(LOCAL_READ_REPAIR_CHANCE); this.replicateOnWrite = is210OrHigher || isNullOrAbsent(row, REPLICATE_ON_WRITE) @@ -176,6 +185,9 @@ public class TableOptionsMetadata { if (is380OrHigher) this.cdc = isNullOrAbsent(row, CDC) ? DEFAULT_CDC : row.getBool(CDC); else this.cdc = DEFAULT_CDC; + + if (is400OrHigher) this.additionalWritePolicy = row.getString(ADDITIONAL_WRITE_POLICY); + else this.additionalWritePolicy = DEFAULT_ADDITIONAL_WRITE_POLICY; } private static boolean isNullOrAbsent(Row row, String name) { @@ -206,6 +218,19 @@ public String getComment() { * @return the read repair chance set for table (in [0.0, 1.0]). */ public double getReadRepairChance() { + return readRepairChance; + } + + /** + * Returns the read_repair option for this table. NOTE: this is a Cassandra® 4.0 and newer + * option (described here: + * http://cassandra.apache.org/doc/latest/operating/read_repair.html). Possible values are + * {@code BLOCKING} or {@code NONE}, with the default being {@code BLOCKING}. + * + * @return the read repair option (either {@code BLOCKING} or {@code NONE}). + */ + public String getReadRepair() { return readRepair; } @@ -215,7 +240,7 @@ public double getReadRepairChance() { * @return the local read repair chance set for table (in [0.0, 1.0]). */ public double getLocalReadRepairChance() { - return localReadRepair; + return localReadRepairChance; } /** @@ -396,6 +421,17 @@ public boolean isCDC() { return cdc; } + /** + * The threshold at which a cheap quorum write will be upgraded to include transient replicas. + * + *

    This option is only available in Cassandra® 4.0 and above. Default value is {@code 99p}. + * + * @return The additional write policy for this table (ex. '99p'). + */ + public String getAdditionalWritePolicy() { + return additionalWritePolicy; + } + @Override public boolean equals(Object other) { if (other == this) return true; @@ -404,8 +440,9 @@ public boolean equals(Object other) { TableOptionsMetadata that = (TableOptionsMetadata) other; return this.isCompactStorage == that.isCompactStorage && MoreObjects.equal(this.comment, that.comment) - && this.readRepair == that.readRepair - && this.localReadRepair == that.localReadRepair + && this.readRepairChance == that.readRepairChance + && this.localReadRepairChance == that.localReadRepairChance + && MoreObjects.equal(this.readRepair, that.readRepair) && this.replicateOnWrite == that.replicateOnWrite && this.gcGrace == that.gcGrace && this.bfFpChance == that.bfFpChance @@ -421,6 +458,7 @@ public boolean equals(Object other) { && MoreObjects.equal(this.compaction, that.compaction) && MoreObjects.equal(this.compression, that.compression) && MoreObjects.equal(this.crcCheckChance, that.crcCheckChance) + && MoreObjects.equal(this.additionalWritePolicy, that.additionalWritePolicy) && MoreObjects.equal(this.extensions, that.extensions); } @@ -429,8 +467,9 @@ public int hashCode() { return MoreObjects.hashCode( isCompactStorage, comment, + readRepairChance, + localReadRepairChance, readRepair, - localReadRepair, replicateOnWrite, gcGrace, bfFpChance, @@ -446,6 +485,7 @@ public int hashCode() { compression, crcCheckChance, extensions, - cdc); + cdc, + additionalWritePolicy); } } 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 e68751157e5..97284655ac3 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 @@ -1047,6 +1047,14 @@ public CCMBridge build() { cassandraConfiguration.remove("rpc_port"); cassandraConfiguration.remove("thrift_prepared_statements_cache_size_mb"); } + if (isMaterializedViewsDisabledByDefault(cassandraVersion)) { + // enable materialized views + cassandraConfiguration.put("enable_materialized_views", true); + } + if (isSasiConfigEnablementRequired(cassandraVersion)) { + // enable SASI indexing in config (disabled by default in C* 4.0) + cassandraConfiguration.put("enable_sasi_indexes", true); + } final CCMBridge ccm = new CCMBridge( clusterName, @@ -1089,7 +1097,16 @@ public void run() { } private static boolean isThriftSupported(VersionNumber cassandraVersion) { - return cassandraVersion.compareTo(VersionNumber.parse("4.0")) < 0; + // Thrift is removed from some pre-release 4.x versions, make the comparison work for those + return cassandraVersion.nextStable().compareTo(VersionNumber.parse("4.0")) < 0; + } + + private static boolean isMaterializedViewsDisabledByDefault(VersionNumber cassandraVersion) { + return cassandraVersion.nextStable().compareTo(VersionNumber.parse("4.0")) >= 0; + } + + private static boolean isSasiConfigEnablementRequired(VersionNumber cassandraVersion) { + return cassandraVersion.nextStable().compareTo(VersionNumber.parse("4.0")) >= 0; } public int weight() { 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 beae645ea8b..3edfe429a91 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 @@ -146,7 +146,7 @@ public void should_create_schema_and_ensure_exported_cql_is_as_expected() { // matter, alphabetical does. session.execute( "CREATE MATERIALIZED VIEW cyclist_by_r_age " - + "AS SELECT age, birthday, name, country " + + "AS SELECT cid, age, birthday, name, country " + "FROM cyclist_mv " + "WHERE age IS NOT NULL AND cid IS NOT NULL " + "PRIMARY KEY (age, cid) " @@ -163,7 +163,7 @@ public void should_create_schema_and_ensure_exported_cql_is_as_expected() { // A materialized view for cyclist_mv, select columns session.execute( "CREATE MATERIALIZED VIEW cyclist_by_age " - + "AS SELECT age, birthday, name, country " + + "AS SELECT cid, age, birthday, name, country " + "FROM cyclist_mv " + "WHERE age IS NOT NULL AND cid IS NOT NULL " + "PRIMARY KEY (age, cid) WITH comment = 'simple view'"); diff --git a/driver-core/src/test/java/com/datastax/driver/core/MissingRpcAddressTest.java b/driver-core/src/test/java/com/datastax/driver/core/MissingRpcAddressTest.java index 68b4fecc15e..8408bb701c4 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/MissingRpcAddressTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/MissingRpcAddressTest.java @@ -72,6 +72,14 @@ private void deleteNode2RpcAddressFromNode1() throws Exception { "DELETE rpc_address FROM system.peers WHERE peer = '%s'", ccm().addressOfNode(2).getHostName()); session.execute(deleteStmt); + // For Cassandra 4.0, we also need to remove the info from peers_v2 + if (ccm().getCassandraVersion().nextStable().compareTo(VersionNumber.parse("4.0")) >= 0) { + deleteStmt = + String.format( + "DELETE native_address, native_port FROM system.peers_v2 WHERE peer = '%s' and peer_port = %d", + ccm().addressOfNode(2).getHostName(), ccm().getStoragePort()); + session.execute(deleteStmt); + } session.close(); cluster.close(); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java b/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java index 20f6efedc36..7015ea6ce91 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java @@ -257,7 +257,7 @@ public void should_retain_view_on_table_update(String keyspace) throws Interrupt // Create view and ensure event is received and metadata is updated session1.execute( String.format( - "CREATE MATERIALIZED VIEW %s.mv1 AS SELECT c FROM %s.table1 WHERE c IS NOT NULL PRIMARY KEY (pk, c)", + "CREATE MATERIALIZED VIEW %s.mv1 AS SELECT pk, c FROM %s.table1 WHERE c IS NOT NULL AND pk IS NOT NULL PRIMARY KEY (pk, c)", keyspace, keyspace)); for (SchemaChangeListener listener : listeners) { ArgumentCaptor viewAdded = @@ -506,7 +506,7 @@ public void should_notify_of_view_creation(String keyspace) { session1.execute(String.format("CREATE TABLE %s.table1 (pk int PRIMARY KEY, c int)", keyspace)); session1.execute( String.format( - "CREATE MATERIALIZED VIEW %s.mv1 AS SELECT c FROM %s.table1 WHERE c IS NOT NULL PRIMARY KEY (pk, c)", + "CREATE MATERIALIZED VIEW %s.mv1 AS SELECT pk, c FROM %s.table1 WHERE c IS NOT NULL AND pk IS NOT NULL PRIMARY KEY (pk, c)", keyspace, keyspace)); for (SchemaChangeListener listener : listeners) { ArgumentCaptor removed = @@ -525,7 +525,7 @@ public void should_notify_of_view_update(String keyspace) { session1.execute(String.format("CREATE TABLE %s.table1 (pk int PRIMARY KEY, c int)", keyspace)); session1.execute( String.format( - "CREATE MATERIALIZED VIEW %s.mv1 AS SELECT c FROM %s.table1 WHERE c IS NOT NULL PRIMARY KEY (pk, c) WITH compaction = { 'class' : 'SizeTieredCompactionStrategy' }", + "CREATE MATERIALIZED VIEW %s.mv1 AS SELECT pk, c FROM %s.table1 WHERE c IS NOT NULL AND pk IS NOT NULL PRIMARY KEY (pk, c) WITH compaction = { 'class' : 'SizeTieredCompactionStrategy' }", keyspace, keyspace)); for (SchemaChangeListener listener : listeners) { ArgumentCaptor removed = @@ -576,7 +576,7 @@ public void should_notify_of_view_drop(String keyspace) { session1.execute(String.format("CREATE TABLE %s.table1 (pk int PRIMARY KEY, c int)", keyspace)); session1.execute( String.format( - "CREATE MATERIALIZED VIEW %s.mv1 AS SELECT c FROM %s.table1 WHERE c IS NOT NULL PRIMARY KEY (pk, c)", + "CREATE MATERIALIZED VIEW %s.mv1 AS SELECT pk, c FROM %s.table1 WHERE c IS NOT NULL AND pk IS NOT NULL PRIMARY KEY (pk, c)", keyspace, keyspace)); session1.execute(String.format("DROP MATERIALIZED VIEW %s.mv1", keyspace)); for (SchemaChangeListener listener : listeners) { 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 53c5696d5e1..e2a72439ef6 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 @@ -300,8 +300,32 @@ public void should_parse_table_options() { // given String cql; - // Cassandra 3.0 + - if (version.getMajor() > 2) { + // Cassandra 4.0 + + if (version.getMajor() > 3) { + 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 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" + + " 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 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.getMajor() > 2) { cql = String.format( "CREATE TABLE %s.with_options (\n" @@ -401,8 +425,58 @@ public void should_parse_table_options() { .hasType(cint()); assertThat(table); - // Cassandra 3.8 + - if (version.getMajor() > 3 || (version.getMajor() == 3 && version.getMinor() >= 8)) { + // Cassandra 4.0 + + if (version.getMajor() > 3) { + + 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.9p"); + 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("speculative_retry = '99.9p'") + .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.getMajor() == 3 && version.getMinor() >= 8) { assertThat(table.getOptions().getReadRepairChance()).isEqualTo(0.5); assertThat(table.getOptions().getLocalReadRepairChance()).isEqualTo(0.6); diff --git a/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java b/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java index 234a5531f82..751d4189ada 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java +++ b/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java @@ -986,7 +986,7 @@ public static Level setLogLevel(String logger, Level newLevel) { * @param ccm cluster to check against */ public static void compactStorageSupportCheck(CCMAccess ccm) { - if (ccm.getCassandraVersion().compareTo(VersionNumber.parse("4.0.0")) >= 0) { + if (ccm.getCassandraVersion().nextStable().compareTo(VersionNumber.parse("4.0")) >= 0) { throw new SkipException( "Compact tables are not allowed in Cassandra starting with 4.0 version"); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java index 9587025081c..6267b357377 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java @@ -951,7 +951,7 @@ public void should_select_from_materialized_view() { String.format("INSERT INTO %s (pk, cc, v) VALUES (0,1,1)", table), String.format("INSERT INTO %s (pk, cc, v) VALUES (0,2,2)", table), String.format( - "CREATE MATERIALIZED VIEW %s AS SELECT cc FROM %s WHERE cc IS NOT NULL PRIMARY KEY (pk, cc)", + "CREATE MATERIALIZED VIEW %s AS SELECT pk, cc FROM %s WHERE cc IS NOT NULL AND pk IS NOT NULL PRIMARY KEY (pk, cc)", mv, table)); // Wait until the MV is fully constructed diff --git a/driver-core/src/test/resources/export_as_string_test_4.0.cql b/driver-core/src/test/resources/export_as_string_test_4.0.cql new file mode 100644 index 00000000000..cc83ebabcee --- /dev/null +++ b/driver-core/src/test/resources/export_as_string_test_4.0.cql @@ -0,0 +1,185 @@ +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, + x frozen +); + +CREATE TYPE complex_ks.atype ( + c frozen +); + +CREATE TABLE complex_ks.cyclist_mv ( + cid uuid, + age int, + birthday date, + country text, + name text, + PRIMARY KEY (cid) +) 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' : 16, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' } + AND default_time_to_live = 0 + 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); + +CREATE MATERIALIZED VIEW complex_ks.cyclist_by_a_age AS + SELECT * + FROM complex_ks.cyclist_mv + WHERE age IS NOT NULL AND cid IS NOT NULL + PRIMARY KEY (age, cid) + WITH CLUSTERING ORDER BY (cid ASC) + 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' : 16, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' } + AND default_time_to_live = 0 + 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 + SELECT age, cid, birthday, country, name + FROM complex_ks.cyclist_mv + WHERE age IS NOT NULL AND cid IS NOT NULL + PRIMARY KEY (age, cid) + WITH CLUSTERING ORDER BY (cid ASC) + 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' : 16, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' } + AND default_time_to_live = 0 + 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 + SELECT age, cid, birthday, country, name + FROM complex_ks.cyclist_mv + WHERE age IS NOT NULL AND cid IS NOT NULL + PRIMARY KEY (age, cid) + WITH CLUSTERING ORDER BY (cid DESC) + 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' : 16, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' } + AND default_time_to_live = 0 + 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 ( + 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 = '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' : 16, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' } + AND default_time_to_live = 0 + 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); + +CREATE INDEX ryear ON complex_ks.rank_by_year_and_name (race_year); + +CREATE TABLE complex_ks.ztable ( + zkey text, + a frozen, + PRIMARY KEY (zkey) +) 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', '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 = '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) + 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,val int) + CALLED ON NULL INPUT + RETURNS tuple + 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 + FINALFUNC avgfinal + INITCOND (0,0); + +CREATE AGGREGATE complex_ks.mean(int) + SFUNC avgstate + STYPE tuple + FINALFUNC avgfinal + INITCOND (0,0); diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperMaterializedViewTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperMaterializedViewTest.java index 4cc806f9b23..f9989993249 100644 --- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperMaterializedViewTest.java +++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperMaterializedViewTest.java @@ -43,22 +43,22 @@ public void onTestContextInitialized() { + " SELECT * FROM scores\n" + " WHERE game IS NOT NULL AND score IS NOT NULL AND user IS NOT NULL AND year IS NOT NULL AND month IS NOT NULL AND day IS NOT NULL\n" + " PRIMARY KEY (game, score, user, year, month, day)\n" - + " WITH CLUSTERING ORDER BY (score desc)", + + " WITH CLUSTERING ORDER BY (score DESC, user ASC, year ASC, month ASC, day ASC)", "CREATE MATERIALIZED VIEW dailyhigh AS\n" + " SELECT * FROM scores\n" + " WHERE game IS NOT NULL AND year IS NOT NULL AND month IS NOT NULL AND day IS NOT NULL AND score IS NOT NULL AND user IS NOT NULL\n" + " PRIMARY KEY ((game, year, month, day), score, user)\n" - + " WITH CLUSTERING ORDER BY (score DESC)", + + " WITH CLUSTERING ORDER BY (score DESC, user ASC)", "CREATE MATERIALIZED VIEW monthlyhigh AS\n" + " SELECT * FROM scores\n" + " WHERE game IS NOT NULL AND year IS NOT NULL AND month IS NOT NULL AND score IS NOT NULL AND user IS NOT NULL AND day IS NOT NULL\n" + " PRIMARY KEY ((game, year, month), score, user, day)\n" - + " WITH CLUSTERING ORDER BY (score DESC)", + + " WITH CLUSTERING ORDER BY (score DESC, user ASC, day ASC)", "CREATE MATERIALIZED VIEW filtereduserhigh AS\n" + " SELECT * FROM scores\n" + " WHERE user in ('jbellis', 'pcmanus') AND game IS NOT NULL AND score IS NOT NULL AND year is NOT NULL AND day is not NULL and month IS NOT NULL\n" + " PRIMARY KEY (game, score, user, year, month, day)\n" - + " WITH CLUSTERING ORDER BY (score DESC)", + + " WITH CLUSTERING ORDER BY (score DESC, user ASC, year ASC, month ASC, day ASC)", "INSERT INTO scores (user, game, year, month, day, score) VALUES ('pcmanus', 'Coup', 2015, 5, 1, 4000)", "INSERT INTO scores (user, game, year, month, day, score) VALUES ('jbellis', 'Coup', 2015, 5, 3, 1750)", "INSERT INTO scores (user, game, year, month, day, score) VALUES ('yukim', 'Coup', 2015, 5, 3, 2250)", diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java index 34965c1da0a..ac075a1f4e6 100644 --- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java +++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java @@ -34,6 +34,7 @@ import com.datastax.driver.core.Session; import com.datastax.driver.core.TypeCodec; import com.datastax.driver.core.UDTValue; +import com.datastax.driver.core.VersionNumber; import com.datastax.driver.core.exceptions.CodecNotFoundException; import com.datastax.driver.core.exceptions.InvalidQueryException; import com.datastax.driver.core.querybuilder.BuiltStatement; @@ -493,18 +494,30 @@ public void should_throw_error_when_table_is_dropped() { MappingManager manager = new MappingManager(session()); Mapper mapper = manager.mapper(User.class); session().execute("DROP TABLE users"); + // error assertion depends on C* version + boolean isCassandra4 = + ccm().getCassandraVersion().nextStable().compareTo(VersionNumber.parse("4.0")) >= 0; // usage of stale mapper try { mapper.save(user); fail("Expected InvalidQueryException"); } catch (InvalidQueryException e) { - assertThat(e.getMessage()).contains("unconfigured", "users"); + // error message is different for C* 4.0 + if (isCassandra4) { + assertThat(e.getMessage()).contains("table users", "does not exist"); + } else { + assertThat(e.getMessage()).contains("unconfigured", "users"); + } } try { mapper.get(user.getUserId()); fail("Expected InvalidQueryException"); } catch (InvalidQueryException e) { - assertThat(e.getMessage()).contains("unconfigured", "users"); + if (isCassandra4) { + assertThat(e.getMessage()).contains("table users", "does not exist"); + } else { + assertThat(e.getMessage()).contains("unconfigured", "users"); + } } // trying to use a new mapper try { diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java index 45cfcbb4b23..f3c4dbebc42 100644 --- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java +++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java @@ -165,7 +165,16 @@ public Option[] getOptions() { mavenBundle("ch.qos.logback", "logback-classic", getVersion("logback.version")), mavenBundle("ch.qos.logback", "logback-core", getVersion("logback.version")), mavenBundle("io.dropwizard.metrics", "metrics-core", getVersion("metrics.version")), - mavenBundle("org.yaml", "snakeyaml", getVersion("snakeyaml.version")), + mavenBundle( + "com.fasterxml.jackson.core", + "jackson-databind", + getVersion("jackson-databind.version")), + mavenBundle( + "com.fasterxml.jackson.core", "jackson-core", getVersion("jackson.version")), + mavenBundle( + "com.fasterxml.jackson.core", + "jackson-annotations", + getVersion("jackson.version")), mavenBundle("org.testng", "testng", getVersion("testng.version")), systemPackages( "org.testng", From b1be7387ab09c8aaed6f2811dc948d3c2c062db6 Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Fri, 24 Apr 2020 15:57:02 -0500 Subject: [PATCH 077/211] JAVA-2702: Transient Replication Support for Cassandra 4.0 --- changelog/README.md | 1 + .../driver/core/ReplicationFactor.java | 79 +++++++++ .../driver/core/ReplicationStategy.java | 25 +-- .../core/schemabuilder/SchemaBuilder.java | 26 +++ .../core/schemabuilder/TableOptions.java | 92 ++++++++++ .../core/AdditionalWritePolicyTest.java | 160 ++++++++++++++++++ .../driver/core/ReplicationFactorTest.java | 44 +++++ .../driver/core/TransietReplicationTest.java | 103 +++++++++++ 8 files changed, 518 insertions(+), 12 deletions(-) create mode 100644 driver-core/src/main/java/com/datastax/driver/core/ReplicationFactor.java create mode 100644 driver-core/src/test/java/com/datastax/driver/core/AdditionalWritePolicyTest.java create mode 100644 driver-core/src/test/java/com/datastax/driver/core/ReplicationFactorTest.java create mode 100644 driver-core/src/test/java/com/datastax/driver/core/TransietReplicationTest.java diff --git a/changelog/README.md b/changelog/README.md index cce2be8dfcd..6c517027ed0 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -10,6 +10,7 @@ - [bug] JAVA-2627: Avoid logging error message including stack trace in request handler. - [new feature] JAVA-2706: Add now_in_seconds to protocol v5 query messages. - [improvement] JAVA-2730: Add support for Cassandra® 4.0 table options +- [improvement[ JAVA-2702: Transient Replication Support for Cassandra® 4.0 ## 3.8.0 diff --git a/driver-core/src/main/java/com/datastax/driver/core/ReplicationFactor.java b/driver-core/src/main/java/com/datastax/driver/core/ReplicationFactor.java new file mode 100644 index 00000000000..a99e5c2f0e8 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/ReplicationFactor.java @@ -0,0 +1,79 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +// This class is a subset of server version at org.apache.cassandra.locator.ReplicationFactor + +class ReplicationFactor { + private final int allReplicas; + private final int fullReplicas; + private final int transientReplicas; + + ReplicationFactor(int allReplicas, int transientReplicas) { + this.allReplicas = allReplicas; + this.transientReplicas = transientReplicas; + this.fullReplicas = allReplicas - transientReplicas; + } + + ReplicationFactor(int allReplicas) { + this(allReplicas, 0); + } + + int fullReplicas() { + return fullReplicas; + } + + int transientReplicas() { + return transientReplicas; + } + + boolean hasTransientReplicas() { + return transientReplicas > 0; + } + + static ReplicationFactor fromString(String s) { + if (s.contains("/")) { + int slash = s.indexOf('/'); + String allPart = s.substring(0, slash); + String transientPart = s.substring(slash + 1); + return new ReplicationFactor(Integer.parseInt(allPart), Integer.parseInt(transientPart)); + } else { + return new ReplicationFactor(Integer.parseInt(s), 0); + } + } + + @Override + public String toString() { + return allReplicas + (hasTransientReplicas() ? "/" + transientReplicas() : ""); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof ReplicationFactor)) { + return false; + } + ReplicationFactor that = (ReplicationFactor) o; + return allReplicas == that.allReplicas && transientReplicas == that.transientReplicas; + } + + @Override + public int hashCode() { + return allReplicas ^ transientReplicas; + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/ReplicationStategy.java b/driver-core/src/main/java/com/datastax/driver/core/ReplicationStategy.java index 481d7ebb78a..aaaefd9a6b7 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ReplicationStategy.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ReplicationStategy.java @@ -46,13 +46,13 @@ static ReplicationStrategy create(Map replicationOptions) { String repFactorString = replicationOptions.get("replication_factor"); return repFactorString == null ? null - : new SimpleStrategy(Integer.parseInt(repFactorString)); + : new SimpleStrategy(ReplicationFactor.fromString(repFactorString)); } else if (strategyClass.contains("NetworkTopologyStrategy")) { - Map dcRfs = new HashMap(); + Map dcRfs = new HashMap(); for (Map.Entry entry : replicationOptions.entrySet()) { if (entry.getKey().equals("class")) continue; - dcRfs.put(entry.getKey(), Integer.parseInt(entry.getValue())); + dcRfs.put(entry.getKey(), ReplicationFactor.fromString(entry.getValue())); } return new NetworkTopologyStrategy(dcRfs); } else { @@ -76,9 +76,9 @@ private static Token getTokenWrapping(int i, List ring) { static class SimpleStrategy extends ReplicationStrategy { - private final int replicationFactor; + private final ReplicationFactor replicationFactor; - private SimpleStrategy(int replicationFactor) { + private SimpleStrategy(ReplicationFactor replicationFactor) { this.replicationFactor = replicationFactor; } @@ -86,7 +86,7 @@ private SimpleStrategy(int replicationFactor) { Map> computeTokenToReplicaMap( String keyspaceName, Map tokenToPrimary, List ring) { - int rf = Math.min(replicationFactor, ring.size()); + int rf = Math.min(replicationFactor.fullReplicas(), ring.size()); Map> replicaMap = new HashMap>(tokenToPrimary.size()); for (int i = 0; i < ring.size(); i++) { @@ -111,16 +111,16 @@ public boolean equals(Object o) { @Override public int hashCode() { - return replicationFactor; + return replicationFactor.hashCode(); } } static class NetworkTopologyStrategy extends ReplicationStrategy { private static final Logger logger = LoggerFactory.getLogger(NetworkTopologyStrategy.class); - private final Map replicationFactors; + private final Map replicationFactors; - private NetworkTopologyStrategy(Map replicationFactors) { + private NetworkTopologyStrategy(Map replicationFactors) { this.replicationFactors = replicationFactors; } @@ -163,7 +163,7 @@ Map> computeTokenToReplicaMap( String dc = h.getDatacenter(); if (dc == null || !allDcReplicas.containsKey(dc)) continue; - Integer rf = replicationFactors.get(dc); + Integer rf = replicationFactors.get(dc).fullReplicas(); Set dcReplicas = allDcReplicas.get(dc); if (rf == null || dcReplicas.size() >= rf) continue; @@ -198,7 +198,7 @@ Map> computeTokenToReplicaMap( // Warn the user because that leads to quadratic performance of this method (JAVA-702). for (Map.Entry> entry : allDcReplicas.entrySet()) { String dcName = entry.getKey(); - int expectedFactor = replicationFactors.get(dcName); + int expectedFactor = replicationFactors.get(dcName).fullReplicas(); int achievedFactor = entry.getValue().size(); if (achievedFactor < expectedFactor && !warnedDcs.contains(dcName)) { logger.warn( @@ -230,7 +230,8 @@ private boolean allDone(Map> map, Map dcHostC for (Map.Entry> entry : map.entrySet()) { String dc = entry.getKey(); int dcCount = dcHostCount.get(dc) == null ? 0 : dcHostCount.get(dc); - if (entry.getValue().size() < Math.min(replicationFactors.get(dc), dcCount)) return false; + if (entry.getValue().size() < Math.min(replicationFactors.get(dc).fullReplicas(), dcCount)) + return false; } return true; } diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/SchemaBuilder.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/SchemaBuilder.java index b2f1f61b7ad..e8d07c90ef2 100755 --- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/SchemaBuilder.java +++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/SchemaBuilder.java @@ -440,4 +440,30 @@ public static TableOptions.CachingRowsPerPartition rows(int rowNumber) { } return new TableOptions.CachingRowsPerPartition(Integer.toString(rowNumber)); } + + public static TableOptions.AdditionalWritePolicyValue additionalWritePolicyNever() { + return new TableOptions.AdditionalWritePolicyValue("'NEVER'"); + } + + public static TableOptions.AdditionalWritePolicyValue additionalWritePolicyAlways() { + return new TableOptions.AdditionalWritePolicyValue("'ALWAYS'"); + } + + public static TableOptions.AdditionalWritePolicyValue additionalWritePolicyPercentile( + int percentile) { + if (percentile < 0 || percentile > 100) { + throw new IllegalArgumentException( + "Percentile value for additional write policy should be between 0 and 100"); + } + return new TableOptions.AdditionalWritePolicyValue("'" + percentile + "percentile'"); + } + + public static TableOptions.AdditionalWritePolicyValue additionalWritePolicyMillisecs( + int millisecs) { + if (millisecs < 0) { + throw new IllegalArgumentException( + "Millisecond value for speculative retry should be positive"); + } + return new TableOptions.AdditionalWritePolicyValue("'" + millisecs + "ms'"); + } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/TableOptions.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/TableOptions.java index b8e66781be8..6aeb9ba4c65 100755 --- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/TableOptions.java +++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/TableOptions.java @@ -72,6 +72,10 @@ public abstract class TableOptions extends SchemaStateme private List customOptions = new ArrayList(); + private Optional readReapair = Optional.absent(); + + private Optional additionalWritePolicy = Optional.absent(); + @SuppressWarnings("unchecked") private final T self = (T) this; @@ -409,6 +413,45 @@ public T freeformOption(String key, Object value) { return self; } + /** + * Define the read_repair mode for this table. Possible values are: + * + *

      + *
    • BLOCKING + *
    • NONE + *
    + * + *

    This option is for Cassandra 4.0+. The default value is {@code BLOCKING}, which means that + * when a read repair is started, a read will block on writes sent to other replicas until the CL + * is reached by the writes. This provides monotonic quorum reads, but not partition level write + * atomicity. + * + *

    If {@code NONE} is specified, the coordinator will reconcile any differences between + * replicas, but will not attempt to repair them. This provides partition level write atomicity, + * but not monotonic quorum reads. + * + * @param readRepair the read repair mode. + * @return this {@code TableOptions} object. + */ + public T readRepair(ReadRepairValue readRepair) { + this.readReapair = Optional.fromNullable(readRepair); + return self; + } + + /** + * Define the additional_write_policy for this table. This specifies the threshold at which a + * cheap quorum write will be upgraded to include transient replicas. + * + *

    This option is for Cassandra 4.0+. The default value is "99p". + * + * @param additionalWritePolicy the additional write policy threshold. + * @return this {@code TableOptions} object. + */ + public T additionalWritePolicy(AdditionalWritePolicyValue additionalWritePolicy) { + this.additionalWritePolicy = Optional.fromNullable(additionalWritePolicy); + return self; + } + private static String buildCustomOption(String key, Object value) { return String.format( "%s = %s", key, (value instanceof String) ? "'" + value + "'" : value.toString()); @@ -483,6 +526,14 @@ private List buildCommonOptions() { options.add("cdc = " + cdc.get()); } + if (readReapair.isPresent()) { + options.add("read_repair = " + readReapair.get().value()); + } + + if (additionalWritePolicy.isPresent()) { + options.add("additional_write_policy = " + additionalWritePolicy.get().value()); + } + options.addAll(customOptions); return options; @@ -1362,4 +1413,45 @@ public String value() { return value; } } + + /** Read Repair modes. Possible values: BLOCKING, NONE. */ + public static enum ReadRepairValue { + BLOCKING("'BLOCKING'"), + NONE("'NONE'"); + + private String value; + + private ReadRepairValue(String value) { + this.value = value; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return value; + } + } + + /** + * Additional Write Policy. Default value is 99p. + * + *

    To create instances, use {@link SchemaBuilder#additionalWritePolicyNone() ()}, {@link + * SchemaBuilder#additionalWritePolicyAlways()}, {@link + * SchemaBuilder#additionalWritePolicyMillisecs(int)} or {@link + * SchemaBuilder#additionalWritePolicyMillisecs(int)}. + */ + public static class AdditionalWritePolicyValue { + private String value; + + public AdditionalWritePolicyValue(String value) { + this.value = value; + } + + public String value() { + return value; + } + } } diff --git a/driver-core/src/test/java/com/datastax/driver/core/AdditionalWritePolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/AdditionalWritePolicyTest.java new file mode 100644 index 00000000000..e14b7290295 --- /dev/null +++ b/driver-core/src/test/java/com/datastax/driver/core/AdditionalWritePolicyTest.java @@ -0,0 +1,160 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import static com.datastax.driver.core.Assertions.assertThat; +import static org.testng.Assert.fail; + +import com.datastax.driver.core.exceptions.InvalidQueryException; +import com.datastax.driver.core.schemabuilder.SchemaBuilder; +import com.datastax.driver.core.schemabuilder.TableOptions; +import com.datastax.driver.core.utils.CassandraVersion; +import org.testng.annotations.Test; + +@CassandraVersion( + value = "4.0.0-alpha1", + description = "Additional Write Policy is for Cassandra 4.0+") +public class AdditionalWritePolicyTest extends CCMTestsSupport { + + private void cleanup(String tableName) { + session().execute(String.format("DROP TABLE IF EXISTS %s", tableName)); + } + + @Test(groups = "short") + public void should_create_table_with_additional_write_policy_default() { + String test_table = "awp_default"; + session() + .execute( + SchemaBuilder.createTable(test_table) + .addPartitionKey("pk", DataType.text()) + .addColumn("data", DataType.text())); + assertThat( + cluster() + .getMetadata() + .getKeyspace(keyspace) + .getTable(test_table) + .getOptions() + .getAdditionalWritePolicy()) + .isEqualTo("99p"); + cleanup(test_table); + } + + @Test(groups = "short") + public void should_create_table_with_additonal_write_policy_percentile() { + String test_table = "awp_percentile"; + session() + .execute( + SchemaBuilder.createTable(test_table) + .addPartitionKey("pk", DataType.text()) + .addColumn("data", DataType.text()) + .withOptions() + .additionalWritePolicy(SchemaBuilder.additionalWritePolicyPercentile(44))); + assertThat( + cluster() + .getMetadata() + .getKeyspace(keyspace) + .getTable(test_table) + .getOptions() + .getAdditionalWritePolicy()) + .isEqualTo("44p"); + cleanup(test_table); + } + + @Test(groups = "short") + public void should_create_table_with_additonal_write_policy_millisecs() { + String test_table = "awp_millisecs"; + session() + .execute( + SchemaBuilder.createTable(test_table) + .addPartitionKey("pk", DataType.text()) + .addColumn("data", DataType.text()) + .withOptions() + .additionalWritePolicy(SchemaBuilder.additionalWritePolicyMillisecs(350))); + assertThat( + cluster() + .getMetadata() + .getKeyspace(keyspace) + .getTable(test_table) + .getOptions() + .getAdditionalWritePolicy()) + .isEqualTo("350ms"); + cleanup(test_table); + } + + @Test(groups = "short") + public void should_create_table_with_additonal_write_policy_never() { + String test_table = "awp_never"; + session() + .execute( + SchemaBuilder.createTable(test_table) + .addPartitionKey("pk", DataType.text()) + .addColumn("data", DataType.text()) + .withOptions() + .additionalWritePolicy(SchemaBuilder.additionalWritePolicyNever())); + assertThat( + cluster() + .getMetadata() + .getKeyspace(keyspace) + .getTable(test_table) + .getOptions() + .getAdditionalWritePolicy()) + .isEqualTo("NEVER"); + cleanup(test_table); + } + + @Test(groups = "short") + public void should_create_table_with_additonal_write_policy_always() { + String test_table = "awp_always"; + session() + .execute( + SchemaBuilder.createTable(test_table) + .addPartitionKey("pk", DataType.text()) + .addColumn("data", DataType.text()) + .withOptions() + .additionalWritePolicy(SchemaBuilder.additionalWritePolicyAlways())); + assertThat( + cluster() + .getMetadata() + .getKeyspace(keyspace) + .getTable(test_table) + .getOptions() + .getAdditionalWritePolicy()) + .isEqualTo("ALWAYS"); + cleanup(test_table); + } + + @Test(groups = "short") + public void should_fail_to_create_table_with_invalid_additonal_write_policy() { + String test_table = "awp_invalid"; + try { + session() + .execute( + SchemaBuilder.createTable(test_table) + .addPartitionKey("pk", DataType.text()) + .addColumn("data", DataType.text()) + .withOptions() + .additionalWritePolicy(new TableOptions.AdditionalWritePolicyValue("'ALL'"))); + fail("Should not be able to create table with invlaid 'additional_write_policy': 'ALL'"); + } catch (InvalidQueryException iqe) { + assertThat(iqe) + .hasMessageContaining("Invalid value") + .hasMessageContaining("ALL") + .hasMessageContaining("for option"); + } finally { + cleanup(test_table); + } + } +} diff --git a/driver-core/src/test/java/com/datastax/driver/core/ReplicationFactorTest.java b/driver-core/src/test/java/com/datastax/driver/core/ReplicationFactorTest.java new file mode 100644 index 00000000000..8c0c44401e5 --- /dev/null +++ b/driver-core/src/test/java/com/datastax/driver/core/ReplicationFactorTest.java @@ -0,0 +1,44 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.annotations.Test; + +public class ReplicationFactorTest { + + @Test(groups = "unit") + public void should_parse_factor_from_string() { + ReplicationFactor transFactor = ReplicationFactor.fromString("3/1"); + assertThat(transFactor.fullReplicas()).isEqualTo(2); + assertThat(transFactor.hasTransientReplicas()).isTrue(); + assertThat(transFactor.transientReplicas()).isEqualTo(1); + + ReplicationFactor factor = ReplicationFactor.fromString("3"); + assertThat(factor.fullReplicas()).isEqualTo(3); + assertThat(factor.hasTransientReplicas()).isFalse(); + assertThat(factor.transientReplicas()).isEqualTo(0); + } + + @Test(groups = "unit") + public void should_create_string_from_factor() { + ReplicationFactor transFactor = new ReplicationFactor(3, 1); + assertThat(transFactor.toString()).isEqualTo("3/1"); + ReplicationFactor factor = new ReplicationFactor(3); + assertThat(factor.toString()).isEqualTo("3"); + } +} diff --git a/driver-core/src/test/java/com/datastax/driver/core/TransietReplicationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TransietReplicationTest.java new file mode 100644 index 00000000000..849d8f99a49 --- /dev/null +++ b/driver-core/src/test/java/com/datastax/driver/core/TransietReplicationTest.java @@ -0,0 +1,103 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import static com.datastax.driver.core.Assertions.assertThat; +import static org.testng.Assert.fail; + +import com.datastax.driver.core.exceptions.InvalidQueryException; +import com.datastax.driver.core.schemabuilder.SchemaBuilder; +import com.datastax.driver.core.schemabuilder.TableOptions; +import com.datastax.driver.core.utils.CassandraVersion; +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +@CassandraVersion( + value = "4.0.0-alpha1", + description = "Transient Replication is for Cassandra 4.0+") +@CCMConfig(config = "enable_transient_replication:true") +public class TransietReplicationTest extends CCMTestsSupport { + + private static final String TRANSIENT_REPLICATION_KEYSPACE = "transient_rep_ks"; + + @BeforeClass(groups = "short") + public void createKeyspace() { + Map replicationOptions = + ImmutableMap.of("class", "SimpleStrategy", "replication_factor", "3/1"); + + // create keyspace + session() + .execute( + SchemaBuilder.createKeyspace(TRANSIENT_REPLICATION_KEYSPACE) + .with() + .replication(replicationOptions)); + + // verify the replication factor in the metadata + assertThat(cluster().getMetadata().getKeyspace(TRANSIENT_REPLICATION_KEYSPACE).getReplication()) + .containsEntry("replication_factor", "3/1"); + } + + @AfterClass(groups = "short") + public void dropKeyspace() { + session().execute("drop keyspace " + TRANSIENT_REPLICATION_KEYSPACE); + } + + @Test(groups = "short") + public void should_handle_read_reapir_none() { + // create a table with read_repair set to 'NONE' + Session session = cluster().connect(TRANSIENT_REPLICATION_KEYSPACE); + session.execute( + SchemaBuilder.createTable("valid_table") + .addPartitionKey("pk", DataType.text()) + .addColumn("data", DataType.text()) + .withOptions() + .readRepair(TableOptions.ReadRepairValue.NONE)); + TableOptionsMetadata options = + cluster() + .getMetadata() + .getKeyspace(TRANSIENT_REPLICATION_KEYSPACE) + .getTable("valid_table") + .getOptions(); + + assertThat(options.getReadRepair()).isEqualTo("NONE"); + // assert that the default additional_write_policy exists as well + assertThat(options.getAdditionalWritePolicy()).isEqualTo("99p"); + } + + @Test(groups = "short") + public void should_fail_to_create_table_with_read_repair_blocking() { + /** + * Attempt to create a table with the default read_repair 'BLOCKING'. This should fail when the + * keyspace uses transient replicas. + */ + try { + Session session = cluster().connect(TRANSIENT_REPLICATION_KEYSPACE); + session.execute( + SchemaBuilder.createTable("invalid_table") + .addPartitionKey("pk", DataType.text()) + .addColumn("data", DataType.text())); + fail( + "Create table with default read_repair ('BLOCKING') is not supported when keyspace uses transient replicas."); + } catch (InvalidQueryException iqe) { + assertThat(iqe) + .hasMessageContaining( + "read_repair must be set to 'NONE' for transiently replicated keyspaces"); + } + } +} From f0009235f94323870870d9c58e8eb1507deef158 Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Tue, 28 Apr 2020 11:25:58 -0500 Subject: [PATCH 078/211] Update versions in docs to 3.9.0 --- README.md | 20 ++++---- changelog/README.md | 2 +- faq/README.md | 4 +- faq/osgi/README.md | 2 +- manual/README.md | 30 +++++------ manual/address_resolution/README.md | 4 +- manual/async/README.md | 8 +-- manual/auth/README.md | 8 +-- manual/compression/README.md | 2 +- manual/control_connection/README.md | 2 +- manual/custom_codecs/README.md | 38 +++++++------- manual/custom_codecs/extras/README.md | 48 ++++++++--------- manual/custom_payloads/README.md | 4 +- manual/idempotence/README.md | 6 +-- manual/load_balancing/README.md | 34 ++++++------ manual/logging/README.md | 10 ++-- manual/metadata/README.md | 38 +++++++------- manual/metrics/README.md | 12 ++--- manual/native_protocol/README.md | 10 ++-- manual/object_mapper/README.md | 2 +- manual/object_mapper/creating/README.md | 26 +++++----- manual/object_mapper/custom_codecs/README.md | 6 +-- manual/object_mapper/using/README.md | 18 +++---- manual/paging/README.md | 8 +-- manual/pooling/README.md | 26 +++++----- manual/query_timestamps/README.md | 8 +-- manual/reconnection/README.md | 8 +-- manual/retries/README.md | 54 ++++++++++---------- manual/shaded_jar/README.md | 8 +-- manual/socket_options/README.md | 24 ++++----- manual/speculative_execution/README.md | 22 ++++---- manual/ssl/README.md | 10 ++-- manual/statements/README.md | 16 +++--- manual/statements/batch/README.md | 6 +-- manual/statements/built/README.md | 10 ++-- manual/statements/prepared/README.md | 12 ++--- manual/statements/simple/README.md | 2 +- manual/tuples/README.md | 8 +-- manual/udts/README.md | 4 +- pom.xml | 2 +- 40 files changed, 281 insertions(+), 281 deletions(-) diff --git a/README.md b/README.md index ee84dfd8278..926c9c50983 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ not yet have been released. You can find the documentation for the latest version through the [Java driver docs](http://docs.datastax.com/en/developer/java-driver/latest/index.html) or via the release tags, [e.g. -3.8.0](https://github.com/datastax/java-driver/tree/3.8.0).* +3.9.0](https://github.com/datastax/java-driver/tree/3.9.0).* A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol @@ -50,12 +50,12 @@ The driver contains the following modules: driver releases and important announcements (low frequency). [@DataStaxEng](https://twitter.com/datastaxeng) has more news including other drivers, Cassandra, and DSE. -- DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.8/manual/) has quick +- DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.9/manual/) has quick start material and technical details about the driver and its features. -- API: http://docs.datastax.com/en/drivers/java/3.8 +- API: http://docs.datastax.com/en/drivers/java/3.9 - GITHUB REPOSITORY: https://github.com/datastax/java-driver - [changelog](changelog/) -- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.8.0.tar.gz) +- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.9.0.tar.gz) ## Getting the driver @@ -67,7 +67,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-dri com.datastax.cassandra cassandra-driver-core - 3.8.0 + 3.9.0 ``` @@ -77,7 +77,7 @@ Note that the object mapper is published as a separate artifact: com.datastax.cassandra cassandra-driver-mapping - 3.8.0 + 3.9.0 ``` @@ -87,7 +87,7 @@ The 'extras' module is also published as a separate artifact: com.datastax.cassandra cassandra-driver-extras - 3.8.0 + 3.9.0 ``` @@ -96,12 +96,12 @@ 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](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.8.0.tar.gz) +[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.9.0.tar.gz) is available for download. ## Compatibility -The Java client driver 3.8.0 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache +The Java client driver 3.9.0 ([branch 3.x](https://github.com/datastax/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/latest/manual/native_protocol/) for the most up-to-date compatibility information). @@ -145,4 +145,4 @@ 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. -[dse-driver]: http://docs.datastax.com/en/developer/java-driver-dse/1.9/ +[dse-driver]: http://docs.datastax.com/en/developer/java-driver-dse/latest/ diff --git a/changelog/README.md b/changelog/README.md index 6c517027ed0..2a1555c5bb4 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,7 +5,7 @@ 3.x versions get published. --> -## 3.9.0 (in progress) +## 3.9.0 - [bug] JAVA-2627: Avoid logging error message including stack trace in request handler. - [new feature] JAVA-2706: Add now_in_seconds to protocol v5 query messages. diff --git a/faq/README.md b/faq/README.md index 19514553dcf..0ee87e9cb57 100644 --- a/faq/README.md +++ b/faq/README.md @@ -35,7 +35,7 @@ row.getBool(0); // this is equivalent row.getBool("applied") Note that, unlike manual inspection, `wasApplied` does not consume the first row. -[wasApplied]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ResultSet.html#wasApplied-- +[wasApplied]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ResultSet.html#wasApplied-- ### What is a parameterized statement and how can I use it? @@ -289,7 +289,7 @@ version is available, you may want to reach out to the maintainer of that tool t an update with compatibility to this driver version. -[Blobs.java]: https://github.com/datastax/java-driver/tree/3.8.0/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java +[Blobs.java]: https://github.com/datastax/java-driver/tree/3.9.0/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304 [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding [Mapper options]: ../manual/object_mapper/using/#mapper-options diff --git a/faq/osgi/README.md b/faq/osgi/README.md index ddfddf21c23..095c7e5f57d 100644 --- a/faq/osgi/README.md +++ b/faq/osgi/README.md @@ -157,7 +157,7 @@ it is also normal to see the following log lines when starting the driver: [BND]:http://bnd.bndtools.org/ [Maven bundle plugin]:https://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Maven+Bundle+Plugin+%28BND%29 [OSGi examples repository]:https://github.com/datastax/java-driver-examples-osgi -[without metrics]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- +[without metrics]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- [SLF4J]:http://www.slf4j.org/ [Logback]:http://logback.qos.ch/ [Tycho]:https://eclipse.org/tycho/ diff --git a/manual/README.md b/manual/README.md index 43311b12d7a..cd4973b69b1 100644 --- a/manual/README.md +++ b/manual/README.md @@ -209,7 +209,7 @@ String firstName = row.getString("first_name"); blob getBytes java.nio.ByteBuffer boolean getBool boolean counter getLong long - date getDate LocalDate + date getDate LocalDate decimal getDecimal java.math.BigDecimal double getDouble double float getFloat float @@ -291,17 +291,17 @@ menu on the left hand side to navigate sub-sections. If you're [browsing the sou github.com](https://github.com/datastax/java-driver/tree/3.x/manual), simply navigate to each sub-directory. -[Cluster]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.html -[Cluster.Builder]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html -[Initializer]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Initializer.html -[Session]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html -[ResultSet]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ResultSet.html -[Row]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Row.html -[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/NettyOptions.html -[QueryOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/QueryOptions.html -[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html -[Host.StateListener]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Host.StateListener.html -[LatencyTracker]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/LatencyTracker.html -[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SchemaChangeListener.html -[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/NoHostAvailableException.html -[LocalDate]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/LocalDate.html \ No newline at end of file +[Cluster]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.html +[Cluster.Builder]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html +[Initializer]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Initializer.html +[Session]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html +[ResultSet]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ResultSet.html +[Row]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Row.html +[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/NettyOptions.html +[QueryOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/QueryOptions.html +[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html +[Host.StateListener]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Host.StateListener.html +[LatencyTracker]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/LatencyTracker.html +[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SchemaChangeListener.html +[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[LocalDate]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/LocalDate.html \ No newline at end of file diff --git a/manual/address_resolution/README.md b/manual/address_resolution/README.md index 63afcdb42e1..b42acbe55ae 100644 --- a/manual/address_resolution/README.md +++ b/manual/address_resolution/README.md @@ -102,8 +102,8 @@ private/public switch automatically based on location). -[AddressTranslator]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/AddressTranslator.html -[EC2MultiRegionAddressTranslator]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslator.html +[AddressTranslator]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/AddressTranslator.html +[EC2MultiRegionAddressTranslator]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslator.html [cassandra.yaml]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html [rpc_address]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html?scroll=configCassandra_yaml__rpc_address diff --git a/manual/async/README.md b/manual/async/README.md index 1adf82324d6..19a974a5df8 100644 --- a/manual/async/README.md +++ b/manual/async/README.md @@ -51,8 +51,8 @@ to the current page, and [fetchMoreResults] to get a future to the next page (see also the section on [paging](../paging/)). Here is a full example: -[getAvailableWithoutFetching]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ResultSet.html#getAvailableWithoutFetching-- -[fetchMoreResults]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ResultSet.html#fetchMoreResults-- +[getAvailableWithoutFetching]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ResultSet.html#getAvailableWithoutFetching-- +[fetchMoreResults]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ResultSet.html#fetchMoreResults-- ```java Statement statement = new SimpleStatement("select * from foo").setFetchSize(20); @@ -134,5 +134,5 @@ There are still a few places where the driver will block internally hasn't been fetched already. [ListenableFuture]: https://github.com/google/guava/wiki/ListenableFutureExplained -[init]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.html#init-- -[query trace]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/QueryTrace.html +[init]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.html#init-- +[query trace]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/QueryTrace.html diff --git a/manual/auth/README.md b/manual/auth/README.md index 9d8b363e7a6..36c5b6c999d 100644 --- a/manual/auth/README.md +++ b/manual/auth/README.md @@ -28,7 +28,7 @@ You can also write your own provider; it must implement [AuthProvider]. [SASL]: https://en.wikipedia.org/wiki/Simple_Authentication_and_Security_Layer -[Cluster.Builder.withCredentials]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withCredentials-java.lang.String-java.lang.String- -[AuthProvider]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/AuthProvider.html -[Cluster.Builder.withAuthProvider]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withAuthProvider-com.datastax.driver.core.AuthProvider- -[PlainTextAuthProvider]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PlainTextAuthProvider.html +[Cluster.Builder.withCredentials]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withCredentials-java.lang.String-java.lang.String- +[AuthProvider]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/AuthProvider.html +[Cluster.Builder.withAuthProvider]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withAuthProvider-com.datastax.driver.core.AuthProvider- +[PlainTextAuthProvider]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PlainTextAuthProvider.html diff --git a/manual/compression/README.md b/manual/compression/README.md index 9a5018c890b..feb3b7f7969 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -88,4 +88,4 @@ cluster = Cluster.builder() .build(); ``` -[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.8.0/cassandra-driver-parent-3.8.0.pom +[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.9.0/cassandra-driver-parent-3.9.0.pom diff --git a/manual/control_connection/README.md b/manual/control_connection/README.md index a4cc732b247..521ede12402 100644 --- a/manual/control_connection/README.md +++ b/manual/control_connection/README.md @@ -18,4 +18,4 @@ used exclusively for administrative requests. It is included in [Session.State.g as well as the `open-connections` [metric](../metrics); for example, if you've configured a pool size of 2, the control node will have 3 connections. -[Session.State.getOpenConnections]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.State.html#getOpenConnections-com.datastax.driver.core.Host- \ No newline at end of file +[Session.State.getOpenConnections]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.State.html#getOpenConnections-com.datastax.driver.core.Host- \ No newline at end of file diff --git a/manual/custom_codecs/README.md b/manual/custom_codecs/README.md index d844e278fab..65915b2b0ca 100644 --- a/manual/custom_codecs/README.md +++ b/manual/custom_codecs/README.md @@ -447,26 +447,26 @@ Beware that in these cases, the lookup performs in average 10x worse. If perform consider using prepared statements all the time. [JAVA-721]: https://datastax-oss.atlassian.net/browse/JAVA-721 -[TypeCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TypeCodec.html -[LocalDate]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/LocalDate.html +[TypeCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TypeCodec.html +[LocalDate]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/LocalDate.html [ByteBuffer]: http://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html -[serialize]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TypeCodec.html#serialize-T-com.datastax.driver.core.ProtocolVersion- -[deserialize]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TypeCodec.html#deserialize-java.nio.ByteBuffer-com.datastax.driver.core.ProtocolVersion- -[TypeCodec.format]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TypeCodec.html#format-T- -[TypeCodec.parse]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TypeCodec.html#parse-java.lang.String- -[accepts]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TypeCodec.html#accepts-com.datastax.driver.core.DataType- -[CodecRegistry]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/CodecRegistry.html -[CodecNotFoundException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/CodecNotFoundException.html +[serialize]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TypeCodec.html#serialize-T-com.datastax.driver.core.ProtocolVersion- +[deserialize]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TypeCodec.html#deserialize-java.nio.ByteBuffer-com.datastax.driver.core.ProtocolVersion- +[TypeCodec.format]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TypeCodec.html#format-T- +[TypeCodec.parse]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TypeCodec.html#parse-java.lang.String- +[accepts]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TypeCodec.html#accepts-com.datastax.driver.core.DataType- +[CodecRegistry]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/CodecRegistry.html +[CodecNotFoundException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/CodecNotFoundException.html [Jackson]: https://github.com/FasterXML/jackson [AbstractType]: https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/marshal/AbstractType.java -[UserType]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/UserType.html -[UDTValue]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/UDTValue.html -[TupleType]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TupleType.html -[TupleValue]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TupleValue.html -[CustomType]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/DataType.CustomType.html +[UserType]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/UserType.html +[UDTValue]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/UDTValue.html +[TupleType]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TupleType.html +[TupleValue]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TupleValue.html +[CustomType]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/DataType.CustomType.html [TypeToken]: https://google.github.io/guava/releases/19.0/api/docs/com/google/common/reflect/TypeToken.html -[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SimpleStatement.html -[BuiltStatement]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/querybuilder/BuiltStatement.html -[setList]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SettableByIndexData.html#setList-int-java.util.List- -[setSet]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SettableByIndexData.html#setSet-int-java.util.Set- -[setMap]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SettableByIndexData.html#setMap-int-java.util.Map- +[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SimpleStatement.html +[BuiltStatement]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/querybuilder/BuiltStatement.html +[setList]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SettableByIndexData.html#setList-int-java.util.List- +[setSet]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SettableByIndexData.html#setSet-int-java.util.Set- +[setMap]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SettableByIndexData.html#setMap-int-java.util.Map- diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index 470466ebf4b..14109ad294c 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -10,7 +10,7 @@ The module is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-extras - 3.8.0 + 3.9.0 ``` @@ -73,12 +73,12 @@ session.execute("INSERT INTO example (id, t) VALUES (1, ?)", ZoneId.of("GMT+07:00")); ``` -[InstantCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/jdk8/InstantCodec.html -[LocalDateCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.html -[LocalDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/jdk8/LocalDateTimeCodec.html -[LocalTimeCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.html -[ZonedDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.html -[ZoneIdCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/jdk8/ZoneIdCodec.html +[InstantCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/jdk8/InstantCodec.html +[LocalDateCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.html +[LocalDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/jdk8/LocalDateTimeCodec.html +[LocalTimeCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.html +[ZonedDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.html +[ZoneIdCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/jdk8/ZoneIdCodec.html [Instant]: https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html [LocalDate]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html [LocalDateTime]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html @@ -130,10 +130,10 @@ session.execute("INSERT INTO example (id, t) VALUES (1, ?)", DateTime.parse("2010-06-30T01:20:47.999+01:00")); ``` -[InstantCodec_joda]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/joda/InstantCodec.html -[LocalDateCodec_joda]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/joda/LocalDateCodec.html -[LocalTimeCodec_joda]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.html -[DateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/joda/DateTimeCodec.html +[InstantCodec_joda]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/joda/InstantCodec.html +[LocalDateCodec_joda]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/joda/LocalDateCodec.html +[LocalTimeCodec_joda]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.html +[DateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/joda/DateTimeCodec.html [DateTime]: http://www.joda.org/joda-time/apidocs/org/joda/time/DateTime.html [Instant_joda]: http://www.joda.org/joda-time/apidocs/org/joda/time/Instant.html [LocalDate_joda]: http://www.joda.org/joda-time/apidocs/org/joda/time/LocalDate.html @@ -151,8 +151,8 @@ Time can also be expressed as simple durations: There is no extra codec for `time`, because by default the driver already maps that type to a `long` representing the number of nanoseconds since midnight. -[SimpleTimestampCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.html -[SimpleDateCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/date/SimpleDateCodec.html +[SimpleTimestampCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.html +[SimpleDateCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/date/SimpleDateCodec.html ### Enums @@ -190,8 +190,8 @@ Note that if you registered an `EnumNameCodec` and an `EnumOrdinalCodec` _for th In practice, this is unlikely to happen, because you'll probably stick to a single CQL type for a given enum type; however, if you ever run into that issue, the workaround is to use [prepared statements](../../statements/prepared/), for which the driver knows the CQL type and can pick the exact codec. -[EnumNameCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/enums/EnumNameCodec.html -[EnumOrdinalCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.html +[EnumNameCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/enums/EnumNameCodec.html +[EnumOrdinalCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.html [name]: https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name-- [ordinal]: https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal-- @@ -236,7 +236,7 @@ session.execute("insert into example (id, owner) values (1, ?)", // owner saved as '{"id":1,"name":"root"}' ``` -[JacksonJsonCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.html +[JacksonJsonCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.html [Jackson]: https://github.com/FasterXML/jackson @@ -275,7 +275,7 @@ session.execute("insert into example (id, owner) values (1, ?)", ``` -[Jsr353JsonCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.html +[Jsr353JsonCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.html [JsonStructure]: https://docs.oracle.com/javaee/7/tutorial/jsonp002.htm @@ -328,7 +328,7 @@ For the same reason, we need to give a type hint when setting "v", in the form o anonymous inner class; we recommend storing these tokens as constants in a utility class, to avoid creating them too often. -[OptionalCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.html +[OptionalCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.html [Optional]: https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html [TypeToken]: http://google.github.io/guava/releases/19.0/api/docs/com/google/common/reflect/TypeToken.html @@ -372,7 +372,7 @@ session.execute(pst.bind() See the JDK8 Optional section above for explanations about [TypeToken]. -[OptionalCodec_guava]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/guava/OptionalCodec.html +[OptionalCodec_guava]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/guava/OptionalCodec.html [Optional_guava]: http://google.github.io/guava/releases/19.0/api/docs/com/google/common/base/Optional.html @@ -397,9 +397,9 @@ session.execute("insert into example (i, l) values (1, ?)", Package [com.datastax.driver.extras.codecs.arrays][arrays] contains similar codecs for all primitive types, and [ObjectArrayCodec] to map arrays of objects. -[IntArrayCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.html -[ObjectArrayCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.html -[arrays]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/arrays/package-summary.html +[IntArrayCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.html +[ObjectArrayCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.html +[arrays]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/arrays/package-summary.html ### Abstract utilities @@ -429,5 +429,5 @@ These two classes are convenient, but since they perform conversions in two step optimal approach. If performance is paramount, it's better to start from scratch and convert your objects to `ByteBuffer` directly. -[MappingCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/MappingCodec.html -[ParsingCodec]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/extras/codecs/ParsingCodec.html +[MappingCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/MappingCodec.html +[ParsingCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/ParsingCodec.html diff --git a/manual/custom_payloads/README.md b/manual/custom_payloads/README.md index 89e3d245c58..21b62e1e87b 100644 --- a/manual/custom_payloads/README.md +++ b/manual/custom_payloads/README.md @@ -241,8 +241,8 @@ The log message contains a pretty-printed version of the payload itself, and its [CASSANDRA-8553]: https://issues.apache.org/jira/browse/CASSANDRA-8553 [v4spec]: https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec [qh]: https://issues.apache.org/jira/browse/CASSANDRA-6659 -[nhae]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[nhae]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/NoHostAvailableException.html [chm]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html [immutablemap]: http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/ImmutableMap.html -[ufe]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/UnsupportedFeatureException.html +[ufe]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/UnsupportedFeatureException.html diff --git a/manual/idempotence/README.md b/manual/idempotence/README.md index d7bd8d1b6f1..4e7c65aeb53 100644 --- a/manual/idempotence/README.md +++ b/manual/idempotence/README.md @@ -125,8 +125,8 @@ broke linearizability by doing a transparent retry at step 6. If linearizability is important for you, you should ensure that lightweight transactions are appropriately flagged as not idempotent. -[isIdempotent]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Statement.html#isIdempotent-- -[setDefaultIdempotence]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/QueryOptions.html#setDefaultIdempotence-boolean- -[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/querybuilder/QueryBuilder.html +[isIdempotent]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Statement.html#isIdempotent-- +[setDefaultIdempotence]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/QueryOptions.html#setDefaultIdempotence-boolean- +[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/querybuilder/QueryBuilder.html [linearizability]: https://en.wikipedia.org/wiki/Linearizability#Definition_of_linearizability \ No newline at end of file diff --git a/manual/load_balancing/README.md b/manual/load_balancing/README.md index 701336936dd..3f725791f1d 100644 --- a/manual/load_balancing/README.md +++ b/manual/load_balancing/README.md @@ -277,11 +277,11 @@ For any host, the distance returned by the policy is always the same as its chil Query plans are based on the child policy's, except that hosts that are currently excluded for being too slow are moved to the end of the plan. -[withExclusionThreshold]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withExclusionThreshold-double- -[withMininumMeasurements]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withMininumMeasurements-int- -[withRetryPeriod]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withRetryPeriod-long-java.util.concurrent.TimeUnit- -[withScale]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withScale-long-java.util.concurrent.TimeUnit- -[withUpdateRate]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withUpdateRate-long-java.util.concurrent.TimeUnit- +[withExclusionThreshold]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withExclusionThreshold-double- +[withMininumMeasurements]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withMininumMeasurements-int- +[withRetryPeriod]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withRetryPeriod-long-java.util.concurrent.TimeUnit- +[withScale]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withScale-long-java.util.concurrent.TimeUnit- +[withUpdateRate]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withUpdateRate-long-java.util.concurrent.TimeUnit- ### Filtering policies @@ -299,15 +299,15 @@ studying the existing implementations first: `RoundRobinPolicy` is a good place complex ones like `DCAwareRoundRobinPolicy`. -[LoadBalancingPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LoadBalancingPolicy.html -[RoundRobinPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RoundRobinPolicy.html -[DCAwareRoundRobinPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.html -[TokenAwarePolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/TokenAwarePolicy.html -[LatencyAwarePolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LatencyAwarePolicy.html -[HostFilterPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/HostFilterPolicy.html -[WhiteListPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/WhiteListPolicy.html -[HostDistance]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/HostDistance.html -[refreshConnectedHosts]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PoolingOptions.html#refreshConnectedHosts-- -[setMetadataEnabled]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/QueryOptions.html#setMetadataEnabled-boolean- -[Statement#getKeyspace]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Statement.html#getKeyspace-- -[Statement#getRoutingKey]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Statement.html#getRoutingKey-- +[LoadBalancingPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LoadBalancingPolicy.html +[RoundRobinPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RoundRobinPolicy.html +[DCAwareRoundRobinPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.html +[TokenAwarePolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/TokenAwarePolicy.html +[LatencyAwarePolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LatencyAwarePolicy.html +[HostFilterPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/HostFilterPolicy.html +[WhiteListPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/WhiteListPolicy.html +[HostDistance]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/HostDistance.html +[refreshConnectedHosts]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PoolingOptions.html#refreshConnectedHosts-- +[setMetadataEnabled]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/QueryOptions.html#setMetadataEnabled-boolean- +[Statement#getKeyspace]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Statement.html#getKeyspace-- +[Statement#getRoutingKey]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Statement.html#getRoutingKey-- diff --git a/manual/logging/README.md b/manual/logging/README.md index fff6897bb92..cd40c910a7e 100644 --- a/manual/logging/README.md +++ b/manual/logging/README.md @@ -208,12 +208,12 @@ Aggregation query used without partition key ``` These -[query warnings](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) +[query warnings](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) are available programmatically from the -[ExecutionInfo](https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ExecutionInfo.html) +[ExecutionInfo](https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ExecutionInfo.html) via -[ResultSet](https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ResultSet.html)'s -[getExecutionInfo()](https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PagingIterable.html#getExecutionInfo--) +[ResultSet](https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ResultSet.html)'s +[getExecutionInfo()](https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PagingIterable.html#getExecutionInfo--) method. They are also logged by the driver: ``` @@ -340,4 +340,4 @@ It also turns on slow query tracing as described above. ``` -[query_logger]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/QueryLogger.html +[query_logger]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/QueryLogger.html diff --git a/manual/metadata/README.md b/manual/metadata/README.md index 6fc2f60e520..8e764c2eb4b 100644 --- a/manual/metadata/README.md +++ b/manual/metadata/README.md @@ -4,7 +4,7 @@ The driver maintains global information about the Cassandra cluster it is connected to. It is available via [Cluster#getMetadata()][getMetadata]. -[getMetadata]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.html#getMetadata-- +[getMetadata]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.html#getMetadata-- ### Schema metadata @@ -12,8 +12,8 @@ Use [getKeyspace(String)][getKeyspace] or [getKeyspaces()][getKeyspaces] to get keyspace-level metadata. From there you can access the keyspace's objects (tables, and UDTs and UDFs if relevant). -[getKeyspace]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#getKeyspace-java.lang.String- -[getKeyspaces]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#getKeyspaces-- +[getKeyspace]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#getKeyspace-java.lang.String- +[getKeyspaces]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#getKeyspaces-- #### Refreshes @@ -47,8 +47,8 @@ Note that it is preferable to register a listener only *after* the cluster is fu otherwise the listener could be notified with a great deal of "Added" events as the driver builds the schema metadata from scratch for the first time. -[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SchemaChangeListener.html -[registerListener]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.html#register-com.datastax.driver.core.SchemaChangeListener- +[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SchemaChangeListener.html +[registerListener]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.html#register-com.datastax.driver.core.SchemaChangeListener- #### Schema agreement @@ -135,9 +135,9 @@ custom executor). Check out the API docs for the features in this section: -* [withMaxSchemaAgreementWaitSeconds(int)](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withMaxSchemaAgreementWaitSeconds-int-) -* [isSchemaInAgreement()](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ExecutionInfo.html#isSchemaInAgreement--) -* [checkSchemaAgreement()](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#checkSchemaAgreement--) +* [withMaxSchemaAgreementWaitSeconds(int)](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withMaxSchemaAgreementWaitSeconds-int-) +* [isSchemaInAgreement()](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ExecutionInfo.html#isSchemaInAgreement--) +* [checkSchemaAgreement()](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#checkSchemaAgreement--) ### Token metadata @@ -181,14 +181,14 @@ Starting with Cassandra 2.1.5, this information is available in a system table (see [CASSANDRA-7688](https://issues.apache.org/jira/browse/CASSANDRA-7688)). -[metadata]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html -[getTokenRanges]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#getTokenRanges-- -[getTokenRanges2]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#getTokenRanges-java.lang.String-com.datastax.driver.core.Host- -[getReplicas]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#getReplicas-java.lang.String-com.datastax.driver.core.TokenRange- -[newToken]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#newToken-java.lang.String- -[newTokenRange]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metadata.html#newTokenRange-com.datastax.driver.core.Token-com.datastax.driver.core.Token- -[TokenRange]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TokenRange.html -[getTokens]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Host.html#getTokens-- -[setToken]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/BoundStatement.html#setToken-int-com.datastax.driver.core.Token- -[getToken]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Row.html#getToken-int- -[getPKToken]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Row.html#getPartitionKeyToken-- +[metadata]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html +[getTokenRanges]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#getTokenRanges-- +[getTokenRanges2]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#getTokenRanges-java.lang.String-com.datastax.driver.core.Host- +[getReplicas]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#getReplicas-java.lang.String-com.datastax.driver.core.TokenRange- +[newToken]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#newToken-java.lang.String- +[newTokenRange]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#newTokenRange-com.datastax.driver.core.Token-com.datastax.driver.core.Token- +[TokenRange]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TokenRange.html +[getTokens]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Host.html#getTokens-- +[setToken]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/BoundStatement.html#setToken-int-com.datastax.driver.core.Token- +[getToken]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Row.html#getToken-int- +[getPKToken]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Row.html#getPartitionKeyToken-- diff --git a/manual/metrics/README.md b/manual/metrics/README.md index 0c6730735ef..d6ea576973f 100644 --- a/manual/metrics/README.md +++ b/manual/metrics/README.md @@ -38,7 +38,7 @@ To do this in a maven project: com.datastax.cassandra cassandra-driver-core - 3.8.0 + 3.9.0 io.dropwizard.metrics @@ -146,8 +146,8 @@ reporter.start(); [Reporters]: http://metrics.dropwizard.io/3.2.2/manual/core.html#reporters [MetricRegistry]: http://metrics.dropwizard.io/3.2.2/apidocs/com/codahale/metrics/MetricRegistry.html [MXBeans]: https://docs.oracle.com/javase/tutorial/jmx/mbeans/mxbeans.html -[withClusterName]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withClusterName-java.lang.String- -[withoutMetrics]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- -[withoutJMXReporting]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withoutJMXReporting-- -[getMetrics]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.html#getMetrics-- -[Metrics]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metrics.html +[withClusterName]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withClusterName-java.lang.String- +[withoutMetrics]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- +[withoutJMXReporting]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withoutJMXReporting-- +[getMetrics]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.html#getMetrics-- +[Metrics]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metrics.html diff --git a/manual/native_protocol/README.md b/manual/native_protocol/README.md index dff2330b207..78de409e68a 100644 --- a/manual/native_protocol/README.md +++ b/manual/native_protocol/README.md @@ -64,7 +64,7 @@ All host(s) tried for query failed [/127.0.0.1:9042] Host /127.0.0.1:9042 does not support protocol version V3 but V2)) ``` -[gpv]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- +[gpv]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- #### Protocol version with mixed clusters @@ -95,19 +95,19 @@ To avoid this issue, you can use one the following workarounds: #### v1 to v2 * bound variables in simple statements - ([Session#execute(String, Object...)](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html#execute-java.lang.String-java.lang.Object...-)) -* [batch statements](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/BatchStatement.html) + ([Session#execute(String, Object...)](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html#execute-java.lang.String-java.lang.Object...-)) +* [batch statements](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/BatchStatement.html) * [query paging](../paging/) #### v2 to v3 * the number of stream ids per connection goes from 128 to 32768 (see [Connection pooling](../pooling/)) -* [serial consistency on batch statements](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/BatchStatement.html#setSerialConsistencyLevel-com.datastax.driver.core.ConsistencyLevel-) +* [serial consistency on batch statements](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/BatchStatement.html#setSerialConsistencyLevel-com.datastax.driver.core.ConsistencyLevel-) * [client-side timestamps](../query_timestamps/) #### v3 to v4 -* [query warnings](http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) +* [query warnings](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) * allowed unset values in bound statements * [Custom payloads](../custom_payloads/) diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md index 3f866382417..dba44952a54 100644 --- a/manual/object_mapper/README.md +++ b/manual/object_mapper/README.md @@ -11,7 +11,7 @@ The mapper is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-mapping - 3.8.0 + 3.9.0 ``` diff --git a/manual/object_mapper/creating/README.md b/manual/object_mapper/creating/README.md index 67384a514a4..3ba3d2bf3a5 100644 --- a/manual/object_mapper/creating/README.md +++ b/manual/object_mapper/creating/README.md @@ -149,9 +149,9 @@ User user = new User() .setName("John Doe"); ``` -[table]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Table.html +[table]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Table.html [case-sensitive]:http://docs.datastax.com/en/cql/3.3/cql/cql_reference/ucase-lcase_r.html -[consistency level]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ConsistencyLevel.html +[consistency level]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ConsistencyLevel.html [java-beans]:https://docs.oracle.com/javase/tutorial/javabeans/writing/properties.html [set-accessible]:https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/AccessibleObject.html#setAccessible-boolean- @@ -189,7 +189,7 @@ CREATE TABLE users(id uuid PRIMARY KEY, "userName" text); private String userName; ``` -[column]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Column.html +[column]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Column.html #### Primary key fields @@ -213,8 +213,8 @@ private String areaCode; The order of the indices must match that of the columns in the table declaration. -[pk]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/PartitionKey.html -[cc]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/ClusteringColumn.html +[pk]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/PartitionKey.html +[cc]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/ClusteringColumn.html [pks]:http://thelastpickle.com/blog/2013/01/11/primary-keys-in-cql.html #### Computed fields @@ -250,7 +250,7 @@ version (see [JAVA-832](https://datastax-oss.atlassian.net/browse/JAVA-832)). [User Defined Functions]:http://www.planetcassandra.org/blog/user-defined-functions-in-cassandra-3-0/ -[computed]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Computed.html +[computed]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Computed.html #### Transient properties @@ -259,7 +259,7 @@ to table columns. [@Transient][transient] can be used to prevent a field or a Java bean property from being mapped. Like other column-level annotations, it should be placed on either the field declaration or the property getter method. -[transient]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Transient.html +[transient]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Transient.html ### Mapping User Types @@ -322,8 +322,8 @@ This also works with UDTs inside collections or other UDTs, with any arbitrary nesting level. [User Defined Types]: ../../udts/ -[udt]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/UDT.html -[field]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Field.html +[udt]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/UDT.html +[field]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Field.html ### Mapping collections @@ -381,10 +381,10 @@ to figure out how to appropriately handle UDT conversion, i.e.: mappingManager.udtCodec(Address.class); ``` -[frozen]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Frozen.html -[frozenkey]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/FrozenKey.html -[frozenvalue]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/FrozenValue.html -[udtCodec]:https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/MappingManager.html#udtCodec-java.lang.Class- +[frozen]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Frozen.html +[frozenkey]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/FrozenKey.html +[frozenvalue]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/FrozenValue.html +[udtCodec]:https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/MappingManager.html#udtCodec-java.lang.Class- #### Prefer Frozen Collections diff --git a/manual/object_mapper/custom_codecs/README.md b/manual/object_mapper/custom_codecs/README.md index b8871734c9d..43f8dde4f21 100644 --- a/manual/object_mapper/custom_codecs/README.md +++ b/manual/object_mapper/custom_codecs/README.md @@ -98,9 +98,9 @@ instance (one per column) and cache it for future use. This also works with [@Field][field] and [@Param][param] annotations. -[column]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Column.html -[field]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Field.html -[param]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Param.html +[column]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Column.html +[field]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Field.html +[param]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Param.html ## Implicit UDT codecs diff --git a/manual/object_mapper/using/README.md b/manual/object_mapper/using/README.md index 0d55cad1585..f2045455b8a 100644 --- a/manual/object_mapper/using/README.md +++ b/manual/object_mapper/using/README.md @@ -28,9 +28,9 @@ Mapper mapper = manager.mapper(User.class); calling `manager#mapper` more than once for the same class will return the previously generated mapper. -[Mapper]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/Mapper.html -[MappingManager]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/MappingManager.html -[Session]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html +[Mapper]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/Mapper.html +[MappingManager]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/MappingManager.html +[Session]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html #### Basic CRUD operations @@ -179,7 +179,7 @@ It provides methods `one()`, `all()`, `iterator()`, `getExecutionInfo()` and `isExhausted()`. Note that iterating the `Result` will consume the `ResultSet`, and vice-versa. -[Result]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/Result.html +[Result]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/Result.html ### Accessors @@ -229,7 +229,7 @@ corresponds to which marker: ResultSet insert(@Param("u") UUID userId, @Param("n") String name); ``` -[param]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/Param.html +[param]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Param.html If a method argument is a Java enumeration, it must be annotated with `@Enumerated` to indicate how to convert it to a CQL type (the rules are @@ -301,7 +301,7 @@ query with the annotation [@QueryParameters]. Then, options like public ListenableFuture> getAllAsync(); ``` -[@QueryParameters]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/annotations/QueryParameters.html +[@QueryParameters]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/QueryParameters.html ### Mapping configuration @@ -345,6 +345,6 @@ PropertyMapper propertyMapper = new DefaultPropertyMapper() There is more to `DefaultPropertyMapper`; see the Javadocs and implementation for details. -[MappingConfiguration]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/MappingConfiguration.html -[PropertyMapper]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/PropertyMapper.html -[DefaultPropertyMapper]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/mapping/DefaultPropertyMapper.html +[MappingConfiguration]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/MappingConfiguration.html +[PropertyMapper]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/PropertyMapper.html +[DefaultPropertyMapper]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/DefaultPropertyMapper.html diff --git a/manual/paging/README.md b/manual/paging/README.md index 9e49347e6b5..71a0dd49578 100644 --- a/manual/paging/README.md +++ b/manual/paging/README.md @@ -176,8 +176,8 @@ if (nextPage != null) { } ``` -[result_set]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ResultSet.html -[paging_state]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PagingState.html +[result_set]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ResultSet.html +[paging_state]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PagingState.html Due to internal implementation details, `PagingState` instances are not @@ -239,8 +239,8 @@ There are two situations where you might want to use the unsafe API: implementing your own validation logic (for example, signing the raw state with a private key). -[gpsu]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ExecutionInfo.html#getPagingStateUnsafe-- -[spsu]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Statement.html#setPagingStateUnsafe-byte:A- +[gpsu]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ExecutionInfo.html#getPagingStateUnsafe-- +[spsu]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Statement.html#setPagingStateUnsafe-byte:A- ### Offset queries diff --git a/manual/pooling/README.md b/manual/pooling/README.md index e66c3b26dbb..e7c83c1746b 100644 --- a/manual/pooling/README.md +++ b/manual/pooling/README.md @@ -285,16 +285,16 @@ either: [newConnectionThreshold][nct] so that enough connections are added by the time you reach the bottleneck. -[result_set_future]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ResultSetFuture.html -[pooling_options]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PoolingOptions.html -[lbp]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LoadBalancingPolicy.html -[nct]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PoolingOptions.html#setNewConnectionThreshold-com.datastax.driver.core.HostDistance-int- -[mrpc]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PoolingOptions.html#setMaxRequestsPerConnection-com.datastax.driver.core.HostDistance-int- -[sits]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PoolingOptions.html#setIdleTimeoutSeconds-int- -[rtm]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#getReadTimeoutMillis-- -[smqs]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PoolingOptions.html#setMaxQueueSize-int- -[sptm]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PoolingOptions.html#setPoolTimeoutMillis-int- -[nhae]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/NoHostAvailableException.html -[getErrors]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- -[get_state]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html#getState-- -[BusyPoolException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/BusyPoolException.html +[result_set_future]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ResultSetFuture.html +[pooling_options]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PoolingOptions.html +[lbp]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LoadBalancingPolicy.html +[nct]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PoolingOptions.html#setNewConnectionThreshold-com.datastax.driver.core.HostDistance-int- +[mrpc]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PoolingOptions.html#setMaxRequestsPerConnection-com.datastax.driver.core.HostDistance-int- +[sits]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PoolingOptions.html#setIdleTimeoutSeconds-int- +[rtm]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#getReadTimeoutMillis-- +[smqs]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PoolingOptions.html#setMaxQueueSize-int- +[sptm]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PoolingOptions.html#setPoolTimeoutMillis-int- +[nhae]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[getErrors]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- +[get_state]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html#getState-- +[BusyPoolException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/BusyPoolException.html diff --git a/manual/query_timestamps/README.md b/manual/query_timestamps/README.md index 4b4f5e22c7a..c6e22870bff 100644 --- a/manual/query_timestamps/README.md +++ b/manual/query_timestamps/README.md @@ -140,10 +140,10 @@ following: Steps 2 and 3 only apply if native protocol v3 or above is in use. -[TimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TimestampGenerator.html -[AtomicMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.html -[ThreadLocalMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.html -[ServerSideTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ServerSideTimestampGenerator.html +[TimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TimestampGenerator.html +[AtomicMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.html +[ThreadLocalMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.html +[ServerSideTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ServerSideTimestampGenerator.html [gettimeofday]: http://man7.org/linux/man-pages/man2/settimeofday.2.html [JNR]: https://github.com/jnr/jnr-ffi diff --git a/manual/reconnection/README.md b/manual/reconnection/README.md index 1fc7c6a6ad1..eee3b023a5d 100644 --- a/manual/reconnection/README.md +++ b/manual/reconnection/README.md @@ -29,7 +29,7 @@ You can also write your own policy; it must implement [ReconnectionPolicy]. For best results, use reasonable values: very low values (for example a constant delay of 10 milliseconds) will quickly saturate your system. -[ReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/ReconnectionPolicy.html -[Cluster.Builder.withReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Cluster.Builder.html#withReconnectionPolicy-com.datastax.driver.core.policies.ReconnectionPolicy- -[ExponentialReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.html -[ConstantReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/ConstantReconnectionPolicy.html +[ReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/ReconnectionPolicy.html +[Cluster.Builder.withReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withReconnectionPolicy-com.datastax.driver.core.policies.ReconnectionPolicy- +[ExponentialReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.html +[ConstantReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/ConstantReconnectionPolicy.html diff --git a/manual/retries/README.md b/manual/retries/README.md index ed514f4879d..de5cf3b8a67 100644 --- a/manual/retries/README.md +++ b/manual/retries/README.md @@ -146,33 +146,33 @@ implementations to handle idempotence (the new behavior is equivalent to what yo `IdempotenceAwareRetryPolicy` before). -[RetryDecision]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html -[retry()]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#retry-com.datastax.driver.core.ConsistencyLevel- -[tryNextHost()]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#tryNextHost-com.datastax.driver.core.ConsistencyLevel- -[rethrow()]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#rethrow-- -[ignore()]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#ignore-- -[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/NoHostAvailableException.html -[getErrors()]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- -[RetryPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.html -[DefaultRetryPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/DefaultRetryPolicy.html -[onReadTimeout]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- -[onWriteTimeout]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onWriteTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.WriteType-int-int-int- -[onUnavailable]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onUnavailable-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-int- -[onRequestError]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- -[UnavailableException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/UnavailableException.html -[ReadTimeoutException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/ReadTimeoutException.html -[WriteTimeoutException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/WriteTimeoutException.html -[OverloadedException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/OverloadedException.html -[ServerError]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/ServerError.html -[OperationTimedOutException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/OperationTimedOutException.html -[ConnectionException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/ConnectionException.html -[QueryValidationException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/QueryValidationException.html -[InvalidQueryException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/InvalidQueryException.html -[InvalidConfigurationInQueryException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.html -[UnauthorizedException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/UnauthorizedException.html -[SyntaxError]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/SyntaxError.html -[AlreadyExistsException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/AlreadyExistsException.html -[TruncateException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/TruncateException.html +[RetryDecision]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html +[retry()]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#retry-com.datastax.driver.core.ConsistencyLevel- +[tryNextHost()]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#tryNextHost-com.datastax.driver.core.ConsistencyLevel- +[rethrow()]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#rethrow-- +[ignore()]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#ignore-- +[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[getErrors()]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- +[RetryPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.html +[DefaultRetryPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/DefaultRetryPolicy.html +[onReadTimeout]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- +[onWriteTimeout]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onWriteTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.WriteType-int-int-int- +[onUnavailable]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onUnavailable-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-int- +[onRequestError]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- +[UnavailableException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/UnavailableException.html +[ReadTimeoutException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/ReadTimeoutException.html +[WriteTimeoutException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/WriteTimeoutException.html +[OverloadedException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/OverloadedException.html +[ServerError]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/ServerError.html +[OperationTimedOutException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/OperationTimedOutException.html +[ConnectionException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/ConnectionException.html +[QueryValidationException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/QueryValidationException.html +[InvalidQueryException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/InvalidQueryException.html +[InvalidConfigurationInQueryException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.html +[UnauthorizedException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/UnauthorizedException.html +[SyntaxError]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/SyntaxError.html +[AlreadyExistsException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/AlreadyExistsException.html +[TruncateException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/TruncateException.html [query plan]: ../load_balancing/#query-plan [connection pool]: ../pooling/ diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md index 44b32016e33..97f924241d7 100644 --- a/manual/shaded_jar/README.md +++ b/manual/shaded_jar/README.md @@ -12,7 +12,7 @@ package name: com.datastax.cassandra cassandra-driver-core - 3.8.0 + 3.9.0 shaded @@ -32,7 +32,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-core - 3.8.0 + 3.9.0 shaded @@ -44,7 +44,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-mapping - 3.8.0 + 3.9.0 com.datastax.cassandra @@ -74,5 +74,5 @@ detects that shaded Netty classes are being used: Detected shaded Netty classes in the classpath; native epoll transport will not work properly, defaulting to NIO. -[NettyOptions]:http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/NettyOptions.html +[NettyOptions]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/NettyOptions.html [Netty native transports]:http://netty.io/wiki/native-transports.html diff --git a/manual/socket_options/README.md b/manual/socket_options/README.md index 7b342fa75f6..1cd55e5e3e9 100644 --- a/manual/socket_options/README.md +++ b/manual/socket_options/README.md @@ -117,15 +117,15 @@ To clarify: We might rename `SocketOptions.setReadTimeoutMillis` in a future version to clear up any confusion. -[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html -[setReadTimeoutMillis]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setReadTimeoutMillis-int- -[setConnectTimeoutMillis]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setConnectTimeoutMillis-int- -[setKeepAlive]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setKeepAlive-boolean- -[setReceiveBufferSize]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setReceiveBufferSize-int- -[setReuseAddress]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setReuseAddress-boolean- -[setSendBufferSize]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setSendBufferSize-int- -[setSoLinger]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setSoLinger-int- -[setTcpNoDelay]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setTcpNoDelay-boolean- -[onReadTimeout]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- -[onRequestError]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- -[OperationTimedOutException]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/exceptions/OperationTimedOutException.html \ No newline at end of file +[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html +[setReadTimeoutMillis]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setReadTimeoutMillis-int- +[setConnectTimeoutMillis]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setConnectTimeoutMillis-int- +[setKeepAlive]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setKeepAlive-boolean- +[setReceiveBufferSize]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setReceiveBufferSize-int- +[setReuseAddress]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setReuseAddress-boolean- +[setSendBufferSize]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setSendBufferSize-int- +[setSoLinger]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setSoLinger-int- +[setTcpNoDelay]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setTcpNoDelay-boolean- +[onReadTimeout]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- +[onRequestError]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- +[OperationTimedOutException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/OperationTimedOutException.html \ No newline at end of file diff --git a/manual/speculative_execution/README.md b/manual/speculative_execution/README.md index 5864c0e1bbe..8913db069fb 100644 --- a/manual/speculative_execution/README.md +++ b/manual/speculative_execution/README.md @@ -73,7 +73,7 @@ Speculative executions are controlled by an instance of `Cluster`. This policy defines the threshold after which a new speculative execution will be triggered. -[SpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html +[SpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html Two implementations are provided with the driver: @@ -101,7 +101,7 @@ way: * if no response has been received at t0 + 1000 milliseconds, start another speculative execution on a third node. -[ConstantSpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/ConstantSpeculativeExecutionPolicy.html +[ConstantSpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/ConstantSpeculativeExecutionPolicy.html #### [PercentileSpeculativeExecutionPolicy] @@ -160,10 +160,10 @@ Note that `PercentileTracker` may also be used with a slow query logger (see the [Logging](../logging/) section). In that case, you would create a single tracker object and share it with both components. -[PercentileSpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/PercentileSpeculativeExecutionPolicy.html -[PercentileTracker]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PercentileTracker.html -[ClusterWidePercentileTracker]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ClusterWidePercentileTracker.html -[PerHostPercentileTracker]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PerHostPercentileTracker.html +[PercentileSpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/PercentileSpeculativeExecutionPolicy.html +[PercentileTracker]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PercentileTracker.html +[ClusterWidePercentileTracker]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ClusterWidePercentileTracker.html +[PerHostPercentileTracker]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PerHostPercentileTracker.html [hdr]: http://hdrhistogram.github.io/HdrHistogram/ #### Using your own @@ -210,7 +210,7 @@ client driver exec1 exec2 The only impact is that all executions of the same query always share the same query plan, so each host will be used by at most one execution. -[retry_policy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.html +[retry_policy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.html ### Tuning and practical details @@ -225,8 +225,8 @@ You can monitor how many speculative executions were triggered with the It should only be a few percents of the total number of requests ([cluster.getMetrics().getRequestsTimer().getCount()][request_metric]). -[se_metric]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metrics.Errors.html#getSpeculativeExecutions-- -[request_metric]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Metrics.html#getRequestsTimer-- +[se_metric]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metrics.Errors.html#getSpeculativeExecutions-- +[request_metric]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metrics.html#getRequestsTimer-- #### Stream id exhaustion @@ -255,8 +255,8 @@ sustained. If you're unsure of which native protocol version you're using, you can check with [cluster.getConfiguration().getProtocolOptions().getProtocolVersion()][protocol_version]. -[session_state]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.State.html -[protocol_version]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- +[session_state]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.State.html +[protocol_version]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- #### Request ordering and client timestamps diff --git a/manual/ssl/README.md b/manual/ssl/README.md index 69054b4f147..35ec7c0537f 100644 --- a/manual/ssl/README.md +++ b/manual/ssl/README.md @@ -207,8 +207,8 @@ Cluster cluster = Cluster.builder() .build(); ``` -[RemoteEndpointAwareSSLOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.html -[RemoteEndpointAwareJdkSSLOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html -[newSSLEngine]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html#newSSLEngine-io.netty.channel.socket.SocketChannel-java.net.InetSocketAddress- -[RemoteEndpointAwareNettySSLOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.html -[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/NettyOptions.html +[RemoteEndpointAwareSSLOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.html +[RemoteEndpointAwareJdkSSLOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html +[newSSLEngine]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html#newSSLEngine-io.netty.channel.socket.SocketChannel-java.net.InetSocketAddress- +[RemoteEndpointAwareNettySSLOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.html +[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/NettyOptions.html diff --git a/manual/statements/README.md b/manual/statements/README.md index f1e6d194978..5c5bacf0cf8 100644 --- a/manual/statements/README.md +++ b/manual/statements/README.md @@ -32,11 +32,11 @@ If you use custom policies ([RetryPolicy], [LoadBalancingPolicy], properties that influence statement execution. To achieve this, you can wrap your statements in a custom [StatementWrapper] implementation. -[Statement]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Statement.html -[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/querybuilder/QueryBuilder.html -[StatementWrapper]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/StatementWrapper.html -[RetryPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/RetryPolicy.html -[LoadBalancingPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/LoadBalancingPolicy.html -[SpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html -[execute]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- -[executeAsync]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- +[Statement]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Statement.html +[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/querybuilder/QueryBuilder.html +[StatementWrapper]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/StatementWrapper.html +[RetryPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.html +[LoadBalancingPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LoadBalancingPolicy.html +[SpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html +[execute]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- +[executeAsync]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- diff --git a/manual/statements/batch/README.md b/manual/statements/batch/README.md index e962084e27f..c036074c4ea 100644 --- a/manual/statements/batch/README.md +++ b/manual/statements/batch/README.md @@ -34,9 +34,9 @@ In addition, simple statements with named parameters are currently not supported due to a [protocol limitation][CASSANDRA-10246] that will be fixed in a future version). If you try to execute such a batch, an `IllegalArgumentException` is thrown. -[BatchStatement]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/BatchStatement.html +[BatchStatement]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/BatchStatement.html [batch_dse]: http://docs.datastax.com/en/dse/5.1/cql/cql/cql_using/useBatch.html -[LOGGED]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/BatchStatement.Type.html#LOGGED -[UNLOGGED]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/BatchStatement.Type.html#UNLOGGED +[LOGGED]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/BatchStatement.Type.html#LOGGED +[UNLOGGED]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/BatchStatement.Type.html#UNLOGGED [batch_size_fail_threshold]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html#configCassandra_yaml__batch_size_fail_threshold_in_kb [CASSANDRA-10246]: https://issues.apache.org/jira/browse/CASSANDRA-10246 diff --git a/manual/statements/built/README.md b/manual/statements/built/README.md index ed79b5d065d..58d9fda3058 100644 --- a/manual/statements/built/README.md +++ b/manual/statements/built/README.md @@ -76,7 +76,7 @@ BuiltStatement ttlAndWriteTime = QueryBuilder.select().column("id").column("t") ``` You can also cast the value of the given column to another type by using the `cast` function, -[specifying](https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/querybuilder/QueryBuilder.html#cast-java.lang.Object-com.datastax.driver.core.DataType-) +[specifying](https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/querybuilder/QueryBuilder.html#cast-java.lang.Object-com.datastax.driver.core.DataType-) the column for which it should be performed, and to what type it should be casted. #### Specifying conditions @@ -92,7 +92,7 @@ BuiltStatement selectOne = QueryBuilder.select().from("test", "test") The `where` function accepts the `Clause` object that is generated by calling `QueryBuilder`'s -[functions](https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/querybuilder/QueryBuilder.html#eq-java.lang.Iterable-java.lang.Iterable-), +[functions](https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/querybuilder/QueryBuilder.html#eq-java.lang.Iterable-java.lang.Iterable-), such as, `eq`, `ne`, `lt`, `in`, `contains`, `notNull`, etc. In most cases, these functions receive 2 arguments: the name of the column, and the value to compare, but there are also variants that receive 2 iterables for columns and values correspondingly. @@ -263,6 +263,6 @@ Note: the call to these functions changes the object type from `BuiltStatement` -[QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/querybuilder/QueryBuilder.html -[TableMetadata]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TableMetadata.html -[SchemaBuilder]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/schemabuilder/SchemaBuilder.html +[QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/querybuilder/QueryBuilder.html +[TableMetadata]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TableMetadata.html +[SchemaBuilder]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/schemabuilder/SchemaBuilder.html diff --git a/manual/statements/prepared/README.md b/manual/statements/prepared/README.md index 59a12aeda44..ce0cbcc58d2 100644 --- a/manual/statements/prepared/README.md +++ b/manual/statements/prepared/README.md @@ -256,11 +256,11 @@ relying on `SELECT *`. This will be addressed in a future release of both Cassandra and the driver. Follow [CASSANDRA-10786] and [JAVA-1196] for more information. -[PreparedStatement]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/PreparedStatement.html -[BoundStatement]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/BoundStatement.html -[setPrepareOnAllHosts]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/QueryOptions.html#setPrepareOnAllHosts-boolean- -[setReprepareOnUp]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/QueryOptions.html#setReprepareOnUp-boolean- -[execute]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- -[executeAsync]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- +[PreparedStatement]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PreparedStatement.html +[BoundStatement]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/BoundStatement.html +[setPrepareOnAllHosts]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/QueryOptions.html#setPrepareOnAllHosts-boolean- +[setReprepareOnUp]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/QueryOptions.html#setReprepareOnUp-boolean- +[execute]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- +[executeAsync]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- [CASSANDRA-10786]: https://issues.apache.org/jira/browse/CASSANDRA-10786 [JAVA-1196]: https://datastax-oss.atlassian.net/browse/JAVA-1196 diff --git a/manual/statements/simple/README.md b/manual/statements/simple/README.md index e021072e6d3..00bdc0fad8b 100644 --- a/manual/statements/simple/README.md +++ b/manual/statements/simple/README.md @@ -128,4 +128,4 @@ session.execute( 1, bytes); ``` -[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SimpleStatement.html +[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SimpleStatement.html diff --git a/manual/tuples/README.md b/manual/tuples/README.md index 898b0819c1b..de11ae2cf78 100644 --- a/manual/tuples/README.md +++ b/manual/tuples/README.md @@ -96,7 +96,7 @@ bs.setList("l", Arrays.asList(oneTimeUsageTuple.newValue("1", "1"), oneTimeUsage session.execute(bs); ``` -[TupleType]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TupleType.html -[TupleValue]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TupleValue.html -[newValueVararg]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TupleType.html#newValue-java.lang.Object...- -[newValue]: http://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/TupleType.html#newValue-- +[TupleType]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TupleType.html +[TupleValue]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TupleValue.html +[newValueVararg]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TupleType.html#newValue-java.lang.Object...- +[newValue]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TupleType.html#newValue-- diff --git a/manual/udts/README.md b/manual/udts/README.md index 5bbb020276e..56ef63a8935 100644 --- a/manual/udts/README.md +++ b/manual/udts/README.md @@ -95,5 +95,5 @@ session.execute(bs); [cql_doc]: https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlRefUDType.html -[UDTValue]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/UDTValue.html -[UserType]: https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/UserType.html +[UDTValue]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/UDTValue.html +[UserType]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/UserType.html diff --git a/pom.xml b/pom.xml index c67ff316083..ed9df6f2ee4 100644 --- a/pom.xml +++ b/pom.xml @@ -641,7 +641,7 @@ - 3.7.2 + 3.8.0 ../clirr-ignores.xml com/datastax/shaded/** From 1e736e0bd364369ebda9fa9dd317cf42125d8b0f Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Tue, 28 Apr 2020 11:34:00 -0500 Subject: [PATCH 079/211] [maven-release-plugin] prepare release 3.9.0 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 53c0c4e7cee..d3ec0522351 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.1-SNAPSHOT + 3.9.0 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 42b7a1f1269..96e6446aa27 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.1-SNAPSHOT + 3.9.0 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index a6113c2e6ed..134792b0a39 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.1-SNAPSHOT + 3.9.0 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 207c59594bc..a5c5d44ed57 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.1-SNAPSHOT + 3.9.0 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 4e63f03fc18..a5adf30ac40 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.1-SNAPSHOT + 3.9.0 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 39a38540bc3..58781356650 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.8.1-SNAPSHOT + 3.9.0 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index d9174bc31a4..c28fcf3e981 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.1-SNAPSHOT + 3.9.0 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 9b6d5650d42..28c5ea716be 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.8.1-SNAPSHOT + 3.9.0 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 2c5c54bf246..361b67ff721 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.8.1-SNAPSHOT + 3.9.0 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index d3dd8de56ab..cddd0f30028 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.8.1-SNAPSHOT + 3.9.0 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 74ef598517e..ed940882036 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.8.1-SNAPSHOT + 3.9.0 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index ed9df6f2ee4..dc5841db60d 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.8.1-SNAPSHOT + 3.9.0 pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.9.0 From a8339723193b68b9f49c469277ceb12b8181a2c8 Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Tue, 28 Apr 2020 11:34:12 -0500 Subject: [PATCH 080/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index d3ec0522351..0e477b33a4b 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.9.0 + 3.9.1-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 96e6446aa27..041f87aa124 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.9.0 + 3.9.1-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 134792b0a39..ad29e09b98f 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.9.0 + 3.9.1-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index a5c5d44ed57..9afbb1c26fd 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.9.0 + 3.9.1-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index a5adf30ac40..7adedebe76f 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.9.0 + 3.9.1-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 58781356650..5f06c5bc7ff 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.9.0 + 3.9.1-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index c28fcf3e981..07e51b21e81 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.9.0 + 3.9.1-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 28c5ea716be..495e0d30727 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.9.0 + 3.9.1-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 361b67ff721..83a9f84d589 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.9.0 + 3.9.1-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index cddd0f30028..ebc3af952df 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.9.0 + 3.9.1-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index ed940882036..936536e2bab 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.9.0 + 3.9.1-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index dc5841db60d..31caf78eaf6 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.9.0 + 3.9.1-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.9.0 + HEAD From 53e54acfdb2430fef7849441995c29dcf18df454 Mon Sep 17 00:00:00 2001 From: olim7t Date: Thu, 14 May 2020 11:24:04 -0700 Subject: [PATCH 081/211] Remove obsolete TODOs in LZ4Compressor --- .../src/main/java/com/datastax/driver/core/LZ4Compressor.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/LZ4Compressor.java b/driver-core/src/main/java/com/datastax/driver/core/LZ4Compressor.java index 2a0a3d15b11..c72208f780c 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/LZ4Compressor.java +++ b/driver-core/src/main/java/com/datastax/driver/core/LZ4Compressor.java @@ -59,8 +59,6 @@ private LZ4Compressor() { @Override Frame compress(Frame frame) throws IOException { ByteBuf input = frame.body; - - // TODO: JAVA-1306: Use the same API calls for direct and heap buffers when LZ4 updated. ByteBuf frameBody = input.isDirect() ? compressDirect(input) : compressHeap(input); return frame.with(frameBody); } @@ -126,8 +124,6 @@ private ByteBuf compressHeap(ByteBuf input) throws IOException { @Override Frame decompress(Frame frame) throws IOException { ByteBuf input = frame.body; - - // TODO: JAVA-1306: Use the same API calls for direct and heap buffers when LZ4 updated. ByteBuf frameBody = input.isDirect() ? decompressDirect(input) : decompressHeap(input); return frame.with(frameBody); } From ae5bd955e9fc1ccec382d8bbe298279b30acec31 Mon Sep 17 00:00:00 2001 From: olim7t Date: Wed, 20 May 2020 16:01:00 -0700 Subject: [PATCH 082/211] Backport JAVA-2676: Don't reschedule flusher after empty runs --- changelog/README.md | 4 ++ .../com/datastax/driver/core/Connection.java | 55 +++++++++++++------ 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 2a1555c5bb4..76838b7d7a7 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,6 +5,10 @@ 3.x versions get published. --> +## 3.10.0 (in progress) + +- [improvement] JAVA-2676: Don't reschedule flusher after empty runs + ## 3.9.0 - [bug] JAVA-2627: Avoid logging error message including stack trace in request handler. diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java index 583147783ab..6718273aea9 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java @@ -19,15 +19,40 @@ import static io.netty.handler.timeout.IdleState.READER_IDLE; import com.datastax.driver.core.Responses.Result.SetKeyspace; -import com.datastax.driver.core.exceptions.*; +import com.datastax.driver.core.exceptions.AuthenticationException; +import com.datastax.driver.core.exceptions.BusyConnectionException; +import com.datastax.driver.core.exceptions.ConnectionException; +import com.datastax.driver.core.exceptions.DriverException; +import com.datastax.driver.core.exceptions.DriverInternalError; +import com.datastax.driver.core.exceptions.FrameTooLongException; +import com.datastax.driver.core.exceptions.OperationTimedOutException; +import com.datastax.driver.core.exceptions.TransportException; +import com.datastax.driver.core.exceptions.UnsupportedProtocolVersionException; import com.datastax.driver.core.utils.MoreFutures; import com.datastax.driver.core.utils.MoreObjects; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; import com.google.common.collect.MapMaker; -import com.google.common.util.concurrent.*; +import com.google.common.util.concurrent.AbstractFuture; +import com.google.common.util.concurrent.AsyncFunction; +import com.google.common.util.concurrent.FutureCallback; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.ListeningExecutorService; +import com.google.common.util.concurrent.SettableFuture; +import com.google.common.util.concurrent.Uninterruptibles; import io.netty.bootstrap.Bootstrap; -import io.netty.channel.*; +import io.netty.channel.Channel; +import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInitializer; +import io.netty.channel.ChannelOption; +import io.netty.channel.ChannelPipeline; +import io.netty.channel.EventLoop; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.SimpleChannelInboundHandler; import io.netty.channel.group.ChannelGroup; import io.netty.channel.group.DefaultChannelGroup; import io.netty.channel.socket.SocketChannel; @@ -44,7 +69,12 @@ import java.util.Iterator; import java.util.List; import java.util.Queue; -import java.util.concurrent.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executor; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; @@ -65,8 +95,6 @@ class Connection { SystemProperties.getBoolean("com.datastax.driver.DISABLE_COALESCING", false); private static final int FLUSHER_SCHEDULE_PERIOD_NS = SystemProperties.getInt("com.datastax.driver.FLUSHER_SCHEDULE_PERIOD_NS", 10000); - private static final int FLUSHER_RUN_WITHOUT_WORK_TIMES = - SystemProperties.getInt("com.datastax.driver.FLUSHER_RUN_WITHOUT_WORK_TIMES", 5); enum State { OPEN, @@ -1098,7 +1126,6 @@ private static final class Flusher implements Runnable { final Queue queued = new ConcurrentLinkedQueue(); final AtomicBoolean running = new AtomicBoolean(false); final HashSet channels = new HashSet(); - int runsWithNoWork = 0; private Flusher(EventLoop eventLoop) { this.eventLoopRef = new WeakReference(eventLoop); @@ -1114,14 +1141,12 @@ void start() { @Override public void run() { - boolean doneWork = false; FlushItem flush; while (null != (flush = queued.poll())) { Channel channel = flush.channel; if (channel.isActive()) { channels.add(channel); channel.write(flush.request).addListener(flush.listener); - doneWork = true; } } @@ -1129,15 +1154,9 @@ public void run() { for (Channel channel : channels) channel.flush(); channels.clear(); - if (doneWork) { - runsWithNoWork = 0; - } else { - // either reschedule or cancel - if (++runsWithNoWork > FLUSHER_RUN_WITHOUT_WORK_TIMES) { - running.set(false); - if (queued.isEmpty() || !running.compareAndSet(false, true)) return; - } - } + // either reschedule or cancel + running.set(false); + if (queued.isEmpty() || !running.compareAndSet(false, true)) return; EventLoop eventLoop = eventLoopRef.get(); if (eventLoop != null && !eventLoop.isShuttingDown()) { From c0bc309bd17d9890969327fb810e60aa3d68e12e Mon Sep 17 00:00:00 2001 From: olim7t Date: Fri, 15 May 2020 11:01:31 -0700 Subject: [PATCH 083/211] JAVA-2772: Support new protocol v5 message format https://issues.apache.org/jira/browse/CASSANDRA-15299 --- changelog/README.md | 1 + .../driver/core/BytesToSegmentDecoder.java | 81 +++++ .../com/datastax/driver/core/Connection.java | 50 ++- .../java/com/datastax/driver/core/Crc.java | 148 +++++++++ .../java/com/datastax/driver/core/Frame.java | 100 +++--- .../datastax/driver/core/FrameCompressor.java | 9 + .../datastax/driver/core/LZ4Compressor.java | 59 +++- .../com/datastax/driver/core/Message.java | 58 +++- .../driver/core/MessageToSegmentEncoder.java | 56 ++++ .../com/datastax/driver/core/Segment.java | 60 ++++ .../datastax/driver/core/SegmentBuilder.java | 257 +++++++++++++++ .../datastax/driver/core/SegmentCodec.java | 210 ++++++++++++ .../driver/core/SegmentToBytesEncoder.java | 38 +++ .../driver/core/SegmentToFrameDecoder.java | 95 ++++++ .../driver/core/SnappyCompressor.java | 16 +- .../core/exceptions/CrcMismatchException.java | 41 +++ .../core/BytesToSegmentDecoderTest.java | 137 ++++++++ .../driver/core/SegmentBuilderTest.java | 308 ++++++++++++++++++ .../driver/core/SegmentCodecTest.java | 142 ++++++++ .../core/SegmentToFrameDecoderTest.java | 120 +++++++ 20 files changed, 1904 insertions(+), 82 deletions(-) create mode 100644 driver-core/src/main/java/com/datastax/driver/core/BytesToSegmentDecoder.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/Crc.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/MessageToSegmentEncoder.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/Segment.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/SegmentBuilder.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/SegmentCodec.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/SegmentToBytesEncoder.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/SegmentToFrameDecoder.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/exceptions/CrcMismatchException.java create mode 100644 driver-core/src/test/java/com/datastax/driver/core/BytesToSegmentDecoderTest.java create mode 100644 driver-core/src/test/java/com/datastax/driver/core/SegmentBuilderTest.java create mode 100644 driver-core/src/test/java/com/datastax/driver/core/SegmentCodecTest.java create mode 100644 driver-core/src/test/java/com/datastax/driver/core/SegmentToFrameDecoderTest.java diff --git a/changelog/README.md b/changelog/README.md index 76838b7d7a7..5030a100c64 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -8,6 +8,7 @@ ## 3.10.0 (in progress) - [improvement] JAVA-2676: Don't reschedule flusher after empty runs +- [new feature] JAVA-2772: Support new protocol v5 message format ## 3.9.0 diff --git a/driver-core/src/main/java/com/datastax/driver/core/BytesToSegmentDecoder.java b/driver-core/src/main/java/com/datastax/driver/core/BytesToSegmentDecoder.java new file mode 100644 index 00000000000..58eda4fde27 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/BytesToSegmentDecoder.java @@ -0,0 +1,81 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.LengthFieldBasedFrameDecoder; +import java.nio.ByteOrder; + +/** + * Decodes {@link Segment}s from a stream of bytes. + * + *

    This works like a regular length-field-based decoder, but we override {@link + * #getUnadjustedFrameLength} to handle two peculiarities: the length is encoded on 17 bits, and we + * also want to check the header CRC before we use it. So we parse the whole segment header ahead of + * time, and store it until we're ready to build the segment. + */ +class BytesToSegmentDecoder extends LengthFieldBasedFrameDecoder { + + private final SegmentCodec segmentCodec; + private SegmentCodec.Header header; + + BytesToSegmentDecoder(SegmentCodec segmentCodec) { + super( + // max length (Netty wants this to be the overall length including everything): + segmentCodec.headerLength() + + SegmentCodec.CRC24_LENGTH + + Segment.MAX_PAYLOAD_LENGTH + + SegmentCodec.CRC32_LENGTH, + // offset and size of the "length" field: that's the whole header + 0, + segmentCodec.headerLength() + SegmentCodec.CRC24_LENGTH, + // length adjustment: add the trailing CRC to the declared length + SegmentCodec.CRC32_LENGTH, + // bytes to skip: the header (we've already parsed it while reading the length) + segmentCodec.headerLength() + SegmentCodec.CRC24_LENGTH); + this.segmentCodec = segmentCodec; + } + + @Override + protected Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception { + try { + ByteBuf payloadAndCrc = (ByteBuf) super.decode(ctx, in); + if (payloadAndCrc == null) { + return null; + } else { + assert header != null; + Segment segment = segmentCodec.decode(header, payloadAndCrc); + header = null; + return segment; + } + } catch (Exception e) { + // Don't hold on to a stale header if we failed to decode the rest of the segment + header = null; + throw e; + } + } + + @Override + protected long getUnadjustedFrameLength(ByteBuf buffer, int offset, int length, ByteOrder order) { + // The parent class calls this repeatedly for the same "frame" if there weren't enough + // accumulated bytes the first time. Only decode the header the first time: + if (header == null) { + header = segmentCodec.decodeHeader(buffer.slice(offset, length)); + } + return header.payloadLength; + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java index 6718273aea9..974e2bdf6ed 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java @@ -22,6 +22,7 @@ import com.datastax.driver.core.exceptions.AuthenticationException; import com.datastax.driver.core.exceptions.BusyConnectionException; import com.datastax.driver.core.exceptions.ConnectionException; +import com.datastax.driver.core.exceptions.CrcMismatchException; import com.datastax.driver.core.exceptions.DriverException; import com.datastax.driver.core.exceptions.DriverInternalError; import com.datastax.driver.core.exceptions.FrameTooLongException; @@ -345,6 +346,11 @@ private AsyncFunction onStartupResponse( return new AsyncFunction() { @Override public ListenableFuture apply(Message.Response response) throws Exception { + + if (protocolVersion.compareTo(ProtocolVersion.V5) >= 0 && response.type != ERROR) { + switchToV5Framing(); + } + switch (response.type) { case READY: return checkClusterName(protocolVersion, initExecutor); @@ -1325,7 +1331,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E // Special case, if we encountered a FrameTooLongException, raise exception on handler and // don't defunct it since // the connection is in an ok state. - if (error != null && error instanceof FrameTooLongException) { + if (error instanceof FrameTooLongException) { FrameTooLongException ftle = (FrameTooLongException) error; int streamId = ftle.getStreamId(); ResponseHandler handler = pending.remove(streamId); @@ -1344,6 +1350,9 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E handler.callback.onException( Connection.this, ftle, System.nanoTime() - handler.startTime, handler.retryCount); return; + } else if (error instanceof CrcMismatchException) { + // Fall back to the defunct call below, but we want a clear warning in the logs + logger.warn("CRC mismatch while decoding a response, dropping the connection", error); } } defunct( @@ -1711,7 +1720,11 @@ protected void initChannel(SocketChannel channel) throws Exception { pipeline.addLast("frameDecoder", new Frame.Decoder()); pipeline.addLast("frameEncoder", frameEncoder); - if (compressor != null) { + if (compressor != null + // Frame-level compression is only done in legacy protocol versions. In V5 and above, it + // happens at a higher level ("segment" that groups multiple frames), so never install + // those handlers. + && protocolVersion.compareTo(ProtocolVersion.V5) < 0) { pipeline.addLast("frameDecompressor", new Frame.Decompressor(compressor)); pipeline.addLast("frameCompressor", new Frame.Compressor(compressor)); } @@ -1744,6 +1757,39 @@ private Message.ProtocolEncoder messageEncoderFor(ProtocolVersion version) { } } + /** + * Rearranges the pipeline to deal with the new framing structure in protocol v5 and above. This + * has to be done manually, because it only happens once we've confirmed that the server supports + * v5. + */ + void switchToV5Framing() { + assert factory.protocolVersion.compareTo(ProtocolVersion.V5) >= 0; + + // We want to do this on the event loop, to make sure it doesn't race with incoming requests + assert channel.eventLoop().inEventLoop(); + + ChannelPipeline pipeline = channel.pipeline(); + SegmentCodec segmentCodec = + new SegmentCodec( + channel.alloc(), factory.configuration.getProtocolOptions().getCompression()); + + // Outbound: "message -> segment -> bytes" instead of "message -> frame -> bytes" + Message.ProtocolEncoder requestEncoder = + (Message.ProtocolEncoder) pipeline.get("messageEncoder"); + pipeline.replace( + "messageEncoder", + "messageToSegmentEncoder", + new MessageToSegmentEncoder(channel.alloc(), requestEncoder)); + pipeline.replace( + "frameEncoder", "segmentToBytesEncoder", new SegmentToBytesEncoder(segmentCodec)); + + // Inbound: "frame <- segment <- bytes" instead of "frame <- bytes" + pipeline.replace( + "frameDecoder", "bytesToSegmentDecoder", new BytesToSegmentDecoder(segmentCodec)); + pipeline.addAfter( + "bytesToSegmentDecoder", "segmentToFrameDecoder", new SegmentToFrameDecoder()); + } + /** A component that "owns" a connection, and should be notified when it dies. */ interface Owner { void onConnectionDefunct(Connection connection); diff --git a/driver-core/src/main/java/com/datastax/driver/core/Crc.java b/driver-core/src/main/java/com/datastax/driver/core/Crc.java new file mode 100644 index 00000000000..2abcfbfa6c0 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/Crc.java @@ -0,0 +1,148 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import io.netty.buffer.ByteBuf; +import io.netty.util.concurrent.FastThreadLocal; +import java.nio.ByteBuffer; +import java.util.zip.CRC32; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** Copied and adapted from the server-side version. */ +class Crc { + + private static final Logger logger = LoggerFactory.getLogger(Crc.class); + + private static final FastThreadLocal crc32 = + new FastThreadLocal() { + @Override + protected CRC32 initialValue() { + return new CRC32(); + } + }; + + private static final byte[] initialBytes = + new byte[] {(byte) 0xFA, (byte) 0x2D, (byte) 0x55, (byte) 0xCA}; + + private static final CrcUpdater CRC_UPDATER = selectCrcUpdater(); + + static int computeCrc32(ByteBuf buffer) { + CRC32 crc = newCrc32(); + CRC_UPDATER.update(crc, buffer); + return (int) crc.getValue(); + } + + private static CRC32 newCrc32() { + CRC32 crc = crc32.get(); + crc.reset(); + crc.update(initialBytes); + return crc; + } + + private static final int CRC24_INIT = 0x875060; + /** + * Polynomial chosen from https://users.ece.cmu.edu/~koopman/crc/index.html, by Philip Koopman + * + *

    This webpage claims a copyright to Philip Koopman, which he licenses under the Creative + * Commons Attribution 4.0 International License (https://creativecommons.org/licenses/by/4.0) + * + *

    It is unclear if this copyright can extend to a 'fact' such as this specific number, + * particularly as we do not use Koopman's notation to represent the polynomial, but we anyway + * attribute his work and link the terms of his license since they are not incompatible with our + * usage and we greatly appreciate his work. + * + *

    This polynomial provides hamming distance of 8 for messages up to length 105 bits; we only + * support 8-64 bits at present, with an expected range of 40-48. + */ + private static final int CRC24_POLY = 0x1974F0B; + + /** + * NOTE: the order of bytes must reach the wire in the same order the CRC is computed, with the + * CRC immediately following in a trailer. Since we read in least significant byte order, if you + * write to a buffer using putInt or putLong, the byte order will be reversed and you will lose + * the guarantee of protection from burst corruptions of 24 bits in length. + * + *

    Make sure either to write byte-by-byte to the wire, or to use Integer/Long.reverseBytes if + * you write to a BIG_ENDIAN buffer. + * + *

    See http://users.ece.cmu.edu/~koopman/pubs/ray06_crcalgorithms.pdf + * + *

    Complain to the ethernet spec writers, for having inverse bit to byte significance order. + * + *

    Note we use the most naive algorithm here. We support at most 8 bytes, and typically supply + * 5 or fewer, so any efficiency of a table approach is swallowed by the time to hit L3, even for + * a tiny (4bit) table. + * + * @param bytes an up to 8-byte register containing bytes to compute the CRC over the bytes AND + * bits will be read least-significant to most significant. + * @param len the number of bytes, greater than 0 and fewer than 9, to be read from bytes + * @return the least-significant bit AND byte order crc24 using the CRC24_POLY polynomial + */ + static int computeCrc24(long bytes, int len) { + int crc = CRC24_INIT; + while (len-- > 0) { + crc ^= (bytes & 0xff) << 16; + bytes >>= 8; + + for (int i = 0; i < 8; i++) { + crc <<= 1; + if ((crc & 0x1000000) != 0) crc ^= CRC24_POLY; + } + } + return crc; + } + + private static CrcUpdater selectCrcUpdater() { + try { + CRC32.class.getDeclaredMethod("update", ByteBuffer.class); + return new Java8CrcUpdater(); + } catch (Exception e) { + logger.warn( + "It looks like you are running Java 7 or below. " + + "CRC checks (used in protocol {} and above) will require a memory copy, which can " + + "negatively impact performance. Consider using a more modern VM.", + ProtocolVersion.V5, + e); + return new Java6CrcUpdater(); + } + } + + private interface CrcUpdater { + void update(CRC32 crc, ByteBuf buffer); + } + + private static class Java6CrcUpdater implements CrcUpdater { + @Override + public void update(CRC32 crc, ByteBuf buffer) { + if (buffer.hasArray()) { + crc.update(buffer.array(), buffer.arrayOffset(), buffer.readableBytes()); + } else { + byte[] bytes = new byte[buffer.readableBytes()]; + buffer.getBytes(buffer.readerIndex(), bytes); + crc.update(bytes); + } + } + } + + @IgnoreJDK6Requirement + private static class Java8CrcUpdater implements CrcUpdater { + @Override + public void update(CRC32 crc, ByteBuf buffer) { + crc.update(buffer.internalNioBuffer(buffer.readerIndex(), buffer.readableBytes())); + } + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/Frame.java b/driver-core/src/main/java/com/datastax/driver/core/Frame.java index 36d6ee37e7b..efe5949284b 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Frame.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Frame.java @@ -87,29 +87,14 @@ class Frame { final Header header; final ByteBuf body; - private Frame(Header header, ByteBuf body) { + Frame(Header header, ByteBuf body) { this.header = header; this.body = body; } private static Frame create(ByteBuf fullFrame) { - assert fullFrame.readableBytes() >= 1 - : String.format("Frame too short (%d bytes)", fullFrame.readableBytes()); - - int versionBytes = fullFrame.readByte(); - // version first byte is the "direction" of the frame (request or response) - ProtocolVersion version = ProtocolVersion.fromInt(versionBytes & 0x7F); - int hdrLen = Header.lengthFor(version); - assert fullFrame.readableBytes() >= (hdrLen - 1) - : String.format("Frame too short (%d bytes)", fullFrame.readableBytes()); - - int flags = fullFrame.readByte(); - int streamId = readStreamid(fullFrame, version); - int opcode = fullFrame.readByte(); - int length = fullFrame.readInt(); - assert length == fullFrame.readableBytes(); - - Header header = new Header(version, flags, streamId, opcode); + Header header = Header.decode(fullFrame); + assert header.bodyLength == fullFrame.readableBytes(); return new Frame(header, fullFrame); } @@ -129,7 +114,7 @@ private static int readStreamid(ByteBuf fullFrame, ProtocolVersion version) { static Frame create( ProtocolVersion version, int opcode, int streamId, EnumSet flags, ByteBuf body) { - Header header = new Header(version, flags, streamId, opcode); + Header header = new Header(version, flags, streamId, opcode, body.readableBytes()); return new Frame(header, body); } @@ -139,16 +124,22 @@ static class Header { final EnumSet flags; final int streamId; final int opcode; + final int bodyLength; - private Header(ProtocolVersion version, int flags, int streamId, int opcode) { - this(version, Flag.deserialize(flags), streamId, opcode); + private Header(ProtocolVersion version, int flags, int streamId, int opcode, int bodyLength) { + this(version, Flag.deserialize(flags), streamId, opcode, bodyLength); } - private Header(ProtocolVersion version, EnumSet flags, int streamId, int opcode) { + Header(ProtocolVersion version, EnumSet flags, int streamId, int opcode, int bodyLength) { this.version = version; this.flags = flags; this.streamId = streamId; this.opcode = opcode; + this.bodyLength = bodyLength; + } + + Header withNewBodyLength(int newBodyLength) { + return new Header(version, flags, streamId, opcode, newBodyLength); } /** @@ -171,6 +162,46 @@ static int lengthFor(ProtocolVersion version) { } } + public void encodeInto(ByteBuf destination) { + // Don't bother with the direction, we only send requests. + destination.writeByte(version.toInt()); + destination.writeByte(Flag.serialize(flags)); + switch (version) { + case V1: + case V2: + destination.writeByte(streamId); + break; + case V3: + case V4: + case V5: + destination.writeShort(streamId); + break; + default: + throw version.unsupported(); + } + destination.writeByte(opcode); + destination.writeInt(bodyLength); + } + + static Header decode(ByteBuf buffer) { + assert buffer.readableBytes() >= 1 + : String.format("Frame too short (%d bytes)", buffer.readableBytes()); + + int versionBytes = buffer.readByte(); + // version first byte is the "direction" of the frame (request or response) + ProtocolVersion version = ProtocolVersion.fromInt(versionBytes & 0x7F); + int hdrLen = Header.lengthFor(version); + assert buffer.readableBytes() >= (hdrLen - 1) + : String.format("Frame too short (%d bytes)", buffer.readableBytes()); + + int flags = buffer.readByte(); + int streamId = readStreamid(buffer, version); + int opcode = buffer.readByte(); + int length = buffer.readInt(); + + return new Header(version, flags, streamId, opcode, length); + } + enum Flag { // The order of that enum matters!! COMPRESSED, @@ -197,7 +228,7 @@ static int serialize(EnumSet flags) { } Frame with(ByteBuf newBody) { - return new Frame(header, newBody); + return new Frame(header.withNewBodyLength(newBody.readableBytes()), newBody); } static final class Decoder extends ByteToMessageDecoder { @@ -273,32 +304,11 @@ protected void encode(ChannelHandlerContext ctx, Frame frame, List out) throws Exception { ProtocolVersion protocolVersion = frame.header.version; ByteBuf header = ctx.alloc().ioBuffer(Frame.Header.lengthFor(protocolVersion)); - // We don't bother with the direction, we only send requests. - header.writeByte(frame.header.version.toInt()); - header.writeByte(Header.Flag.serialize(frame.header.flags)); - writeStreamId(frame.header.streamId, header, protocolVersion); - header.writeByte(frame.header.opcode); - header.writeInt(frame.body.readableBytes()); + frame.header.encodeInto(header); out.add(header); out.add(frame.body); } - - private void writeStreamId(int streamId, ByteBuf header, ProtocolVersion protocolVersion) { - switch (protocolVersion) { - case V1: - case V2: - header.writeByte(streamId); - break; - case V3: - case V4: - case V5: - header.writeShort(streamId); - break; - default: - throw protocolVersion.unsupported(); - } - } } static class Decompressor extends MessageToMessageDecoder { diff --git a/driver-core/src/main/java/com/datastax/driver/core/FrameCompressor.java b/driver-core/src/main/java/com/datastax/driver/core/FrameCompressor.java index d38e230d7d2..a7d6daf21e6 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/FrameCompressor.java +++ b/driver-core/src/main/java/com/datastax/driver/core/FrameCompressor.java @@ -23,8 +23,17 @@ abstract class FrameCompressor { abstract Frame compress(Frame frame) throws IOException; + /** + * Unlike {@link #compress(Frame)}, this variant does not store the uncompressed length if the + * underlying algorithm does not do it natively (like LZ4). It must be stored separately and + * passed back to {@link #decompress(ByteBuf, int)}. + */ + abstract ByteBuf compress(ByteBuf buffer) throws IOException; + abstract Frame decompress(Frame frame) throws IOException; + abstract ByteBuf decompress(ByteBuf buffer, int uncompressedLength) throws IOException; + protected static ByteBuffer inputNioBuffer(ByteBuf buf) { // Using internalNioBuffer(...) as we only hold the reference in this method and so can // reduce Object allocations. diff --git a/driver-core/src/main/java/com/datastax/driver/core/LZ4Compressor.java b/driver-core/src/main/java/com/datastax/driver/core/LZ4Compressor.java index c72208f780c..a20f400be8e 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/LZ4Compressor.java +++ b/driver-core/src/main/java/com/datastax/driver/core/LZ4Compressor.java @@ -59,22 +59,41 @@ private LZ4Compressor() { @Override Frame compress(Frame frame) throws IOException { ByteBuf input = frame.body; - ByteBuf frameBody = input.isDirect() ? compressDirect(input) : compressHeap(input); + ByteBuf frameBody = compress(input, true); return frame.with(frameBody); } - private ByteBuf compressDirect(ByteBuf input) throws IOException { + @Override + ByteBuf compress(ByteBuf buffer) throws IOException { + return compress(buffer, false); + } + + private ByteBuf compress(ByteBuf buffer, boolean prependWithUncompressedLength) + throws IOException { + return buffer.isDirect() + ? compressDirect(buffer, prependWithUncompressedLength) + : compressHeap(buffer, prependWithUncompressedLength); + } + + private ByteBuf compressDirect(ByteBuf input, boolean prependWithUncompressedLength) + throws IOException { int maxCompressedLength = compressor.maxCompressedLength(input.readableBytes()); // If the input is direct we will allocate a direct output buffer as well as this will allow us // to use // LZ4Compressor.compress and so eliminate memory copies. - ByteBuf output = input.alloc().directBuffer(INTEGER_BYTES + maxCompressedLength); + ByteBuf output = + input + .alloc() + .directBuffer( + (prependWithUncompressedLength ? INTEGER_BYTES : 0) + maxCompressedLength); try { ByteBuffer in = inputNioBuffer(input); // Increase reader index. input.readerIndex(input.writerIndex()); - output.writeInt(in.remaining()); + if (prependWithUncompressedLength) { + output.writeInt(in.remaining()); + } ByteBuffer out = outputNioBuffer(output); int written = @@ -90,7 +109,8 @@ private ByteBuf compressDirect(ByteBuf input) throws IOException { return output; } - private ByteBuf compressHeap(ByteBuf input) throws IOException { + private ByteBuf compressHeap(ByteBuf input, boolean prependWithUncompressedLength) + throws IOException { int maxCompressedLength = compressor.maxCompressedLength(input.readableBytes()); // Not a direct buffer so use byte arrays... @@ -103,9 +123,14 @@ private ByteBuf compressHeap(ByteBuf input) throws IOException { // Allocate a heap buffer from the ByteBufAllocator as we may use a PooledByteBufAllocator and // so // can eliminate the overhead of allocate a new byte[]. - ByteBuf output = input.alloc().heapBuffer(INTEGER_BYTES + maxCompressedLength); + ByteBuf output = + input + .alloc() + .heapBuffer((prependWithUncompressedLength ? INTEGER_BYTES : 0) + maxCompressedLength); try { - output.writeInt(len); + if (prependWithUncompressedLength) { + output.writeInt(len); + } // calculate the correct offset. int offset = output.arrayOffset() + output.writerIndex(); byte[] out = output.array(); @@ -124,16 +149,23 @@ private ByteBuf compressHeap(ByteBuf input) throws IOException { @Override Frame decompress(Frame frame) throws IOException { ByteBuf input = frame.body; - ByteBuf frameBody = input.isDirect() ? decompressDirect(input) : decompressHeap(input); + int uncompressedLength = input.readInt(); + ByteBuf frameBody = decompress(input, uncompressedLength); return frame.with(frameBody); } - private ByteBuf decompressDirect(ByteBuf input) throws IOException { + @Override + ByteBuf decompress(ByteBuf buffer, int uncompressedLength) throws IOException { + return buffer.isDirect() + ? decompressDirect(buffer, uncompressedLength) + : decompressHeap(buffer, uncompressedLength); + } + + private ByteBuf decompressDirect(ByteBuf input, int uncompressedLength) throws IOException { // If the input is direct we will allocate a direct output buffer as well as this will allow us // to use // LZ4Compressor.decompress and so eliminate memory copies. int readable = input.readableBytes(); - int uncompressedLength = input.readInt(); ByteBuffer in = inputNioBuffer(input); // Increase reader index. input.readerIndex(input.writerIndex()); @@ -141,7 +173,7 @@ private ByteBuf decompressDirect(ByteBuf input) throws IOException { try { ByteBuffer out = outputNioBuffer(output); int read = decompressor.decompress(in, in.position(), out, out.position(), out.remaining()); - if (read != readable - INTEGER_BYTES) throw new IOException("Compressed lengths mismatch"); + if (read != readable) throw new IOException("Compressed lengths mismatch"); // Set the writer index so the amount of written bytes is reflected output.writerIndex(output.writerIndex() + uncompressedLength); @@ -153,11 +185,10 @@ private ByteBuf decompressDirect(ByteBuf input) throws IOException { return output; } - private ByteBuf decompressHeap(ByteBuf input) throws IOException { + private ByteBuf decompressHeap(ByteBuf input, int uncompressedLength) throws IOException { // Not a direct buffer so use byte arrays... byte[] in = input.array(); int len = input.readableBytes(); - int uncompressedLength = input.readInt(); int inOffset = input.arrayOffset() + input.readerIndex(); // Increase reader index. input.readerIndex(input.writerIndex()); @@ -170,7 +201,7 @@ private ByteBuf decompressHeap(ByteBuf input) throws IOException { int offset = output.arrayOffset() + output.writerIndex(); byte out[] = output.array(); int read = decompressor.decompress(in, inOffset, out, offset, uncompressedLength); - if (read != len - INTEGER_BYTES) throw new IOException("Compressed lengths mismatch"); + if (read != len) throw new IOException("Compressed lengths mismatch"); // Set the writer index so the amount of written bytes is reflected output.writerIndex(output.writerIndex() + uncompressedLength); diff --git a/driver-core/src/main/java/com/datastax/driver/core/Message.java b/driver-core/src/main/java/com/datastax/driver/core/Message.java index 74e3adb3270..205c3335a45 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Message.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Message.java @@ -310,7 +310,7 @@ protected void decode(ChannelHandlerContext ctx, Frame frame, List out) @ChannelHandler.Sharable static class ProtocolEncoder extends MessageToMessageEncoder { - private final ProtocolVersion protocolVersion; + final ProtocolVersion protocolVersion; ProtocolEncoder(ProtocolVersion version) { this.protocolVersion = version; @@ -319,6 +319,27 @@ static class ProtocolEncoder extends MessageToMessageEncoder { @Override protected void encode(ChannelHandlerContext ctx, Request request, List out) throws Exception { + EnumSet flags = computeFlags(request); + int messageSize = encodedSize(request); + ByteBuf body = ctx.alloc().buffer(messageSize); + @SuppressWarnings("unchecked") + Coder coder = (Coder) request.type.coder; + coder.encode(request, body, protocolVersion); + + if (body.capacity() != messageSize) { + logger.debug( + "Detected buffer resizing while encoding {} message ({} => {}), " + + "this is a driver bug " + + "(ultimately it does not affect the query, but leads to a small inefficiency)", + request.type, + messageSize, + body.capacity()); + } + out.add( + Frame.create(protocolVersion, request.type.opcode, request.getStreamId(), flags, body)); + } + + EnumSet computeFlags(Request request) { EnumSet flags = EnumSet.noneOf(Frame.Header.Flag.class); if (request.isTracingRequested()) flags.add(Frame.Header.Flag.TRACING); if (protocolVersion == ProtocolVersion.NEWEST_BETA) flags.add(Frame.Header.Flag.USE_BETA); @@ -329,36 +350,37 @@ protected void encode(ChannelHandlerContext ctx, Request request, List o protocolVersion, "Custom payloads are only supported since native protocol V4"); flags.add(Frame.Header.Flag.CUSTOM_PAYLOAD); } + return flags; + } + int encodedSize(Request request) { @SuppressWarnings("unchecked") Coder coder = (Coder) request.type.coder; int messageSize = coder.encodedSize(request, protocolVersion); int payloadLength = -1; - if (customPayload != null) { - payloadLength = CBUtil.sizeOfBytesMap(customPayload); + if (request.getCustomPayload() != null) { + payloadLength = CBUtil.sizeOfBytesMap(request.getCustomPayload()); messageSize += payloadLength; } - ByteBuf body = ctx.alloc().buffer(messageSize); + return messageSize; + } + + void encode(Request request, ByteBuf destination) { + @SuppressWarnings("unchecked") + Coder coder = (Coder) request.type.coder; + + Map customPayload = request.getCustomPayload(); if (customPayload != null) { - CBUtil.writeBytesMap(customPayload, body); + CBUtil.writeBytesMap(customPayload, destination); if (logger.isTraceEnabled()) { logger.trace( - "Sending payload: {} ({} bytes total)", printPayload(customPayload), payloadLength); + "Sending payload: {} ({} bytes total)", + printPayload(customPayload), + CBUtil.sizeOfBytesMap(customPayload)); } } - coder.encode(request, body, protocolVersion); - if (body.capacity() != messageSize) { - logger.debug( - "Detected buffer resizing while encoding {} message ({} => {}), " - + "this is a driver bug " - + "(ultimately it does not affect the query, but leads to a small inefficiency)", - request.type, - messageSize, - body.capacity()); - } - out.add( - Frame.create(protocolVersion, request.type.opcode, request.getStreamId(), flags, body)); + coder.encode(request, destination, protocolVersion); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/MessageToSegmentEncoder.java b/driver-core/src/main/java/com/datastax/driver/core/MessageToSegmentEncoder.java new file mode 100644 index 00000000000..41924e6c173 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/MessageToSegmentEncoder.java @@ -0,0 +1,56 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import io.netty.buffer.ByteBufAllocator; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelOutboundHandlerAdapter; +import io.netty.channel.ChannelPromise; + +class MessageToSegmentEncoder extends ChannelOutboundHandlerAdapter { + + private final ByteBufAllocator allocator; + private final Message.ProtocolEncoder requestEncoder; + + private SegmentBuilder segmentBuilder; + + MessageToSegmentEncoder(ByteBufAllocator allocator, Message.ProtocolEncoder requestEncoder) { + this.allocator = allocator; + this.requestEncoder = requestEncoder; + } + + @Override + public void handlerAdded(ChannelHandlerContext ctx) throws Exception { + super.handlerAdded(ctx); + this.segmentBuilder = new SegmentBuilder(ctx, allocator, requestEncoder); + } + + @Override + public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) + throws Exception { + if (msg instanceof Message.Request) { + segmentBuilder.addRequest(((Message.Request) msg), promise); + } else { + super.write(ctx, msg, promise); + } + } + + @Override + public void flush(ChannelHandlerContext ctx) throws Exception { + segmentBuilder.flush(); + super.flush(ctx); + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/Segment.java b/driver-core/src/main/java/com/datastax/driver/core/Segment.java new file mode 100644 index 00000000000..231c50028f6 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/Segment.java @@ -0,0 +1,60 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import io.netty.buffer.ByteBuf; + +/** + * A container of {@link Frame}s in protocol v5 and above. This is a new protocol construct that + * allows checksumming and compressing multiple messages together. + * + *

    {@link #getPayload()} contains either: + * + *

      + *
    • a sequence of encoded {@link Frame}s, all concatenated together. In this case, {@link + * #isSelfContained()} return true. + *
    • or a slice of an encoded large {@link Frame} (if that frame is longer than {@link + * #MAX_PAYLOAD_LENGTH}). In this case, {@link #isSelfContained()} returns false. + *
    + * + * The payload is not compressed; compression is handled at a lower level when encoding or decoding + * this object. + * + *

    Naming is provisional: "segment" is not the official name, I picked it arbitrarily for the + * driver code to avoid a name clash. It's possible that this type will be renamed to "frame", and + * {@link Frame} to something else, at some point in the future (this is an ongoing discussion on + * the server ticket). + */ +class Segment { + + static int MAX_PAYLOAD_LENGTH = 128 * 1024 - 1; + + private final ByteBuf payload; + private final boolean isSelfContained; + + Segment(ByteBuf payload, boolean isSelfContained) { + this.payload = payload; + this.isSelfContained = isSelfContained; + } + + public ByteBuf getPayload() { + return payload; + } + + public boolean isSelfContained() { + return isSelfContained; + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/SegmentBuilder.java b/driver-core/src/main/java/com/datastax/driver/core/SegmentBuilder.java new file mode 100644 index 00000000000..ddf0235b48e --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/SegmentBuilder.java @@ -0,0 +1,257 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableList; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelPromise; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.GenericFutureListener; +import java.util.ArrayList; +import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Abstracts the details of batching a sequence of {@link Message.Request}s into one or more {@link + * Segment}s before sending them out on the network. + * + *

    This class is not thread-safe. + */ +class SegmentBuilder { + + private static final Logger logger = LoggerFactory.getLogger(SegmentBuilder.class); + + private final ChannelHandlerContext context; + private final ByteBufAllocator allocator; + private final int maxPayloadLength; + private final Message.ProtocolEncoder requestEncoder; + + private final List currentPayloadHeaders = new ArrayList(); + private final List currentPayloadBodies = new ArrayList(); + private final List currentPayloadPromises = new ArrayList(); + private int currentPayloadLength; + + SegmentBuilder( + ChannelHandlerContext context, + ByteBufAllocator allocator, + Message.ProtocolEncoder requestEncoder) { + this(context, allocator, requestEncoder, Segment.MAX_PAYLOAD_LENGTH); + } + + /** Exposes the max length for unit tests; in production, this is hard-coded. */ + @VisibleForTesting + SegmentBuilder( + ChannelHandlerContext context, + ByteBufAllocator allocator, + Message.ProtocolEncoder requestEncoder, + int maxPayloadLength) { + this.context = context; + this.allocator = allocator; + this.requestEncoder = requestEncoder; + this.maxPayloadLength = maxPayloadLength; + } + + /** + * Adds a new request. It will be encoded into one or more segments, that will be passed to {@link + * #processSegment(Segment, ChannelPromise)} at some point in the future. + * + *

    The caller must invoke {@link #flush()} after the last request. + */ + public void addRequest(Message.Request request, ChannelPromise promise) { + + // Wrap the request into a legacy frame, append that frame to the payload. + int frameHeaderLength = Frame.Header.lengthFor(requestEncoder.protocolVersion); + int frameBodyLength = requestEncoder.encodedSize(request); + int frameLength = frameHeaderLength + frameBodyLength; + + Frame.Header header = + new Frame.Header( + requestEncoder.protocolVersion, + requestEncoder.computeFlags(request), + request.getStreamId(), + request.type.opcode, + frameBodyLength); + + if (frameLength > maxPayloadLength) { + // Large request: split into multiple dedicated segments and process them immediately: + ByteBuf frame = allocator.ioBuffer(frameLength); + header.encodeInto(frame); + requestEncoder.encode(request, frame); + + int sliceCount = + (frameLength / maxPayloadLength) + (frameLength % maxPayloadLength == 0 ? 0 : 1); + + logger.trace( + "Splitting large request ({} bytes) into {} segments: {}", + frameLength, + sliceCount, + request); + + List segmentPromises = split(promise, sliceCount); + int i = 0; + do { + ByteBuf part = frame.readSlice(Math.min(maxPayloadLength, frame.readableBytes())); + part.retain(); + process(part, false, segmentPromises.get(i++)); + } while (frame.isReadable()); + // We've retained each slice, and won't reference this buffer anymore + frame.release(); + } else { + // Small request: append to an existing segment, together with other messages. + if (currentPayloadLength + frameLength > maxPayloadLength) { + // Current segment is full, process and start a new one: + processCurrentPayload(); + resetCurrentPayload(); + } + // Append frame to current segment + logger.trace( + "Adding {}th request to self-contained segment: {}", + currentPayloadHeaders.size() + 1, + request); + currentPayloadHeaders.add(header); + currentPayloadBodies.add(request); + currentPayloadPromises.add(promise); + currentPayloadLength += frameLength; + } + } + + /** + * Signals that we're done adding requests. + * + *

    This must be called after adding the last request, it will possibly trigger the generation + * of one last segment. + */ + public void flush() { + if (currentPayloadLength > 0) { + processCurrentPayload(); + resetCurrentPayload(); + } + } + + /** What to do whenever a full segment is ready. */ + protected void processSegment(Segment segment, ChannelPromise segmentPromise) { + context.write(segment, segmentPromise); + } + + private void process(ByteBuf payload, boolean isSelfContained, ChannelPromise segmentPromise) { + processSegment(new Segment(payload, isSelfContained), segmentPromise); + } + + private void processCurrentPayload() { + int requestCount = currentPayloadHeaders.size(); + assert currentPayloadBodies.size() == requestCount + && currentPayloadPromises.size() == requestCount; + logger.trace("Emitting new self-contained segment with {} frame(s)", requestCount); + ByteBuf payload = this.allocator.ioBuffer(currentPayloadLength); + for (int i = 0; i < requestCount; i++) { + Frame.Header header = currentPayloadHeaders.get(i); + Message.Request request = currentPayloadBodies.get(i); + header.encodeInto(payload); + requestEncoder.encode(request, payload); + } + process(payload, true, merge(currentPayloadPromises)); + } + + private void resetCurrentPayload() { + currentPayloadHeaders.clear(); + currentPayloadBodies.clear(); + currentPayloadPromises.clear(); + currentPayloadLength = 0; + } + + // Merges multiple promises into a single one, that will notify all of them when done. + // This is used when multiple requests are sent as a single segment. + private ChannelPromise merge(List framePromises) { + if (framePromises.size() == 1) { + return framePromises.get(0); + } + ChannelPromise segmentPromise = context.newPromise(); + final ImmutableList dependents = ImmutableList.copyOf(framePromises); + segmentPromise.addListener( + new GenericFutureListener>() { + @Override + public void operationComplete(Future future) throws Exception { + if (future.isSuccess()) { + for (ChannelPromise framePromise : dependents) { + framePromise.setSuccess(); + } + } else { + Throwable cause = future.cause(); + for (ChannelPromise framePromise : dependents) { + framePromise.setFailure(cause); + } + } + } + }); + return segmentPromise; + } + + // Splits a single promise into multiple ones. The original promise will complete when all the + // splits have. + // This is used when a single request is sliced into multiple segment. + private List split(ChannelPromise framePromise, int sliceCount) { + // We split one frame into multiple slices. When all slices are written, the frame is written. + List slicePromises = new ArrayList(sliceCount); + for (int i = 0; i < sliceCount; i++) { + slicePromises.add(context.newPromise()); + } + GenericFutureListener> sliceListener = + new SliceWriteListener(framePromise, slicePromises); + for (int i = 0; i < sliceCount; i++) { + slicePromises.get(i).addListener(sliceListener); + } + return slicePromises; + } + + static class SliceWriteListener implements GenericFutureListener> { + + private final ChannelPromise parentPromise; + private final List slicePromises; + + // All slices are written to the same channel, and the segment is built from the Flusher which + // also runs on the same event loop, so we don't need synchronization. + private int remainingSlices; + + SliceWriteListener(ChannelPromise parentPromise, List slicePromises) { + this.parentPromise = parentPromise; + this.slicePromises = slicePromises; + this.remainingSlices = slicePromises.size(); + } + + @Override + public void operationComplete(Future future) { + if (!parentPromise.isDone()) { + if (future.isSuccess()) { + remainingSlices -= 1; + if (remainingSlices == 0) { + parentPromise.setSuccess(); + } + } else { + // If any slice fails, we can immediately mark the whole frame as failed: + parentPromise.setFailure(future.cause()); + // Cancel any remaining slice, Netty will not send the bytes. + for (ChannelPromise slicePromise : slicePromises) { + slicePromise.cancel(/*Netty ignores this*/ false); + } + } + } + } + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/SegmentCodec.java b/driver-core/src/main/java/com/datastax/driver/core/SegmentCodec.java new file mode 100644 index 00000000000..66122e4725f --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/SegmentCodec.java @@ -0,0 +1,210 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import com.datastax.driver.core.exceptions.CrcMismatchException; +import com.google.common.annotations.VisibleForTesting; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import java.io.IOException; +import java.util.List; + +class SegmentCodec { + + private static final int COMPRESSED_HEADER_LENGTH = 5; + private static final int UNCOMPRESSED_HEADER_LENGTH = 3; + static final int CRC24_LENGTH = 3; + static final int CRC32_LENGTH = 4; + + private final ByteBufAllocator allocator; + private final boolean compress; + private final FrameCompressor compressor; + + SegmentCodec(ByteBufAllocator allocator, ProtocolOptions.Compression compression) { + this.allocator = allocator; + this.compress = compression != ProtocolOptions.Compression.NONE; + this.compressor = compression.compressor(); + } + + /** The length of the segment header, excluding the 3-byte trailing CRC. */ + int headerLength() { + return compress ? COMPRESSED_HEADER_LENGTH : UNCOMPRESSED_HEADER_LENGTH; + } + + void encode(Segment segment, List out) throws IOException { + ByteBuf uncompressedPayload = segment.getPayload(); + int uncompressedPayloadLength = uncompressedPayload.readableBytes(); + assert uncompressedPayloadLength <= Segment.MAX_PAYLOAD_LENGTH; + ByteBuf encodedPayload; + if (compress) { + uncompressedPayload.markReaderIndex(); + ByteBuf compressedPayload = compressor.compress(uncompressedPayload); + if (compressedPayload.readableBytes() >= uncompressedPayloadLength) { + // Skip compression if it's not worth it + uncompressedPayload.resetReaderIndex(); + encodedPayload = uncompressedPayload; + compressedPayload.release(); + // By convention, this is how we signal this to the server: + uncompressedPayloadLength = 0; + } else { + encodedPayload = compressedPayload; + uncompressedPayload.release(); + } + } else { + encodedPayload = uncompressedPayload; + } + int payloadLength = encodedPayload.readableBytes(); + + ByteBuf header = + encodeHeader(payloadLength, uncompressedPayloadLength, segment.isSelfContained()); + + int payloadCrc = Crc.computeCrc32(encodedPayload); + ByteBuf trailer = allocator.ioBuffer(CRC32_LENGTH); + for (int i = 0; i < CRC32_LENGTH; i++) { + trailer.writeByte(payloadCrc & 0xFF); + payloadCrc >>= 8; + } + + out.add(header); + out.add(encodedPayload); + out.add(trailer); + } + + @VisibleForTesting + ByteBuf encodeHeader(int payloadLength, int uncompressedLength, boolean isSelfContained) { + assert payloadLength <= Segment.MAX_PAYLOAD_LENGTH; + assert !compress || uncompressedLength <= Segment.MAX_PAYLOAD_LENGTH; + + int headerLength = headerLength(); + + long headerData = payloadLength; + int flagOffset = 17; + if (compress) { + headerData |= (long) uncompressedLength << 17; + flagOffset += 17; + } + if (isSelfContained) { + headerData |= 1L << flagOffset; + } + + int headerCrc = Crc.computeCrc24(headerData, headerLength); + + ByteBuf header = allocator.ioBuffer(headerLength + CRC24_LENGTH); + // Write both data and CRC in little-endian order + for (int i = 0; i < headerLength; i++) { + int shift = i * 8; + header.writeByte((int) (headerData >> shift & 0xFF)); + } + for (int i = 0; i < CRC24_LENGTH; i++) { + int shift = i * 8; + header.writeByte(headerCrc >> shift & 0xFF); + } + return header; + } + + /** + * Decodes a segment header and checks its CRC. It is assumed that the caller has already checked + * that there are enough bytes. + */ + Header decodeHeader(ByteBuf buffer) throws CrcMismatchException { + int headerLength = headerLength(); + assert buffer.readableBytes() >= headerLength + CRC24_LENGTH; + + // Read header data (little endian): + long headerData = 0; + for (int i = 0; i < headerLength; i++) { + headerData |= (buffer.readByte() & 0xFFL) << 8 * i; + } + + // Read CRC (little endian) and check it: + int expectedHeaderCrc = 0; + for (int i = 0; i < CRC24_LENGTH; i++) { + expectedHeaderCrc |= (buffer.readByte() & 0xFF) << 8 * i; + } + int actualHeaderCrc = Crc.computeCrc24(headerData, headerLength); + if (actualHeaderCrc != expectedHeaderCrc) { + throw new CrcMismatchException( + String.format( + "CRC mismatch on header %s. Received %s, computed %s.", + Long.toHexString(headerData), + Integer.toHexString(expectedHeaderCrc), + Integer.toHexString(actualHeaderCrc))); + } + + int payloadLength = (int) headerData & Segment.MAX_PAYLOAD_LENGTH; + headerData >>= 17; + int uncompressedPayloadLength; + if (compress) { + uncompressedPayloadLength = (int) headerData & Segment.MAX_PAYLOAD_LENGTH; + headerData >>= 17; + } else { + uncompressedPayloadLength = -1; + } + boolean isSelfContained = (headerData & 1) == 1; + return new Header(payloadLength, uncompressedPayloadLength, isSelfContained); + } + + /** + * Decodes the rest of a segment from a previously decoded header, and checks the payload's CRC. + * It is assumed that the caller has already checked that there are enough bytes. + */ + Segment decode(Header header, ByteBuf buffer) throws CrcMismatchException, IOException { + assert buffer.readableBytes() == header.payloadLength + CRC32_LENGTH; + + // Extract payload: + ByteBuf encodedPayload = buffer.readSlice(header.payloadLength); + encodedPayload.retain(); + + // Read and check CRC: + int expectedPayloadCrc = 0; + for (int i = 0; i < CRC32_LENGTH; i++) { + expectedPayloadCrc |= (buffer.readByte() & 0xFF) << 8 * i; + } + buffer.release(); // done with this (we retained the payload independently) + int actualPayloadCrc = Crc.computeCrc32(encodedPayload); + if (actualPayloadCrc != expectedPayloadCrc) { + encodedPayload.release(); + throw new CrcMismatchException( + String.format( + "CRC mismatch on payload. Received %s, computed %s.", + Integer.toHexString(expectedPayloadCrc), Integer.toHexString(actualPayloadCrc))); + } + + // Decompress payload if needed: + ByteBuf payload; + if (compress && header.uncompressedPayloadLength > 0) { + payload = compressor.decompress(encodedPayload, header.uncompressedPayloadLength); + encodedPayload.release(); + } else { + payload = encodedPayload; + } + + return new Segment(payload, header.isSelfContained); + } + + /** Temporary holder for header data. During decoding, it is convenient to store it separately. */ + static class Header { + final int payloadLength; + final int uncompressedPayloadLength; + final boolean isSelfContained; + + public Header(int payloadLength, int uncompressedPayloadLength, boolean isSelfContained) { + this.payloadLength = payloadLength; + this.uncompressedPayloadLength = uncompressedPayloadLength; + this.isSelfContained = isSelfContained; + } + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/SegmentToBytesEncoder.java b/driver-core/src/main/java/com/datastax/driver/core/SegmentToBytesEncoder.java new file mode 100644 index 00000000000..f4cd8b42672 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/SegmentToBytesEncoder.java @@ -0,0 +1,38 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToMessageEncoder; +import java.util.List; + +@ChannelHandler.Sharable +class SegmentToBytesEncoder extends MessageToMessageEncoder { + + private final SegmentCodec codec; + + SegmentToBytesEncoder(SegmentCodec codec) { + super(Segment.class); + this.codec = codec; + } + + @Override + protected void encode(ChannelHandlerContext ctx, Segment segment, List out) + throws Exception { + codec.encode(segment, out); + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/SegmentToFrameDecoder.java b/driver-core/src/main/java/com/datastax/driver/core/SegmentToFrameDecoder.java new file mode 100644 index 00000000000..095d3836960 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/SegmentToFrameDecoder.java @@ -0,0 +1,95 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import com.datastax.driver.core.Frame.Header; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import io.netty.buffer.CompositeByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToMessageDecoder; +import java.util.ArrayList; +import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Converts the segments decoded by {@link BytesToSegmentDecoder} into legacy frames understood by + * the rest of the driver. + */ +class SegmentToFrameDecoder extends MessageToMessageDecoder { + + private static final Logger logger = LoggerFactory.getLogger(SegmentToFrameDecoder.class); + + // Accumulated state when we are reading a sequence of slices + private Header pendingHeader; + private final List accumulatedSlices = new ArrayList(); + private int accumulatedLength; + + SegmentToFrameDecoder() { + super(Segment.class); + } + + @Override + protected void decode(ChannelHandlerContext ctx, Segment segment, List out) { + if (segment.isSelfContained()) { + decodeSelfContained(segment, out); + } else { + decodeSlice(segment, ctx.alloc(), out); + } + } + + private void decodeSelfContained(Segment segment, List out) { + ByteBuf payload = segment.getPayload(); + int frameCount = 0; + do { + Header header = Header.decode(payload); + ByteBuf body = payload.readSlice(header.bodyLength); + body.retain(); + out.add(new Frame(header, body)); + frameCount += 1; + } while (payload.isReadable()); + payload.release(); + logger.trace("Decoded self-contained segment into {} frame(s)", frameCount); + } + + private void decodeSlice(Segment segment, ByteBufAllocator allocator, List out) { + assert pendingHeader != null ^ (accumulatedSlices.isEmpty() && accumulatedLength == 0); + ByteBuf payload = segment.getPayload(); + if (pendingHeader == null) { // first slice + pendingHeader = Header.decode(payload); // note: this consumes the header data + } + accumulatedSlices.add(payload); + accumulatedLength += payload.readableBytes(); + logger.trace( + "StreamId {}: decoded slice {}, {}/{} bytes", + pendingHeader.streamId, + accumulatedSlices.size(), + accumulatedLength, + pendingHeader.bodyLength); + assert accumulatedLength <= pendingHeader.bodyLength; + if (accumulatedLength == pendingHeader.bodyLength) { + // We've received enough data to reassemble the whole message + CompositeByteBuf body = allocator.compositeBuffer(accumulatedSlices.size()); + body.addComponents(true, accumulatedSlices); + out.add(new Frame(pendingHeader, body)); + // Reset our state + pendingHeader = null; + accumulatedSlices.clear(); + accumulatedLength = 0; + } + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/SnappyCompressor.java b/driver-core/src/main/java/com/datastax/driver/core/SnappyCompressor.java index 6f0c9f3811f..7b9e2b85b8f 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/SnappyCompressor.java +++ b/driver-core/src/main/java/com/datastax/driver/core/SnappyCompressor.java @@ -54,9 +54,12 @@ private SnappyCompressor() { @Override Frame compress(Frame frame) throws IOException { - ByteBuf input = frame.body; - ByteBuf frameBody = input.isDirect() ? compressDirect(input) : compressHeap(input); - return frame.with(frameBody); + return frame.with(compress(frame.body)); + } + + @Override + ByteBuf compress(ByteBuf buffer) throws IOException { + return buffer.isDirect() ? compressDirect(buffer) : compressHeap(buffer); } private ByteBuf compressDirect(ByteBuf input) throws IOException { @@ -117,6 +120,13 @@ Frame decompress(Frame frame) throws IOException { return frame.with(frameBody); } + @Override + ByteBuf decompress(ByteBuf buffer, int uncompressedLength) throws IOException { + // Note that the Snappy algorithm already encodes the uncompressed length, we don't need the + // provided one. + return buffer.isDirect() ? decompressDirect(buffer) : decompressHeap(buffer); + } + private ByteBuf decompressDirect(ByteBuf input) throws IOException { ByteBuffer in = inputNioBuffer(input); // Increase reader index. diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/CrcMismatchException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/CrcMismatchException.java new file mode 100644 index 00000000000..a79a49fdd54 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/CrcMismatchException.java @@ -0,0 +1,41 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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.exceptions; + +/** + * Thrown when the checksums in a server response don't match (protocol v5 or above). + * + *

    This indicates a data corruption issue, either due to a hardware issue on the client, or on + * the network between the server and the client. It is not recoverable: the driver will drop the + * connection. + */ +public class CrcMismatchException extends DriverException { + + private static final long serialVersionUID = 0; + + public CrcMismatchException(String message) { + super(message); + } + + public CrcMismatchException(String message, Throwable cause) { + super(message, cause); + } + + @Override + public CrcMismatchException copy() { + return new CrcMismatchException(getMessage(), this); + } +} diff --git a/driver-core/src/test/java/com/datastax/driver/core/BytesToSegmentDecoderTest.java b/driver-core/src/test/java/com/datastax/driver/core/BytesToSegmentDecoderTest.java new file mode 100644 index 00000000000..8b2bcb9015c --- /dev/null +++ b/driver-core/src/test/java/com/datastax/driver/core/BytesToSegmentDecoderTest.java @@ -0,0 +1,137 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.datastax.driver.core.ProtocolOptions.Compression; +import com.datastax.driver.core.exceptions.CrcMismatchException; +import com.google.common.base.Strings; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import io.netty.buffer.ByteBufUtil; +import io.netty.buffer.Unpooled; +import io.netty.channel.embedded.EmbeddedChannel; +import io.netty.handler.codec.DecoderException; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class BytesToSegmentDecoderTest { + + // Hard-coded test data, the values were generated with our encoding methods. + // We're not really testing the decoding itself here, only that our subclass calls the + // LengthFieldBasedFrameDecoder parent constructor with the right parameters. + private static final ByteBuf REGULAR_HEADER = byteBuf("04000201f9f2"); + private static final ByteBuf REGULAR_PAYLOAD = byteBuf("00000001"); + private static final ByteBuf REGULAR_TRAILER = byteBuf("1fd6022d"); + private static final ByteBuf REGULAR_WRONG_HEADER = byteBuf("04000202f9f2"); + private static final ByteBuf REGULAR_WRONG_TRAILER = byteBuf("1fd6022e"); + + private static final ByteBuf MAX_HEADER = byteBuf("ffff03254047"); + private static final ByteBuf MAX_PAYLOAD = + byteBuf(Strings.repeat("01", Segment.MAX_PAYLOAD_LENGTH)); + private static final ByteBuf MAX_TRAILER = byteBuf("a05c2f13"); + + private static final ByteBuf LZ4_HEADER = byteBuf("120020000491c94f"); + private static final ByteBuf LZ4_PAYLOAD_UNCOMPRESSED = + byteBuf("00000001000000010000000100000001"); + private static final ByteBuf LZ4_PAYLOAD_COMPRESSED = + byteBuf("f00100000001000000010000000100000001"); + private static final ByteBuf LZ4_TRAILER = byteBuf("2bd67f90"); + + private EmbeddedChannel channel; + + @BeforeMethod(groups = "unit") + public void setup() { + channel = new EmbeddedChannel(); + } + + @Test(groups = "unit") + public void should_decode_regular_segment() { + channel.pipeline().addLast(newDecoder(Compression.NONE)); + channel.writeInbound(Unpooled.wrappedBuffer(REGULAR_HEADER, REGULAR_PAYLOAD, REGULAR_TRAILER)); + Segment segment = (Segment) channel.readInbound(); + assertThat(segment.isSelfContained()).isTrue(); + assertThat(segment.getPayload()).isEqualTo(REGULAR_PAYLOAD); + } + + @Test(groups = "unit") + public void should_decode_max_length_segment() { + channel.pipeline().addLast(newDecoder(Compression.NONE)); + channel.writeInbound(Unpooled.wrappedBuffer(MAX_HEADER, MAX_PAYLOAD, MAX_TRAILER)); + Segment segment = (Segment) channel.readInbound(); + assertThat(segment.isSelfContained()).isTrue(); + assertThat(segment.getPayload()).isEqualTo(MAX_PAYLOAD); + } + + @Test(groups = "unit") + public void should_decode_segment_from_multiple_incoming_chunks() { + channel.pipeline().addLast(newDecoder(Compression.NONE)); + // Send the header in two slices, to cover the case where the length can't be read the first + // time: + ByteBuf headerStart = REGULAR_HEADER.slice(0, 3); + ByteBuf headerEnd = REGULAR_HEADER.slice(3, 3); + channel.writeInbound(headerStart); + channel.writeInbound(headerEnd); + channel.writeInbound(REGULAR_PAYLOAD.duplicate()); + channel.writeInbound(REGULAR_TRAILER.duplicate()); + Segment segment = (Segment) channel.readInbound(); + assertThat(segment.isSelfContained()).isTrue(); + assertThat(segment.getPayload()).isEqualTo(REGULAR_PAYLOAD); + } + + @Test(groups = "unit") + public void should_decode_compressed_segment() { + channel.pipeline().addLast(newDecoder(Compression.LZ4)); + // We need a contiguous buffer for this one, because of how our decompressor operates + ByteBuf buffer = Unpooled.wrappedBuffer(LZ4_HEADER, LZ4_PAYLOAD_COMPRESSED, LZ4_TRAILER).copy(); + channel.writeInbound(buffer); + Segment segment = (Segment) channel.readInbound(); + assertThat(segment.isSelfContained()).isTrue(); + assertThat(segment.getPayload()).isEqualTo(LZ4_PAYLOAD_UNCOMPRESSED); + } + + @Test(groups = "unit") + public void should_surface_header_crc_mismatch() { + try { + channel.pipeline().addLast(newDecoder(Compression.NONE)); + channel.writeInbound( + Unpooled.wrappedBuffer(REGULAR_WRONG_HEADER, REGULAR_PAYLOAD, REGULAR_TRAILER)); + } catch (DecoderException exception) { + assertThat(exception).hasCauseInstanceOf(CrcMismatchException.class); + } + } + + @Test(groups = "unit") + public void should_surface_trailer_crc_mismatch() { + try { + channel.pipeline().addLast(newDecoder(Compression.NONE)); + channel.writeInbound( + Unpooled.wrappedBuffer(REGULAR_HEADER, REGULAR_PAYLOAD, REGULAR_WRONG_TRAILER)); + } catch (DecoderException exception) { + assertThat(exception).hasCauseInstanceOf(CrcMismatchException.class); + } + } + + private BytesToSegmentDecoder newDecoder(Compression compression) { + return new BytesToSegmentDecoder(new SegmentCodec(ByteBufAllocator.DEFAULT, compression)); + } + + private static ByteBuf byteBuf(String hex) { + return Unpooled.unreleasableBuffer( + Unpooled.unmodifiableBuffer(Unpooled.wrappedBuffer(ByteBufUtil.decodeHexDump(hex)))); + } +} diff --git a/driver-core/src/test/java/com/datastax/driver/core/SegmentBuilderTest.java b/driver-core/src/test/java/com/datastax/driver/core/SegmentBuilderTest.java new file mode 100644 index 00000000000..40adfb66dc3 --- /dev/null +++ b/driver-core/src/test/java/com/datastax/driver/core/SegmentBuilderTest.java @@ -0,0 +1,308 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.when; + +import io.netty.buffer.ByteBufAllocator; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelPromise; +import io.netty.channel.embedded.EmbeddedChannel; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import org.mockito.Mockito; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class SegmentBuilderTest { + + private static final Message.ProtocolEncoder REQUEST_ENCODER = + new Message.ProtocolEncoder(ProtocolVersion.V5); + + // The constant names denote the total encoded size, including the frame header + private static final Message.Request _38B_REQUEST = new Requests.Query("SELECT * FROM table"); + private static final Message.Request _51B_REQUEST = + new Requests.Query("SELECT * FROM table WHERE id = 1"); + private static final Message.Request _1KB_REQUEST = + new Requests.Query( + "SELECT * FROM table WHERE id = ?", + new Requests.QueryProtocolOptions( + Message.Request.Type.QUERY, + ConsistencyLevel.ONE, + new ByteBuffer[] {ByteBuffer.allocate(967)}, + Collections.emptyMap(), + false, + -1, + null, + ConsistencyLevel.SERIAL, + Long.MIN_VALUE, + Integer.MIN_VALUE), + false); + + private static final EmbeddedChannel MOCK_CHANNEL = new EmbeddedChannel(); + private static final ChannelHandlerContext CONTEXT = Mockito.mock(ChannelHandlerContext.class); + + @BeforeClass(groups = "unit") + public static void setup() { + // This is the only method called by our test implementation + when(CONTEXT.newPromise()) + .thenAnswer( + new Answer() { + @Override + public ChannelPromise answer(InvocationOnMock invocation) { + return MOCK_CHANNEL.newPromise(); + } + }); + } + + @Test(groups = "unit") + public void should_concatenate_frames_when_under_limit() { + TestSegmentBuilder builder = new TestSegmentBuilder(CONTEXT, 100); + + ChannelPromise requestPromise1 = newPromise(); + builder.addRequest(_38B_REQUEST, requestPromise1); + ChannelPromise requestPromise2 = newPromise(); + builder.addRequest(_51B_REQUEST, requestPromise2); + // Nothing produced yet since we would still have room for more frames + assertThat(builder.segments).isEmpty(); + + builder.flush(); + assertThat(builder.segments).hasSize(1); + assertThat(builder.segmentPromises).hasSize(1); + Segment segment = builder.segments.get(0); + assertThat(segment.getPayload().readableBytes()).isEqualTo(38 + 51); + assertThat(segment.isSelfContained()).isTrue(); + ChannelPromise segmentPromise = builder.segmentPromises.get(0); + assertForwards(segmentPromise, requestPromise1, requestPromise2); + } + + @Test(groups = "unit") + public void should_start_new_segment_when_over_limit() { + TestSegmentBuilder builder = new TestSegmentBuilder(CONTEXT, 100); + + ChannelPromise requestPromise1 = newPromise(); + builder.addRequest(_38B_REQUEST, requestPromise1); + ChannelPromise requestPromise2 = newPromise(); + builder.addRequest(_51B_REQUEST, requestPromise2); + ChannelPromise requestPromise3 = newPromise(); + builder.addRequest(_38B_REQUEST, requestPromise3); + // Adding the 3rd frame brings the total size over 100, so a first segment should be emitted + // with the first two messages: + assertThat(builder.segments).hasSize(1); + + ChannelPromise requestPromise4 = newPromise(); + builder.addRequest(_38B_REQUEST, requestPromise4); + builder.flush(); + assertThat(builder.segments).hasSize(2); + + Segment segment1 = builder.segments.get(0); + assertThat(segment1.getPayload().readableBytes()).isEqualTo(38 + 51); + assertThat(segment1.isSelfContained()).isTrue(); + ChannelPromise segmentPromise1 = builder.segmentPromises.get(0); + assertForwards(segmentPromise1, requestPromise1, requestPromise2); + Segment segment2 = builder.segments.get(1); + assertThat(segment2.getPayload().readableBytes()).isEqualTo(38 + 38); + assertThat(segment2.isSelfContained()).isTrue(); + ChannelPromise segmentPromise2 = builder.segmentPromises.get(1); + assertForwards(segmentPromise2, requestPromise3, requestPromise4); + } + + @Test(groups = "unit") + public void should_start_new_segment_when_at_limit() { + TestSegmentBuilder builder = new TestSegmentBuilder(CONTEXT, 38 + 51); + + ChannelPromise requestPromise1 = newPromise(); + builder.addRequest(_38B_REQUEST, requestPromise1); + ChannelPromise requestPromise2 = newPromise(); + builder.addRequest(_51B_REQUEST, requestPromise2); + ChannelPromise requestPromise3 = newPromise(); + builder.addRequest(_38B_REQUEST, requestPromise3); + assertThat(builder.segments).hasSize(1); + + ChannelPromise requestPromise4 = newPromise(); + builder.addRequest(_51B_REQUEST, requestPromise4); + builder.flush(); + assertThat(builder.segments).hasSize(2); + + Segment segment1 = builder.segments.get(0); + assertThat(segment1.getPayload().readableBytes()).isEqualTo(38 + 51); + assertThat(segment1.isSelfContained()).isTrue(); + ChannelPromise segmentPromise1 = builder.segmentPromises.get(0); + assertForwards(segmentPromise1, requestPromise1, requestPromise2); + Segment segment2 = builder.segments.get(1); + assertThat(segment2.getPayload().readableBytes()).isEqualTo(38 + 51); + assertThat(segment2.isSelfContained()).isTrue(); + ChannelPromise segmentPromise2 = builder.segmentPromises.get(1); + assertForwards(segmentPromise2, requestPromise3, requestPromise4); + } + + @Test(groups = "unit") + public void should_split_large_frame() { + TestSegmentBuilder builder = new TestSegmentBuilder(CONTEXT, 100); + + ChannelPromise parentPromise = newPromise(); + builder.addRequest(_1KB_REQUEST, parentPromise); + + assertThat(builder.segments).hasSize(11); + assertThat(builder.segmentPromises).hasSize(11); + for (int i = 0; i < 11; i++) { + Segment slice = builder.segments.get(i); + assertThat(slice.getPayload().readableBytes()).isEqualTo(i == 10 ? 24 : 100); + assertThat(slice.isSelfContained()).isFalse(); + } + } + + @Test(groups = "unit") + public void should_succeed_parent_write_if_all_slices_successful() { + TestSegmentBuilder builder = new TestSegmentBuilder(CONTEXT, 100); + + ChannelPromise parentPromise = newPromise(); + builder.addRequest(_1KB_REQUEST, parentPromise); + + assertThat(builder.segments).hasSize(11); + assertThat(builder.segmentPromises).hasSize(11); + + for (int i = 0; i < 11; i++) { + assertThat(parentPromise.isDone()).isFalse(); + builder.segmentPromises.get(i).setSuccess(); + } + + assertThat(parentPromise.isDone()).isTrue(); + } + + @Test(groups = "unit") + public void should_fail_parent_write_if_any_slice_fails() { + TestSegmentBuilder builder = new TestSegmentBuilder(CONTEXT, 100); + + ChannelPromise parentPromise = newPromise(); + builder.addRequest(_1KB_REQUEST, parentPromise); + + assertThat(builder.segments).hasSize(11); + + // Complete a few slices successfully + for (int i = 0; i < 5; i++) { + builder.segmentPromises.get(i).setSuccess(); + } + assertThat(parentPromise.isDone()).isFalse(); + + // Fail a slice, the parent should fail immediately + Exception mockException = new Exception("test"); + builder.segmentPromises.get(5).setFailure(mockException); + assertThat(parentPromise.isDone()).isTrue(); + assertThat(parentPromise.cause()).isEqualTo(mockException); + + // The remaining slices should have been cancelled + for (int i = 6; i < 11; i++) { + assertThat(builder.segmentPromises.get(i).isCancelled()).isTrue(); + } + } + + @Test(groups = "unit") + public void should_split_large_frame_when_exact_multiple() { + TestSegmentBuilder builder = new TestSegmentBuilder(CONTEXT, 256); + + ChannelPromise parentPromise = newPromise(); + builder.addRequest(_1KB_REQUEST, parentPromise); + + assertThat(builder.segments).hasSize(4); + assertThat(builder.segmentPromises).hasSize(4); + for (int i = 0; i < 4; i++) { + Segment slice = builder.segments.get(i); + assertThat(slice.getPayload().readableBytes()).isEqualTo(256); + assertThat(slice.isSelfContained()).isFalse(); + } + } + + @Test(groups = "unit") + public void should_mix_small_frames_and_large_frames() { + TestSegmentBuilder builder = new TestSegmentBuilder(CONTEXT, 100); + + ChannelPromise requestPromise1 = newPromise(); + builder.addRequest(_38B_REQUEST, requestPromise1); + ChannelPromise requestPromise2 = newPromise(); + builder.addRequest(_51B_REQUEST, requestPromise2); + + // Large frame: process immediately, does not impact accumulated small frames + ChannelPromise requestPromise3 = newPromise(); + builder.addRequest(_1KB_REQUEST, requestPromise3); + assertThat(builder.segments).hasSize(11); + + // Another small frames bring us above the limit + ChannelPromise requestPromise4 = newPromise(); + builder.addRequest(_38B_REQUEST, requestPromise4); + assertThat(builder.segments).hasSize(12); + + // One last frame and finish + ChannelPromise requestPromise5 = newPromise(); + builder.addRequest(_38B_REQUEST, requestPromise5); + builder.flush(); + assertThat(builder.segments).hasSize(13); + assertThat(builder.segmentPromises).hasSize(13); + + for (int i = 0; i < 11; i++) { + Segment slice = builder.segments.get(i); + assertThat(slice.getPayload().readableBytes()).isEqualTo(i == 10 ? 24 : 100); + assertThat(slice.isSelfContained()).isFalse(); + } + + Segment smallMessages1 = builder.segments.get(11); + assertThat(smallMessages1.getPayload().readableBytes()).isEqualTo(38 + 51); + assertThat(smallMessages1.isSelfContained()).isTrue(); + ChannelPromise segmentPromise1 = builder.segmentPromises.get(11); + assertForwards(segmentPromise1, requestPromise1, requestPromise2); + Segment smallMessages2 = builder.segments.get(12); + assertThat(smallMessages2.getPayload().readableBytes()).isEqualTo(38 + 38); + assertThat(smallMessages2.isSelfContained()).isTrue(); + ChannelPromise segmentPromise2 = builder.segmentPromises.get(12); + assertForwards(segmentPromise2, requestPromise4, requestPromise5); + } + + private static ChannelPromise newPromise() { + return MOCK_CHANNEL.newPromise(); + } + + private void assertForwards(ChannelPromise segmentPromise, ChannelPromise... requestPromises) { + for (ChannelPromise requestPromise : requestPromises) { + assertThat(requestPromise.isDone()).isFalse(); + } + segmentPromise.setSuccess(); + for (ChannelPromise requestPromise : requestPromises) { + assertThat(requestPromise.isSuccess()).isTrue(); + } + } + + // Test implementation that simply stores segments and promises in the order they were produced. + static class TestSegmentBuilder extends SegmentBuilder { + + List segments = new ArrayList(); + List segmentPromises = new ArrayList(); + + TestSegmentBuilder(ChannelHandlerContext context, int maxPayloadLength) { + super(context, ByteBufAllocator.DEFAULT, REQUEST_ENCODER, maxPayloadLength); + } + + @Override + protected void processSegment(Segment segment, ChannelPromise segmentPromise) { + segments.add(segment); + segmentPromises.add(segmentPromise); + } + } +} diff --git a/driver-core/src/test/java/com/datastax/driver/core/SegmentCodecTest.java b/driver-core/src/test/java/com/datastax/driver/core/SegmentCodecTest.java new file mode 100644 index 00000000000..1d8170256cc --- /dev/null +++ b/driver-core/src/test/java/com/datastax/driver/core/SegmentCodecTest.java @@ -0,0 +1,142 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +import com.datastax.driver.core.ProtocolOptions.Compression; +import com.datastax.driver.core.SegmentCodec.Header; +import com.datastax.driver.core.exceptions.CrcMismatchException; +import com.google.common.base.Strings; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.UnpooledByteBufAllocator; +import org.testng.annotations.Test; + +public class SegmentCodecTest { + + public static final SegmentCodec CODEC_NO_COMPRESSION = + new SegmentCodec(UnpooledByteBufAllocator.DEFAULT, Compression.NONE); + public static final SegmentCodec CODEC_LZ4 = + new SegmentCodec(UnpooledByteBufAllocator.DEFAULT, Compression.LZ4); + + @Test(groups = "unit") + public void should_encode_uncompressed_header() { + ByteBuf header = CODEC_NO_COMPRESSION.encodeHeader(5, -1, true); + + byte byte0 = header.getByte(2); + byte byte1 = header.getByte(1); + byte byte2 = header.getByte(0); + + assertThat(bits(byte0) + bits(byte1) + bits(byte2)) + .isEqualTo( + "000000" // padding (6 bits) + + "1" // selfContainedFlag + + "00000000000000101" // length (17 bits) + ); + } + + @Test(groups = "unit") + public void should_encode_compressed_header() { + ByteBuf header = CODEC_LZ4.encodeHeader(5, 12, true); + + byte byte0 = header.getByte(4); + byte byte1 = header.getByte(3); + byte byte2 = header.getByte(2); + byte byte3 = header.getByte(1); + byte byte4 = header.getByte(0); + + assertThat(bits(byte0) + bits(byte1) + bits(byte2) + bits(byte3) + bits(byte4)) + .isEqualTo( + "00000" // padding (5 bits) + + "1" // selfContainedFlag + + "00000000000001100" // uncompressed length (17 bits) + + "00000000000000101" // compressed length (17 bits) + ); + } + + /** + * Checks that we correctly use 8 bytes when we left-shift the uncompressed length, to avoid + * overflows. + */ + @Test(groups = "unit") + public void should_encode_compressed_header_when_aligned_uncompressed_length_overflows() { + ByteBuf header = CODEC_LZ4.encodeHeader(5, Segment.MAX_PAYLOAD_LENGTH, true); + + byte byte0 = header.getByte(4); + byte byte1 = header.getByte(3); + byte byte2 = header.getByte(2); + byte byte3 = header.getByte(1); + byte byte4 = header.getByte(0); + + assertThat(bits(byte0) + bits(byte1) + bits(byte2) + bits(byte3) + bits(byte4)) + .isEqualTo( + "00000" // padding (5 bits) + + "1" // selfContainedFlag + + "11111111111111111" // uncompressed length (17 bits) + + "00000000000000101" // compressed length (17 bits) + ); + } + + @Test(groups = "unit") + public void should_decode_uncompressed_payload() { + // Assembling the test data manually would have little value because it would be very similar to + // our production code. So simply use that production code, assuming it's correct. + ByteBuf buffer = CODEC_NO_COMPRESSION.encodeHeader(5, -1, true); + Header header = CODEC_NO_COMPRESSION.decodeHeader(buffer); + assertThat(header.payloadLength).isEqualTo(5); + assertThat(header.uncompressedPayloadLength).isEqualTo(-1); + assertThat(header.isSelfContained).isTrue(); + } + + @Test(groups = "unit") + public void should_decode_compressed_payload() { + ByteBuf buffer = CODEC_LZ4.encodeHeader(5, 12, true); + Header header = CODEC_LZ4.decodeHeader(buffer); + assertThat(header.payloadLength).isEqualTo(5); + assertThat(header.uncompressedPayloadLength).isEqualTo(12); + assertThat(header.isSelfContained).isTrue(); + } + + @Test(groups = "unit") + public void should_fail_to_decode_if_corrupted() { + ByteBuf buffer = CODEC_NO_COMPRESSION.encodeHeader(5, -1, true); + + // Flip a random byte + for (int bitOffset = 0; bitOffset < 47; bitOffset++) { + int byteOffset = bitOffset / 8; + int shift = bitOffset % 8; + + ByteBuf slice = buffer.slice(buffer.readerIndex() + byteOffset, 1); + slice.markReaderIndex(); + byte byteToCorrupt = slice.readByte(); + slice.resetReaderIndex(); + slice.writerIndex(slice.readerIndex()); + slice.writeByte((byteToCorrupt & 0xFF) ^ (1 << shift)); + + try { + CODEC_NO_COMPRESSION.decodeHeader(buffer.duplicate()); + fail("Expected CrcMismatchException"); + } catch (CrcMismatchException e) { + // expected + } + } + } + + private static String bits(byte b) { + return Strings.padStart(Integer.toBinaryString(b & 0xFF), 8, '0'); + } +} diff --git a/driver-core/src/test/java/com/datastax/driver/core/SegmentToFrameDecoderTest.java b/driver-core/src/test/java/com/datastax/driver/core/SegmentToFrameDecoderTest.java new file mode 100644 index 00000000000..bef4a5beaef --- /dev/null +++ b/driver-core/src/test/java/com/datastax/driver/core/SegmentToFrameDecoderTest.java @@ -0,0 +1,120 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import static com.datastax.driver.core.Message.Response.Type.READY; +import static com.datastax.driver.core.Message.Response.Type.RESULT; +import static org.assertj.core.api.Assertions.assertThat; + +import com.datastax.driver.core.Frame.Header; +import com.datastax.driver.core.Frame.Header.Flag; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.UnpooledByteBufAllocator; +import io.netty.channel.embedded.EmbeddedChannel; +import java.util.EnumSet; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class SegmentToFrameDecoderTest { + + private static final ByteBuf SMALL_BODY_1 = buffer(128); + private static final Header SMALL_HEADER_1 = + new Header( + ProtocolVersion.V5, + EnumSet.noneOf(Flag.class), + 2, + READY.opcode, + SMALL_BODY_1.readableBytes()); + + private static final ByteBuf SMALL_BODY_2 = buffer(1024); + private static final Header SMALL_HEADER_2 = + new Header( + ProtocolVersion.V5, + EnumSet.noneOf(Flag.class), + 7, + RESULT.opcode, + SMALL_BODY_2.readableBytes()); + + private static final ByteBuf LARGE_BODY = buffer(256 * 1024); + private static final Header LARGE_HEADER = + new Header( + ProtocolVersion.V5, + EnumSet.noneOf(Flag.class), + 12, + RESULT.opcode, + LARGE_BODY.readableBytes()); + + private EmbeddedChannel channel; + + @BeforeMethod(groups = "unit") + public void setup() { + channel = new EmbeddedChannel(); + channel.pipeline().addLast(new SegmentToFrameDecoder()); + } + + @Test(groups = "unit") + public void should_decode_self_contained() { + ByteBuf payload = UnpooledByteBufAllocator.DEFAULT.buffer(); + appendFrame(SMALL_HEADER_1, SMALL_BODY_1, payload); + appendFrame(SMALL_HEADER_2, SMALL_BODY_2, payload); + + channel.writeInbound(new Segment(payload, true)); + + Frame frame1 = (Frame) channel.readInbound(); + Header header1 = frame1.header; + assertThat(header1.streamId).isEqualTo(SMALL_HEADER_1.streamId); + assertThat(header1.opcode).isEqualTo(SMALL_HEADER_1.opcode); + assertThat(frame1.body).isEqualTo(SMALL_BODY_1); + + Frame frame2 = (Frame) channel.readInbound(); + Header header2 = frame2.header; + assertThat(header2.streamId).isEqualTo(SMALL_HEADER_2.streamId); + assertThat(header2.opcode).isEqualTo(SMALL_HEADER_2.opcode); + assertThat(frame2.body).isEqualTo(SMALL_BODY_2); + } + + @Test(groups = "unit") + public void should_decode_sequence_of_slices() { + ByteBuf encodedFrame = UnpooledByteBufAllocator.DEFAULT.buffer(); + appendFrame(LARGE_HEADER, LARGE_BODY, encodedFrame); + + do { + ByteBuf payload = + encodedFrame.readSlice( + Math.min(Segment.MAX_PAYLOAD_LENGTH, encodedFrame.readableBytes())); + channel.writeInbound(new Segment(payload, false)); + } while (encodedFrame.isReadable()); + + Frame frame = (Frame) channel.readInbound(); + Header header = frame.header; + assertThat(header.streamId).isEqualTo(LARGE_HEADER.streamId); + assertThat(header.opcode).isEqualTo(LARGE_HEADER.opcode); + assertThat(frame.body).isEqualTo(LARGE_BODY); + } + + private static final ByteBuf buffer(int length) { + ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer(length); + // Contents don't really matter, keep all zeroes + buffer.writerIndex(buffer.readerIndex() + length); + return buffer; + } + + private static void appendFrame(Header frameHeader, ByteBuf frameBody, ByteBuf payload) { + frameHeader.encodeInto(payload); + // this method doesn't affect the body's indices: + payload.writeBytes(frameBody, frameBody.readerIndex(), frameBody.readableBytes()); + } +} From 4b8282f98626c3811430261c6116d5d08ec9a6f2 Mon Sep 17 00:00:00 2001 From: olim7t Date: Tue, 28 Jul 2020 09:27:35 -0700 Subject: [PATCH 084/211] Fix custom payload encoding issue --- .../src/main/java/com/datastax/driver/core/Message.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/Message.java b/driver-core/src/main/java/com/datastax/driver/core/Message.java index 205c3335a45..84c214dd22d 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Message.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Message.java @@ -317,14 +317,11 @@ static class ProtocolEncoder extends MessageToMessageEncoder { } @Override - protected void encode(ChannelHandlerContext ctx, Request request, List out) - throws Exception { + protected void encode(ChannelHandlerContext ctx, Request request, List out) { EnumSet flags = computeFlags(request); int messageSize = encodedSize(request); ByteBuf body = ctx.alloc().buffer(messageSize); - @SuppressWarnings("unchecked") - Coder coder = (Coder) request.type.coder; - coder.encode(request, body, protocolVersion); + encode(request, body); if (body.capacity() != messageSize) { logger.debug( From 8ebf97e57d7f06c3af8b80a90a0234cdc9e91964 Mon Sep 17 00:00:00 2001 From: olim7t Date: Tue, 28 Jul 2020 09:28:08 -0700 Subject: [PATCH 085/211] Correct typo --- driver-core/src/main/java/com/datastax/driver/core/Frame.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/Frame.java b/driver-core/src/main/java/com/datastax/driver/core/Frame.java index efe5949284b..f0480e8efa1 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Frame.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Frame.java @@ -98,7 +98,7 @@ private static Frame create(ByteBuf fullFrame) { return new Frame(header, fullFrame); } - private static int readStreamid(ByteBuf fullFrame, ProtocolVersion version) { + private static int readStreamId(ByteBuf fullFrame, ProtocolVersion version) { switch (version) { case V1: case V2: @@ -195,7 +195,7 @@ static Header decode(ByteBuf buffer) { : String.format("Frame too short (%d bytes)", buffer.readableBytes()); int flags = buffer.readByte(); - int streamId = readStreamid(buffer, version); + int streamId = readStreamId(buffer, version); int opcode = buffer.readByte(); int length = buffer.readInt(); From b54bb66e35e2c0113f3fbcf88199b839a0fb3bc5 Mon Sep 17 00:00:00 2001 From: olim7t Date: Tue, 28 Jul 2020 13:32:31 -0700 Subject: [PATCH 086/211] Update version in docs --- README.md | 16 +++--- changelog/README.md | 2 +- faq/README.md | 4 +- faq/osgi/README.md | 2 +- manual/README.md | 30 +++++------ manual/address_resolution/README.md | 4 +- manual/async/README.md | 8 +-- manual/auth/README.md | 8 +-- manual/compression/README.md | 2 +- manual/control_connection/README.md | 2 +- manual/custom_codecs/README.md | 38 +++++++------- manual/custom_codecs/extras/README.md | 48 ++++++++--------- manual/custom_payloads/README.md | 4 +- manual/idempotence/README.md | 6 +-- manual/load_balancing/README.md | 34 ++++++------ manual/logging/README.md | 10 ++-- manual/metadata/README.md | 38 +++++++------- manual/metrics/README.md | 12 ++--- manual/native_protocol/README.md | 10 ++-- manual/object_mapper/README.md | 2 +- manual/object_mapper/creating/README.md | 26 +++++----- manual/object_mapper/custom_codecs/README.md | 6 +-- manual/object_mapper/using/README.md | 18 +++---- manual/paging/README.md | 8 +-- manual/pooling/README.md | 26 +++++----- manual/query_timestamps/README.md | 8 +-- manual/reconnection/README.md | 8 +-- manual/retries/README.md | 54 ++++++++++---------- manual/shaded_jar/README.md | 8 +-- manual/socket_options/README.md | 24 ++++----- manual/speculative_execution/README.md | 22 ++++---- manual/ssl/README.md | 10 ++-- manual/statements/README.md | 16 +++--- manual/statements/batch/README.md | 6 +-- manual/statements/built/README.md | 10 ++-- manual/statements/prepared/README.md | 12 ++--- manual/statements/simple/README.md | 2 +- manual/tuples/README.md | 8 +-- manual/udts/README.md | 4 +- pom.xml | 2 +- 40 files changed, 279 insertions(+), 279 deletions(-) diff --git a/README.md b/README.md index 926c9c50983..c7c1ff59959 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ not yet have been released. You can find the documentation for the latest version through the [Java driver docs](http://docs.datastax.com/en/developer/java-driver/latest/index.html) or via the release tags, [e.g. -3.9.0](https://github.com/datastax/java-driver/tree/3.9.0).* +3.10.0](https://github.com/datastax/java-driver/tree/3.10.0).* A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol @@ -52,10 +52,10 @@ The driver contains the following modules: other drivers, Cassandra, and DSE. - DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.9/manual/) has quick start material and technical details about the driver and its features. -- API: http://docs.datastax.com/en/drivers/java/3.9 +- API: https://docs.datastax.com/en/drivers/java/3.10 - GITHUB REPOSITORY: https://github.com/datastax/java-driver - [changelog](changelog/) -- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.9.0.tar.gz) +- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.10.0.tar.gz) ## Getting the driver @@ -67,7 +67,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-dri com.datastax.cassandra cassandra-driver-core - 3.9.0 + 3.10.0 ``` @@ -77,7 +77,7 @@ Note that the object mapper is published as a separate artifact: com.datastax.cassandra cassandra-driver-mapping - 3.9.0 + 3.10.0 ``` @@ -87,7 +87,7 @@ The 'extras' module is also published as a separate artifact: com.datastax.cassandra cassandra-driver-extras - 3.9.0 + 3.10.0 ``` @@ -96,12 +96,12 @@ 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](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.9.0.tar.gz) +[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.10.0.tar.gz) is available for download. ## Compatibility -The Java client driver 3.9.0 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache +The Java client driver 3.10.0 ([branch 3.x](https://github.com/datastax/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/latest/manual/native_protocol/) for the most up-to-date compatibility information). diff --git a/changelog/README.md b/changelog/README.md index 5030a100c64..47dd231e28b 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,7 +5,7 @@ 3.x versions get published. --> -## 3.10.0 (in progress) +## 3.10.0 - [improvement] JAVA-2676: Don't reschedule flusher after empty runs - [new feature] JAVA-2772: Support new protocol v5 message format diff --git a/faq/README.md b/faq/README.md index 0ee87e9cb57..8ef0dd017b6 100644 --- a/faq/README.md +++ b/faq/README.md @@ -35,7 +35,7 @@ row.getBool(0); // this is equivalent row.getBool("applied") Note that, unlike manual inspection, `wasApplied` does not consume the first row. -[wasApplied]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ResultSet.html#wasApplied-- +[wasApplied]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ResultSet.html#wasApplied-- ### What is a parameterized statement and how can I use it? @@ -289,7 +289,7 @@ version is available, you may want to reach out to the maintainer of that tool t an update with compatibility to this driver version. -[Blobs.java]: https://github.com/datastax/java-driver/tree/3.9.0/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java +[Blobs.java]: https://github.com/datastax/java-driver/tree/3.10.0/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304 [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding [Mapper options]: ../manual/object_mapper/using/#mapper-options diff --git a/faq/osgi/README.md b/faq/osgi/README.md index 095c7e5f57d..dd01626e2db 100644 --- a/faq/osgi/README.md +++ b/faq/osgi/README.md @@ -157,7 +157,7 @@ it is also normal to see the following log lines when starting the driver: [BND]:http://bnd.bndtools.org/ [Maven bundle plugin]:https://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Maven+Bundle+Plugin+%28BND%29 [OSGi examples repository]:https://github.com/datastax/java-driver-examples-osgi -[without metrics]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- +[without metrics]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- [SLF4J]:http://www.slf4j.org/ [Logback]:http://logback.qos.ch/ [Tycho]:https://eclipse.org/tycho/ diff --git a/manual/README.md b/manual/README.md index cd4973b69b1..1635e1219f4 100644 --- a/manual/README.md +++ b/manual/README.md @@ -209,7 +209,7 @@ String firstName = row.getString("first_name"); blob getBytes java.nio.ByteBuffer boolean getBool boolean counter getLong long - date getDate LocalDate + date getDate LocalDate decimal getDecimal java.math.BigDecimal double getDouble double float getFloat float @@ -291,17 +291,17 @@ menu on the left hand side to navigate sub-sections. If you're [browsing the sou github.com](https://github.com/datastax/java-driver/tree/3.x/manual), simply navigate to each sub-directory. -[Cluster]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.html -[Cluster.Builder]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html -[Initializer]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Initializer.html -[Session]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html -[ResultSet]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ResultSet.html -[Row]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Row.html -[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/NettyOptions.html -[QueryOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/QueryOptions.html -[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html -[Host.StateListener]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Host.StateListener.html -[LatencyTracker]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/LatencyTracker.html -[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SchemaChangeListener.html -[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/NoHostAvailableException.html -[LocalDate]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/LocalDate.html \ No newline at end of file +[Cluster]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.html +[Cluster.Builder]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html +[Initializer]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Initializer.html +[Session]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html +[ResultSet]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ResultSet.html +[Row]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Row.html +[NettyOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/NettyOptions.html +[QueryOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/QueryOptions.html +[SocketOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html +[Host.StateListener]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Host.StateListener.html +[LatencyTracker]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/LatencyTracker.html +[SchemaChangeListener]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SchemaChangeListener.html +[NoHostAvailableException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[LocalDate]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/LocalDate.html \ No newline at end of file diff --git a/manual/address_resolution/README.md b/manual/address_resolution/README.md index b42acbe55ae..8f0ffd33740 100644 --- a/manual/address_resolution/README.md +++ b/manual/address_resolution/README.md @@ -102,8 +102,8 @@ private/public switch automatically based on location). -[AddressTranslator]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/AddressTranslator.html -[EC2MultiRegionAddressTranslator]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslator.html +[AddressTranslator]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/AddressTranslator.html +[EC2MultiRegionAddressTranslator]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslator.html [cassandra.yaml]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html [rpc_address]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html?scroll=configCassandra_yaml__rpc_address diff --git a/manual/async/README.md b/manual/async/README.md index 19a974a5df8..21a70f7b767 100644 --- a/manual/async/README.md +++ b/manual/async/README.md @@ -51,8 +51,8 @@ to the current page, and [fetchMoreResults] to get a future to the next page (see also the section on [paging](../paging/)). Here is a full example: -[getAvailableWithoutFetching]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ResultSet.html#getAvailableWithoutFetching-- -[fetchMoreResults]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ResultSet.html#fetchMoreResults-- +[getAvailableWithoutFetching]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ResultSet.html#getAvailableWithoutFetching-- +[fetchMoreResults]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ResultSet.html#fetchMoreResults-- ```java Statement statement = new SimpleStatement("select * from foo").setFetchSize(20); @@ -134,5 +134,5 @@ There are still a few places where the driver will block internally hasn't been fetched already. [ListenableFuture]: https://github.com/google/guava/wiki/ListenableFutureExplained -[init]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.html#init-- -[query trace]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/QueryTrace.html +[init]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.html#init-- +[query trace]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/QueryTrace.html diff --git a/manual/auth/README.md b/manual/auth/README.md index 36c5b6c999d..c8fc021b6f9 100644 --- a/manual/auth/README.md +++ b/manual/auth/README.md @@ -28,7 +28,7 @@ You can also write your own provider; it must implement [AuthProvider]. [SASL]: https://en.wikipedia.org/wiki/Simple_Authentication_and_Security_Layer -[Cluster.Builder.withCredentials]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withCredentials-java.lang.String-java.lang.String- -[AuthProvider]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/AuthProvider.html -[Cluster.Builder.withAuthProvider]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withAuthProvider-com.datastax.driver.core.AuthProvider- -[PlainTextAuthProvider]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PlainTextAuthProvider.html +[Cluster.Builder.withCredentials]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withCredentials-java.lang.String-java.lang.String- +[AuthProvider]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/AuthProvider.html +[Cluster.Builder.withAuthProvider]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withAuthProvider-com.datastax.driver.core.AuthProvider- +[PlainTextAuthProvider]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PlainTextAuthProvider.html diff --git a/manual/compression/README.md b/manual/compression/README.md index feb3b7f7969..d8563834180 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -88,4 +88,4 @@ cluster = Cluster.builder() .build(); ``` -[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.9.0/cassandra-driver-parent-3.9.0.pom +[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.10.0/cassandra-driver-parent-3.10.0.pom diff --git a/manual/control_connection/README.md b/manual/control_connection/README.md index 521ede12402..eb610627941 100644 --- a/manual/control_connection/README.md +++ b/manual/control_connection/README.md @@ -18,4 +18,4 @@ used exclusively for administrative requests. It is included in [Session.State.g as well as the `open-connections` [metric](../metrics); for example, if you've configured a pool size of 2, the control node will have 3 connections. -[Session.State.getOpenConnections]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.State.html#getOpenConnections-com.datastax.driver.core.Host- \ No newline at end of file +[Session.State.getOpenConnections]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.State.html#getOpenConnections-com.datastax.driver.core.Host- \ No newline at end of file diff --git a/manual/custom_codecs/README.md b/manual/custom_codecs/README.md index 65915b2b0ca..108d7dab1d4 100644 --- a/manual/custom_codecs/README.md +++ b/manual/custom_codecs/README.md @@ -447,26 +447,26 @@ Beware that in these cases, the lookup performs in average 10x worse. If perform consider using prepared statements all the time. [JAVA-721]: https://datastax-oss.atlassian.net/browse/JAVA-721 -[TypeCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TypeCodec.html -[LocalDate]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/LocalDate.html +[TypeCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TypeCodec.html +[LocalDate]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/LocalDate.html [ByteBuffer]: http://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html -[serialize]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TypeCodec.html#serialize-T-com.datastax.driver.core.ProtocolVersion- -[deserialize]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TypeCodec.html#deserialize-java.nio.ByteBuffer-com.datastax.driver.core.ProtocolVersion- -[TypeCodec.format]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TypeCodec.html#format-T- -[TypeCodec.parse]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TypeCodec.html#parse-java.lang.String- -[accepts]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TypeCodec.html#accepts-com.datastax.driver.core.DataType- -[CodecRegistry]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/CodecRegistry.html -[CodecNotFoundException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/CodecNotFoundException.html +[serialize]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TypeCodec.html#serialize-T-com.datastax.driver.core.ProtocolVersion- +[deserialize]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TypeCodec.html#deserialize-java.nio.ByteBuffer-com.datastax.driver.core.ProtocolVersion- +[TypeCodec.format]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TypeCodec.html#format-T- +[TypeCodec.parse]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TypeCodec.html#parse-java.lang.String- +[accepts]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TypeCodec.html#accepts-com.datastax.driver.core.DataType- +[CodecRegistry]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/CodecRegistry.html +[CodecNotFoundException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/CodecNotFoundException.html [Jackson]: https://github.com/FasterXML/jackson [AbstractType]: https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/marshal/AbstractType.java -[UserType]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/UserType.html -[UDTValue]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/UDTValue.html -[TupleType]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TupleType.html -[TupleValue]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TupleValue.html -[CustomType]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/DataType.CustomType.html +[UserType]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/UserType.html +[UDTValue]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/UDTValue.html +[TupleType]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TupleType.html +[TupleValue]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TupleValue.html +[CustomType]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/DataType.CustomType.html [TypeToken]: https://google.github.io/guava/releases/19.0/api/docs/com/google/common/reflect/TypeToken.html -[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SimpleStatement.html -[BuiltStatement]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/querybuilder/BuiltStatement.html -[setList]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SettableByIndexData.html#setList-int-java.util.List- -[setSet]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SettableByIndexData.html#setSet-int-java.util.Set- -[setMap]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SettableByIndexData.html#setMap-int-java.util.Map- +[SimpleStatement]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SimpleStatement.html +[BuiltStatement]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/querybuilder/BuiltStatement.html +[setList]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SettableByIndexData.html#setList-int-java.util.List- +[setSet]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SettableByIndexData.html#setSet-int-java.util.Set- +[setMap]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SettableByIndexData.html#setMap-int-java.util.Map- diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index 14109ad294c..25c7a606920 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -10,7 +10,7 @@ The module is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-extras - 3.9.0 + 3.10.0 ``` @@ -73,12 +73,12 @@ session.execute("INSERT INTO example (id, t) VALUES (1, ?)", ZoneId.of("GMT+07:00")); ``` -[InstantCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/jdk8/InstantCodec.html -[LocalDateCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.html -[LocalDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/jdk8/LocalDateTimeCodec.html -[LocalTimeCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.html -[ZonedDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.html -[ZoneIdCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/jdk8/ZoneIdCodec.html +[InstantCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/jdk8/InstantCodec.html +[LocalDateCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.html +[LocalDateTimeCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/jdk8/LocalDateTimeCodec.html +[LocalTimeCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.html +[ZonedDateTimeCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.html +[ZoneIdCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/jdk8/ZoneIdCodec.html [Instant]: https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html [LocalDate]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html [LocalDateTime]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html @@ -130,10 +130,10 @@ session.execute("INSERT INTO example (id, t) VALUES (1, ?)", DateTime.parse("2010-06-30T01:20:47.999+01:00")); ``` -[InstantCodec_joda]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/joda/InstantCodec.html -[LocalDateCodec_joda]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/joda/LocalDateCodec.html -[LocalTimeCodec_joda]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.html -[DateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/joda/DateTimeCodec.html +[InstantCodec_joda]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/joda/InstantCodec.html +[LocalDateCodec_joda]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/joda/LocalDateCodec.html +[LocalTimeCodec_joda]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.html +[DateTimeCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/joda/DateTimeCodec.html [DateTime]: http://www.joda.org/joda-time/apidocs/org/joda/time/DateTime.html [Instant_joda]: http://www.joda.org/joda-time/apidocs/org/joda/time/Instant.html [LocalDate_joda]: http://www.joda.org/joda-time/apidocs/org/joda/time/LocalDate.html @@ -151,8 +151,8 @@ Time can also be expressed as simple durations: There is no extra codec for `time`, because by default the driver already maps that type to a `long` representing the number of nanoseconds since midnight. -[SimpleTimestampCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.html -[SimpleDateCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/date/SimpleDateCodec.html +[SimpleTimestampCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.html +[SimpleDateCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/date/SimpleDateCodec.html ### Enums @@ -190,8 +190,8 @@ Note that if you registered an `EnumNameCodec` and an `EnumOrdinalCodec` _for th In practice, this is unlikely to happen, because you'll probably stick to a single CQL type for a given enum type; however, if you ever run into that issue, the workaround is to use [prepared statements](../../statements/prepared/), for which the driver knows the CQL type and can pick the exact codec. -[EnumNameCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/enums/EnumNameCodec.html -[EnumOrdinalCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.html +[EnumNameCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/enums/EnumNameCodec.html +[EnumOrdinalCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.html [name]: https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name-- [ordinal]: https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal-- @@ -236,7 +236,7 @@ session.execute("insert into example (id, owner) values (1, ?)", // owner saved as '{"id":1,"name":"root"}' ``` -[JacksonJsonCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.html +[JacksonJsonCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.html [Jackson]: https://github.com/FasterXML/jackson @@ -275,7 +275,7 @@ session.execute("insert into example (id, owner) values (1, ?)", ``` -[Jsr353JsonCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.html +[Jsr353JsonCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.html [JsonStructure]: https://docs.oracle.com/javaee/7/tutorial/jsonp002.htm @@ -328,7 +328,7 @@ For the same reason, we need to give a type hint when setting "v", in the form o anonymous inner class; we recommend storing these tokens as constants in a utility class, to avoid creating them too often. -[OptionalCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.html +[OptionalCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.html [Optional]: https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html [TypeToken]: http://google.github.io/guava/releases/19.0/api/docs/com/google/common/reflect/TypeToken.html @@ -372,7 +372,7 @@ session.execute(pst.bind() See the JDK8 Optional section above for explanations about [TypeToken]. -[OptionalCodec_guava]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/guava/OptionalCodec.html +[OptionalCodec_guava]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/guava/OptionalCodec.html [Optional_guava]: http://google.github.io/guava/releases/19.0/api/docs/com/google/common/base/Optional.html @@ -397,9 +397,9 @@ session.execute("insert into example (i, l) values (1, ?)", Package [com.datastax.driver.extras.codecs.arrays][arrays] contains similar codecs for all primitive types, and [ObjectArrayCodec] to map arrays of objects. -[IntArrayCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.html -[ObjectArrayCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.html -[arrays]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/arrays/package-summary.html +[IntArrayCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.html +[ObjectArrayCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.html +[arrays]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/arrays/package-summary.html ### Abstract utilities @@ -429,5 +429,5 @@ These two classes are convenient, but since they perform conversions in two step optimal approach. If performance is paramount, it's better to start from scratch and convert your objects to `ByteBuffer` directly. -[MappingCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/MappingCodec.html -[ParsingCodec]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/extras/codecs/ParsingCodec.html +[MappingCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/MappingCodec.html +[ParsingCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/ParsingCodec.html diff --git a/manual/custom_payloads/README.md b/manual/custom_payloads/README.md index 21b62e1e87b..a31cee5161b 100644 --- a/manual/custom_payloads/README.md +++ b/manual/custom_payloads/README.md @@ -241,8 +241,8 @@ The log message contains a pretty-printed version of the payload itself, and its [CASSANDRA-8553]: https://issues.apache.org/jira/browse/CASSANDRA-8553 [v4spec]: https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec [qh]: https://issues.apache.org/jira/browse/CASSANDRA-6659 -[nhae]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[nhae]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/NoHostAvailableException.html [chm]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html [immutablemap]: http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/ImmutableMap.html -[ufe]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/UnsupportedFeatureException.html +[ufe]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/UnsupportedFeatureException.html diff --git a/manual/idempotence/README.md b/manual/idempotence/README.md index 4e7c65aeb53..71246748735 100644 --- a/manual/idempotence/README.md +++ b/manual/idempotence/README.md @@ -125,8 +125,8 @@ broke linearizability by doing a transparent retry at step 6. If linearizability is important for you, you should ensure that lightweight transactions are appropriately flagged as not idempotent. -[isIdempotent]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Statement.html#isIdempotent-- -[setDefaultIdempotence]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/QueryOptions.html#setDefaultIdempotence-boolean- -[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/querybuilder/QueryBuilder.html +[isIdempotent]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Statement.html#isIdempotent-- +[setDefaultIdempotence]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/QueryOptions.html#setDefaultIdempotence-boolean- +[QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/querybuilder/QueryBuilder.html [linearizability]: https://en.wikipedia.org/wiki/Linearizability#Definition_of_linearizability \ No newline at end of file diff --git a/manual/load_balancing/README.md b/manual/load_balancing/README.md index 3f725791f1d..dad615adeb8 100644 --- a/manual/load_balancing/README.md +++ b/manual/load_balancing/README.md @@ -277,11 +277,11 @@ For any host, the distance returned by the policy is always the same as its chil Query plans are based on the child policy's, except that hosts that are currently excluded for being too slow are moved to the end of the plan. -[withExclusionThreshold]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withExclusionThreshold-double- -[withMininumMeasurements]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withMininumMeasurements-int- -[withRetryPeriod]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withRetryPeriod-long-java.util.concurrent.TimeUnit- -[withScale]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withScale-long-java.util.concurrent.TimeUnit- -[withUpdateRate]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withUpdateRate-long-java.util.concurrent.TimeUnit- +[withExclusionThreshold]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withExclusionThreshold-double- +[withMininumMeasurements]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withMininumMeasurements-int- +[withRetryPeriod]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withRetryPeriod-long-java.util.concurrent.TimeUnit- +[withScale]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withScale-long-java.util.concurrent.TimeUnit- +[withUpdateRate]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withUpdateRate-long-java.util.concurrent.TimeUnit- ### Filtering policies @@ -299,15 +299,15 @@ studying the existing implementations first: `RoundRobinPolicy` is a good place complex ones like `DCAwareRoundRobinPolicy`. -[LoadBalancingPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LoadBalancingPolicy.html -[RoundRobinPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RoundRobinPolicy.html -[DCAwareRoundRobinPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.html -[TokenAwarePolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/TokenAwarePolicy.html -[LatencyAwarePolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LatencyAwarePolicy.html -[HostFilterPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/HostFilterPolicy.html -[WhiteListPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/WhiteListPolicy.html -[HostDistance]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/HostDistance.html -[refreshConnectedHosts]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PoolingOptions.html#refreshConnectedHosts-- -[setMetadataEnabled]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/QueryOptions.html#setMetadataEnabled-boolean- -[Statement#getKeyspace]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Statement.html#getKeyspace-- -[Statement#getRoutingKey]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Statement.html#getRoutingKey-- +[LoadBalancingPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LoadBalancingPolicy.html +[RoundRobinPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RoundRobinPolicy.html +[DCAwareRoundRobinPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.html +[TokenAwarePolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/TokenAwarePolicy.html +[LatencyAwarePolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LatencyAwarePolicy.html +[HostFilterPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/HostFilterPolicy.html +[WhiteListPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/WhiteListPolicy.html +[HostDistance]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/HostDistance.html +[refreshConnectedHosts]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PoolingOptions.html#refreshConnectedHosts-- +[setMetadataEnabled]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/QueryOptions.html#setMetadataEnabled-boolean- +[Statement#getKeyspace]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Statement.html#getKeyspace-- +[Statement#getRoutingKey]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Statement.html#getRoutingKey-- diff --git a/manual/logging/README.md b/manual/logging/README.md index cd40c910a7e..d68f0c2d45c 100644 --- a/manual/logging/README.md +++ b/manual/logging/README.md @@ -208,12 +208,12 @@ Aggregation query used without partition key ``` These -[query warnings](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) +[query warnings](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) are available programmatically from the -[ExecutionInfo](https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ExecutionInfo.html) +[ExecutionInfo](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ExecutionInfo.html) via -[ResultSet](https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ResultSet.html)'s -[getExecutionInfo()](https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PagingIterable.html#getExecutionInfo--) +[ResultSet](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ResultSet.html)'s +[getExecutionInfo()](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PagingIterable.html#getExecutionInfo--) method. They are also logged by the driver: ``` @@ -340,4 +340,4 @@ It also turns on slow query tracing as described above. ``` -[query_logger]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/QueryLogger.html +[query_logger]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/QueryLogger.html diff --git a/manual/metadata/README.md b/manual/metadata/README.md index 8e764c2eb4b..fd65ed90e4e 100644 --- a/manual/metadata/README.md +++ b/manual/metadata/README.md @@ -4,7 +4,7 @@ The driver maintains global information about the Cassandra cluster it is connected to. It is available via [Cluster#getMetadata()][getMetadata]. -[getMetadata]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.html#getMetadata-- +[getMetadata]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.html#getMetadata-- ### Schema metadata @@ -12,8 +12,8 @@ Use [getKeyspace(String)][getKeyspace] or [getKeyspaces()][getKeyspaces] to get keyspace-level metadata. From there you can access the keyspace's objects (tables, and UDTs and UDFs if relevant). -[getKeyspace]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#getKeyspace-java.lang.String- -[getKeyspaces]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#getKeyspaces-- +[getKeyspace]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#getKeyspace-java.lang.String- +[getKeyspaces]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#getKeyspaces-- #### Refreshes @@ -47,8 +47,8 @@ Note that it is preferable to register a listener only *after* the cluster is fu otherwise the listener could be notified with a great deal of "Added" events as the driver builds the schema metadata from scratch for the first time. -[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SchemaChangeListener.html -[registerListener]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.html#register-com.datastax.driver.core.SchemaChangeListener- +[SchemaChangeListener]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SchemaChangeListener.html +[registerListener]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.html#register-com.datastax.driver.core.SchemaChangeListener- #### Schema agreement @@ -135,9 +135,9 @@ custom executor). Check out the API docs for the features in this section: -* [withMaxSchemaAgreementWaitSeconds(int)](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withMaxSchemaAgreementWaitSeconds-int-) -* [isSchemaInAgreement()](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ExecutionInfo.html#isSchemaInAgreement--) -* [checkSchemaAgreement()](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#checkSchemaAgreement--) +* [withMaxSchemaAgreementWaitSeconds(int)](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withMaxSchemaAgreementWaitSeconds-int-) +* [isSchemaInAgreement()](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ExecutionInfo.html#isSchemaInAgreement--) +* [checkSchemaAgreement()](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#checkSchemaAgreement--) ### Token metadata @@ -181,14 +181,14 @@ Starting with Cassandra 2.1.5, this information is available in a system table (see [CASSANDRA-7688](https://issues.apache.org/jira/browse/CASSANDRA-7688)). -[metadata]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html -[getTokenRanges]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#getTokenRanges-- -[getTokenRanges2]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#getTokenRanges-java.lang.String-com.datastax.driver.core.Host- -[getReplicas]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#getReplicas-java.lang.String-com.datastax.driver.core.TokenRange- -[newToken]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#newToken-java.lang.String- -[newTokenRange]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metadata.html#newTokenRange-com.datastax.driver.core.Token-com.datastax.driver.core.Token- -[TokenRange]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TokenRange.html -[getTokens]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Host.html#getTokens-- -[setToken]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/BoundStatement.html#setToken-int-com.datastax.driver.core.Token- -[getToken]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Row.html#getToken-int- -[getPKToken]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Row.html#getPartitionKeyToken-- +[metadata]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html +[getTokenRanges]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#getTokenRanges-- +[getTokenRanges2]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#getTokenRanges-java.lang.String-com.datastax.driver.core.Host- +[getReplicas]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#getReplicas-java.lang.String-com.datastax.driver.core.TokenRange- +[newToken]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#newToken-java.lang.String- +[newTokenRange]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#newTokenRange-com.datastax.driver.core.Token-com.datastax.driver.core.Token- +[TokenRange]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TokenRange.html +[getTokens]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Host.html#getTokens-- +[setToken]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/BoundStatement.html#setToken-int-com.datastax.driver.core.Token- +[getToken]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Row.html#getToken-int- +[getPKToken]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Row.html#getPartitionKeyToken-- diff --git a/manual/metrics/README.md b/manual/metrics/README.md index d6ea576973f..4f1d376d275 100644 --- a/manual/metrics/README.md +++ b/manual/metrics/README.md @@ -38,7 +38,7 @@ To do this in a maven project: com.datastax.cassandra cassandra-driver-core - 3.9.0 + 3.10.0 io.dropwizard.metrics @@ -146,8 +146,8 @@ reporter.start(); [Reporters]: http://metrics.dropwizard.io/3.2.2/manual/core.html#reporters [MetricRegistry]: http://metrics.dropwizard.io/3.2.2/apidocs/com/codahale/metrics/MetricRegistry.html [MXBeans]: https://docs.oracle.com/javase/tutorial/jmx/mbeans/mxbeans.html -[withClusterName]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withClusterName-java.lang.String- -[withoutMetrics]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- -[withoutJMXReporting]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withoutJMXReporting-- -[getMetrics]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.html#getMetrics-- -[Metrics]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metrics.html +[withClusterName]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withClusterName-java.lang.String- +[withoutMetrics]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- +[withoutJMXReporting]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withoutJMXReporting-- +[getMetrics]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.html#getMetrics-- +[Metrics]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metrics.html diff --git a/manual/native_protocol/README.md b/manual/native_protocol/README.md index 78de409e68a..e07ff9fe8bd 100644 --- a/manual/native_protocol/README.md +++ b/manual/native_protocol/README.md @@ -64,7 +64,7 @@ All host(s) tried for query failed [/127.0.0.1:9042] Host /127.0.0.1:9042 does not support protocol version V3 but V2)) ``` -[gpv]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- +[gpv]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- #### Protocol version with mixed clusters @@ -95,19 +95,19 @@ To avoid this issue, you can use one the following workarounds: #### v1 to v2 * bound variables in simple statements - ([Session#execute(String, Object...)](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html#execute-java.lang.String-java.lang.Object...-)) -* [batch statements](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/BatchStatement.html) + ([Session#execute(String, Object...)](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html#execute-java.lang.String-java.lang.Object...-)) +* [batch statements](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/BatchStatement.html) * [query paging](../paging/) #### v2 to v3 * the number of stream ids per connection goes from 128 to 32768 (see [Connection pooling](../pooling/)) -* [serial consistency on batch statements](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/BatchStatement.html#setSerialConsistencyLevel-com.datastax.driver.core.ConsistencyLevel-) +* [serial consistency on batch statements](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/BatchStatement.html#setSerialConsistencyLevel-com.datastax.driver.core.ConsistencyLevel-) * [client-side timestamps](../query_timestamps/) #### v3 to v4 -* [query warnings](http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) +* [query warnings](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) * allowed unset values in bound statements * [Custom payloads](../custom_payloads/) diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md index dba44952a54..617c324b304 100644 --- a/manual/object_mapper/README.md +++ b/manual/object_mapper/README.md @@ -11,7 +11,7 @@ The mapper is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-mapping - 3.9.0 + 3.10.0 ``` diff --git a/manual/object_mapper/creating/README.md b/manual/object_mapper/creating/README.md index 3ba3d2bf3a5..dbd5fc5b826 100644 --- a/manual/object_mapper/creating/README.md +++ b/manual/object_mapper/creating/README.md @@ -149,9 +149,9 @@ User user = new User() .setName("John Doe"); ``` -[table]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Table.html +[table]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Table.html [case-sensitive]:http://docs.datastax.com/en/cql/3.3/cql/cql_reference/ucase-lcase_r.html -[consistency level]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ConsistencyLevel.html +[consistency level]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ConsistencyLevel.html [java-beans]:https://docs.oracle.com/javase/tutorial/javabeans/writing/properties.html [set-accessible]:https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/AccessibleObject.html#setAccessible-boolean- @@ -189,7 +189,7 @@ CREATE TABLE users(id uuid PRIMARY KEY, "userName" text); private String userName; ``` -[column]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Column.html +[column]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Column.html #### Primary key fields @@ -213,8 +213,8 @@ private String areaCode; The order of the indices must match that of the columns in the table declaration. -[pk]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/PartitionKey.html -[cc]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/ClusteringColumn.html +[pk]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/PartitionKey.html +[cc]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/ClusteringColumn.html [pks]:http://thelastpickle.com/blog/2013/01/11/primary-keys-in-cql.html #### Computed fields @@ -250,7 +250,7 @@ version (see [JAVA-832](https://datastax-oss.atlassian.net/browse/JAVA-832)). [User Defined Functions]:http://www.planetcassandra.org/blog/user-defined-functions-in-cassandra-3-0/ -[computed]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Computed.html +[computed]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Computed.html #### Transient properties @@ -259,7 +259,7 @@ to table columns. [@Transient][transient] can be used to prevent a field or a Java bean property from being mapped. Like other column-level annotations, it should be placed on either the field declaration or the property getter method. -[transient]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Transient.html +[transient]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Transient.html ### Mapping User Types @@ -322,8 +322,8 @@ This also works with UDTs inside collections or other UDTs, with any arbitrary nesting level. [User Defined Types]: ../../udts/ -[udt]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/UDT.html -[field]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Field.html +[udt]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/UDT.html +[field]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Field.html ### Mapping collections @@ -381,10 +381,10 @@ to figure out how to appropriately handle UDT conversion, i.e.: mappingManager.udtCodec(Address.class); ``` -[frozen]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Frozen.html -[frozenkey]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/FrozenKey.html -[frozenvalue]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/FrozenValue.html -[udtCodec]:https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/MappingManager.html#udtCodec-java.lang.Class- +[frozen]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Frozen.html +[frozenkey]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/FrozenKey.html +[frozenvalue]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/FrozenValue.html +[udtCodec]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/MappingManager.html#udtCodec-java.lang.Class- #### Prefer Frozen Collections diff --git a/manual/object_mapper/custom_codecs/README.md b/manual/object_mapper/custom_codecs/README.md index 43f8dde4f21..c68f59ba67f 100644 --- a/manual/object_mapper/custom_codecs/README.md +++ b/manual/object_mapper/custom_codecs/README.md @@ -98,9 +98,9 @@ instance (one per column) and cache it for future use. This also works with [@Field][field] and [@Param][param] annotations. -[column]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Column.html -[field]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Field.html -[param]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Param.html +[column]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Column.html +[field]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Field.html +[param]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Param.html ## Implicit UDT codecs diff --git a/manual/object_mapper/using/README.md b/manual/object_mapper/using/README.md index f2045455b8a..f6367ecf203 100644 --- a/manual/object_mapper/using/README.md +++ b/manual/object_mapper/using/README.md @@ -28,9 +28,9 @@ Mapper mapper = manager.mapper(User.class); calling `manager#mapper` more than once for the same class will return the previously generated mapper. -[Mapper]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/Mapper.html -[MappingManager]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/MappingManager.html -[Session]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html +[Mapper]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/Mapper.html +[MappingManager]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/MappingManager.html +[Session]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html #### Basic CRUD operations @@ -179,7 +179,7 @@ It provides methods `one()`, `all()`, `iterator()`, `getExecutionInfo()` and `isExhausted()`. Note that iterating the `Result` will consume the `ResultSet`, and vice-versa. -[Result]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/Result.html +[Result]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/Result.html ### Accessors @@ -229,7 +229,7 @@ corresponds to which marker: ResultSet insert(@Param("u") UUID userId, @Param("n") String name); ``` -[param]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/Param.html +[param]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Param.html If a method argument is a Java enumeration, it must be annotated with `@Enumerated` to indicate how to convert it to a CQL type (the rules are @@ -301,7 +301,7 @@ query with the annotation [@QueryParameters]. Then, options like public ListenableFuture> getAllAsync(); ``` -[@QueryParameters]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/annotations/QueryParameters.html +[@QueryParameters]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/QueryParameters.html ### Mapping configuration @@ -345,6 +345,6 @@ PropertyMapper propertyMapper = new DefaultPropertyMapper() There is more to `DefaultPropertyMapper`; see the Javadocs and implementation for details. -[MappingConfiguration]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/MappingConfiguration.html -[PropertyMapper]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/PropertyMapper.html -[DefaultPropertyMapper]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/mapping/DefaultPropertyMapper.html +[MappingConfiguration]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/MappingConfiguration.html +[PropertyMapper]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/PropertyMapper.html +[DefaultPropertyMapper]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/DefaultPropertyMapper.html diff --git a/manual/paging/README.md b/manual/paging/README.md index 71a0dd49578..d3628cbfaa8 100644 --- a/manual/paging/README.md +++ b/manual/paging/README.md @@ -176,8 +176,8 @@ if (nextPage != null) { } ``` -[result_set]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ResultSet.html -[paging_state]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PagingState.html +[result_set]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ResultSet.html +[paging_state]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PagingState.html Due to internal implementation details, `PagingState` instances are not @@ -239,8 +239,8 @@ There are two situations where you might want to use the unsafe API: implementing your own validation logic (for example, signing the raw state with a private key). -[gpsu]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ExecutionInfo.html#getPagingStateUnsafe-- -[spsu]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Statement.html#setPagingStateUnsafe-byte:A- +[gpsu]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ExecutionInfo.html#getPagingStateUnsafe-- +[spsu]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Statement.html#setPagingStateUnsafe-byte:A- ### Offset queries diff --git a/manual/pooling/README.md b/manual/pooling/README.md index e7c83c1746b..ab13653b481 100644 --- a/manual/pooling/README.md +++ b/manual/pooling/README.md @@ -285,16 +285,16 @@ either: [newConnectionThreshold][nct] so that enough connections are added by the time you reach the bottleneck. -[result_set_future]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ResultSetFuture.html -[pooling_options]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PoolingOptions.html -[lbp]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LoadBalancingPolicy.html -[nct]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PoolingOptions.html#setNewConnectionThreshold-com.datastax.driver.core.HostDistance-int- -[mrpc]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PoolingOptions.html#setMaxRequestsPerConnection-com.datastax.driver.core.HostDistance-int- -[sits]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PoolingOptions.html#setIdleTimeoutSeconds-int- -[rtm]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#getReadTimeoutMillis-- -[smqs]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PoolingOptions.html#setMaxQueueSize-int- -[sptm]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PoolingOptions.html#setPoolTimeoutMillis-int- -[nhae]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/NoHostAvailableException.html -[getErrors]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- -[get_state]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html#getState-- -[BusyPoolException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/BusyPoolException.html +[result_set_future]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ResultSetFuture.html +[pooling_options]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PoolingOptions.html +[lbp]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LoadBalancingPolicy.html +[nct]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PoolingOptions.html#setNewConnectionThreshold-com.datastax.driver.core.HostDistance-int- +[mrpc]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PoolingOptions.html#setMaxRequestsPerConnection-com.datastax.driver.core.HostDistance-int- +[sits]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PoolingOptions.html#setIdleTimeoutSeconds-int- +[rtm]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#getReadTimeoutMillis-- +[smqs]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PoolingOptions.html#setMaxQueueSize-int- +[sptm]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PoolingOptions.html#setPoolTimeoutMillis-int- +[nhae]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[getErrors]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- +[get_state]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html#getState-- +[BusyPoolException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/BusyPoolException.html diff --git a/manual/query_timestamps/README.md b/manual/query_timestamps/README.md index c6e22870bff..20f4e9c6a47 100644 --- a/manual/query_timestamps/README.md +++ b/manual/query_timestamps/README.md @@ -140,10 +140,10 @@ following: Steps 2 and 3 only apply if native protocol v3 or above is in use. -[TimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TimestampGenerator.html -[AtomicMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.html -[ThreadLocalMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.html -[ServerSideTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ServerSideTimestampGenerator.html +[TimestampGenerator]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TimestampGenerator.html +[AtomicMonotonicTimestampGenerator]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.html +[ThreadLocalMonotonicTimestampGenerator]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.html +[ServerSideTimestampGenerator]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ServerSideTimestampGenerator.html [gettimeofday]: http://man7.org/linux/man-pages/man2/settimeofday.2.html [JNR]: https://github.com/jnr/jnr-ffi diff --git a/manual/reconnection/README.md b/manual/reconnection/README.md index eee3b023a5d..f99be3ef99f 100644 --- a/manual/reconnection/README.md +++ b/manual/reconnection/README.md @@ -29,7 +29,7 @@ You can also write your own policy; it must implement [ReconnectionPolicy]. For best results, use reasonable values: very low values (for example a constant delay of 10 milliseconds) will quickly saturate your system. -[ReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/ReconnectionPolicy.html -[Cluster.Builder.withReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Cluster.Builder.html#withReconnectionPolicy-com.datastax.driver.core.policies.ReconnectionPolicy- -[ExponentialReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.html -[ConstantReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/ConstantReconnectionPolicy.html +[ReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/ReconnectionPolicy.html +[Cluster.Builder.withReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withReconnectionPolicy-com.datastax.driver.core.policies.ReconnectionPolicy- +[ExponentialReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.html +[ConstantReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/ConstantReconnectionPolicy.html diff --git a/manual/retries/README.md b/manual/retries/README.md index de5cf3b8a67..231707022c9 100644 --- a/manual/retries/README.md +++ b/manual/retries/README.md @@ -146,33 +146,33 @@ implementations to handle idempotence (the new behavior is equivalent to what yo `IdempotenceAwareRetryPolicy` before). -[RetryDecision]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html -[retry()]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#retry-com.datastax.driver.core.ConsistencyLevel- -[tryNextHost()]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#tryNextHost-com.datastax.driver.core.ConsistencyLevel- -[rethrow()]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#rethrow-- -[ignore()]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#ignore-- -[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/NoHostAvailableException.html -[getErrors()]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- -[RetryPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.html -[DefaultRetryPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/DefaultRetryPolicy.html -[onReadTimeout]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- -[onWriteTimeout]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onWriteTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.WriteType-int-int-int- -[onUnavailable]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onUnavailable-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-int- -[onRequestError]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- -[UnavailableException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/UnavailableException.html -[ReadTimeoutException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/ReadTimeoutException.html -[WriteTimeoutException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/WriteTimeoutException.html -[OverloadedException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/OverloadedException.html -[ServerError]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/ServerError.html -[OperationTimedOutException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/OperationTimedOutException.html -[ConnectionException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/ConnectionException.html -[QueryValidationException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/QueryValidationException.html -[InvalidQueryException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/InvalidQueryException.html -[InvalidConfigurationInQueryException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.html -[UnauthorizedException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/UnauthorizedException.html -[SyntaxError]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/SyntaxError.html -[AlreadyExistsException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/AlreadyExistsException.html -[TruncateException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/TruncateException.html +[RetryDecision]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html +[retry()]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#retry-com.datastax.driver.core.ConsistencyLevel- +[tryNextHost()]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#tryNextHost-com.datastax.driver.core.ConsistencyLevel- +[rethrow()]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#rethrow-- +[ignore()]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#ignore-- +[NoHostAvailableException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[getErrors()]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- +[RetryPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.html +[DefaultRetryPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/DefaultRetryPolicy.html +[onReadTimeout]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- +[onWriteTimeout]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onWriteTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.WriteType-int-int-int- +[onUnavailable]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onUnavailable-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-int- +[onRequestError]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- +[UnavailableException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/UnavailableException.html +[ReadTimeoutException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/ReadTimeoutException.html +[WriteTimeoutException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/WriteTimeoutException.html +[OverloadedException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/OverloadedException.html +[ServerError]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/ServerError.html +[OperationTimedOutException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/OperationTimedOutException.html +[ConnectionException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/ConnectionException.html +[QueryValidationException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/QueryValidationException.html +[InvalidQueryException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/InvalidQueryException.html +[InvalidConfigurationInQueryException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.html +[UnauthorizedException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/UnauthorizedException.html +[SyntaxError]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/SyntaxError.html +[AlreadyExistsException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/AlreadyExistsException.html +[TruncateException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/TruncateException.html [query plan]: ../load_balancing/#query-plan [connection pool]: ../pooling/ diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md index 97f924241d7..4346bc7dbfb 100644 --- a/manual/shaded_jar/README.md +++ b/manual/shaded_jar/README.md @@ -12,7 +12,7 @@ package name: com.datastax.cassandra cassandra-driver-core - 3.9.0 + 3.10.0 shaded @@ -32,7 +32,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-core - 3.9.0 + 3.10.0 shaded @@ -44,7 +44,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-mapping - 3.9.0 + 3.10.0 com.datastax.cassandra @@ -74,5 +74,5 @@ detects that shaded Netty classes are being used: Detected shaded Netty classes in the classpath; native epoll transport will not work properly, defaulting to NIO. -[NettyOptions]:http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/NettyOptions.html +[NettyOptions]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/NettyOptions.html [Netty native transports]:http://netty.io/wiki/native-transports.html diff --git a/manual/socket_options/README.md b/manual/socket_options/README.md index 1cd55e5e3e9..3edd9a74718 100644 --- a/manual/socket_options/README.md +++ b/manual/socket_options/README.md @@ -117,15 +117,15 @@ To clarify: We might rename `SocketOptions.setReadTimeoutMillis` in a future version to clear up any confusion. -[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html -[setReadTimeoutMillis]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setReadTimeoutMillis-int- -[setConnectTimeoutMillis]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setConnectTimeoutMillis-int- -[setKeepAlive]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setKeepAlive-boolean- -[setReceiveBufferSize]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setReceiveBufferSize-int- -[setReuseAddress]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setReuseAddress-boolean- -[setSendBufferSize]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setSendBufferSize-int- -[setSoLinger]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setSoLinger-int- -[setTcpNoDelay]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SocketOptions.html#setTcpNoDelay-boolean- -[onReadTimeout]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- -[onRequestError]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- -[OperationTimedOutException]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/exceptions/OperationTimedOutException.html \ No newline at end of file +[SocketOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html +[setReadTimeoutMillis]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setReadTimeoutMillis-int- +[setConnectTimeoutMillis]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setConnectTimeoutMillis-int- +[setKeepAlive]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setKeepAlive-boolean- +[setReceiveBufferSize]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setReceiveBufferSize-int- +[setReuseAddress]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setReuseAddress-boolean- +[setSendBufferSize]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setSendBufferSize-int- +[setSoLinger]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setSoLinger-int- +[setTcpNoDelay]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setTcpNoDelay-boolean- +[onReadTimeout]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- +[onRequestError]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- +[OperationTimedOutException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/OperationTimedOutException.html \ No newline at end of file diff --git a/manual/speculative_execution/README.md b/manual/speculative_execution/README.md index 8913db069fb..3ef65f60242 100644 --- a/manual/speculative_execution/README.md +++ b/manual/speculative_execution/README.md @@ -73,7 +73,7 @@ Speculative executions are controlled by an instance of `Cluster`. This policy defines the threshold after which a new speculative execution will be triggered. -[SpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html +[SpeculativeExecutionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html Two implementations are provided with the driver: @@ -101,7 +101,7 @@ way: * if no response has been received at t0 + 1000 milliseconds, start another speculative execution on a third node. -[ConstantSpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/ConstantSpeculativeExecutionPolicy.html +[ConstantSpeculativeExecutionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/ConstantSpeculativeExecutionPolicy.html #### [PercentileSpeculativeExecutionPolicy] @@ -160,10 +160,10 @@ Note that `PercentileTracker` may also be used with a slow query logger (see the [Logging](../logging/) section). In that case, you would create a single tracker object and share it with both components. -[PercentileSpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/PercentileSpeculativeExecutionPolicy.html -[PercentileTracker]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PercentileTracker.html -[ClusterWidePercentileTracker]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ClusterWidePercentileTracker.html -[PerHostPercentileTracker]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PerHostPercentileTracker.html +[PercentileSpeculativeExecutionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/PercentileSpeculativeExecutionPolicy.html +[PercentileTracker]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PercentileTracker.html +[ClusterWidePercentileTracker]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ClusterWidePercentileTracker.html +[PerHostPercentileTracker]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PerHostPercentileTracker.html [hdr]: http://hdrhistogram.github.io/HdrHistogram/ #### Using your own @@ -210,7 +210,7 @@ client driver exec1 exec2 The only impact is that all executions of the same query always share the same query plan, so each host will be used by at most one execution. -[retry_policy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.html +[retry_policy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.html ### Tuning and practical details @@ -225,8 +225,8 @@ You can monitor how many speculative executions were triggered with the It should only be a few percents of the total number of requests ([cluster.getMetrics().getRequestsTimer().getCount()][request_metric]). -[se_metric]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metrics.Errors.html#getSpeculativeExecutions-- -[request_metric]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Metrics.html#getRequestsTimer-- +[se_metric]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metrics.Errors.html#getSpeculativeExecutions-- +[request_metric]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metrics.html#getRequestsTimer-- #### Stream id exhaustion @@ -255,8 +255,8 @@ sustained. If you're unsure of which native protocol version you're using, you can check with [cluster.getConfiguration().getProtocolOptions().getProtocolVersion()][protocol_version]. -[session_state]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.State.html -[protocol_version]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- +[session_state]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.State.html +[protocol_version]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- #### Request ordering and client timestamps diff --git a/manual/ssl/README.md b/manual/ssl/README.md index 35ec7c0537f..9fb628bacd5 100644 --- a/manual/ssl/README.md +++ b/manual/ssl/README.md @@ -207,8 +207,8 @@ Cluster cluster = Cluster.builder() .build(); ``` -[RemoteEndpointAwareSSLOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.html -[RemoteEndpointAwareJdkSSLOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html -[newSSLEngine]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html#newSSLEngine-io.netty.channel.socket.SocketChannel-java.net.InetSocketAddress- -[RemoteEndpointAwareNettySSLOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.html -[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/NettyOptions.html +[RemoteEndpointAwareSSLOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.html +[RemoteEndpointAwareJdkSSLOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html +[newSSLEngine]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html#newSSLEngine-io.netty.channel.socket.SocketChannel-java.net.InetSocketAddress- +[RemoteEndpointAwareNettySSLOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.html +[NettyOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/NettyOptions.html diff --git a/manual/statements/README.md b/manual/statements/README.md index 5c5bacf0cf8..865818796d0 100644 --- a/manual/statements/README.md +++ b/manual/statements/README.md @@ -32,11 +32,11 @@ If you use custom policies ([RetryPolicy], [LoadBalancingPolicy], properties that influence statement execution. To achieve this, you can wrap your statements in a custom [StatementWrapper] implementation. -[Statement]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Statement.html -[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/querybuilder/QueryBuilder.html -[StatementWrapper]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/StatementWrapper.html -[RetryPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/RetryPolicy.html -[LoadBalancingPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/LoadBalancingPolicy.html -[SpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html -[execute]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- -[executeAsync]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- +[Statement]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Statement.html +[QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/querybuilder/QueryBuilder.html +[StatementWrapper]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/StatementWrapper.html +[RetryPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.html +[LoadBalancingPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LoadBalancingPolicy.html +[SpeculativeExecutionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html +[execute]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- +[executeAsync]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- diff --git a/manual/statements/batch/README.md b/manual/statements/batch/README.md index c036074c4ea..e6db824424a 100644 --- a/manual/statements/batch/README.md +++ b/manual/statements/batch/README.md @@ -34,9 +34,9 @@ In addition, simple statements with named parameters are currently not supported due to a [protocol limitation][CASSANDRA-10246] that will be fixed in a future version). If you try to execute such a batch, an `IllegalArgumentException` is thrown. -[BatchStatement]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/BatchStatement.html +[BatchStatement]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/BatchStatement.html [batch_dse]: http://docs.datastax.com/en/dse/5.1/cql/cql/cql_using/useBatch.html -[LOGGED]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/BatchStatement.Type.html#LOGGED -[UNLOGGED]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/BatchStatement.Type.html#UNLOGGED +[LOGGED]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/BatchStatement.Type.html#LOGGED +[UNLOGGED]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/BatchStatement.Type.html#UNLOGGED [batch_size_fail_threshold]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html#configCassandra_yaml__batch_size_fail_threshold_in_kb [CASSANDRA-10246]: https://issues.apache.org/jira/browse/CASSANDRA-10246 diff --git a/manual/statements/built/README.md b/manual/statements/built/README.md index 58d9fda3058..d54f6e30faa 100644 --- a/manual/statements/built/README.md +++ b/manual/statements/built/README.md @@ -76,7 +76,7 @@ BuiltStatement ttlAndWriteTime = QueryBuilder.select().column("id").column("t") ``` You can also cast the value of the given column to another type by using the `cast` function, -[specifying](https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/querybuilder/QueryBuilder.html#cast-java.lang.Object-com.datastax.driver.core.DataType-) +[specifying](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/querybuilder/QueryBuilder.html#cast-java.lang.Object-com.datastax.driver.core.DataType-) the column for which it should be performed, and to what type it should be casted. #### Specifying conditions @@ -92,7 +92,7 @@ BuiltStatement selectOne = QueryBuilder.select().from("test", "test") The `where` function accepts the `Clause` object that is generated by calling `QueryBuilder`'s -[functions](https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/querybuilder/QueryBuilder.html#eq-java.lang.Iterable-java.lang.Iterable-), +[functions](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/querybuilder/QueryBuilder.html#eq-java.lang.Iterable-java.lang.Iterable-), such as, `eq`, `ne`, `lt`, `in`, `contains`, `notNull`, etc. In most cases, these functions receive 2 arguments: the name of the column, and the value to compare, but there are also variants that receive 2 iterables for columns and values correspondingly. @@ -263,6 +263,6 @@ Note: the call to these functions changes the object type from `BuiltStatement` -[QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/querybuilder/QueryBuilder.html -[TableMetadata]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TableMetadata.html -[SchemaBuilder]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/schemabuilder/SchemaBuilder.html +[QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/querybuilder/QueryBuilder.html +[TableMetadata]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TableMetadata.html +[SchemaBuilder]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/schemabuilder/SchemaBuilder.html diff --git a/manual/statements/prepared/README.md b/manual/statements/prepared/README.md index ce0cbcc58d2..d9dd7fee278 100644 --- a/manual/statements/prepared/README.md +++ b/manual/statements/prepared/README.md @@ -256,11 +256,11 @@ relying on `SELECT *`. This will be addressed in a future release of both Cassandra and the driver. Follow [CASSANDRA-10786] and [JAVA-1196] for more information. -[PreparedStatement]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/PreparedStatement.html -[BoundStatement]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/BoundStatement.html -[setPrepareOnAllHosts]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/QueryOptions.html#setPrepareOnAllHosts-boolean- -[setReprepareOnUp]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/QueryOptions.html#setReprepareOnUp-boolean- -[execute]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- -[executeAsync]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- +[PreparedStatement]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PreparedStatement.html +[BoundStatement]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/BoundStatement.html +[setPrepareOnAllHosts]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/QueryOptions.html#setPrepareOnAllHosts-boolean- +[setReprepareOnUp]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/QueryOptions.html#setReprepareOnUp-boolean- +[execute]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- +[executeAsync]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- [CASSANDRA-10786]: https://issues.apache.org/jira/browse/CASSANDRA-10786 [JAVA-1196]: https://datastax-oss.atlassian.net/browse/JAVA-1196 diff --git a/manual/statements/simple/README.md b/manual/statements/simple/README.md index 00bdc0fad8b..1144ba64c83 100644 --- a/manual/statements/simple/README.md +++ b/manual/statements/simple/README.md @@ -128,4 +128,4 @@ session.execute( 1, bytes); ``` -[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/SimpleStatement.html +[SimpleStatement]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SimpleStatement.html diff --git a/manual/tuples/README.md b/manual/tuples/README.md index de11ae2cf78..b8842082c99 100644 --- a/manual/tuples/README.md +++ b/manual/tuples/README.md @@ -96,7 +96,7 @@ bs.setList("l", Arrays.asList(oneTimeUsageTuple.newValue("1", "1"), oneTimeUsage session.execute(bs); ``` -[TupleType]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TupleType.html -[TupleValue]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TupleValue.html -[newValueVararg]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TupleType.html#newValue-java.lang.Object...- -[newValue]: http://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/TupleType.html#newValue-- +[TupleType]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TupleType.html +[TupleValue]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TupleValue.html +[newValueVararg]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TupleType.html#newValue-java.lang.Object...- +[newValue]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TupleType.html#newValue-- diff --git a/manual/udts/README.md b/manual/udts/README.md index 56ef63a8935..f2f4d514496 100644 --- a/manual/udts/README.md +++ b/manual/udts/README.md @@ -95,5 +95,5 @@ session.execute(bs); [cql_doc]: https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlRefUDType.html -[UDTValue]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/UDTValue.html -[UserType]: https://docs.datastax.com/en/drivers/java/3.9/com/datastax/driver/core/UserType.html +[UDTValue]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/UDTValue.html +[UserType]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/UserType.html diff --git a/pom.xml b/pom.xml index 31caf78eaf6..6764cfb44ae 100644 --- a/pom.xml +++ b/pom.xml @@ -641,7 +641,7 @@ - 3.8.0 + 3.9.0 ../clirr-ignores.xml com/datastax/shaded/** From 95e8c9da7a33fa8d7b379d29c7b665c6319c07ed Mon Sep 17 00:00:00 2001 From: olim7t Date: Tue, 28 Jul 2020 13:40:51 -0700 Subject: [PATCH 087/211] [maven-release-plugin] prepare release 3.10.0 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 0e477b33a4b..51df1bc29c5 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.9.1-SNAPSHOT + 3.10.0 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 041f87aa124..26b44e09a1a 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.9.1-SNAPSHOT + 3.10.0 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index ad29e09b98f..b95b65d5230 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.9.1-SNAPSHOT + 3.10.0 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 9afbb1c26fd..845b8e5eb8b 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.9.1-SNAPSHOT + 3.10.0 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 7adedebe76f..40757197b85 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.9.1-SNAPSHOT + 3.10.0 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 5f06c5bc7ff..a0151aada56 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.9.1-SNAPSHOT + 3.10.0 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 07e51b21e81..556bd4d0c9b 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.9.1-SNAPSHOT + 3.10.0 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 495e0d30727..978ec2f1204 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.9.1-SNAPSHOT + 3.10.0 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 83a9f84d589..226affa71f2 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.9.1-SNAPSHOT + 3.10.0 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index ebc3af952df..362c3ccc490 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.9.1-SNAPSHOT + 3.10.0 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 936536e2bab..2c14c4a359a 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.9.1-SNAPSHOT + 3.10.0 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 6764cfb44ae..bcb7a7c54f9 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.9.1-SNAPSHOT + 3.10.0 pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.10.0 From f5a042df4907c80e59738398b5b85413c1859d31 Mon Sep 17 00:00:00 2001 From: olim7t Date: Tue, 28 Jul 2020 13:41:00 -0700 Subject: [PATCH 088/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 51df1bc29c5..e362b2f0283 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.0 + 3.11.0-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 26b44e09a1a..122b8f7d5bb 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.0 + 3.11.0-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index b95b65d5230..0a326ecad12 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.0 + 3.11.0-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 845b8e5eb8b..a458b60332b 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.0 + 3.11.0-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 40757197b85..243b9755621 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.0 + 3.11.0-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index a0151aada56..23eb8567f7e 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.0 + 3.11.0-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 556bd4d0c9b..b4557cd170d 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.0 + 3.11.0-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 978ec2f1204..3ef443e5796 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.0 + 3.11.0-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 226affa71f2..26cc7970279 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.10.0 + 3.11.0-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 362c3ccc490..cfd521f9f9c 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.10.0 + 3.11.0-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 2c14c4a359a..826121182cf 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.0 + 3.11.0-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index bcb7a7c54f9..06310509326 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.0 + 3.11.0-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.10.0 + HEAD From 818c540133d6b9a5cf078aa300247690cb1f5df2 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Wed, 5 Aug 2020 11:56:27 +0200 Subject: [PATCH 089/211] Use CREATE KEYSPACE instead of CREATE SCHEMA --- .../java/com/datastax/driver/mapping/UDTFieldMapperTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/UDTFieldMapperTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/UDTFieldMapperTest.java index cb211752234..9256f7f74d4 100644 --- a/driver-mapping/src/test/java/com/datastax/driver/mapping/UDTFieldMapperTest.java +++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/UDTFieldMapperTest.java @@ -47,7 +47,7 @@ public void udt_and_tables_with_ks_created_in_another_session_should_be_mapped() Session session1 = cluster1.connect(); // Create type and table session1.execute( - "create schema if not exists java_509 " + "create keyspace if not exists java_509 " + "with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };"); session1.execute("create type java_509.my_tuple (" + "type text, " + "value text);"); session1.execute( @@ -89,7 +89,7 @@ public void udt_and_tables_without_ks_created_in_another_session_should_be_mappe .build()); Session session1 = cluster1.connect(); session1.execute( - "create schema if not exists java_509b " + "create keyspace if not exists java_509b " + "with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };"); session1.execute("use java_509b"); session1.execute("create type my_tuple (" + "type text, " + "value text);"); From a856beb0f13e21748ebc082843983cdc0faac504 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 4 Aug 2020 12:55:28 +0200 Subject: [PATCH 090/211] JAVA-2857: Fix NPE when built statements without parameters are logged at TRACE level --- changelog/README.md | 4 ++ .../com/datastax/driver/core/QueryLogger.java | 6 +- .../datastax/driver/core/QueryLoggerTest.java | 58 +++++++++++++++++++ 3 files changed, 65 insertions(+), 3 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 47dd231e28b..fa6f4817534 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,6 +5,10 @@ 3.x versions get published. --> +## 3.10.1 + +- [bug] JAVA-2857: Fix NPE when built statements without parameters are logged at TRACE level. + ## 3.10.0 - [improvement] JAVA-2676: Don't reschedule flusher after empty runs diff --git a/driver-core/src/main/java/com/datastax/driver/core/QueryLogger.java b/driver-core/src/main/java/com/datastax/driver/core/QueryLogger.java index 5cc70a03474..591320533ad 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/QueryLogger.java +++ b/driver-core/src/main/java/com/datastax/driver/core/QueryLogger.java @@ -872,9 +872,9 @@ protected int appendParameters(BuiltStatement statement, StringBuilder buffer, i if (remaining == 0) { return 0; } - int numberOfParameters = - statement.getValues(protocolVersion(), cluster.getConfiguration().getCodecRegistry()) - .length; + ByteBuffer[] values = + statement.getValues(protocolVersion(), cluster.getConfiguration().getCodecRegistry()); + int numberOfParameters = values == null ? 0 : values.length; if (numberOfParameters > 0) { int numberOfLoggedParameters; if (remaining == -1) { diff --git a/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerTest.java b/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerTest.java index 432633dd893..c08cebe5f03 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerTest.java @@ -414,6 +414,64 @@ public void should_log_normal_queries() throws Exception { // Tests with query parameters (log level TRACE) + /** @jira_ticket JAVA-2857 */ + @Test(groups = "short") + @CassandraVersion("2.0.0") + public void should_log_simple_statements_without_parameters() throws Exception { + // given + normal.setLevel(TRACE); + queryLogger = QueryLogger.builder().build(); + cluster().register(queryLogger); + + // when + String query = "UPDATE test SET c_int = 42 WHERE pk = 42"; + SimpleStatement stmt = new SimpleStatement(query); + session().execute(stmt); + + // then + String line = normalAppender.waitAndGet(10000); + assertThat(line).contains("Query completed normally").contains(query); + } + + /** @jira_ticket JAVA-2857 */ + @Test(groups = "short") + @CassandraVersion("2.0.0") + public void should_log_bound_statements_without_parameters() throws Exception { + // given + normal.setLevel(TRACE); + queryLogger = QueryLogger.builder().build(); + cluster().register(queryLogger); + + // when + String query = "UPDATE test SET c_int = 42 WHERE pk = 42"; + PreparedStatement ps = session().prepare(query); + BoundStatement bs = ps.bind(); + session().execute(bs); + + // then + String line = normalAppender.waitAndGet(10000); + assertThat(line).contains("Query completed normally").contains(query); + } + + /** @jira_ticket JAVA-2857 */ + @Test(groups = "short") + @CassandraVersion("2.0.0") + public void should_log_built_statements_without_parameters() throws Exception { + // given + normal.setLevel(TRACE); + queryLogger = QueryLogger.builder().build(); + cluster().register(queryLogger); + + // when + // both c_int and pk will be inlined + BuiltStatement update = update("test").with(set("c_int", 42)).where(eq("pk", 42)); + session().execute(update); + + // then + String line = normalAppender.waitAndGet(10000); + assertThat(line).contains("Query completed normally").contains(update.getQueryString()); + } + @Test(groups = "short") @CassandraVersion("2.0.0") public void should_log_non_null_named_parameter_bound_statements() throws Exception { From 985d2394c1246909b52cf98d7e1b026133d24691 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 4 Aug 2020 22:37:26 +0200 Subject: [PATCH 091/211] Protect against failures when calling LatencyTracker.update --- .../src/main/java/com/datastax/driver/core/Cluster.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java index 0af1b9eb9e6..0efaced9322 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java @@ -1878,7 +1878,11 @@ boolean removeSession(Session session) { void reportQuery(Host host, Statement statement, Exception exception, long latencyNanos) { for (LatencyTracker tracker : latencyTrackers) { - tracker.update(host, statement, exception, latencyNanos); + try { + tracker.update(host, statement, exception, latencyNanos); + } catch (Exception e) { + logger.error("Call to latency tracker failed", e); + } } } From 4977553f330487d995add3f50522bb4e0957c8bd Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 4 Aug 2020 15:20:31 +0200 Subject: [PATCH 092/211] Exclude enable_materialized_views and enable_sasi_indexes from cassandra.yaml for DSE --- .../java/com/datastax/driver/core/CCMBridge.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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 97284655ac3..0b811a41282 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 @@ -1047,13 +1047,15 @@ public CCMBridge build() { cassandraConfiguration.remove("rpc_port"); cassandraConfiguration.remove("thrift_prepared_statements_cache_size_mb"); } - if (isMaterializedViewsDisabledByDefault(cassandraVersion)) { - // enable materialized views - cassandraConfiguration.put("enable_materialized_views", true); - } - if (isSasiConfigEnablementRequired(cassandraVersion)) { - // enable SASI indexing in config (disabled by default in C* 4.0) - cassandraConfiguration.put("enable_sasi_indexes", true); + if (!dse) { + if (isMaterializedViewsDisabledByDefault(cassandraVersion)) { + // enable materialized views + cassandraConfiguration.put("enable_materialized_views", true); + } + if (isSasiConfigEnablementRequired(cassandraVersion)) { + // enable SASI indexing in config (disabled by default in C* 4.0) + cassandraConfiguration.put("enable_sasi_indexes", true); + } } final CCMBridge ccm = new CCMBridge( From 51d30a83b9aa857970f695c322144979ab1c4ba6 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 4 Aug 2020 22:16:07 +0200 Subject: [PATCH 093/211] Include DSE in nightly jobs --- Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0a721b5b00f..95e4c4f147a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -457,7 +457,11 @@ pipeline { values '2.1', // Legacy Apache CassandraⓇ '3.0', // Previous Apache CassandraⓇ '3.11', // Current Apache CassandraⓇ - '4.0' // Development 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 } } when { From 66983ec22c7b26e6336bcfb9fb0790a8fb188f6c Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 4 Aug 2020 22:24:31 +0200 Subject: [PATCH 094/211] JAVA-2843: Successfully parse DSE table schema in OSS driver --- Jenkinsfile | 22 +++++++++++- changelog/README.md | 4 ++- .../driver/core/ControlConnection.java | 6 ++++ .../datastax/driver/core/SchemaParser.java | 1 + .../driver/core/ExportAsStringTest.java | 11 ++++-- .../driver/core/TableMetadataTest.java | 36 ++++++++++++++----- 6 files changed, 68 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 95e4c4f147a..031820a8169 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -220,8 +220,12 @@ pipeline { '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 'ALL'], - description: '''Apache Cassandra® server version to use for adhoc BUILD-AND-EXECUTE-TESTS builds + description: '''Apache Cassandra® or DataStax Enterprise server version to use for adhoc BUILD-AND-EXECUTE-TESTS builds @@ -249,6 +253,22 @@ pipeline { + + + + + + + + + + + + + + + +
    4.0 Apache Cassandra® v4.x (CURRENTLY UNDER DEVELOPMENT)
    dse-5.1DataStax Enterprise v5.1.x
    dse-6.0DataStax Enterprise v6.0.x
    dse-6.7DataStax Enterprise v6.7.x
    dse-6.8.0DataStax Enterprise v6.8.0
    ''') choice( name: 'ADHOC_BUILD_AND_EXECUTE_TESTS_JABBA_VERSION', diff --git a/changelog/README.md b/changelog/README.md index fa6f4817534..346e4768533 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,9 +5,11 @@ 3.x versions get published. --> -## 3.10.1 +## 3.10.1 (in progress) - [bug] JAVA-2857: Fix NPE when built statements without parameters are logged at TRACE level. +- [bug] JAVA-2843: Successfully parse DSE table schema in OSS driver. + ## 3.10.0 diff --git a/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java b/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java index 6ba401c5687..3558f006d9d 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java @@ -77,6 +77,8 @@ class ControlConnection implements Connection.Owner { private static final String SELECT_SCHEMA_LOCAL = "SELECT schema_version, host_id FROM system.local WHERE key='local'"; + private static final VersionNumber _3_11 = VersionNumber.parse("3.11.0"); + @VisibleForTesting final AtomicReference connectionRef = new AtomicReference(); @@ -406,6 +408,10 @@ static void refreshSchema( dseVersion == null ? SchemaParser.forVersion(cassandraVersion) : SchemaParser.forDseVersion(dseVersion); + if (dseVersion != null && dseVersion.getMajor() == 6 && dseVersion.getMinor() < 8) { + // DSE 6.0 and 6.7 report C* 4.0, but consider it C* 3.11 for schema parsing purposes + cassandraVersion = _3_11; + } } schemaParser.refresh( diff --git a/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java b/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java index 7c7f1352738..74443a22741 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java +++ b/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java @@ -56,6 +56,7 @@ static SchemaParser forVersion(VersionNumber cassandraVersion) { } static SchemaParser forDseVersion(VersionNumber dseVersion) { + if (dseVersion.getMajor() == 6 && dseVersion.getMinor() >= 8) return V4_PARSER; if (dseVersion.getMajor() >= 5) return V3_PARSER; return V2_PARSER; } 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 3edfe429a91..843d77ece7a 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 @@ -225,8 +225,15 @@ public void should_create_schema_and_ensure_exported_cql_is_as_expected() { } private String getExpectedCqlString() { - String majorMinor = - ccm().getCassandraVersion().getMajor() + "." + ccm().getCassandraVersion().getMinor(); + VersionNumber cassandraVersion = ccm().getCassandraVersion(); + VersionNumber dseVersion = ccm().getDSEVersion(); + String majorMinor; + if (dseVersion != null && dseVersion.getMajor() == 6 && dseVersion.getMinor() < 8) { + // DSE 6.0 and 6.7 report C* 4.0 but in reality it is C* 3.11 + majorMinor = "3.11"; + } else { + majorMinor = cassandraVersion.getMajor() + "." + cassandraVersion.getMinor(); + } String resourceName = "/export_as_string_test_" + majorMinor + ".cql"; Closer closer = Closer.create(); 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 e2a72439ef6..6560b910cb6 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 @@ -295,13 +295,17 @@ public void should_parse_compact_table_with_multiple_clustering_columns() { @Test(groups = "short") public void should_parse_table_options() { - VersionNumber version = TestUtils.findHost(cluster(), 1).getCassandraVersion(); + VersionNumber version = ccm().getCassandraVersion(); + VersionNumber dseVersion = ccm().getDSEVersion(); + boolean isRealCassandra4 = + version.getMajor() > 3 + && (dseVersion == null || dseVersion.compareTo(VersionNumber.parse("6.8")) >= 0); // given String cql; // Cassandra 4.0 + - if (version.getMajor() > 3) { + if (isRealCassandra4) { cql = String.format( "CREATE TABLE %s.with_options (\n" @@ -325,7 +329,7 @@ public void should_parse_table_options() { keyspace); // Cassandra 3.0 + - } else if (version.getMajor() > 2) { + } else if (version.compareTo(VersionNumber.parse("3.0")) >= 0) { cql = String.format( "CREATE TABLE %s.with_options (\n" @@ -426,7 +430,7 @@ public void should_parse_table_options() { assertThat(table); // Cassandra 4.0 + - if (version.getMajor() > 3) { + if (isRealCassandra4) { assertThat(table.getOptions().getGcGraceInSeconds()).isEqualTo(42); assertThat(table.getOptions().getBloomFilterFalsePositiveChance()).isEqualTo(0.01); @@ -445,7 +449,8 @@ public void should_parse_table_options() { 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.9p"); + 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); @@ -467,7 +472,10 @@ public void should_parse_table_options() { "'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.9p'") + .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") @@ -476,7 +484,7 @@ public void should_parse_table_options() { .doesNotContain(" index_interval") .doesNotContain("replicate_on_write"); // Cassandra 3.8 + - } else if (version.getMajor() == 3 && version.getMinor() >= 8) { + } else if (version.compareTo(VersionNumber.parse("3.8")) >= 0) { assertThat(table.getOptions().getReadRepairChance()).isEqualTo(0.5); assertThat(table.getOptions().getLocalReadRepairChance()).isEqualTo(0.6); @@ -528,7 +536,7 @@ public void should_parse_table_options() { .doesNotContain(" index_interval") .doesNotContain("replicate_on_write"); // Cassandra 3.0 + - } else if (version.getMajor() > 2) { + } else if (version.compareTo(VersionNumber.parse("3.0")) >= 0) { assertThat(table.getOptions().getReadRepairChance()).isEqualTo(0.5); assertThat(table.getOptions().getLocalReadRepairChance()).isEqualTo(0.6); @@ -719,6 +727,18 @@ public void should_parse_table_options() { .doesNotContain("cdc") .doesNotContain("memtable_flush_period_in_ms"); // 2.0 + } + + // Also check that the generated CQL is valid and creates an identical table + session().execute("DROP TABLE " + table.getName()); + session().execute(table.asCQLQuery()); + TableMetadata actual = + cluster() + .getMetadata() + .getKeyspace(table.getKeyspace().getName()) + .getTable(table.getName()); + + assertThat(actual.getOptions()).isEqualTo(table.getOptions()); + assertThat(actual.asCQLQuery(true)).isEqualTo(table.asCQLQuery(true)); } /** From 1b2fe54fc3f036aebbd2bf8203364d6d1fdc1231 Mon Sep 17 00:00:00 2001 From: Erik Merkle Date: Thu, 6 Aug 2020 13:24:23 -0500 Subject: [PATCH 095/211] Fix logic to set "dse" flag for DSE tests --- Jenkinsfile | 2 ++ .../com/datastax/driver/core/CCMBridge.java | 23 +++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 031820a8169..45d02d3d9d5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -74,6 +74,7 @@ def executeTests() { -Dcom.datastax.driver.TEST_BASE_NODE_WAIT=120 \ -Dcom.datastax.driver.NEW_NODE_DELAY_SECONDS=100 \ -Dcassandra.version=${CCM_CASSANDRA_VERSION} \ + -Ddse=${CCM_IS_DSE} \ -Dccm.java.home=${CCM_JAVA_HOME} \ -Dccm.path=${CCM_JAVA_HOME}/bin \ -Dccm.maxNumberOfNodes=3 \ @@ -88,6 +89,7 @@ def executeTests() { -Dcom.datastax.driver.TEST_BASE_NODE_WAIT=120 \ -Dcom.datastax.driver.NEW_NODE_DELAY_SECONDS=100 \ -Dcassandra.version=${CCM_CASSANDRA_VERSION} \ + -Ddse=${CCM_IS_DSE} \ -Dccm.java.home=${CCM_JAVA_HOME} \ -Dccm.path=${CCM_JAVA_HOME}/bin \ -Dccm.maxNumberOfNodes=3 \ 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 0b811a41282..73fb162c67c 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 @@ -173,12 +173,6 @@ public class CCMBridge implements CCMAccess { String installDirectory = System.getProperty("cassandra.directory"); String branch = System.getProperty("cassandra.branch"); - String dseProperty = System.getProperty("dse"); - // If -Ddse, if the value is empty interpret it as enabled, - // otherwise if there is a value, parse as boolean. - boolean isDse = - dseProperty != null && (dseProperty.isEmpty() || Boolean.parseBoolean(dseProperty)); - ImmutableSet.Builder installArgs = ImmutableSet.builder(); if (installDirectory != null && !installDirectory.trim().isEmpty()) { installArgs.add("--install-dir=" + new File(installDirectory).getAbsolutePath()); @@ -188,7 +182,7 @@ public class CCMBridge implements CCMAccess { installArgs.add("-v " + inputCassandraVersion); } - if (isDse) { + if (isDse()) { installArgs.add("--dse"); } @@ -219,7 +213,7 @@ public class CCMBridge implements CCMAccess { } ENVIRONMENT_MAP = ImmutableMap.copyOf(envMap); - if (isDse) { + if (isDse()) { GLOBAL_DSE_VERSION_NUMBER = VersionNumber.parse(inputCassandraVersion); GLOBAL_CASSANDRA_VERSION_NUMBER = CCMBridge.getCassandraVersion(GLOBAL_DSE_VERSION_NUMBER); logger.info( @@ -247,6 +241,11 @@ public static VersionNumber getGlobalDSEVersion() { return GLOBAL_DSE_VERSION_NUMBER; } + public static boolean isDse() { + // System property "dse" must be present and evaluate to TRUE to indicate DSE is enabled. + return Boolean.getBoolean("dse"); + } + /** * @return The mapped cassandra version to the given dseVersion. If the DSE version can't be * derived the following logic is used: @@ -862,13 +861,13 @@ public static class Builder { int[] nodes = {1}; private int[] jmxPorts = {}; private boolean start = true; - private boolean dse = false; + private boolean dse = isDse(); private VersionNumber version = null; - private Set createOptions = new LinkedHashSet(); - private Set jvmArgs = new LinkedHashSet(); + private final Set createOptions = new LinkedHashSet(); + private final Set jvmArgs = new LinkedHashSet(); private final Map cassandraConfiguration = Maps.newLinkedHashMap(); private final Map dseConfiguration = Maps.newLinkedHashMap(); - private Map workloads = new HashMap(); + private final Map workloads = new HashMap(); private Builder() { cassandraConfiguration.put("start_rpc", false); From 21bfe8d0a8ff87d4962a1c9dde9053020c2ee739 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 7 Aug 2020 16:29:38 +0200 Subject: [PATCH 096/211] Improve heuristic to infer C* version from DSE version --- .../src/test/java/com/datastax/driver/core/CCMBridge.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 73fb162c67c..ffae2677872 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 @@ -110,7 +110,6 @@ public class CCMBridge implements CCMAccess { */ private static final Map dseToCassandraVersions = ImmutableMap.builder() - .put("6.0", "4.0") .put("5.1", "3.11") .put("5.0.4", "3.0.10") .put("5.0.3", "3.0.9") @@ -274,6 +273,12 @@ public static VersionNumber getCassandraVersion(VersionNumber dseVersion) { } else { return VersionNumber.parse("3.11"); } + } else if (dseVersion.getMajor() == 6) { + if (dseVersion.getMinor() < 8) { + return VersionNumber.parse("3.11"); + } else { + return VersionNumber.parse("4.0"); + } } else { // Fallback on 4.0 by default. return VersionNumber.parse("4.0"); From 40e1a547f83c52b52955b2c6772b3535a4ad1c58 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 7 Aug 2020 20:37:24 +0200 Subject: [PATCH 097/211] Fix thrift support detection in CCMBridge --- .../java/com/datastax/driver/core/CCMBridge.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 ffae2677872..f890b3447fd 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 @@ -1045,7 +1045,7 @@ public CCMBridge build() { } } - if (!isThriftSupported(cassandraVersion)) { + if (!isThriftSupported(cassandraVersion, dseVersion)) { // remove thrift configuration cassandraConfiguration.remove("start_rpc"); cassandraConfiguration.remove("rpc_port"); @@ -1102,9 +1102,14 @@ public void run() { return ccm; } - private static boolean isThriftSupported(VersionNumber cassandraVersion) { - // Thrift is removed from some pre-release 4.x versions, make the comparison work for those - return cassandraVersion.nextStable().compareTo(VersionNumber.parse("4.0")) < 0; + private static boolean isThriftSupported( + VersionNumber cassandraVersion, VersionNumber dseVersion) { + if (dseVersion == null) { + // Thrift is removed from some pre-release 4.x versions, make the comparison work for those + return cassandraVersion.nextStable().compareTo(VersionNumber.parse("4.0")) < 0; + } else { + return dseVersion.nextStable().compareTo(VersionNumber.parse("6.0")) < 0; + } } private static boolean isMaterializedViewsDisabledByDefault(VersionNumber cassandraVersion) { From 1aaa538408a5b07e19aa5f2cf395d0ad34d61218 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 7 Aug 2020 20:43:14 +0200 Subject: [PATCH 098/211] Update version in docs --- README.md | 2 +- changelog/README.md | 5 ++--- pom.xml | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c7c1ff59959..7d7d26cad85 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ The driver contains the following modules: driver releases and important announcements (low frequency). [@DataStaxEng](https://twitter.com/datastaxeng) has more news including other drivers, Cassandra, and DSE. -- DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.9/manual/) has quick +- DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.10/manual/) has quick start material and technical details about the driver and its features. - API: https://docs.datastax.com/en/drivers/java/3.10 - GITHUB REPOSITORY: https://github.com/datastax/java-driver diff --git a/changelog/README.md b/changelog/README.md index 346e4768533..45cefceff26 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,12 +5,11 @@ 3.x versions get published. --> -## 3.10.1 (in progress) +## 3.10.1 - [bug] JAVA-2857: Fix NPE when built statements without parameters are logged at TRACE level. - [bug] JAVA-2843: Successfully parse DSE table schema in OSS driver. - ## 3.10.0 - [improvement] JAVA-2676: Don't reschedule flusher after empty runs @@ -21,7 +20,7 @@ - [bug] JAVA-2627: Avoid logging error message including stack trace in request handler. - [new feature] JAVA-2706: Add now_in_seconds to protocol v5 query messages. - [improvement] JAVA-2730: Add support for Cassandra® 4.0 table options -- [improvement[ JAVA-2702: Transient Replication Support for Cassandra® 4.0 +- [improvement] JAVA-2702: Transient Replication Support for Cassandra® 4.0 ## 3.8.0 diff --git a/pom.xml b/pom.xml index 06310509326..0e98fe0bdd0 100644 --- a/pom.xml +++ b/pom.xml @@ -641,7 +641,7 @@ - 3.9.0 + 3.10.0 ../clirr-ignores.xml com/datastax/shaded/** From e92198679db4bcea96af908cf6e6ef20c0894af1 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 7 Aug 2020 20:48:14 +0200 Subject: [PATCH 099/211] [maven-release-plugin] prepare release 3.10.1 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index e362b2f0283..c0417c0645c 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.0-SNAPSHOT + 3.10.1 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 122b8f7d5bb..e651ab76407 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.0-SNAPSHOT + 3.10.1 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 0a326ecad12..d3d9950ac49 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.0-SNAPSHOT + 3.10.1 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index a458b60332b..9a6fe144a7b 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.0-SNAPSHOT + 3.10.1 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 243b9755621..fc8f04eb4e9 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.0-SNAPSHOT + 3.10.1 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 23eb8567f7e..23739820bb5 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.0-SNAPSHOT + 3.10.1 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index b4557cd170d..8bdacabca00 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.0-SNAPSHOT + 3.10.1 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 3ef443e5796..51265bf4326 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.0-SNAPSHOT + 3.10.1 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 26cc7970279..634f9e6348b 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.0-SNAPSHOT + 3.10.1 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index cfd521f9f9c..a9316b920f4 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.0-SNAPSHOT + 3.10.1 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 826121182cf..4dba56fe20a 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.0-SNAPSHOT + 3.10.1 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 0e98fe0bdd0..f6f0c0ce680 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.0-SNAPSHOT + 3.10.1 pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.10.1 From b0a3968e0a3b37dacd510537dfd1166ec52b9098 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 7 Aug 2020 20:48:26 +0200 Subject: [PATCH 100/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index c0417c0645c..7ef14ab6440 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.1 + 3.10.2-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index e651ab76407..bf29b272439 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.1 + 3.10.2-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index d3d9950ac49..6c87fe41abd 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.1 + 3.10.2-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 9a6fe144a7b..5fa6f6c7fb4 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.1 + 3.10.2-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index fc8f04eb4e9..125ea4386e2 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.1 + 3.10.2-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 23739820bb5..584aa741073 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.1 + 3.10.2-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 8bdacabca00..e8387cd92dd 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.1 + 3.10.2-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 51265bf4326..6b8460f28fa 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.1 + 3.10.2-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 634f9e6348b..119f2666a03 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.10.1 + 3.10.2-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index a9316b920f4..b95e1be3835 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.10.1 + 3.10.2-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 4dba56fe20a..8bb8273e3a8 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.1 + 3.10.2-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index f6f0c0ce680..cbe2c44bffc 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.1 + 3.10.2-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.10.1 + HEAD From e45d09e44bdcbeb0023691c866e66fcb2b30d839 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Sat, 8 Aug 2020 10:28:58 +0200 Subject: [PATCH 101/211] Fix ProtocolBetaVersionTest --- .../driver/core/ProtocolBetaVersionTest.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java b/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java index da9cb4d13bf..96c84706608 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java @@ -21,12 +21,22 @@ import static org.assertj.core.api.Assertions.fail; import com.datastax.driver.core.utils.CassandraVersion; +import org.testng.SkipException; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /** Tests for the new USE_BETA flag introduced in protocol v5 and Cassandra 3.10. */ @CassandraVersion("3.10") public class ProtocolBetaVersionTest extends CCMTestsSupport { + @BeforeClass + public void checkNotCassandra4OrHigher() { + if (ccm().getCassandraVersion().getMajor() > 3) { + throw new SkipException( + "ProtocolBetaVersionTest should only be executed against C* versions >= 3.10 and < 4.0"); + } + } + /** * Verifies that the cluster builder fails when version is explicitly set and user attempts to set * beta flag. @@ -99,9 +109,12 @@ public void should_not_connect_when_beta_version_explicitly_required_and_flag_no * Verifies that the driver can connect to 3.10 with the following combination of options: Version * UNSET Flag SET Expected version: V5 * + *

    Note: Since driver 3.10, and due to JAVA-2772, it is not possible anymore to connect with v5 + * to a Cassandra 3.x cluster. + * * @jira_ticket JAVA-1248 */ - @Test(groups = "short") + @Test(groups = "short", enabled = false) public void should_connect_with_beta_when_no_version_explicitly_required_and_flag_set() throws Exception { // Note: when the driver's ProtocolVersion.NEWEST_SUPPORTED will be incremented to V6 or higher From b7012f5a4934f2e11fc3ebc7fb873eaac9775788 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Sat, 8 Aug 2020 11:00:27 +0200 Subject: [PATCH 102/211] Make client encryption non optional when enabling SSL in CCMBridge --- .../src/test/java/com/datastax/driver/core/CCMBridge.java | 1 + 1 file changed, 1 insertion(+) 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 f890b3447fd..1c7790e6189 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 @@ -902,6 +902,7 @@ public Builder withoutNodes() { /** Enables SSL encryption. */ public Builder withSSL() { cassandraConfiguration.put("client_encryption_options.enabled", "true"); + cassandraConfiguration.put("client_encryption_options.optional", "false"); cassandraConfiguration.put( "client_encryption_options.keystore", DEFAULT_SERVER_KEYSTORE_FILE.getAbsolutePath()); cassandraConfiguration.put( From 218a5627c5b0a873ac64d247c3a35e53a46e9219 Mon Sep 17 00:00:00 2001 From: olim7t Date: Thu, 13 Aug 2020 10:14:22 -0700 Subject: [PATCH 103/211] JAVA-2860: Avoid NPE if channel initialization crashes --- changelog/README.md | 4 ++++ .../main/java/com/datastax/driver/core/Connection.java | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 45cefceff26..d8965ce3db4 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,6 +5,10 @@ 3.x versions get published. --> +## 3.10.2 (in progress) + +- [bug] JAVA-2860: Avoid NPE if channel initialization crashes + ## 3.10.1 - [bug] JAVA-2857: Fix NPE when built statements without parameters are logged at TRACE level. diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java index 974e2bdf6ed..92861dc9fe6 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java @@ -193,8 +193,10 @@ ListenableFuture initAsync() { @Override public void operationComplete(ChannelFuture future) throws Exception { writer.decrementAndGet(); + // Note: future.channel() can be null in some error cases, so we need to guard against + // it in the rest of the code below. channel = future.channel(); - if (isClosed()) { + if (isClosed() && channel != null) { channel .close() .addListener( @@ -208,7 +210,9 @@ public void operationComplete(ChannelFuture future) throws Exception { } }); } else { - Connection.this.factory.allChannels.add(channel); + if (channel != null) { + Connection.this.factory.allChannels.add(channel); + } if (!future.isSuccess()) { if (logger.isDebugEnabled()) logger.debug( @@ -221,6 +225,7 @@ public void operationComplete(ChannelFuture future) throws Exception { new TransportException( Connection.this.endPoint, "Cannot connect", future.cause())); } else { + assert channel != null; logger.debug( "{} Connection established, initializing transport", Connection.this); channel.closeFuture().addListener(new ChannelCloseListener()); From 37813e78819f2c353a35da614fba36dbbe6a8f32 Mon Sep 17 00:00:00 2001 From: olim7t Date: Thu, 13 Aug 2020 10:14:22 -0700 Subject: [PATCH 104/211] JAVA-2860: Avoid NPE if channel initialization crashes --- changelog/README.md | 4 ++++ .../main/java/com/datastax/driver/core/Connection.java | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 45cefceff26..d8965ce3db4 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,6 +5,10 @@ 3.x versions get published. --> +## 3.10.2 (in progress) + +- [bug] JAVA-2860: Avoid NPE if channel initialization crashes + ## 3.10.1 - [bug] JAVA-2857: Fix NPE when built statements without parameters are logged at TRACE level. diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java index 974e2bdf6ed..92861dc9fe6 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java @@ -193,8 +193,10 @@ ListenableFuture initAsync() { @Override public void operationComplete(ChannelFuture future) throws Exception { writer.decrementAndGet(); + // Note: future.channel() can be null in some error cases, so we need to guard against + // it in the rest of the code below. channel = future.channel(); - if (isClosed()) { + if (isClosed() && channel != null) { channel .close() .addListener( @@ -208,7 +210,9 @@ public void operationComplete(ChannelFuture future) throws Exception { } }); } else { - Connection.this.factory.allChannels.add(channel); + if (channel != null) { + Connection.this.factory.allChannels.add(channel); + } if (!future.isSuccess()) { if (logger.isDebugEnabled()) logger.debug( @@ -221,6 +225,7 @@ public void operationComplete(ChannelFuture future) throws Exception { new TransportException( Connection.this.endPoint, "Cannot connect", future.cause())); } else { + assert channel != null; logger.debug( "{} Connection established, initializing transport", Connection.this); channel.closeFuture().addListener(new ChannelCloseListener()); From 1857326d0c93b4aa96728178acc8c789c00e2376 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Wed, 26 Aug 2020 15:17:17 +0200 Subject: [PATCH 105/211] Update version in docs --- changelog/README.md | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index d8965ce3db4..1b64f4aa38b 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,9 +5,9 @@ 3.x versions get published. --> -## 3.10.2 (in progress) +## 3.10.2 -- [bug] JAVA-2860: Avoid NPE if channel initialization crashes +- [bug] JAVA-2860: Avoid NPE if channel initialization crashes. ## 3.10.1 diff --git a/pom.xml b/pom.xml index cbe2c44bffc..b0b6af5aef9 100644 --- a/pom.xml +++ b/pom.xml @@ -641,7 +641,7 @@ - 3.10.0 + 3.10.1 ../clirr-ignores.xml com/datastax/shaded/** From 348797bd831d01a09109bff1e63be98715fafd73 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Wed, 26 Aug 2020 15:19:41 +0200 Subject: [PATCH 106/211] [maven-release-plugin] prepare release 3.10.2 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 7ef14ab6440..f96155bfb60 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.2-SNAPSHOT + 3.10.2 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index bf29b272439..e8ce8623245 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.2-SNAPSHOT + 3.10.2 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 6c87fe41abd..ad94e740f18 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.2-SNAPSHOT + 3.10.2 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 5fa6f6c7fb4..bcff1139ccd 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.2-SNAPSHOT + 3.10.2 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 125ea4386e2..25df9f53826 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.2-SNAPSHOT + 3.10.2 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 584aa741073..ecd7f29bc61 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.2-SNAPSHOT + 3.10.2 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index e8387cd92dd..936eabcbeec 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.2-SNAPSHOT + 3.10.2 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 6b8460f28fa..72ba8be1ff8 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.2-SNAPSHOT + 3.10.2 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 119f2666a03..41f80275ed3 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.10.2-SNAPSHOT + 3.10.2 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index b95e1be3835..2af611ceaaa 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.10.2-SNAPSHOT + 3.10.2 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 8bb8273e3a8..f51eae55ef1 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.2-SNAPSHOT + 3.10.2 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index b0b6af5aef9..d0f6e7cd065 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.2-SNAPSHOT + 3.10.2 pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.10.2 From cab218e4a559a6888dd0e09ad88d22a52148065f Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Wed, 26 Aug 2020 15:19:50 +0200 Subject: [PATCH 107/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index f96155bfb60..a16af74b088 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.2 + 3.10.3-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index e8ce8623245..d3ebba22797 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.2 + 3.10.3-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index ad94e740f18..8222ddaa145 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.2 + 3.10.3-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index bcff1139ccd..2676c7ce1dc 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.2 + 3.10.3-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 25df9f53826..8477da9c8b0 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.2 + 3.10.3-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index ecd7f29bc61..decb2e70c78 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.2 + 3.10.3-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 936eabcbeec..208b2fa5f5a 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.2 + 3.10.3-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 72ba8be1ff8..f2f3edd969e 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.2 + 3.10.3-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 41f80275ed3..bdc09dc32dd 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.10.2 + 3.10.3-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 2af611ceaaa..326dda89c06 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.10.2 + 3.10.3-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index f51eae55ef1..1074db44442 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.2 + 3.10.3-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index d0f6e7cd065..39f5451d7ec 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.2 + 3.10.3-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.10.2 + HEAD From 6cb4d14bb322ea138337af27fc556d5cba83e961 Mon Sep 17 00:00:00 2001 From: Madhavan Date: Tue, 17 Nov 2020 08:26:05 -0500 Subject: [PATCH 108/211] Rebrand Apollo to Astra (#1507) Co-authored-by: Madhavan Sridharan --- README.md | 14 ++++---- .../AstraReadCassandraVersion.java} | 25 +++++++------- manual/cloud/README.md | 33 ++++++++----------- 3 files changed, 34 insertions(+), 38 deletions(-) rename driver-examples/src/main/java/com/datastax/driver/examples/{apollo/ApolloReadCassandraVersion.java => astra/AstraReadCassandraVersion.java} (79%) diff --git a/README.md b/README.md index 7d7d26cad85..db50f55c590 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ not yet have been released. You can find the documentation for the latest version through the [Java driver docs](http://docs.datastax.com/en/developer/java-driver/latest/index.html) or via the release tags, [e.g. -3.10.0](https://github.com/datastax/java-driver/tree/3.10.0).* +3.10.2](https://github.com/datastax/java-driver/tree/3.10.2).* A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol @@ -55,7 +55,7 @@ The driver contains the following modules: - API: https://docs.datastax.com/en/drivers/java/3.10 - GITHUB REPOSITORY: https://github.com/datastax/java-driver - [changelog](changelog/) -- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.10.0.tar.gz) +- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.10.2.tar.gz) ## Getting the driver @@ -67,7 +67,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-dri com.datastax.cassandra cassandra-driver-core - 3.10.0 + 3.10.2 ``` @@ -77,7 +77,7 @@ Note that the object mapper is published as a separate artifact: com.datastax.cassandra cassandra-driver-mapping - 3.10.0 + 3.10.2 ``` @@ -87,7 +87,7 @@ The 'extras' module is also published as a separate artifact: com.datastax.cassandra cassandra-driver-extras - 3.10.0 + 3.10.2 ``` @@ -96,12 +96,12 @@ 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](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.10.0.tar.gz) +[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.10.2.tar.gz) is available for download. ## Compatibility -The Java client driver 3.10.0 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache +The Java client driver 3.10.2 ([branch 3.x](https://github.com/datastax/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/latest/manual/native_protocol/) for the most up-to-date compatibility information). diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/apollo/ApolloReadCassandraVersion.java b/driver-examples/src/main/java/com/datastax/driver/examples/astra/AstraReadCassandraVersion.java similarity index 79% rename from driver-examples/src/main/java/com/datastax/driver/examples/apollo/ApolloReadCassandraVersion.java rename to driver-examples/src/main/java/com/datastax/driver/examples/astra/AstraReadCassandraVersion.java index 18ee0ae907d..59591aa2cf8 100644 --- a/driver-examples/src/main/java/com/datastax/driver/examples/apollo/ApolloReadCassandraVersion.java +++ b/driver-examples/src/main/java/com/datastax/driver/examples/astra/AstraReadCassandraVersion.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.datastax.driver.examples.apollo; +package com.datastax.driver.examples.astra; import com.datastax.driver.core.Cluster; import com.datastax.driver.core.ResultSet; @@ -23,27 +23,28 @@ import java.io.File; /** - * Connects to a DataStax Apollo cluster and extracts basic information from it. + * Connects to a DataStax Astra cluster and extracts basic information from it. * *

    Preconditions: * *

      - *
    • A DataStax Apollo cluster is running and accessible. - *
    • A DataStax Apollo secure connect bundle for the running cluster. + *
    • A DataStax Astra cluster is running and accessible. + *
    • A DataStax Astra secure connect bundle for the running cluster. *
    * *

    Side effects: none. * + * @see Creating an + * Astra Database * @see - * Creating an Apollo Database - * @see - * Providing access to Apollo databases - * @see - * Obtaining Apollo secure connect bundle + * href="https://docs.astra.datastax.com/docs/obtaining-database-credentials#sharing-your-secure-connect-bundle"> + * Providing access to Astra databases + * @see + * Obtaining Astra secure connect bundle * @see Java driver online manual */ -public class ApolloReadCassandraVersion { +public class AstraReadCassandraVersion { public static void main(String[] args) { @@ -58,7 +59,7 @@ public static void main(String[] args) { Cluster.builder() // Change the path here to the secure connect bundle location (see javadocs above) .withCloudSecureConnectBundle(new File("/path/to/secure-connect-database_name.zip")) - // Change the user_name and password here for the Apollo instance + // Change the user_name and password here for the Astra instance .withCredentials("user_name", "password") // Uncomment the next line to use a specific keyspace // .withKeyspace("keyspace_name") diff --git a/manual/cloud/README.md b/manual/cloud/README.md index 5b9268643a2..46f9ff0ae56 100644 --- a/manual/cloud/README.md +++ b/manual/cloud/README.md @@ -1,22 +1,20 @@ -## Connecting to Apollo (Cloud) +## Connecting to Astra (Cloud) -Using the DataStax Java Driver to connect to a DataStax Apollo database is almost identical to using +Using the DataStax Java Driver to connect to a DataStax Astra database is almost identical to using the driver to connect to any normal Apache Cassandra® database. The only differences are in how the driver is configured in an application and that you will need to obtain a `secure connect bundle`. -The following is a Quick Start guide to writing a simple application that can connect to an Apollo +The following is a Quick Start guide to writing a simple application that can connect to an Astra database. ### Prerequisites 1. [Download][Download Maven] and [install][Install Maven] Maven. -1. Create an Apollo database on [GCP][Create an Apollo database - GCP] or - [AWS][Create an Apollo database - AWS]; alternatively, have a team member provide access to their - Apollo database (instructions for [GCP][Access an Apollo database - GCP] and - [AWS][Access an Apollo database - AWS]) to obtain database connection details. +1. Create an Astra database on [GCP/AWS/Azure][Create an Astra database - GCP/AWS/Azure]; alternatively, + have a team member provide access to their Astra database (instructions for + [GCP/AWS/Azure][Access an Astra database - GCP/AWS/Azure]) to obtain database connection details. 1. Download the secure connect bundle (instructions for - [GCP][Download the secure connect bundle - GCP] and - [AWS][Download the secure connect bundle - AWS]) to obtain connection credentials for your + [GCP/AWS/Azure][Download the secure connect bundle - GCP/AWS/Azure]) to obtain connection credentials for your database. 1. Ensure you are using Java 8 or higher. The cloud connect api does not support java 6 or 7. @@ -36,11 +34,11 @@ database. ``` b. Copy the following code for your DataStax Driver into the `ConnectDatabase.java` file. - The following example implements a `ConnectDatabase` class to connect to your Apollo database, + The following example implements a `ConnectDatabase` class to connect to your Astra database, runs a CQL query, and prints the output to the console. **Note:** With the `Cluster.builder()` object, make sure to set the path to the secure - connect bundle for your Apollo database (**"/path/to/secure-connect-database_name.zip"**) in + connect bundle for your Astra database (**"/path/to/secure-connect-database_name.zip"**) in the `withCloudSecureConnectBundle()` method as shown in the following example. * DataStax Java Driver for Apache Cassandra 3.x @@ -81,9 +79,9 @@ database. c. Save and close the ConnectDatabase.java file. -### Apollo Differences +### Astra Differences -In most circumstances, the client code for interacting with an Apollo cluster will be the same as +In most circumstances, the client code for interacting with an Astra cluster will be the same as interacting with any other Cassandra cluster. The exceptions being: * An SSL connection will be established automatically. Manual SSL configuration is not necessary. @@ -97,10 +95,7 @@ interacting with any other Cassandra cluster. The exceptions being: [Download Maven]: https://maven.apache.org/download.cgi [Install Maven]: https://maven.apache.org/install.html -[Create an Apollo database - GCP]: https://helpdocs.datastax.com/gcp/dscloud/apollo/dscloudGettingStarted.html#dscloudCreateCluster -[Create an Apollo database - AWS]: https://helpdocs.datastax.com/aws/dscloud/apollo/dscloudGettingStarted.html#dscloudCreateCluster -[Access an Apollo database - GCP]: https://helpdocs.datastax.com/gcp/dscloud/apollo/dscloudShareClusterDetails.html -[Access an Apollo database - AWS]: https://helpdocs.datastax.com/aws/dscloud/apollo/dscloudShareClusterDetails.html -[Download the secure connect bundle - GCP]: https://helpdocs.datastax.com/gcp/dscloud/apollo/dscloudObtainingCredentials.html -[Download the secure connect bundle - AWS]: https://helpdocs.datastax.com/aws/dscloud/apollo/dscloudObtainingCredentials.html +[Create an Astra database - GCP/AWS/Azure]: https://docs.astra.datastax.com/docs/creating-your-astra-database#dscloudCreateCluster +[Access an Astra database - GCP/AWS/Azure]: https://docs.astra.datastax.com/docs/obtaining-database-credentials#sharing-your-secure-connect-bundle +[Download the secure connect bundle - GCP/AWS/Azure]: https://docs.astra.datastax.com/docs/obtaining-database-credentials [pom.xml dependency]: ../../#getting-the-driver From 18ef45530f99bae91b818e09471d372ab2790dab Mon Sep 17 00:00:00 2001 From: Sam Tunnicliffe Date: Wed, 17 Feb 2021 11:04:39 +0000 Subject: [PATCH 109/211] JAVA-2705: Remove protocol v5 beta status, add v6-beta (#1529) --- changelog/README.md | 4 ++++ .../java/com/datastax/driver/core/BatchStatement.java | 1 + .../java/com/datastax/driver/core/BoundStatement.java | 1 + .../main/java/com/datastax/driver/core/CodecUtils.java | 5 +++++ .../main/java/com/datastax/driver/core/Connection.java | 6 +++++- .../src/main/java/com/datastax/driver/core/Frame.java | 3 +++ .../main/java/com/datastax/driver/core/ProtocolEvent.java | 1 + .../java/com/datastax/driver/core/ProtocolFeature.java | 2 +- .../java/com/datastax/driver/core/ProtocolVersion.java | 7 ++++--- .../java/com/datastax/driver/core/RegularStatement.java | 1 + .../src/main/java/com/datastax/driver/core/Requests.java | 4 ++++ .../src/main/java/com/datastax/driver/core/Responses.java | 2 ++ .../java/com/datastax/driver/core/StreamIdGenerator.java | 1 + .../com/datastax/driver/core/ProtocolBetaVersionTest.java | 8 ++++---- .../driver/core/ProtocolVersionRenegotiationTest.java | 8 ++++---- 15 files changed, 41 insertions(+), 13 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 1b64f4aa38b..246eb753936 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,6 +5,10 @@ 3.x versions get published. --> +### 3.11.0 (in progress) + +- [improvement] JAVA-2705: Remove protocol v5 beta status, add v6-beta. + ## 3.10.2 - [bug] JAVA-2860: Avoid NPE if channel initialization crashes. diff --git a/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java b/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java index e5fc175fe62..e2b7a805483 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java +++ b/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java @@ -220,6 +220,7 @@ public int requestSizeInBytes(ProtocolVersion protocolVersion, CodecRegistry cod case V3: case V4: case V5: + case V6: size += CBUtil.sizeOfConsistencyLevel(getConsistencyLevel()); size += QueryFlag.serializedSize(protocolVersion); // Serial CL and default timestamp also depend on session-level defaults (QueryOptions). diff --git a/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java b/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java index 9b1c8d0a3d2..01c39dfc232 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java +++ b/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java @@ -321,6 +321,7 @@ public int requestSizeInBytes(ProtocolVersion protocolVersion, CodecRegistry cod case V3: case V4: case V5: + case V6: size += CBUtil.sizeOfConsistencyLevel(getConsistencyLevel()); size += QueryFlag.serializedSize(protocolVersion); if (wrapper.values.length > 0) { diff --git a/driver-core/src/main/java/com/datastax/driver/core/CodecUtils.java b/driver-core/src/main/java/com/datastax/driver/core/CodecUtils.java index 94295a0bb14..afaa7176bca 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/CodecUtils.java +++ b/driver-core/src/main/java/com/datastax/driver/core/CodecUtils.java @@ -64,6 +64,7 @@ public static int readSize(ByteBuffer input, ProtocolVersion version) { case V3: case V4: case V5: + case V6: return input.getInt(); default: throw version.unsupported(); @@ -92,6 +93,7 @@ public static void writeSize(ByteBuffer output, int size, ProtocolVersion versio case V3: case V4: case V5: + case V6: output.putInt(size); break; default: @@ -131,6 +133,7 @@ public static void writeValue(ByteBuffer output, ByteBuffer value, ProtocolVersi case V3: case V4: case V5: + case V6: if (value == null) { output.putInt(-1); } else { @@ -217,6 +220,7 @@ private static int sizeOfCollectionSize(ProtocolVersion version) { case V3: case V4: case V5: + case V6: return 4; default: throw version.unsupported(); @@ -237,6 +241,7 @@ private static int sizeOfValue(ByteBuffer value, ProtocolVersion version) { case V3: case V4: case V5: + case V6: return value == null ? 4 : 4 + value.remaining(); default: throw version.unsupported(); diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java index 92861dc9fe6..b373fbec578 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java @@ -394,6 +394,7 @@ public ListenableFuture apply(Message.Response response) throws Exception case V3: case V4: case V5: + case V6: return authenticateV2(authenticator, protocolVersion, initExecutor); default: throw defunct(protocolVersion.unsupported()); @@ -1659,6 +1660,8 @@ private static class Initializer extends ChannelInitializer { new Message.ProtocolEncoder(ProtocolVersion.V4); private static final Message.ProtocolEncoder messageEncoderV5 = new Message.ProtocolEncoder(ProtocolVersion.V5); + private static final Message.ProtocolEncoder messageEncoderV6 = + new Message.ProtocolEncoder(ProtocolVersion.V6); private static final Frame.Encoder frameEncoder = new Frame.Encoder(); private final ProtocolVersion protocolVersion; @@ -1756,6 +1759,8 @@ private Message.ProtocolEncoder messageEncoderFor(ProtocolVersion version) { return messageEncoderV4; case V5: return messageEncoderV5; + case V6: + return messageEncoderV6; default: throw new DriverInternalError("Unsupported protocol version " + protocolVersion); } @@ -1769,7 +1774,6 @@ private Message.ProtocolEncoder messageEncoderFor(ProtocolVersion version) { */ void switchToV5Framing() { assert factory.protocolVersion.compareTo(ProtocolVersion.V5) >= 0; - // We want to do this on the event loop, to make sure it doesn't race with incoming requests assert channel.eventLoop().inEventLoop(); diff --git a/driver-core/src/main/java/com/datastax/driver/core/Frame.java b/driver-core/src/main/java/com/datastax/driver/core/Frame.java index f0480e8efa1..392e09c7bf0 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Frame.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Frame.java @@ -106,6 +106,7 @@ private static int readStreamId(ByteBuf fullFrame, ProtocolVersion version) { case V3: case V4: case V5: + case V6: return fullFrame.readShort(); default: throw version.unsupported(); @@ -156,6 +157,7 @@ static int lengthFor(ProtocolVersion version) { case V3: case V4: case V5: + case V6: return 9; default: throw version.unsupported(); @@ -174,6 +176,7 @@ public void encodeInto(ByteBuf destination) { case V3: case V4: case V5: + case V6: destination.writeShort(streamId); break; default: diff --git a/driver-core/src/main/java/com/datastax/driver/core/ProtocolEvent.java b/driver-core/src/main/java/com/datastax/driver/core/ProtocolEvent.java index e72a11e7cdd..eb841598e3d 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ProtocolEvent.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ProtocolEvent.java @@ -155,6 +155,7 @@ static SchemaChange deserializeEvent(ByteBuf bb, ProtocolVersion version) { case V3: case V4: case V5: + case V6: change = CBUtil.readEnumValue(Change.class, bb); targetType = CBUtil.readEnumValue(SchemaElement.class, bb); targetKeyspace = CBUtil.readString(bb); diff --git a/driver-core/src/main/java/com/datastax/driver/core/ProtocolFeature.java b/driver-core/src/main/java/com/datastax/driver/core/ProtocolFeature.java index 57f9d6f79b9..fdbdbbe6ef6 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ProtocolFeature.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ProtocolFeature.java @@ -42,7 +42,7 @@ enum ProtocolFeature { boolean isSupportedBy(ProtocolVersion version) { switch (this) { case PREPARED_METADATA_CHANGES: - return version == ProtocolVersion.V5; + return version.compareTo(ProtocolVersion.V5) >= 0; case CUSTOM_PAYLOADS: return version.compareTo(ProtocolVersion.V4) >= 0; case CLIENT_TIMESTAMPS: diff --git a/driver-core/src/main/java/com/datastax/driver/core/ProtocolVersion.java b/driver-core/src/main/java/com/datastax/driver/core/ProtocolVersion.java index e165c6b17e7..fb0ad0bcff9 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ProtocolVersion.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ProtocolVersion.java @@ -26,13 +26,14 @@ public enum ProtocolVersion { V2("2.0.0", 2, V1), V3("2.1.0", 3, V2), V4("2.2.0", 4, V3), - V5("3.10.0", 5, V4); + V5("4.0.0", 5, V4), + V6("4.0.0", 6, V5); /** The most recent protocol version supported by the driver. */ - public static final ProtocolVersion NEWEST_SUPPORTED = V4; + public static final ProtocolVersion NEWEST_SUPPORTED = V5; /** The most recent beta protocol version supported by the driver. */ - public static final ProtocolVersion NEWEST_BETA = V5; + public static final ProtocolVersion NEWEST_BETA = V6; private final VersionNumber minCassandraVersion; diff --git a/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java b/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java index 27f08226e60..3a9e8fe90d7 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java +++ b/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java @@ -194,6 +194,7 @@ public int requestSizeInBytes(ProtocolVersion protocolVersion, CodecRegistry cod case V3: case V4: case V5: + case V6: size += CBUtil.sizeOfConsistencyLevel(getConsistencyLevel()); size += QueryFlag.serializedSize(protocolVersion); if (hasValues()) { diff --git a/driver-core/src/main/java/com/datastax/driver/core/Requests.java b/driver-core/src/main/java/com/datastax/driver/core/Requests.java index 3cd15773eb8..c9d8110c758 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Requests.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Requests.java @@ -388,6 +388,7 @@ void encode(ByteBuf dest, ProtocolVersion version) { case V3: case V4: case V5: + case V6: CBUtil.writeConsistencyLevel(consistency, dest); QueryFlag.serialize(flags, dest, version); if (flags.contains(QueryFlag.VALUES)) { @@ -425,6 +426,7 @@ int encodedSize(ProtocolVersion version) { case V3: case V4: case V5: + case V6: int size = 0; size += CBUtil.sizeOfConsistencyLevel(consistency); size += QueryFlag.serializedSize(version); @@ -596,6 +598,7 @@ void encode(ByteBuf dest, ProtocolVersion version) { case V3: case V4: case V5: + case V6: CBUtil.writeConsistencyLevel(consistency, dest); QueryFlag.serialize(flags, dest, version); if (flags.contains(QueryFlag.SERIAL_CONSISTENCY)) @@ -616,6 +619,7 @@ int encodedSize(ProtocolVersion version) { case V3: case V4: case V5: + case V6: int size = 0; size += CBUtil.sizeOfConsistencyLevel(consistency); size += QueryFlag.serializedSize(version); diff --git a/driver-core/src/main/java/com/datastax/driver/core/Responses.java b/driver-core/src/main/java/com/datastax/driver/core/Responses.java index b0245f2bfff..d9402f5b189 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Responses.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Responses.java @@ -605,6 +605,7 @@ private Metadata decodeResultMetadata( case V3: case V4: case V5: + case V6: return Rows.Metadata.decode(body, version, codecRegistry); default: throw version.unsupported(); @@ -679,6 +680,7 @@ public Result decode( case V3: case V4: case V5: + case V6: change = CBUtil.readEnumValue(Change.class, body); targetType = CBUtil.readEnumValue(SchemaElement.class, body); targetKeyspace = CBUtil.readString(body); diff --git a/driver-core/src/main/java/com/datastax/driver/core/StreamIdGenerator.java b/driver-core/src/main/java/com/datastax/driver/core/StreamIdGenerator.java index b7f613d569f..182c4ac3940 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/StreamIdGenerator.java +++ b/driver-core/src/main/java/com/datastax/driver/core/StreamIdGenerator.java @@ -47,6 +47,7 @@ private static int streamIdSizeFor(ProtocolVersion version) { case V3: case V4: case V5: + case V6: return 2; default: throw version.unsupported(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java b/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java index 96c84706608..55b743775a8 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java @@ -16,7 +16,7 @@ package com.datastax.driver.core; import static com.datastax.driver.core.ProtocolVersion.V4; -import static com.datastax.driver.core.ProtocolVersion.V5; +import static com.datastax.driver.core.ProtocolVersion.V6; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; @@ -85,7 +85,7 @@ public void should_not_initialize_when_beta_flag_is_set_and_version_explicitly_r /** * Verifies that the driver CANNOT connect to 3.10 with the following combination of options: - * Version V5 Flag UNSET + * Version V6 Flag UNSET * * @jira_ticket JAVA-1248 */ @@ -96,7 +96,7 @@ public void should_not_connect_when_beta_version_explicitly_required_and_flag_no Cluster.builder() .addContactPoints(getContactPoints()) .withPort(ccm().getBinaryPort()) - .withProtocolVersion(V5) + .withProtocolVersion(V6) .build(); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { @@ -127,7 +127,7 @@ public void should_connect_with_beta_when_no_version_explicitly_required_and_fla .allowBetaProtocolVersion() .build(); cluster.connect(); - assertThat(cluster.getConfiguration().getProtocolOptions().getProtocolVersion()).isEqualTo(V5); + assertThat(cluster.getConfiguration().getProtocolOptions().getProtocolVersion()).isEqualTo(V6); } /** diff --git a/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java b/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java index 927fbb89cac..c740f0d3f45 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java @@ -17,7 +17,7 @@ import static com.datastax.driver.core.ProtocolVersion.V1; import static com.datastax.driver.core.ProtocolVersion.V4; -import static com.datastax.driver.core.ProtocolVersion.V5; +import static com.datastax.driver.core.ProtocolVersion.V6; import static org.assertj.core.api.Assertions.assertThat; import com.datastax.driver.core.exceptions.UnsupportedProtocolVersionException; @@ -67,11 +67,11 @@ public void should_fail_when_version_provided_and_too_high() throws Exception { /** @jira_ticket JAVA-1367 */ @Test(groups = "short") public void should_fail_when_beta_allowed_and_too_high() throws Exception { - if (ccm().getCassandraVersion().compareTo(VersionNumber.parse("3.10")) >= 0) { - throw new SkipException("Server supports protocol protocol V5 beta"); + if (ccm().getCassandraVersion().compareTo(VersionNumber.parse("4.0.0")) >= 0) { + throw new SkipException("Server supports protocol protocol V6 beta"); } UnsupportedProtocolVersionException e = connectWithUnsupportedBetaVersion(); - assertThat(e.getUnsupportedVersion()).isEqualTo(V5); + assertThat(e.getUnsupportedVersion()).isEqualTo(V6); } /** @jira_ticket JAVA-1367 */ From 1af7382fee4c4f0ea38abaedbb4ba0301a356265 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Mon, 22 Feb 2021 17:52:58 +0100 Subject: [PATCH 110/211] Remove incorrect assertion It's legal for a client to not supply a specific version, e.g. not call Cluster.Builder::withProtocolVersion, in which case factory.protocolVersion is null. While v5 was marked beta this wasn't a problem as Cluster.Builder::allowProtocolVersion was required, but now this causes an NPE in the driver. --- .../src/main/java/com/datastax/driver/core/Connection.java | 1 - 1 file changed, 1 deletion(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java index b373fbec578..d953130cc6b 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java @@ -1773,7 +1773,6 @@ private Message.ProtocolEncoder messageEncoderFor(ProtocolVersion version) { * v5. */ void switchToV5Framing() { - assert factory.protocolVersion.compareTo(ProtocolVersion.V5) >= 0; // We want to do this on the event loop, to make sure it doesn't race with incoming requests assert channel.eventLoop().inEventLoop(); From e035569df8b293c8912a513c6d43045fb7caddac Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Wed, 3 Mar 2021 12:31:19 +0100 Subject: [PATCH 111/211] Add support for Cassandra 4.0 to CCMBridge --- .../src/test/java/com/datastax/driver/core/CCMBridge.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 1c7790e6189..81a203fe63f 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 @@ -799,8 +799,10 @@ public ProtocolVersion getProtocolVersion() { return ProtocolVersion.V2; } else if (version.compareTo(VersionNumber.parse("2.2")) < 0) { return ProtocolVersion.V3; - } else { + } else if (version.compareTo(VersionNumber.parse("4.0")) < 0) { return ProtocolVersion.V4; + } else { + return ProtocolVersion.V5; } } From 0b682c44461dc20a89033ec20ec625dba4b17f73 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Wed, 3 Mar 2021 21:47:28 +0100 Subject: [PATCH 112/211] JAVA-2923: Detect and use Guava's new HostAndPort.getHost method (#1533) --- changelog/README.md | 3 ++- .../driver/core/CloudConfigFactory.java | 4 ++-- .../driver/core/GuavaCompatibility.java | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 246eb753936..a6f9644a422 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,9 +5,10 @@ 3.x versions get published. --> -### 3.11.0 (in progress) +## 3.11.0 (in progress) - [improvement] JAVA-2705: Remove protocol v5 beta status, add v6-beta. +- [bug] JAVA-2923: Detect and use Guava's new HostAndPort.getHost method. ## 3.10.2 diff --git a/driver-core/src/main/java/com/datastax/driver/core/CloudConfigFactory.java b/driver-core/src/main/java/com/datastax/driver/core/CloudConfigFactory.java index 98faf16c956..f11b1fcecf4 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/CloudConfigFactory.java +++ b/driver-core/src/main/java/com/datastax/driver/core/CloudConfigFactory.java @@ -228,8 +228,8 @@ protected InetSocketAddress getSniProxyAddress(JsonNode proxyMetadata) { throw new IllegalStateException( "Invalid proxy metadata: missing port from field sni_proxy_address"); } - return InetSocketAddress.createUnresolved( - sniProxyHostAndPort.getHostText(), sniProxyHostAndPort.getPort()); + String host = GuavaCompatibility.INSTANCE.getHost(sniProxyHostAndPort); + return InetSocketAddress.createUnresolved(host, sniProxyHostAndPort.getPort()); } else { throw new IllegalStateException("Invalid proxy metadata: missing field sni_proxy_address"); } diff --git a/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java b/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java index a0e7fe8ec55..069f550b049 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java +++ b/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java @@ -19,6 +19,7 @@ import com.google.common.base.Function; import com.google.common.collect.BiMap; import com.google.common.collect.Maps; +import com.google.common.net.HostAndPort; import com.google.common.reflect.TypeToken; import com.google.common.util.concurrent.AsyncFunction; import com.google.common.util.concurrent.FutureCallback; @@ -180,6 +181,24 @@ public abstract ListenableFuture transformAsync( */ public abstract Executor sameThreadExecutor(); + /** + * Returns the portion of the given {@link HostAndPort} instance that should represent the + * hostname or IPv4/IPv6 literal. + * + *

    The method {@code HostAndPort.getHostText} has been replaced with {@code + * HostAndPort.getHost} starting with Guava 20.0; it has been completely removed in Guava 22.0. + */ + @SuppressWarnings("JavaReflectionMemberAccess") + public String getHost(HostAndPort hostAndPort) { + try { + // Guava >= 20.0 + return (String) HostAndPort.class.getMethod("getHost").invoke(hostAndPort); + } catch (Exception e) { + // Guava < 22.0 + return hostAndPort.getHostText(); + } + } + private static GuavaCompatibility selectImplementation() { if (isGuava_19_0_OrHigher()) { logger.info("Detected Guava >= 19 in the classpath, using modern compatibility layer"); From 9ffe103124c1ba5c5cc91def514b9aeb98d4ebab Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 5 Mar 2021 15:55:39 +0100 Subject: [PATCH 113/211] Fix failing test against C* 4.0 --- .../driver/core/querybuilder/QueryBuilderExecutionTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java index 6267b357377..338db321996 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java @@ -875,7 +875,7 @@ public void should_support_group_by() throws Exception { .groupBy("a", "clustering1")); fail("Expecting IQE"); } catch (InvalidQueryException e) { - assertThat(e.getMessage()).isEqualTo("Undefined column name clustering1"); + assertThat(e.getMessage()).startsWith("Undefined column name clustering1"); } try { @@ -890,7 +890,7 @@ public void should_support_group_by() throws Exception { .groupBy("a", "b", "z")); fail("Expecting IQE"); } catch (InvalidQueryException e) { - assertThat(e.getMessage()).isEqualTo("Undefined column name z"); + assertThat(e.getMessage()).startsWith("Undefined column name z"); } // Test with composite partition key From e20f79cf5c810317229f02afe45834fe3de0b72b Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Sat, 6 Mar 2021 19:49:45 +0100 Subject: [PATCH 114/211] JAVA-2922: Switch to modern framing format inside a channel handler (#1532) --- changelog/README.md | 1 + .../com/datastax/driver/core/Connection.java | 38 +-------- .../driver/core/FramingFormatHandler.java | 78 +++++++++++++++++++ 3 files changed, 81 insertions(+), 36 deletions(-) create mode 100644 driver-core/src/main/java/com/datastax/driver/core/FramingFormatHandler.java diff --git a/changelog/README.md b/changelog/README.md index a6f9644a422..e293d8628d9 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -9,6 +9,7 @@ - [improvement] JAVA-2705: Remove protocol v5 beta status, add v6-beta. - [bug] JAVA-2923: Detect and use Guava's new HostAndPort.getHost method. +- [bug] JAVA-2922: Switch to modern framing format inside a channel handler. ## 3.10.2 diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java index d953130cc6b..7dea01a6080 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java @@ -351,11 +351,6 @@ private AsyncFunction onStartupResponse( return new AsyncFunction() { @Override public ListenableFuture apply(Message.Response response) throws Exception { - - if (protocolVersion.compareTo(ProtocolVersion.V5) >= 0 && response.type != ERROR) { - switchToV5Framing(); - } - switch (response.type) { case READY: return checkClusterName(protocolVersion, initExecutor); @@ -1728,6 +1723,8 @@ protected void initChannel(SocketChannel channel) throws Exception { pipeline.addLast("frameDecoder", new Frame.Decoder()); pipeline.addLast("frameEncoder", frameEncoder); + pipeline.addLast("framingFormatHandler", new FramingFormatHandler(connection.factory)); + if (compressor != null // Frame-level compression is only done in legacy protocol versions. In V5 and above, it // happens at a higher level ("segment" that groups multiple frames), so never install @@ -1767,37 +1764,6 @@ private Message.ProtocolEncoder messageEncoderFor(ProtocolVersion version) { } } - /** - * Rearranges the pipeline to deal with the new framing structure in protocol v5 and above. This - * has to be done manually, because it only happens once we've confirmed that the server supports - * v5. - */ - void switchToV5Framing() { - // We want to do this on the event loop, to make sure it doesn't race with incoming requests - assert channel.eventLoop().inEventLoop(); - - ChannelPipeline pipeline = channel.pipeline(); - SegmentCodec segmentCodec = - new SegmentCodec( - channel.alloc(), factory.configuration.getProtocolOptions().getCompression()); - - // Outbound: "message -> segment -> bytes" instead of "message -> frame -> bytes" - Message.ProtocolEncoder requestEncoder = - (Message.ProtocolEncoder) pipeline.get("messageEncoder"); - pipeline.replace( - "messageEncoder", - "messageToSegmentEncoder", - new MessageToSegmentEncoder(channel.alloc(), requestEncoder)); - pipeline.replace( - "frameEncoder", "segmentToBytesEncoder", new SegmentToBytesEncoder(segmentCodec)); - - // Inbound: "frame <- segment <- bytes" instead of "frame <- bytes" - pipeline.replace( - "frameDecoder", "bytesToSegmentDecoder", new BytesToSegmentDecoder(segmentCodec)); - pipeline.addAfter( - "bytesToSegmentDecoder", "segmentToFrameDecoder", new SegmentToFrameDecoder()); - } - /** A component that "owns" a connection, and should be notified when it dies. */ interface Owner { void onConnectionDefunct(Connection connection); diff --git a/driver-core/src/main/java/com/datastax/driver/core/FramingFormatHandler.java b/driver-core/src/main/java/com/datastax/driver/core/FramingFormatHandler.java new file mode 100644 index 00000000000..91459a1ab34 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/FramingFormatHandler.java @@ -0,0 +1,78 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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; + +import com.datastax.driver.core.Message.Response.Type; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelPipeline; +import io.netty.handler.codec.MessageToMessageDecoder; +import java.util.List; + +/** + * A handler to deal with different protocol framing formats. + * + *

    This handler detects when a handshake is successful; then, if necessary, adapts the pipeline + * to the modern framing format introduced in protocol v5. + */ +public class FramingFormatHandler extends MessageToMessageDecoder { + + private final Connection.Factory factory; + + FramingFormatHandler(Connection.Factory factory) { + this.factory = factory; + } + + @Override + protected void decode(ChannelHandlerContext ctx, Frame frame, List out) throws Exception { + boolean handshakeSuccessful = + frame.header.opcode == Type.READY.opcode || frame.header.opcode == Type.AUTHENTICATE.opcode; + if (handshakeSuccessful) { + // By default, the pipeline is configured for legacy framing since this is the format used + // by all protocol versions until handshake; after handshake however, we need to switch to + // modern framing for protocol v5 and higher. + if (frame.header.version.compareTo(ProtocolVersion.V5) >= 0) { + switchToModernFraming(ctx); + } + // once the handshake is successful, the framing format cannot change anymore; + // we can safely remove ourselves from the pipeline. + ctx.pipeline().remove("framingFormatHandler"); + } + out.add(frame); + } + + private void switchToModernFraming(ChannelHandlerContext ctx) { + ChannelPipeline pipeline = ctx.pipeline(); + SegmentCodec segmentCodec = + new SegmentCodec( + ctx.channel().alloc(), factory.configuration.getProtocolOptions().getCompression()); + + // Outbound: "message -> segment -> bytes" instead of "message -> frame -> bytes" + Message.ProtocolEncoder requestEncoder = + (Message.ProtocolEncoder) pipeline.get("messageEncoder"); + pipeline.replace( + "messageEncoder", + "messageToSegmentEncoder", + new MessageToSegmentEncoder(ctx.channel().alloc(), requestEncoder)); + pipeline.replace( + "frameEncoder", "segmentToBytesEncoder", new SegmentToBytesEncoder(segmentCodec)); + + // Inbound: "frame <- segment <- bytes" instead of "frame <- bytes" + pipeline.replace( + "frameDecoder", "bytesToSegmentDecoder", new BytesToSegmentDecoder(segmentCodec)); + pipeline.addAfter( + "bytesToSegmentDecoder", "segmentToFrameDecoder", new SegmentToFrameDecoder()); + } +} From 3980cd017a58bcc93ced982a82aaa7c2122c3297 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Sat, 6 Mar 2021 19:51:25 +0100 Subject: [PATCH 115/211] JAVA-2924: Consider protocol version unsupported when server requires USE_BETA flag for it (#1534) --- changelog/README.md | 1 + .../java/com/datastax/driver/core/Connection.java | 4 +++- .../core/ProtocolVersionRenegotiationTest.java | 15 ++++++++------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index e293d8628d9..7ad8de76e67 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -10,6 +10,7 @@ - [improvement] JAVA-2705: Remove protocol v5 beta status, add v6-beta. - [bug] JAVA-2923: Detect and use Guava's new HostAndPort.getHost method. - [bug] JAVA-2922: Switch to modern framing format inside a channel handler. +- [bug] JAVA-2924: Consider protocol version unsupported when server requires USE_BETA flag for it. ## 3.10.2 diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java index 7dea01a6080..26ee6c91b0a 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java @@ -572,7 +572,9 @@ private boolean isUnsupportedProtocolVersion(Responses.Error error) { // Testing for a specific string is a tad fragile but well, we don't have much choice // C* 2.1 reports a server error instead of protocol error, see CASSANDRA-9451 return (error.code == ExceptionCode.PROTOCOL_ERROR || error.code == ExceptionCode.SERVER_ERROR) - && error.message.contains("Invalid or unsupported protocol version"); + && (error.message.contains("Invalid or unsupported protocol version") + // JAVA-2924: server is behind driver and considers the proposed version as beta + || error.message.contains("Beta version of the protocol used")); } private UnsupportedProtocolVersionException unsupportedProtocolVersionException( diff --git a/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java b/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java index c740f0d3f45..d5e0862028a 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java @@ -16,7 +16,7 @@ package com.datastax.driver.core; import static com.datastax.driver.core.ProtocolVersion.V1; -import static com.datastax.driver.core.ProtocolVersion.V4; +import static com.datastax.driver.core.ProtocolVersion.V5; import static com.datastax.driver.core.ProtocolVersion.V6; import static org.assertj.core.api.Assertions.assertThat; @@ -55,13 +55,14 @@ public void should_fail_when_version_provided_and_too_low_3_8_plus() throws Exce /** @jira_ticket JAVA-1367 */ @Test(groups = "short") public void should_fail_when_version_provided_and_too_high() throws Exception { - if (ccm().getCassandraVersion().compareTo(VersionNumber.parse("2.2")) >= 0) { - throw new SkipException("Server supports protocol V4"); + if (ccm().getCassandraVersion().compareTo(VersionNumber.parse("3.10")) >= 0) { + throw new SkipException("Server supports protocol V5"); } - UnsupportedProtocolVersionException e = connectWithUnsupportedVersion(V4); - assertThat(e.getUnsupportedVersion()).isEqualTo(V4); - // pre-CASSANDRA-11464: server replies with its own version - assertThat(e.getServerVersion()).isEqualTo(protocolVersion); + UnsupportedProtocolVersionException e = connectWithUnsupportedVersion(V5); + assertThat(e.getUnsupportedVersion()).isEqualTo(V5); + // see CASSANDRA-11464: for C* < 3.0.9 and 3.8, server replies with its own version; + // otherwise it replies with the client's version. + assertThat(e.getServerVersion()).isIn(V5, protocolVersion); } /** @jira_ticket JAVA-1367 */ From d340a9fe5f0e7ad7735297540e6d81736c2cb72f Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Wed, 3 Mar 2021 21:45:17 +0100 Subject: [PATCH 116/211] Minor improvements to CCM tests --- .../datastax/driver/core/AsyncQueryTest.java | 9 +--- .../driver/core/AuthenticationTest.java | 34 +++------------ .../com/datastax/driver/core/CCMAccess.java | 30 +++++++++---- .../com/datastax/driver/core/CCMBridge.java | 22 ++++++++++ .../com/datastax/driver/core/CCMCache.java | 7 +++ .../datastax/driver/core/CCMTestsSupport.java | 40 ++++++++++++----- .../driver/core/ClusterStressTest.java | 4 +- .../driver/core/ControlConnectionTest.java | 27 ++---------- .../core/EventDebouncerIntegrationTest.java | 7 +-- .../core/GettableDataIntegrationTest.java | 2 +- .../LoadBalancingPolicyBootstrapTest.java | 16 +------ .../datastax/driver/core/MetadataTest.java | 9 +--- .../com/datastax/driver/core/MetricsTest.java | 18 ++------ .../driver/core/MissingRpcAddressTest.java | 11 +---- .../driver/core/NettyOptionsTest.java | 4 +- .../core/NodeListRefreshDebouncerTest.java | 8 +--- .../driver/core/NodeRefreshDebouncerTest.java | 8 +--- .../PreparedStatementInvalidationTest.java | 14 ------ .../driver/core/PreparedStatementTest.java | 20 ++++----- .../driver/core/ProtocolBetaVersionTest.java | 33 ++++++-------- .../ProtocolVersionRenegotiationTest.java | 11 ++--- .../driver/core/QueryTimestampTest.java | 2 +- .../driver/core/RecommissionedNodeTest.java | 20 ++++----- .../driver/core/ReconnectionTest.java | 23 +++------- .../driver/core/RefreshConnectedHostTest.java | 5 +-- .../driver/core/SSLEncryptionTest.java | 13 +----- .../com/datastax/driver/core/SSLTestBase.java | 16 +------ .../driver/core/SchemaChangesCCTest.java | 16 +------ .../driver/core/SchemaChangesTest.java | 26 +++-------- .../core/SchemaRefreshDebouncerTest.java | 8 +--- .../datastax/driver/core/SessionLeakTest.java | 13 +----- .../driver/core/SessionStressTest.java | 4 +- .../driver/core/StatementWrapperTest.java | 2 +- .../com/datastax/driver/core/TestUtils.java | 43 +++++++++++++++++-- .../driver/core/TimeoutStressTest.java | 2 +- ...est.java => TransientReplicationTest.java} | 6 +-- ...decOverlappingJavaTypeIntegrationTest.java | 2 +- .../core/TypeCodecTupleIntegrationTest.java | 28 +++++------- .../core/TypeCodecUDTIntegrationTest.java | 13 ++---- .../driver/core/UnresolvedUserTypeTest.java | 13 ++---- .../datastax/driver/core/cloud/CloudTest.java | 27 ++++++++++-- .../CloseableLoadBalancingPolicyTest.java | 4 +- .../core/policies/TokenAwarePolicyTest.java | 4 +- .../extras/codecs/arrays/ArrayCodecsTest.java | 2 +- .../driver/mapping/MapperUDTTest.java | 17 +++----- .../driver/mapping/UDTFieldMapperTest.java | 28 ++---------- 46 files changed, 259 insertions(+), 412 deletions(-) rename driver-core/src/test/java/com/datastax/driver/core/{TransietReplicationTest.java => TransientReplicationTest.java} (95%) diff --git a/driver-core/src/test/java/com/datastax/driver/core/AsyncQueryTest.java b/driver-core/src/test/java/com/datastax/driver/core/AsyncQueryTest.java index fe52b343bfd..2a884937cce 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/AsyncQueryTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/AsyncQueryTest.java @@ -24,7 +24,6 @@ import com.datastax.driver.core.utils.CassandraVersion; import com.google.common.base.Function; import com.google.common.base.Throwables; -import com.google.common.collect.Lists; import com.google.common.util.concurrent.AsyncFunction; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.Uninterruptibles; @@ -83,13 +82,7 @@ public void cancelled_query_should_release_the_connection() throws InterruptedEx public void should_init_cluster_and_session_if_needed() throws Exception { // For this test we need an uninitialized cluster, so we can't reuse the one provided by the // parent class. Rebuild a new one with the same (unique) host. - Host host = cluster().getMetadata().allHosts().iterator().next(); - - Cluster cluster2 = - register( - Cluster.builder() - .addContactPointsWithPorts(Lists.newArrayList(host.getEndPoint().resolve())) - .build()); + Cluster cluster2 = register(createClusterBuilder().build()); try { Session session2 = cluster2.newSession(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/AuthenticationTest.java b/driver-core/src/test/java/com/datastax/driver/core/AuthenticationTest.java index 07f17101059..e3b7cba650c 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/AuthenticationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/AuthenticationTest.java @@ -53,12 +53,7 @@ public void sleepIf12() { @Test(groups = "short") public void should_connect_with_credentials() { PlainTextAuthProvider authProvider = spy(new PlainTextAuthProvider("cassandra", "cassandra")); - Cluster cluster = - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withAuthProvider(authProvider) - .build(); + Cluster cluster = createClusterBuilder().withAuthProvider(authProvider).build(); cluster.connect(); verify(authProvider, atLeastOnce()) .newAuthenticator( @@ -78,13 +73,7 @@ public void should_connect_with_credentials() { */ @Test(groups = "short") public void should_fail_to_connect_with_wrong_credentials() { - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withCredentials("bogus", "bogus") - .build()); + Cluster cluster = register(createClusterBuilder().withCredentials("bogus", "bogus").build()); try { cluster.connect(); @@ -106,12 +95,7 @@ public void should_fail_to_connect_with_wrong_credentials() { @Test(groups = "short", expectedExceptions = AuthenticationException.class) public void should_fail_to_connect_without_credentials() { - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .build()); + Cluster cluster = register(createClusterBuilder().build()); cluster.connect(); } @@ -124,9 +108,7 @@ public void should_fail_to_connect_without_credentials() { @CCMConfig(dirtiesContext = true) public void should_connect_with_slow_server() { Cluster cluster = - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() .withAuthProvider(new SlowAuthProvider()) .withPoolingOptions(new PoolingOptions().setHeartbeatIntervalSeconds(1)) .build(); @@ -169,13 +151,7 @@ public void run() { @Test(groups = "short") public void should_not_create_pool_with_wrong_credentials() { PlainTextAuthProvider authProvider = new PlainTextAuthProvider("cassandra", "cassandra"); - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withAuthProvider(authProvider) - .build()); + Cluster cluster = register(createClusterBuilder().withAuthProvider(authProvider).build()); cluster.init(); authProvider.setPassword("wrong"); Level previous = TestUtils.setLogLevel(Session.class, Level.WARN); diff --git a/driver-core/src/test/java/com/datastax/driver/core/CCMAccess.java b/driver-core/src/test/java/com/datastax/driver/core/CCMAccess.java index c3bcc00e8d5..b722025a266 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/CCMAccess.java +++ b/driver-core/src/test/java/com/datastax/driver/core/CCMAccess.java @@ -17,7 +17,9 @@ import java.io.Closeable; import java.io.File; +import java.net.InetAddress; import java.net.InetSocketAddress; +import java.util.List; import java.util.Map; public interface CCMAccess extends Closeable { @@ -41,8 +43,6 @@ enum Workload { * is assumed that this value is only used for representing the compatible Cassandra version for * that DSE version. * - *

    - * * @return The version of this CCM cluster. */ VersionNumber getCassandraVersion(); @@ -50,8 +50,6 @@ enum Workload { /** * Returns the DSE version of this CCM cluster if this is a DSE cluster, otherwise null. * - *

    - * * @return The version of this CCM cluster. */ VersionNumber getDSEVersion(); @@ -87,13 +85,29 @@ enum Workload { void setKeepLogs(boolean keepLogs); /** - * @return the node count for each datacenter, mapped in the corresponding cell of the returned - * int array. This is the count that was passed at initialization (that is, the argument to - * {@link CCMBridge.Builder#withNodes(int...)} or {@link CCMConfig#numberOfNodes()}). Note - * that it will NOT be updated dynamically if nodes are added or removed at runtime. + * Returns the node count for each datacenter, mapped in the corresponding cell of the returned + * int array. + * + *

    This is the count that was passed at initialization (that is, the argument to {@link + * CCMBridge.Builder#withNodes(int...)} or {@link CCMConfig#numberOfNodes()}). Note that it will + * NOT be updated dynamically if nodes are added or removed at runtime. + * + * @return the node count for each datacenter. */ int[] getNodeCount(); + /** + * Returns the contact points to use to contact the CCM cluster. + * + *

    This reflects the initial number of nodes in the cluster, as configured at initialization + * (that is, the argument to {@link CCMBridge.Builder#withNodes(int...)} or {@link + * CCMConfig#numberOfNodes()}). Note that it will NOT be updated dynamically if nodes are + * added or removed at runtime. + * + * @return the contact points to use to contact the CCM cluster. + */ + List getContactPoints(); + /** * Returns the address of the {@code nth} host in the CCM cluster (counting from 1, i.e., {@code * addressOfNode(1)} returns the address of the first node. 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 81a203fe63f..1ca13e1c2e9 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 @@ -35,11 +35,15 @@ import java.io.OutputStream; import java.io.PrintWriter; import java.io.StringWriter; +import java.net.InetAddress; import java.net.InetSocketAddress; +import java.net.UnknownHostException; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashSet; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; @@ -367,6 +371,24 @@ public int[] getNodeCount() { return Arrays.copyOf(nodes, nodes.length); } + @Override + public List getContactPoints() { + List contactPoints = new ArrayList(); + int n = 1; + for (int dc = 1; dc <= nodes.length; dc++) { + int nodesInDc = nodes[dc - 1]; + for (int i = 0; i < nodesInDc; i++) { + try { + contactPoints.add(InetAddress.getByName(ipOfNode(n))); + } catch (UnknownHostException e) { + Throwables.propagate(e); + } + n++; + } + } + return contactPoints; + } + protected String ipOfNode(int n) { return ipPrefix + n; } diff --git a/driver-core/src/test/java/com/datastax/driver/core/CCMCache.java b/driver-core/src/test/java/com/datastax/driver/core/CCMCache.java index e8682003c7f..26bbaeed031 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/CCMCache.java +++ b/driver-core/src/test/java/com/datastax/driver/core/CCMCache.java @@ -23,8 +23,10 @@ import com.google.common.cache.RemovalNotification; import com.google.common.cache.Weigher; import java.io.File; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicInteger; @@ -107,6 +109,11 @@ public int[] getNodeCount() { return ccm.getNodeCount(); } + @Override + public List getContactPoints() { + return ccm.getContactPoints(); + } + @Override public InetSocketAddress addressOfNode(int n) { return ccm.addressOfNode(n); 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 8f695a42701..6bcb65fd88a 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 @@ -23,6 +23,7 @@ import static org.assertj.core.api.Assertions.fail; import com.datastax.driver.core.CCMAccess.Workload; +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; @@ -157,6 +158,11 @@ public int[] getNodeCount() { return delegate.getNodeCount(); } + @Override + public List getContactPoints() { + return delegate.getContactPoints(); + } + @Override public String checkForErrors() { return delegate.checkForErrors(); @@ -631,7 +637,7 @@ public void beforeTestClass(Object testInstance) throws Exception { } catch (Exception e) { LOGGER.error(e.getMessage(), e); errorOut(); - fail(e.getMessage()); + throw e; } } } @@ -706,18 +712,15 @@ public void afterTestClass() throws Exception { /** * Returns the cluster builder to use for this test. * - *

    The default implementation returns a vanilla builder. - * - *

    It's not required to call {@link - * com.datastax.driver.core.Cluster.Builder#addContactPointsWithPorts}, it will be done - * automatically. + *

    The default implementation returns a vanilla builder with contact points and port that match + * the running CCM cluster. Therefore it's not required to call {@link + * Cluster.Builder#addContactPointsWithPorts}, it will be done automatically. * * @return The cluster builder to use for the tests. */ public Cluster.Builder createClusterBuilder() { - return Cluster.builder() - // use a different codec registry for each cluster instance - .withCodecRegistry(new CodecRegistry()); + Cluster.Builder builder = Cluster.builder(); + return configureClusterBuilder(builder); } /** @@ -730,7 +733,18 @@ public Cluster.Builder createClusterBuilder() { * @return The cluster builder to use for the tests. */ public Cluster.Builder createClusterBuilderNoDebouncing() { - return Cluster.builder().withQueryOptions(TestUtils.nonDebouncingQueryOptions()); + return createClusterBuilder().withQueryOptions(TestUtils.nonDebouncingQueryOptions()); + } + + /** + * Configures the builder with contact points and port that match the running CCM cluster. + * Therefore it's not required to call {@link Cluster.Builder#addContactPointsWithPorts}, it will + * be done automatically. + * + * @return The cluster builder (for method chaining). + */ + protected Builder configureClusterBuilder(Builder builder) { + return TestUtils.configureClusterBuilder(builder, ccm()); } /** @@ -963,6 +977,12 @@ protected void initTestCluster(Object testInstance) throws Exception { // add contact points only if the provided builder didn't do so if (builder.getContactPoints().isEmpty()) builder.addContactPoints(getContactPoints()); builder.withPort(ccm.getBinaryPort()); + if (ccm().getCassandraVersion().compareTo(VersionNumber.parse("3.10")) >= 0 + && ccm().getCassandraVersion().compareTo(VersionNumber.parse("4.0-beta5")) < 0) { + // prevent usage of protocol v5 for 3.10 and 3.11 since these versions have the beta + // version of it + builder.withProtocolVersion(ProtocolVersion.V4); + } cluster = register(builder.build()); cluster.init(); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/ClusterStressTest.java b/driver-core/src/test/java/com/datastax/driver/core/ClusterStressTest.java index e7a62993b42..f50dac1fb4d 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ClusterStressTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ClusterStressTest.java @@ -174,9 +174,7 @@ private class CreateClusterAndCheckConnections CreateClusterAndCheckConnections(CountDownLatch startSignal) { this.startSignal = startSignal; this.cluster = - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() .withPoolingOptions( new PoolingOptions().setCoreConnectionsPerHost(HostDistance.LOCAL, 1)) .withNettyOptions(channelMonitor.nettyOptions()) diff --git a/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java b/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java index 06d5b711f38..a406bbf8e00 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java @@ -19,7 +19,6 @@ import static com.datastax.driver.core.CreateCCM.TestMode.PER_METHOD; import static com.datastax.driver.core.ScassandraCluster.SELECT_PEERS; import static com.datastax.driver.core.ScassandraCluster.datacenter; -import static com.datastax.driver.core.TestUtils.nonDebouncingQueryOptions; import static com.datastax.driver.core.TestUtils.nonQuietClusterCloseOptions; import static com.google.common.collect.Lists.newArrayList; import static org.scassandra.http.client.PrimingRequest.then; @@ -79,9 +78,7 @@ public void should_prevent_simultaneous_reconnection_attempts() throws Interrupt // this host Cluster cluster = register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() .withReconnectionPolicy(reconnectionPolicy) .withLoadBalancingPolicy(loadBalancingPolicy) .build()); @@ -109,12 +106,7 @@ public void should_prevent_simultaneous_reconnection_attempts() throws Interrupt @CassandraVersion("2.1.0") public void should_parse_UDT_definitions_when_using_default_protocol_version() { // First driver instance: create UDT - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) - .build()); + Cluster cluster = register(createClusterBuilder().build()); Session session = cluster.connect(); session.execute( "create keyspace ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}"); @@ -122,12 +114,7 @@ public void should_parse_UDT_definitions_when_using_default_protocol_version() { cluster.close(); // Second driver instance: read UDT definition - Cluster cluster2 = - register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) - .build()); + Cluster cluster2 = register(createClusterBuilder().build()); UserType fooType = cluster2.getMetadata().getKeyspace("ks").getUserType("foo"); assertThat(fooType.getFieldNames()).containsExactly("i"); @@ -146,13 +133,7 @@ public void should_parse_UDT_definitions_when_using_default_protocol_version() { @CCMConfig(numberOfNodes = 3) public void should_reestablish_if_control_node_decommissioned() throws InterruptedException { InetSocketAddress firstHost = ccm().addressOfNode(1); - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(firstHost.getAddress()) - .withPort(ccm().getBinaryPort()) - .withQueryOptions(nonDebouncingQueryOptions()) - .build()); + Cluster cluster = register(createClusterBuilderNoDebouncing().build()); cluster.init(); // Ensure the control connection host is that of the first node. diff --git a/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerIntegrationTest.java index aa6e8c6bc30..5e1c1bc1561 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerIntegrationTest.java @@ -47,12 +47,7 @@ public void should_wait_until_load_balancing_policy_is_fully_initialized() throws InterruptedException { TestLoadBalancingPolicy policy = new TestLoadBalancingPolicy(); final Cluster cluster = - register( - createClusterBuilderNoDebouncing() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) - .withLoadBalancingPolicy(policy) - .build()); + register(createClusterBuilderNoDebouncing().withLoadBalancingPolicy(policy).build()); new Thread() { @Override public void run() { diff --git a/driver-core/src/test/java/com/datastax/driver/core/GettableDataIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/GettableDataIntegrationTest.java index 5872746cd61..e2a6a8860d0 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/GettableDataIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/GettableDataIntegrationTest.java @@ -58,7 +58,7 @@ public void onTestContextInitialized() { @Override public Cluster.Builder createClusterBuilder() { - return Cluster.builder().withCodecRegistry(registry); + return super.createClusterBuilder().withCodecRegistry(registry); } @BeforeClass(groups = "short") diff --git a/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java b/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java index 26e319bb28e..8cb4d6c316c 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java @@ -52,13 +52,7 @@ public class LoadBalancingPolicyBootstrapTest extends CCMTestsSupport { public void should_init_policy_with_up_contact_points() throws Exception { HistoryPolicy policy = new HistoryPolicy(new RoundRobinPolicy()); - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withLoadBalancingPolicy(policy) - .build()); + Cluster cluster = register(createClusterBuilder().withLoadBalancingPolicy(policy).build()); try { cluster.init(); @@ -103,13 +97,7 @@ public void should_send_down_notifications_after_init_when_contact_points_are_do ccm().waitForDown(nodeToStop); HistoryPolicy policy = new HistoryPolicy(new RoundRobinPolicy()); - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withLoadBalancingPolicy(policy) - .build()); + Cluster cluster = register(createClusterBuilder().withLoadBalancingPolicy(policy).build()); try { cluster.init(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/MetadataTest.java b/driver-core/src/test/java/com/datastax/driver/core/MetadataTest.java index 44774cc59b3..26e88c5d87e 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/MetadataTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/MetadataTest.java @@ -17,7 +17,6 @@ import static com.datastax.driver.core.Assertions.assertThat; import static com.datastax.driver.core.CreateCCM.TestMode.PER_METHOD; -import static com.datastax.driver.core.TestUtils.nonDebouncingQueryOptions; import static com.datastax.driver.core.TestUtils.waitForUp; import com.google.common.collect.Maps; @@ -57,13 +56,7 @@ public class MetadataTest extends CCMTestsSupport { @Test(groups = "long") @CCMConfig(numberOfNodes = 3, dirtiesContext = true, createCluster = false) public void should_update_metadata_on_topology_change() { - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) - .withQueryOptions(nonDebouncingQueryOptions()) - .build()); + Cluster cluster = register(createClusterBuilderNoDebouncing().build()); Session session = cluster.connect(); String keyspace = "test"; diff --git a/driver-core/src/test/java/com/datastax/driver/core/MetricsTest.java b/driver-core/src/test/java/com/datastax/driver/core/MetricsTest.java index ead5fd52cd9..2c97550a7c9 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/MetricsTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/MetricsTest.java @@ -36,7 +36,7 @@ public class MetricsTest extends CCMTestsSupport { @Override public Cluster.Builder createClusterBuilder() { - return Cluster.builder() + return super.createClusterBuilder() .withRetryPolicy( new RetryPolicy() { @Override @@ -141,13 +141,7 @@ public void should_enable_metrics_and_jmx_by_default() throws Exception { */ @Test(groups = "short", expectedExceptions = InstanceNotFoundException.class) public void metrics_should_be_null_when_metrics_disabled() throws Exception { - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withoutMetrics() - .build()); + Cluster cluster = register(createClusterBuilder().withoutMetrics().build()); try { cluster.init(); assertThat(cluster.getMetrics()).isNull(); @@ -169,13 +163,7 @@ public void metrics_should_be_null_when_metrics_disabled() throws Exception { */ @Test(groups = "short", expectedExceptions = InstanceNotFoundException.class) public void should_be_no_jmx_mbean_when_jmx_is_disabled() throws Exception { - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withoutJMXReporting() - .build()); + Cluster cluster = register(createClusterBuilder().withoutJMXReporting().build()); try { cluster.init(); assertThat(cluster.getMetrics()).isNotNull(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/MissingRpcAddressTest.java b/driver-core/src/test/java/com/datastax/driver/core/MissingRpcAddressTest.java index 8408bb701c4..f778ca94394 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/MissingRpcAddressTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/MissingRpcAddressTest.java @@ -40,12 +40,7 @@ public class MissingRpcAddressTest extends CCMTestsSupport { public void testMissingRpcAddressAtStartup() throws Exception { deleteNode2RpcAddressFromNode1(); // Use only one contact point to make sure that the control connection is on node1 - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) - .build()); + Cluster cluster = register(createClusterBuilder().build()); cluster.connect(); // Since node2's RPC address is unknown on our control host, it should have been ignored @@ -58,9 +53,7 @@ private void deleteNode2RpcAddressFromNode1() throws Exception { InetSocketAddress firstHost = ccm().addressOfNode(1); Cluster cluster = register( - Cluster.builder() - .addContactPoints(firstHost.getAddress()) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() // ensure we will only connect to node1 .withLoadBalancingPolicy( new WhiteListPolicy( diff --git a/driver-core/src/test/java/com/datastax/driver/core/NettyOptionsTest.java b/driver-core/src/test/java/com/datastax/driver/core/NettyOptionsTest.java index 321c2878369..58b459199ac 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/NettyOptionsTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/NettyOptionsTest.java @@ -73,9 +73,7 @@ public Object answer(InvocationOnMock invocation) throws Throwable { .afterChannelInitialized(any(SocketChannel.class)); Cluster cluster = register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() .withPoolingOptions( new PoolingOptions() .setConnectionsPerHost( diff --git a/driver-core/src/test/java/com/datastax/driver/core/NodeListRefreshDebouncerTest.java b/driver-core/src/test/java/com/datastax/driver/core/NodeListRefreshDebouncerTest.java index b7445259f1a..aba127ecbf8 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/NodeListRefreshDebouncerTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/NodeListRefreshDebouncerTest.java @@ -42,13 +42,7 @@ public void setup() { queryOptions.setMaxPendingRefreshNodeListRequests(5); queryOptions.setRefreshSchemaIntervalMillis(0); // Create a separate cluster that will receive the schema events on its control connection. - cluster2 = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withQueryOptions(queryOptions) - .build()); + cluster2 = register(createClusterBuilder().withQueryOptions(queryOptions).build()); cluster2.init(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/NodeRefreshDebouncerTest.java b/driver-core/src/test/java/com/datastax/driver/core/NodeRefreshDebouncerTest.java index 6b2c1a87680..c59078d0aaf 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/NodeRefreshDebouncerTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/NodeRefreshDebouncerTest.java @@ -45,13 +45,7 @@ public void should_call_onAdd_with_bootstrap_stop_start() { int refreshNodeInterval = 30000; QueryOptions queryOptions = new QueryOptions().setRefreshNodeIntervalMillis(refreshNodeInterval); - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) - .withQueryOptions(queryOptions) - .build()); + Cluster cluster = register(createClusterBuilder().withQueryOptions(queryOptions).build()); cluster.connect(); Host.StateListener listener = mock(Host.StateListener.class); cluster.register(listener); diff --git a/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementInvalidationTest.java b/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementInvalidationTest.java index 7a72fc73fbf..86bc7c49648 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementInvalidationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementInvalidationTest.java @@ -40,23 +40,9 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -/** - * Note: at the time of writing, this test exercises features of an unreleased Cassandra version. To - * test against a local build, run with - * - *

    - *   -Dcassandra.version=4.0.0 -Dcassandra.directory=/path/to/cassandra
    - * 
    - */ @CassandraVersion("4.0") public class PreparedStatementInvalidationTest extends CCMTestsSupport { - @Override - public Cluster.Builder createClusterBuilder() { - // TODO remove when protocol v5 is stable in C* 4 - return super.createClusterBuilderNoDebouncing().allowBetaProtocolVersion(); - } - @BeforeMethod(groups = "short", alwaysRun = true) public void setup() throws Exception { execute("CREATE TABLE prepared_statement_invalidation_test (a int PRIMARY KEY, b int, c int);"); diff --git a/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementTest.java b/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementTest.java index d53ad6bc6e9..c52db70f0df 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementTest.java @@ -546,11 +546,7 @@ public void should_set_routing_key_on_case_sensitive_keyspace_and_table() { @Test(groups = "short", expectedExceptions = InvalidQueryException.class) public void should_fail_when_prepared_on_another_cluster() throws Exception { - Cluster otherCluster = - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .build(); + Cluster otherCluster = createClusterBuilder().build(); try { PreparedStatement pst = otherCluster.connect().prepare("select * from system.peers where inet = ?"); @@ -577,9 +573,7 @@ public void should_fail_when_prepared_on_another_cluster() throws Exception { public void should_not_allow_unbound_value_on_bound_statement_when_protocol_lesser_than_v4() { Cluster cluster = register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() .withProtocolVersion(ccm().getProtocolVersion(ProtocolVersion.V3)) .build()); Session session = cluster.connect(); @@ -592,6 +586,9 @@ public void should_not_allow_unbound_value_on_bound_statement_when_protocol_less fail("Should not have executed statement with UNSET values in protocol V3"); } catch (IllegalStateException e) { assertThat(e.getMessage()).contains("Unset value at index 1"); + } finally { + session.close(); + cluster.close(); } } @@ -609,9 +606,7 @@ public void should_not_allow_unbound_value_on_bound_statement_when_protocol_less public void should_not_allow_unbound_value_on_batch_statement_when_protocol_lesser_than_v4() { Cluster cluster = register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() .withProtocolVersion(ccm().getProtocolVersion(ProtocolVersion.V3)) .build()); Session session = cluster.connect(); @@ -625,6 +620,9 @@ public void should_not_allow_unbound_value_on_batch_statement_when_protocol_less fail("Should not have executed statement with UNSET values in protocol V3"); } catch (IllegalStateException e) { assertThat(e.getMessage()).contains("Unset value at index 1"); + } finally { + session.close(); + cluster.close(); } } diff --git a/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java b/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java index 55b743775a8..6c1111128ae 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java @@ -27,6 +27,7 @@ /** Tests for the new USE_BETA flag introduced in protocol v5 and Cassandra 3.10. */ @CassandraVersion("3.10") +@CCMConfig(createCluster = false) public class ProtocolBetaVersionTest extends CCMTestsSupport { @BeforeClass @@ -44,8 +45,7 @@ public void checkNotCassandra4OrHigher() { * @jira_ticket JAVA-1248 */ @Test(groups = "short") - public void should_not_initialize_when_version_explicitly_required_and_beta_flag_is_set() - throws Exception { + public void should_not_initialize_when_version_explicitly_required_and_beta_flag_is_set() { try { Cluster.builder() .addContactPoints(getContactPoints()) @@ -67,8 +67,7 @@ public void should_not_initialize_when_version_explicitly_required_and_beta_flag * @jira_ticket JAVA-1248 */ @Test(groups = "short") - public void should_not_initialize_when_beta_flag_is_set_and_version_explicitly_required() - throws Exception { + public void should_not_initialize_when_beta_flag_is_set_and_version_explicitly_required() { try { Cluster.builder() .addContactPoints(getContactPoints()) @@ -90,8 +89,7 @@ public void should_not_initialize_when_beta_flag_is_set_and_version_explicitly_r * @jira_ticket JAVA-1248 */ @Test(groups = "short") - public void should_not_connect_when_beta_version_explicitly_required_and_flag_not_set() - throws Exception { + public void should_not_connect_when_beta_version_explicitly_required_and_flag_not_set() { try { Cluster.builder() .addContactPoints(getContactPoints()) @@ -101,7 +99,7 @@ public void should_not_connect_when_beta_version_explicitly_required_and_flag_no fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { assertThat(e.getMessage()) - .startsWith("Can not use V5 protocol version. Newest supported protocol version is: V4"); + .startsWith("Can not use V6 protocol version. Newest supported protocol version is: V5"); } } @@ -109,17 +107,10 @@ public void should_not_connect_when_beta_version_explicitly_required_and_flag_no * Verifies that the driver can connect to 3.10 with the following combination of options: Version * UNSET Flag SET Expected version: V5 * - *

    Note: Since driver 3.10, and due to JAVA-2772, it is not possible anymore to connect with v5 - * to a Cassandra 3.x cluster. - * * @jira_ticket JAVA-1248 */ @Test(groups = "short", enabled = false) - public void should_connect_with_beta_when_no_version_explicitly_required_and_flag_set() - throws Exception { - // Note: when the driver's ProtocolVersion.NEWEST_SUPPORTED will be incremented to V6 or higher - // a renegotiation will start taking place here and will downgrade the version from V6 to V5, - // but the test should remain valid since it's executed against 3.10 exclusively + public void should_connect_with_beta_when_no_version_explicitly_required_and_flag_set() { Cluster cluster = Cluster.builder() .addContactPoints(getContactPoints()) @@ -134,15 +125,15 @@ public void should_connect_with_beta_when_no_version_explicitly_required_and_fla * Verifies that the driver can connect to 3.10 with the following combination of options: Version * UNSET Flag UNSET Expected version: V4 * + *

    This test has been disabled as of driver 3.11 because v5 is not beta anymore in the driver. + * As a consequence, protocol negotiation without specifying an initial version is not possible + * anymore against C* >= 3.10 and < 4.0. + * * @jira_ticket JAVA-1248 */ - @Test(groups = "short") + @Test(groups = "short", enabled = false) public void - should_connect_after_renegotiation_when_no_version_explicitly_required_and_flag_not_set() - throws Exception { - // Note: when the driver's ProtocolVersion.NEWEST_SUPPORTED will be incremented to V6 or higher - // the renegotiation will start downgrading the version from V6 to V4 instead of V5 to V4, - // but the test should remain valid since it's executed against 3.10 exclusively + should_connect_after_renegotiation_when_no_version_explicitly_required_and_flag_not_set() { Cluster cluster = Cluster.builder() .addContactPoints(getContactPoints()) diff --git a/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java b/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java index d5e0862028a..913175bc353 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java @@ -26,6 +26,7 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; +@CCMConfig(createCluster = false) public class ProtocolVersionRenegotiationTest extends CCMTestsSupport { private ProtocolVersion protocolVersion; @@ -37,7 +38,7 @@ public void setUp() { /** @jira_ticket JAVA-1367 */ @Test(groups = "short") - public void should_succeed_when_version_provided_and_matches() throws Exception { + public void should_succeed_when_version_provided_and_matches() { Cluster cluster = connectWithVersion(protocolVersion); assertThat(actualProtocolVersion(cluster)).isEqualTo(protocolVersion); } @@ -45,7 +46,7 @@ public void should_succeed_when_version_provided_and_matches() throws Exception /** @jira_ticket JAVA-1367 */ @Test(groups = "short") @CassandraVersion("3.8") - public void should_fail_when_version_provided_and_too_low_3_8_plus() throws Exception { + public void should_fail_when_version_provided_and_too_low_3_8_plus() { UnsupportedProtocolVersionException e = connectWithUnsupportedVersion(V1); assertThat(e.getUnsupportedVersion()).isEqualTo(V1); // post-CASSANDRA-11464: server replies with client's version @@ -54,7 +55,7 @@ public void should_fail_when_version_provided_and_too_low_3_8_plus() throws Exce /** @jira_ticket JAVA-1367 */ @Test(groups = "short") - public void should_fail_when_version_provided_and_too_high() throws Exception { + public void should_fail_when_version_provided_and_too_high() { if (ccm().getCassandraVersion().compareTo(VersionNumber.parse("3.10")) >= 0) { throw new SkipException("Server supports protocol V5"); } @@ -67,7 +68,7 @@ public void should_fail_when_version_provided_and_too_high() throws Exception { /** @jira_ticket JAVA-1367 */ @Test(groups = "short") - public void should_fail_when_beta_allowed_and_too_high() throws Exception { + public void should_fail_when_beta_allowed_and_too_high() { if (ccm().getCassandraVersion().compareTo(VersionNumber.parse("4.0.0")) >= 0) { throw new SkipException("Server supports protocol protocol V6 beta"); } @@ -78,7 +79,7 @@ public void should_fail_when_beta_allowed_and_too_high() throws Exception { /** @jira_ticket JAVA-1367 */ @Test(groups = "short") @CCMConfig(version = "2.1.16", createCluster = false) - public void should_negotiate_when_no_version_provided() throws Exception { + public void should_negotiate_when_no_version_provided() { if (protocolVersion.compareTo(ProtocolVersion.NEWEST_SUPPORTED) >= 0) { throw new SkipException("Server supports newest protocol version driver supports"); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/QueryTimestampTest.java b/driver-core/src/test/java/com/datastax/driver/core/QueryTimestampTest.java index e4beebb14c1..f6ad7e08f78 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/QueryTimestampTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/QueryTimestampTest.java @@ -39,7 +39,7 @@ public void onTestContextInitialized() { public Cluster.Builder createClusterBuilder() { @SuppressWarnings("deprecation") Builder builder = - Cluster.builder() + super.createClusterBuilder() .withTimestampGenerator( new TimestampGenerator() { @Override diff --git a/driver-core/src/test/java/com/datastax/driver/core/RecommissionedNodeTest.java b/driver-core/src/test/java/com/datastax/driver/core/RecommissionedNodeTest.java index 31dafba37b4..3e9907c57aa 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/RecommissionedNodeTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/RecommissionedNodeTest.java @@ -55,9 +55,8 @@ public void should_ignore_recommissioned_node_on_reconnection_attempt() throws E // Now start the driver that will connect to node2 and node3, and consider node1 down mainCluster = - Cluster.builder() - .addContactPoints(mainCcm.addressOfNode(2).getAddress()) - .withPort(mainCcm.getBinaryPort()) + TestUtils.configureClusterBuilder( + Cluster.builder(), mainCcm, mainCcm.addressOfNode(2).getAddress()) .withQueryOptions(nonDebouncingQueryOptions()) .build(); mainCluster.connect(); @@ -89,9 +88,8 @@ public void should_ignore_recommissioned_node_on_control_connection_reconnect() // Start the driver, the control connection will be on node2 mainCluster = - Cluster.builder() - .addContactPoints(mainCcm.addressOfNode(2).getAddress()) - .withPort(mainCcm.getBinaryPort()) + TestUtils.configureClusterBuilder( + Cluster.builder(), mainCcm, mainCcm.addressOfNode(2).getAddress()) .withQueryOptions(nonDebouncingQueryOptions()) .build(); mainCluster.connect(); @@ -134,9 +132,8 @@ public void should_ignore_recommissioned_node_on_session_init() throws Exception // Start the driver, it should only connect to node 2 mainCluster = - Cluster.builder() - .addContactPoints(mainCcm.addressOfNode(2).getAddress()) - .withPort(mainCcm.getBinaryPort()) + TestUtils.configureClusterBuilder( + Cluster.builder(), mainCcm, mainCcm.addressOfNode(2).getAddress()) .withQueryOptions(nonDebouncingQueryOptions()) .build(); @@ -181,9 +178,8 @@ public void should_ignore_node_that_does_not_support_protocol_version_on_session // Start the driver, it should only connect to node 2 mainCluster = - Cluster.builder() - .addContactPoints(mainCcm.addressOfNode(2).getAddress()) - .withPort(mainCcm.getBinaryPort()) + TestUtils.configureClusterBuilder( + Cluster.builder(), mainCcm, mainCcm.addressOfNode(2).getAddress()) .withQueryOptions(nonDebouncingQueryOptions()) .build(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java b/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java index c9733b7b078..bcf680fc976 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java @@ -50,9 +50,7 @@ public class ReconnectionTest extends CCMTestsSupport { public void should_reconnect_after_full_connectivity_loss() throws InterruptedException { Cluster cluster = register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() .withReconnectionPolicy(new ConstantReconnectionPolicy(reconnectionDelayMillis)) .build()); cluster.connect(); @@ -92,9 +90,7 @@ public void should_keep_reconnecting_on_authentication_error() throws Interrupte CountingAuthProvider authProvider = new CountingAuthProvider("cassandra", "cassandra"); Cluster cluster = register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() // Start with the correct auth so that we can initialize the server .withAuthProvider(authProvider) .withReconnectionPolicy(reconnectionPolicy) @@ -141,12 +137,7 @@ public void should_cancel_reconnection_attempts() throws InterruptedException { new CountingReconnectionPolicy(new ConstantReconnectionPolicy(reconnectionDelayMillis)); Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) - .withReconnectionPolicy(reconnectionPolicy) - .build()); + register(createClusterBuilder().withReconnectionPolicy(reconnectionPolicy).build()); cluster.connect(); // Stop a node and cancel the reconnection attempts to it @@ -173,9 +164,7 @@ public void should_trigger_one_time_reconnect() throws InterruptedException, IOE TogglabePolicy loadBalancingPolicy = new TogglabePolicy(new RoundRobinPolicy()); Cluster cluster = register( - Cluster.builder() - .addContactPointsWithPorts(ccm().addressOfNode(1)) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() .withLoadBalancingPolicy(loadBalancingPolicy) .withReconnectionPolicy(new ConstantReconnectionPolicy(reconnectionDelayMillis)) .build()); @@ -230,9 +219,7 @@ public void should_use_connection_from_reconnection_in_pool() { SocketOptions socketOptions = spy(new SocketOptions()); Cluster cluster = register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() .withReconnectionPolicy(new ConstantReconnectionPolicy(5000)) .withLoadBalancingPolicy(loadBalancingPolicy) .withSocketOptions(socketOptions) diff --git a/driver-core/src/test/java/com/datastax/driver/core/RefreshConnectedHostTest.java b/driver-core/src/test/java/com/datastax/driver/core/RefreshConnectedHostTest.java index 4fe2a333037..52ec02163be 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/RefreshConnectedHostTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/RefreshConnectedHostTest.java @@ -40,13 +40,10 @@ public void should_refresh_single_connected_host() { PoolingOptions poolingOptions = Mockito.spy(new PoolingOptions()); Cluster cluster = register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) + createClusterBuilderNoDebouncing() .withPoolingOptions(poolingOptions) .withLoadBalancingPolicy(loadBalancingPolicy) .withReconnectionPolicy(new ConstantReconnectionPolicy(1000)) - .withQueryOptions(TestUtils.nonDebouncingQueryOptions()) .build()); Session session = cluster.connect(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/SSLEncryptionTest.java b/driver-core/src/test/java/com/datastax/driver/core/SSLEncryptionTest.java index c9a01089363..b141837f272 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/SSLEncryptionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/SSLEncryptionTest.java @@ -76,12 +76,7 @@ public void should_not_connect_with_ssl_without_trusting_server_cert( groups = "short", expectedExceptions = {NoHostAvailableException.class}) public void should_not_connect_without_ssl_but_node_uses_ssl() throws Exception { - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .build()); + Cluster cluster = register(createClusterBuilder().build()); cluster.connect(); } @@ -99,11 +94,7 @@ public void should_reconnect_with_ssl_on_node_up(SslImplementation sslImplementa throws Exception { Cluster cluster = register( - Cluster.builder() - .addContactPoints(this.getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withSSL(getSSLOptions(sslImplementation, true, true)) - .build()); + createClusterBuilder().withSSL(getSSLOptions(sslImplementation, true, true)).build()); cluster.connect(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/SSLTestBase.java b/driver-core/src/test/java/com/datastax/driver/core/SSLTestBase.java index 97a9434938d..645c03bf7b3 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/SSLTestBase.java +++ b/driver-core/src/test/java/com/datastax/driver/core/SSLTestBase.java @@ -51,13 +51,7 @@ public static Object[][] sslImplementation() { * be raised here if connection cannot be established. */ protected void connectWithSSLOptions(SSLOptions sslOptions) throws Exception { - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withSSL(sslOptions) - .build()); + Cluster cluster = register(createClusterBuilder().withSSL(sslOptions).build()); cluster.connect(); } @@ -69,13 +63,7 @@ protected void connectWithSSLOptions(SSLOptions sslOptions) throws Exception { * be raised here if connection cannot be established. */ protected void connectWithSSL() throws Exception { - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withSSL() - .build()); + Cluster cluster = register(createClusterBuilder().withSSL().build()); cluster.connect(); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesCCTest.java b/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesCCTest.java index 972f668eba5..2340b45678b 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesCCTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesCCTest.java @@ -58,22 +58,10 @@ public class SchemaChangesCCTest extends CCMTestsSupport { public void should_receive_changes_made_while_control_connection_is_down_on_reconnect() throws Exception { ToggleablePolicy lbPolicy = new ToggleablePolicy(Policies.defaultLoadBalancingPolicy()); - Cluster cluster = - register( - Cluster.builder() - .withLoadBalancingPolicy(lbPolicy) - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) - .build()); + Cluster cluster = register(createClusterBuilder().withLoadBalancingPolicy(lbPolicy).build()); // Put cluster2 control connection on node 2 so it doesn't go down (to prevent noise for // debugging). - Cluster cluster2 = - register( - Cluster.builder() - .withLoadBalancingPolicy(lbPolicy) - .addContactPoints(getContactPoints().get(1)) - .withPort(ccm().getBinaryPort()) - .build()); + Cluster cluster2 = register(createClusterBuilder().withLoadBalancingPolicy(lbPolicy).build()); SchemaChangeListener listener = mock(SchemaChangeListener.class); cluster.init(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java b/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java index 7015ea6ce91..679efcbc943 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java @@ -81,23 +81,11 @@ public class SchemaChangesTest extends CCMTestsSupport { @BeforeClass(groups = "short") public void setup() throws InterruptedException { - cluster1 = - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withQueryOptions(nonDebouncingQueryOptions()) - .build(); - cluster2 = - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withQueryOptions(nonDebouncingQueryOptions()) - .build(); + cluster1 = createClusterBuilderNoDebouncing().build(); + cluster2 = createClusterBuilderNoDebouncing().build(); schemaDisabledCluster = spy( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() .withClusterName("schema-disabled") .withQueryOptions(nonDebouncingQueryOptions().setMetadataEnabled(false)) .build()); @@ -660,9 +648,7 @@ public void should_notify_of_keyspace_drop(String keyspace) throws InterruptedEx @Test(groups = "short", expectedExceptions = IllegalStateException.class) public void should_throw_illegal_state_exception_on_newToken_with_metadata_disabled() { Cluster cluster = - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() .withQueryOptions(nonDebouncingQueryOptions().setMetadataEnabled(false)) .build(); @@ -684,9 +670,7 @@ public void should_throw_illegal_state_exception_on_newToken_with_metadata_disab @Test(groups = "short", expectedExceptions = IllegalStateException.class) public void should_throw_illegal_state_exception_on_newTokenRange_with_metadata_disabled() { Cluster cluster = - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() .withQueryOptions(nonDebouncingQueryOptions().setMetadataEnabled(false)) .build(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/SchemaRefreshDebouncerTest.java b/driver-core/src/test/java/com/datastax/driver/core/SchemaRefreshDebouncerTest.java index 65c3a727f13..ca091f7f33a 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/SchemaRefreshDebouncerTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/SchemaRefreshDebouncerTest.java @@ -59,13 +59,7 @@ public void setup() { queryOptions.setRefreshSchemaIntervalMillis(DEBOUNCE_TIME); queryOptions.setMaxPendingRefreshSchemaRequests(5); // Create a separate cluster that will receive the schema events on its control connection. - cluster2 = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withQueryOptions(queryOptions) - .build()); + cluster2 = register(createClusterBuilder().withQueryOptions(queryOptions).build()); session2 = cluster2.connect(); // Create a spy of the Cluster's control connection and replace it with the spy. diff --git a/driver-core/src/test/java/com/datastax/driver/core/SessionLeakTest.java b/driver-core/src/test/java/com/datastax/driver/core/SessionLeakTest.java index cc6940575af..aa0f5737954 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/SessionLeakTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/SessionLeakTest.java @@ -17,7 +17,6 @@ import static com.datastax.driver.core.Assertions.assertThat; import static com.datastax.driver.core.CreateCCM.TestMode.PER_METHOD; -import static com.datastax.driver.core.TestUtils.nonDebouncingQueryOptions; import static com.google.common.collect.Lists.newArrayList; import static java.util.concurrent.TimeUnit.MINUTES; import static org.assertj.core.api.Assertions.fail; @@ -40,11 +39,8 @@ public void connectionLeakTest() throws Exception { channelMonitor.reportAtFixedInterval(1, TimeUnit.SECONDS); Cluster cluster = register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) + createClusterBuilderNoDebouncing() .withNettyOptions(channelMonitor.nettyOptions()) - .withQueryOptions(nonDebouncingQueryOptions()) .build()); cluster.init(); @@ -102,12 +98,7 @@ public void should_not_leak_session_when_wrong_keyspace() throws Exception { channelMonitor = new SocketChannelMonitor(); channelMonitor.reportAtFixedInterval(1, TimeUnit.SECONDS); Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) - .withNettyOptions(channelMonitor.nettyOptions()) - .build()); + register(createClusterBuilder().withNettyOptions(channelMonitor.nettyOptions()).build()); cluster.init(); assertThat(cluster.manager.sessions.size()).isEqualTo(0); try { diff --git a/driver-core/src/test/java/com/datastax/driver/core/SessionStressTest.java b/driver-core/src/test/java/com/datastax/driver/core/SessionStressTest.java index b80ba5e2182..25fde7d5df2 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/SessionStressTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/SessionStressTest.java @@ -99,9 +99,7 @@ public void sessions_should_not_leak_connections() { // override inherited field with a new cluster object and ensure 0 sessions and connections channelMonitor.reportAtFixedInterval(1, TimeUnit.SECONDS); stressCluster = - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) + createClusterBuilder() .withPoolingOptions( new PoolingOptions().setCoreConnectionsPerHost(HostDistance.LOCAL, 1)) .withNettyOptions(channelMonitor.nettyOptions()) diff --git a/driver-core/src/test/java/com/datastax/driver/core/StatementWrapperTest.java b/driver-core/src/test/java/com/datastax/driver/core/StatementWrapperTest.java index 82416c567f4..06d539bb606 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/StatementWrapperTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/StatementWrapperTest.java @@ -50,7 +50,7 @@ public void onTestContextInitialized() { @Override public Cluster.Builder createClusterBuilder() { - return Cluster.builder() + return super.createClusterBuilder() .withLoadBalancingPolicy(loadBalancingPolicy) .withSpeculativeExecutionPolicy(speculativeExecutionPolicy) .withRetryPolicy(retryPolicy); diff --git a/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java b/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java index 751d4189ada..7656cbe1684 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java +++ b/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java @@ -19,6 +19,7 @@ import static java.util.concurrent.TimeUnit.MINUTES; import static java.util.concurrent.TimeUnit.SECONDS; +import com.datastax.driver.core.Cluster.Builder; import com.datastax.driver.core.policies.RoundRobinPolicy; import com.datastax.driver.core.policies.WhiteListPolicy; import com.google.common.base.Predicate; @@ -815,13 +816,41 @@ public static Cluster buildControlCluster(Cluster cluster, CCMAccess ccm) { Host controlHost = cluster.manager.controlConnection.connectedHost(); List singleAddress = Collections.singletonList(controlHost.getEndPoint().resolve()); - return Cluster.builder() - .addContactPoints(controlHost.getEndPoint().resolve().getAddress()) - .withPort(ccm.getBinaryPort()) + return configureClusterBuilder(Cluster.builder(), ccm) .withLoadBalancingPolicy(new WhiteListPolicy(new RoundRobinPolicy(), singleAddress)) .build(); } + /** + * Configures the builder with one contact point and port matching the given CCM cluster. + * Therefore it's not required to call {@link Cluster.Builder#addContactPoints}, it will be done + * automatically. + * + * @return The cluster builder (for method chaining). + */ + public static Builder configureClusterBuilder(Builder builder, CCMAccess ccm) { + // add only one contact point to force node1 to become the control host; some tests rely on + // that. + return configureClusterBuilder(builder, ccm, ccm.getContactPoints().get(0)); + } + + /** + * Configures the builder with binary port matching the given CCM cluster and with the given + * contact points. Therefore it's not required to call {@link Cluster.Builder#addContactPoints}, + * it will be done automatically. + * + * @return The cluster builder (for method chaining). + */ + public static Builder configureClusterBuilder( + Builder builder, CCMAccess ccm, InetAddress... contactPoints) { + builder + // use a different codec registry for each cluster instance + .withCodecRegistry(new CodecRegistry()) + .addContactPoints(contactPoints) + .withPort(ccm.getBinaryPort()); + return builder; + } + /** @return a {@link QueryOptions} that disables debouncing by setting intervals to 0ms. */ public static QueryOptions nonDebouncingQueryOptions() { return new QueryOptions() @@ -868,6 +897,8 @@ public static void executeNoFail(Callable task, boolean logException) { task.call(); } catch (Exception e) { if (logException) logger.error(e.getMessage(), e); + } catch (AssertionError e) { + if (logException) logger.error(e.getMessage(), e); } } @@ -981,7 +1012,7 @@ public static Level setLogLevel(String logger, Level newLevel) { /** * Throws a {@link SkipException} if the input {@link CCMAccess} does not support compact storage - * (C* 4.0+) + * (C* 4.0+ or DSE 6.0+). * * @param ccm cluster to check against */ @@ -990,5 +1021,9 @@ public static void compactStorageSupportCheck(CCMAccess ccm) { throw new SkipException( "Compact tables are not allowed in Cassandra starting with 4.0 version"); } + if (ccm.getDSEVersion() != null + && ccm.getDSEVersion().compareTo(VersionNumber.parse("6.0")) >= 0) { + throw new SkipException("Compact tables are not allowed in DSE starting with 6.0 version"); + } } } diff --git a/driver-core/src/test/java/com/datastax/driver/core/TimeoutStressTest.java b/driver-core/src/test/java/com/datastax/driver/core/TimeoutStressTest.java index ecf36c2e87b..8278adb8d44 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/TimeoutStressTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/TimeoutStressTest.java @@ -63,7 +63,7 @@ public Cluster.Builder createClusterBuilder() { channelMonitor = register(new SocketChannelMonitor()); PoolingOptions poolingOptions = new PoolingOptions().setConnectionsPerHost(HostDistance.LOCAL, 8, 8); - return Cluster.builder() + return super.createClusterBuilder() .withPoolingOptions(poolingOptions) .withNettyOptions(channelMonitor.nettyOptions()) .withReconnectionPolicy(new ConstantReconnectionPolicy(1000)); diff --git a/driver-core/src/test/java/com/datastax/driver/core/TransietReplicationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TransientReplicationTest.java similarity index 95% rename from driver-core/src/test/java/com/datastax/driver/core/TransietReplicationTest.java rename to driver-core/src/test/java/com/datastax/driver/core/TransientReplicationTest.java index 849d8f99a49..4a0521228a8 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/TransietReplicationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/TransientReplicationTest.java @@ -28,11 +28,9 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -@CassandraVersion( - value = "4.0.0-alpha1", - description = "Transient Replication is for Cassandra 4.0+") +@CassandraVersion(value = "4.0.0", description = "Transient Replication is for Cassandra 4.0+") @CCMConfig(config = "enable_transient_replication:true") -public class TransietReplicationTest extends CCMTestsSupport { +public class TransientReplicationTest extends CCMTestsSupport { private static final String TRANSIENT_REPLICATION_KEYSPACE = "transient_rep_ks"; diff --git a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecOverlappingJavaTypeIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecOverlappingJavaTypeIntegrationTest.java index 3b25b25adc7..874893fb351 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecOverlappingJavaTypeIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecOverlappingJavaTypeIntegrationTest.java @@ -46,7 +46,7 @@ public void onTestContextInitialized() { } public Cluster.Builder createClusterBuilder() { - return Cluster.builder() + return super.createClusterBuilder() .withCodecRegistry(new CodecRegistry().register(new IntToStringCodec())); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecTupleIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecTupleIntegrationTest.java index 3d7a68f7133..fecc7579403 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecTupleIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecTupleIntegrationTest.java @@ -97,17 +97,13 @@ public void should_handle_partial_tuples_with_default_codecs() { @Test(groups = "short") public void should_handle_tuples_with_custom_codecs() { - CodecRegistry codecRegistry = new CodecRegistry(); - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withCodecRegistry(codecRegistry) - .build()); + Cluster cluster = register(createClusterBuilder().build()); Session session = cluster.connect(keyspace); setUpTupleTypes(cluster); - codecRegistry.register(new LocationCodec(TypeCodec.tuple(locationType))); + cluster + .getConfiguration() + .getCodecRegistry() + .register(new LocationCodec(TypeCodec.tuple(locationType))); session.execute(insertQuery, uuid, "John Doe", locationValue); ResultSet rows = session.execute(selectQuery, uuid); Row row = rows.one(); @@ -129,17 +125,13 @@ public void should_handle_tuples_with_custom_codecs() { @Test(groups = "short") public void should_handle_partial_tuples_with_custom_codecs() { - CodecRegistry codecRegistry = new CodecRegistry(); - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withCodecRegistry(codecRegistry) - .build()); + Cluster cluster = register(createClusterBuilder().build()); Session session = cluster.connect(keyspace); setUpTupleTypes(cluster); - codecRegistry.register(new LocationCodec(TypeCodec.tuple(locationType))); + cluster + .getConfiguration() + .getCodecRegistry() + .register(new LocationCodec(TypeCodec.tuple(locationType))); session.execute(insertQuery, uuid, "John Doe", partialLocationValueInserted); ResultSet rows = session.execute(selectQuery, uuid); Row row = rows.one(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecUDTIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecUDTIntegrationTest.java index c92580782d3..d3d14966edb 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecUDTIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecUDTIntegrationTest.java @@ -74,19 +74,14 @@ public void should_handle_udts_with_default_codecs() { @Test(groups = "short") public void should_handle_udts_with_custom_codecs() { - CodecRegistry codecRegistry = new CodecRegistry(); - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .withCodecRegistry(codecRegistry) - .build()); + Cluster cluster = register(createClusterBuilder().build()); Session session = cluster.connect(keyspace); setUpUserTypes(cluster); TypeCodec addressTypeCodec = TypeCodec.userType(addressType); TypeCodec phoneTypeCodec = TypeCodec.userType(phoneType); - codecRegistry + cluster + .getConfiguration() + .getCodecRegistry() .register(new AddressCodec(addressTypeCodec, Address.class)) .register(new PhoneCodec(phoneTypeCodec, Phone.class)); session.execute(insertQuery, uuid, "John Doe", address); diff --git a/driver-core/src/test/java/com/datastax/driver/core/UnresolvedUserTypeTest.java b/driver-core/src/test/java/com/datastax/driver/core/UnresolvedUserTypeTest.java index 5ce5355197d..eb9faa03923 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/UnresolvedUserTypeTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/UnresolvedUserTypeTest.java @@ -104,19 +104,12 @@ Creates the following acyclic graph (edges directed upwards public void should_resolve_nested_user_types() throws ExecutionException, InterruptedException { // Each CREATE TYPE statement in getTableDefinitions() has triggered a partial schema refresh - // that - // should have used previous UDT definitions for dependencies. + // that should have used previous UDT definitions for dependencies. checkUserTypes(cluster().getMetadata()); // Create a different Cluster instance to force a full refresh where all UDTs are loaded at - // once. - // The parsing logic should sort them to make sure they are loaded in the right order. - Cluster newCluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .build()); + // once. The parsing logic should sort them to make sure they are loaded in the right order. + Cluster newCluster = register(createClusterBuilder().build()); checkUserTypes(newCluster.getMetadata()); } 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 index edf41534221..cfbe0a4f6d9 100644 --- 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 @@ -26,6 +26,7 @@ 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; @@ -73,6 +74,7 @@ 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"); @@ -84,7 +86,11 @@ 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)).build().connect(); + Cluster.builder() + .withCloudSecureConnectBundle(new File(path)) + .withProtocolVersion(ProtocolVersion.V4) + .build() + .connect(); ResultSet set = session.execute("select * from system.local"); assertThat(set).isNotNull(); } @@ -104,7 +110,12 @@ public void should_connect_to_proxy_using_file_provided_by_the_http_URL() throws new URL(String.format("http://localhost:%d%s", wireMockServer.port(), CERTS_BUNDLE_SUFFIX)); // when - Session session = Cluster.builder().withCloudSecureConnectBundle(configFile).build().connect(); + Session session = + Cluster.builder() + .withCloudSecureConnectBundle(configFile) + .withProtocolVersion(ProtocolVersion.V4) + .build() + .connect(); // then ResultSet set = session.execute("select * from system.local"); @@ -127,7 +138,11 @@ public void should_connect_to_proxy_using_file_provided_by_input_stream() throws // when Session session = - Cluster.builder().withCloudSecureConnectBundle(configFile.openStream()).build().connect(); + Cluster.builder() + .withCloudSecureConnectBundle(configFile.openStream()) + .withProtocolVersion(ProtocolVersion.V4) + .build() + .connect(); // then ResultSet set = session.execute("select * from system.local"); @@ -140,6 +155,7 @@ public void should_connect_to_proxy_using_auth_provider() { Cluster.builder() .withCloudSecureConnectBundle(proxy.getSecureBundleNoCredsPath()) .withAuthProvider(new PlainTextAuthProvider("cassandra", "cassandra")) + .withProtocolVersion(ProtocolVersion.V4) .build() .connect(); ResultSet set = session.execute("select * from system.local"); @@ -152,6 +168,7 @@ public void should_not_connect_to_proxy_bad_creds() { Session session = Cluster.builder() .withCloudSecureConnectBundle(proxy.getSecureBundleNoCredsPath()) + .withProtocolVersion(ProtocolVersion.V4) .build() .connect(); fail("Expected an AuthenticationException"); @@ -166,6 +183,7 @@ public void should_not_connect_to_proxy() { Session session = Cluster.builder() .withCloudSecureConnectBundle(proxy.getSecureBundleUnreachable()) + .withProtocolVersion(ProtocolVersion.V4) .build() .connect(); fail("Expected an IllegalStateException"); @@ -182,6 +200,7 @@ public void should_not_allow_contact_points_and_cloud() { .addContactPoint("127.0.0.1") .withCloudSecureConnectBundle(proxy.getSecureBundleNoCredsPath()) .withCredentials("cassandra", "cassandra") + .withProtocolVersion(ProtocolVersion.V4) .build() .connect(); fail("Expected an IllegalStateException"); @@ -200,6 +219,7 @@ public void should_not_allow_cloud_with_contact_points_string() { .withCloudSecureConnectBundle(proxy.getSecureBundleNoCredsPath()) .addContactPoint("127.0.0.1") .withCredentials("cassandra", "cassandra") + .withProtocolVersion(ProtocolVersion.V4) .build() .connect(); fail("Expected an IllegalStateException"); @@ -224,6 +244,7 @@ public InetSocketAddress resolve() { } }) .withCredentials("cassandra", "cassandra") + .withProtocolVersion(ProtocolVersion.V4) .build() .connect(); fail("Expected an IllegalStateException"); diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/CloseableLoadBalancingPolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/CloseableLoadBalancingPolicyTest.java index 475d5b2b153..26a5409490f 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/policies/CloseableLoadBalancingPolicyTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/policies/CloseableLoadBalancingPolicyTest.java @@ -40,9 +40,7 @@ public void should_be_invoked_at_shutdown() { @Override public Cluster.Builder createClusterBuilder() { policy = new CloseMonitoringPolicy(Policies.defaultLoadBalancingPolicy()); - return Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withLoadBalancingPolicy(policy); + return super.createClusterBuilder().withLoadBalancingPolicy(policy); } static class CloseMonitoringPolicy extends DelegatingLoadBalancingPolicy { diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/TokenAwarePolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/TokenAwarePolicyTest.java index 2bc7ff201be..cdd17ffade0 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/policies/TokenAwarePolicyTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/policies/TokenAwarePolicyTest.java @@ -508,9 +508,7 @@ public void should_properly_generate_and_use_routing_key_for_composite_partition ccm.start(); Cluster cluster = - Cluster.builder() - .addContactPoints(ccm.addressOfNode(1).getAddress()) - .withPort(ccm.getBinaryPort()) + TestUtils.configureClusterBuilder(Cluster.builder(), ccm) .withNettyOptions(nonQuietClusterCloseOptions) .withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy())) .build(); diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/arrays/ArrayCodecsTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/arrays/ArrayCodecsTest.java index d541fc1ed7c..762791feddf 100644 --- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/arrays/ArrayCodecsTest.java +++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/arrays/ArrayCodecsTest.java @@ -63,7 +63,7 @@ public void onTestContextInitialized() { @Override public Cluster.Builder createClusterBuilder() { - return Cluster.builder() + return super.createClusterBuilder() .withCodecRegistry( new CodecRegistry() .register(IntArrayCodec.instance) diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java index ac075a1f4e6..12fb9b4f4b5 100644 --- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java +++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java @@ -338,12 +338,7 @@ public void testAccessor() throws Exception { public void should_be_able_to_use_udtCodec_standalone() { // Create a separate Cluster/Session to start with a CodecRegistry from scratch (so not already // registered). - Cluster cluster = - register( - Cluster.builder() - .addContactPoints(getContactPoints()) - .withPort(ccm().getBinaryPort()) - .build()); + Cluster cluster = register(createClusterBuilder().build()); CodecRegistry registry = cluster.getConfiguration().getCodecRegistry(); Session session = cluster.connect(keyspace); @@ -557,7 +552,7 @@ public void should_throw_error_when_table_is_altered_and_is_not_compatible_anymo } catch (InvalidQueryException e) { // Error message varies by C* version. assertThat(e.getMessage()) - .isIn("Unknown identifier mainaddress", "Undefined column name mainaddress"); + .matches("(Unknown identifier mainaddress|Undefined column name mainaddress.*)"); } try { mapper.get(user.getUserId()); @@ -565,17 +560,15 @@ public void should_throw_error_when_table_is_altered_and_is_not_compatible_anymo } catch (InvalidQueryException e) { // Error message varies by C* version. assertThat(e.getMessage()) - .isIn( - "Undefined name mainaddress in selection clause", - "Undefined column name mainaddress"); + .matches( + "(Undefined name mainaddress in selection clause|Undefined column name mainaddress.*)"); } // trying to use a new mapper try { manager.mapper(User.class); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { - assertThat(e.getMessage()) - .isIn(String.format("Column mainaddress does not exist in table \"%s\".users", keyspace)); + assertThat(e.getMessage()).startsWith("Column mainaddress does not exist"); } } diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/UDTFieldMapperTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/UDTFieldMapperTest.java index 9256f7f74d4..f66b4a5708a 100644 --- a/driver-mapping/src/test/java/com/datastax/driver/mapping/UDTFieldMapperTest.java +++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/UDTFieldMapperTest.java @@ -38,12 +38,7 @@ public class UDTFieldMapperTest extends CCMTestsSupport { @Test(groups = "short") public void udt_and_tables_with_ks_created_in_another_session_should_be_mapped() { - Cluster cluster1 = - register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) - .build()); + Cluster cluster1 = register(createClusterBuilder().build()); Session session1 = cluster1.connect(); // Create type and table session1.execute( @@ -57,12 +52,7 @@ public void udt_and_tables_with_ks_created_in_another_session_should_be_mapped() cluster1.close(); // Create entities with another connection - Cluster cluster2 = - register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) - .build()); + Cluster cluster2 = register(createClusterBuilder().build()); Session session2 = cluster2.newSession(); Mapper hashMapper = new MappingManager(session2).mapper(MyHashWithKeyspace.class); @@ -81,12 +71,7 @@ public void udt_and_tables_with_ks_created_in_another_session_should_be_mapped() @Test(groups = "short") public void udt_and_tables_without_ks_created_in_another_session_should_be_mapped() { - Cluster cluster1 = - register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) - .build()); + Cluster cluster1 = register(createClusterBuilder().build()); Session session1 = cluster1.connect(); session1.execute( "create keyspace if not exists java_509b " @@ -100,12 +85,7 @@ public void udt_and_tables_without_ks_created_in_another_session_should_be_mappe cluster1.close(); // Create entities with another connection - Cluster cluster2 = - register( - Cluster.builder() - .addContactPoints(getContactPoints().get(0)) - .withPort(ccm().getBinaryPort()) - .build()); + Cluster cluster2 = register(createClusterBuilder().build()); Session session2 = cluster2.newSession(); session2.execute("use java_509b"); From 46efef05b4db9c958e94da7a106a1d033be0afaa Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Thu, 11 Mar 2021 14:54:47 +0100 Subject: [PATCH 117/211] Update version in docs --- README.md | 16 +++--- changelog/README.md | 10 ++-- faq/README.md | 4 +- faq/osgi/README.md | 2 +- manual/README.md | 30 +++++------ manual/address_resolution/README.md | 4 +- manual/async/README.md | 8 +-- manual/auth/README.md | 8 +-- manual/compression/README.md | 2 +- manual/control_connection/README.md | 2 +- manual/custom_codecs/README.md | 38 +++++++------- manual/custom_codecs/extras/README.md | 48 ++++++++--------- manual/custom_payloads/README.md | 4 +- manual/idempotence/README.md | 6 +-- manual/load_balancing/README.md | 34 ++++++------ manual/logging/README.md | 10 ++-- manual/metadata/README.md | 38 +++++++------- manual/metrics/README.md | 12 ++--- manual/native_protocol/README.md | 10 ++-- manual/object_mapper/README.md | 2 +- manual/object_mapper/creating/README.md | 26 +++++----- manual/object_mapper/custom_codecs/README.md | 6 +-- manual/object_mapper/using/README.md | 18 +++---- manual/paging/README.md | 8 +-- manual/pooling/README.md | 26 +++++----- manual/query_timestamps/README.md | 8 +-- manual/reconnection/README.md | 8 +-- manual/retries/README.md | 54 ++++++++++---------- manual/shaded_jar/README.md | 8 +-- manual/socket_options/README.md | 24 ++++----- manual/speculative_execution/README.md | 22 ++++---- manual/ssl/README.md | 10 ++-- manual/statements/README.md | 16 +++--- manual/statements/batch/README.md | 6 +-- manual/statements/built/README.md | 10 ++-- manual/statements/prepared/README.md | 12 ++--- manual/statements/simple/README.md | 2 +- manual/tuples/README.md | 8 +-- manual/udts/README.md | 4 +- pom.xml | 2 +- 40 files changed, 285 insertions(+), 281 deletions(-) diff --git a/README.md b/README.md index db50f55c590..6eaa9c43305 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ not yet have been released. You can find the documentation for the latest version through the [Java driver docs](http://docs.datastax.com/en/developer/java-driver/latest/index.html) or via the release tags, [e.g. -3.10.2](https://github.com/datastax/java-driver/tree/3.10.2).* +3.11.0](https://github.com/datastax/java-driver/tree/3.11.0).* A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol @@ -50,12 +50,12 @@ The driver contains the following modules: driver releases and important announcements (low frequency). [@DataStaxEng](https://twitter.com/datastaxeng) has more news including other drivers, Cassandra, and DSE. -- DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.10/manual/) has quick +- DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.11/manual/) has quick start material and technical details about the driver and its features. -- API: https://docs.datastax.com/en/drivers/java/3.10 +- API: https://docs.datastax.com/en/drivers/java/3.11 - GITHUB REPOSITORY: https://github.com/datastax/java-driver - [changelog](changelog/) -- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.10.2.tar.gz) +- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.11.0.tar.gz) ## Getting the driver @@ -77,7 +77,7 @@ Note that the object mapper is published as a separate artifact: com.datastax.cassandra cassandra-driver-mapping - 3.10.2 + 3.11.0 ``` @@ -87,7 +87,7 @@ The 'extras' module is also published as a separate artifact: com.datastax.cassandra cassandra-driver-extras - 3.10.2 + 3.11.0 ``` @@ -96,12 +96,12 @@ 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](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.10.2.tar.gz) +[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.11.0.tar.gz) is available for download. ## Compatibility -The Java client driver 3.10.2 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache +The Java client driver 3.11.0 ([branch 3.x](https://github.com/datastax/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/latest/manual/native_protocol/) for the most up-to-date compatibility information). diff --git a/changelog/README.md b/changelog/README.md index 7ad8de76e67..a91d0e1a917 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,26 +5,30 @@ 3.x versions get published. --> -## 3.11.0 (in progress) +## 3.11.0 - [improvement] JAVA-2705: Remove protocol v5 beta status, add v6-beta. - [bug] JAVA-2923: Detect and use Guava's new HostAndPort.getHost method. - [bug] JAVA-2922: Switch to modern framing format inside a channel handler. - [bug] JAVA-2924: Consider protocol version unsupported when server requires USE_BETA flag for it. + ## 3.10.2 - [bug] JAVA-2860: Avoid NPE if channel initialization crashes. + ## 3.10.1 - [bug] JAVA-2857: Fix NPE when built statements without parameters are logged at TRACE level. - [bug] JAVA-2843: Successfully parse DSE table schema in OSS driver. + ## 3.10.0 -- [improvement] JAVA-2676: Don't reschedule flusher after empty runs -- [new feature] JAVA-2772: Support new protocol v5 message format +- [improvement] JAVA-2676: Don't reschedule flusher after empty runs. +- [new feature] JAVA-2772: Support new protocol v5 message format. + ## 3.9.0 diff --git a/faq/README.md b/faq/README.md index 8ef0dd017b6..d806a414f71 100644 --- a/faq/README.md +++ b/faq/README.md @@ -35,7 +35,7 @@ row.getBool(0); // this is equivalent row.getBool("applied") Note that, unlike manual inspection, `wasApplied` does not consume the first row. -[wasApplied]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ResultSet.html#wasApplied-- +[wasApplied]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ResultSet.html#wasApplied-- ### What is a parameterized statement and how can I use it? @@ -289,7 +289,7 @@ version is available, you may want to reach out to the maintainer of that tool t an update with compatibility to this driver version. -[Blobs.java]: https://github.com/datastax/java-driver/tree/3.10.0/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java +[Blobs.java]: https://github.com/datastax/java-driver/tree/3.11.0/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304 [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding [Mapper options]: ../manual/object_mapper/using/#mapper-options diff --git a/faq/osgi/README.md b/faq/osgi/README.md index dd01626e2db..a2b17b676d3 100644 --- a/faq/osgi/README.md +++ b/faq/osgi/README.md @@ -157,7 +157,7 @@ it is also normal to see the following log lines when starting the driver: [BND]:http://bnd.bndtools.org/ [Maven bundle plugin]:https://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Maven+Bundle+Plugin+%28BND%29 [OSGi examples repository]:https://github.com/datastax/java-driver-examples-osgi -[without metrics]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- +[without metrics]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- [SLF4J]:http://www.slf4j.org/ [Logback]:http://logback.qos.ch/ [Tycho]:https://eclipse.org/tycho/ diff --git a/manual/README.md b/manual/README.md index 1635e1219f4..aebd1c91673 100644 --- a/manual/README.md +++ b/manual/README.md @@ -209,7 +209,7 @@ String firstName = row.getString("first_name"); blob getBytes java.nio.ByteBuffer boolean getBool boolean counter getLong long - date getDate LocalDate + date getDate LocalDate decimal getDecimal java.math.BigDecimal double getDouble double float getFloat float @@ -291,17 +291,17 @@ menu on the left hand side to navigate sub-sections. If you're [browsing the sou github.com](https://github.com/datastax/java-driver/tree/3.x/manual), simply navigate to each sub-directory. -[Cluster]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.html -[Cluster.Builder]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html -[Initializer]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Initializer.html -[Session]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html -[ResultSet]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ResultSet.html -[Row]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Row.html -[NettyOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/NettyOptions.html -[QueryOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/QueryOptions.html -[SocketOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html -[Host.StateListener]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Host.StateListener.html -[LatencyTracker]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/LatencyTracker.html -[SchemaChangeListener]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SchemaChangeListener.html -[NoHostAvailableException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/NoHostAvailableException.html -[LocalDate]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/LocalDate.html \ No newline at end of file +[Cluster]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.html +[Cluster.Builder]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.Builder.html +[Initializer]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.Initializer.html +[Session]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Session.html +[ResultSet]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ResultSet.html +[Row]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Row.html +[NettyOptions]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/NettyOptions.html +[QueryOptions]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/QueryOptions.html +[SocketOptions]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SocketOptions.html +[Host.StateListener]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Host.StateListener.html +[LatencyTracker]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/LatencyTracker.html +[SchemaChangeListener]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SchemaChangeListener.html +[NoHostAvailableException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[LocalDate]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/LocalDate.html \ No newline at end of file diff --git a/manual/address_resolution/README.md b/manual/address_resolution/README.md index 8f0ffd33740..0662ab92295 100644 --- a/manual/address_resolution/README.md +++ b/manual/address_resolution/README.md @@ -102,8 +102,8 @@ private/public switch automatically based on location). -[AddressTranslator]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/AddressTranslator.html -[EC2MultiRegionAddressTranslator]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslator.html +[AddressTranslator]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/AddressTranslator.html +[EC2MultiRegionAddressTranslator]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslator.html [cassandra.yaml]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html [rpc_address]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html?scroll=configCassandra_yaml__rpc_address diff --git a/manual/async/README.md b/manual/async/README.md index 21a70f7b767..43523cd548c 100644 --- a/manual/async/README.md +++ b/manual/async/README.md @@ -51,8 +51,8 @@ to the current page, and [fetchMoreResults] to get a future to the next page (see also the section on [paging](../paging/)). Here is a full example: -[getAvailableWithoutFetching]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ResultSet.html#getAvailableWithoutFetching-- -[fetchMoreResults]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ResultSet.html#fetchMoreResults-- +[getAvailableWithoutFetching]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ResultSet.html#getAvailableWithoutFetching-- +[fetchMoreResults]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ResultSet.html#fetchMoreResults-- ```java Statement statement = new SimpleStatement("select * from foo").setFetchSize(20); @@ -134,5 +134,5 @@ There are still a few places where the driver will block internally hasn't been fetched already. [ListenableFuture]: https://github.com/google/guava/wiki/ListenableFutureExplained -[init]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.html#init-- -[query trace]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/QueryTrace.html +[init]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.html#init-- +[query trace]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/QueryTrace.html diff --git a/manual/auth/README.md b/manual/auth/README.md index c8fc021b6f9..22838a4836d 100644 --- a/manual/auth/README.md +++ b/manual/auth/README.md @@ -28,7 +28,7 @@ You can also write your own provider; it must implement [AuthProvider]. [SASL]: https://en.wikipedia.org/wiki/Simple_Authentication_and_Security_Layer -[Cluster.Builder.withCredentials]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withCredentials-java.lang.String-java.lang.String- -[AuthProvider]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/AuthProvider.html -[Cluster.Builder.withAuthProvider]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withAuthProvider-com.datastax.driver.core.AuthProvider- -[PlainTextAuthProvider]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PlainTextAuthProvider.html +[Cluster.Builder.withCredentials]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.Builder.html#withCredentials-java.lang.String-java.lang.String- +[AuthProvider]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/AuthProvider.html +[Cluster.Builder.withAuthProvider]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.Builder.html#withAuthProvider-com.datastax.driver.core.AuthProvider- +[PlainTextAuthProvider]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/PlainTextAuthProvider.html diff --git a/manual/compression/README.md b/manual/compression/README.md index d8563834180..ab96172418e 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -88,4 +88,4 @@ cluster = Cluster.builder() .build(); ``` -[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.10.0/cassandra-driver-parent-3.10.0.pom +[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.11.0/cassandra-driver-parent-3.11.0.pom diff --git a/manual/control_connection/README.md b/manual/control_connection/README.md index eb610627941..189ba31b82b 100644 --- a/manual/control_connection/README.md +++ b/manual/control_connection/README.md @@ -18,4 +18,4 @@ used exclusively for administrative requests. It is included in [Session.State.g as well as the `open-connections` [metric](../metrics); for example, if you've configured a pool size of 2, the control node will have 3 connections. -[Session.State.getOpenConnections]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.State.html#getOpenConnections-com.datastax.driver.core.Host- \ No newline at end of file +[Session.State.getOpenConnections]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Session.State.html#getOpenConnections-com.datastax.driver.core.Host- \ No newline at end of file diff --git a/manual/custom_codecs/README.md b/manual/custom_codecs/README.md index 108d7dab1d4..3d586a028f8 100644 --- a/manual/custom_codecs/README.md +++ b/manual/custom_codecs/README.md @@ -447,26 +447,26 @@ Beware that in these cases, the lookup performs in average 10x worse. If perform consider using prepared statements all the time. [JAVA-721]: https://datastax-oss.atlassian.net/browse/JAVA-721 -[TypeCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TypeCodec.html -[LocalDate]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/LocalDate.html +[TypeCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TypeCodec.html +[LocalDate]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/LocalDate.html [ByteBuffer]: http://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html -[serialize]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TypeCodec.html#serialize-T-com.datastax.driver.core.ProtocolVersion- -[deserialize]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TypeCodec.html#deserialize-java.nio.ByteBuffer-com.datastax.driver.core.ProtocolVersion- -[TypeCodec.format]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TypeCodec.html#format-T- -[TypeCodec.parse]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TypeCodec.html#parse-java.lang.String- -[accepts]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TypeCodec.html#accepts-com.datastax.driver.core.DataType- -[CodecRegistry]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/CodecRegistry.html -[CodecNotFoundException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/CodecNotFoundException.html +[serialize]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TypeCodec.html#serialize-T-com.datastax.driver.core.ProtocolVersion- +[deserialize]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TypeCodec.html#deserialize-java.nio.ByteBuffer-com.datastax.driver.core.ProtocolVersion- +[TypeCodec.format]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TypeCodec.html#format-T- +[TypeCodec.parse]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TypeCodec.html#parse-java.lang.String- +[accepts]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TypeCodec.html#accepts-com.datastax.driver.core.DataType- +[CodecRegistry]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/CodecRegistry.html +[CodecNotFoundException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/CodecNotFoundException.html [Jackson]: https://github.com/FasterXML/jackson [AbstractType]: https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/marshal/AbstractType.java -[UserType]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/UserType.html -[UDTValue]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/UDTValue.html -[TupleType]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TupleType.html -[TupleValue]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TupleValue.html -[CustomType]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/DataType.CustomType.html +[UserType]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/UserType.html +[UDTValue]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/UDTValue.html +[TupleType]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TupleType.html +[TupleValue]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TupleValue.html +[CustomType]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/DataType.CustomType.html [TypeToken]: https://google.github.io/guava/releases/19.0/api/docs/com/google/common/reflect/TypeToken.html -[SimpleStatement]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SimpleStatement.html -[BuiltStatement]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/querybuilder/BuiltStatement.html -[setList]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SettableByIndexData.html#setList-int-java.util.List- -[setSet]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SettableByIndexData.html#setSet-int-java.util.Set- -[setMap]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SettableByIndexData.html#setMap-int-java.util.Map- +[SimpleStatement]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SimpleStatement.html +[BuiltStatement]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/querybuilder/BuiltStatement.html +[setList]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SettableByIndexData.html#setList-int-java.util.List- +[setSet]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SettableByIndexData.html#setSet-int-java.util.Set- +[setMap]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SettableByIndexData.html#setMap-int-java.util.Map- diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index 25c7a606920..9e253aa60e3 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -10,7 +10,7 @@ The module is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-extras - 3.10.0 + 3.11.0 ``` @@ -73,12 +73,12 @@ session.execute("INSERT INTO example (id, t) VALUES (1, ?)", ZoneId.of("GMT+07:00")); ``` -[InstantCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/jdk8/InstantCodec.html -[LocalDateCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.html -[LocalDateTimeCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/jdk8/LocalDateTimeCodec.html -[LocalTimeCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.html -[ZonedDateTimeCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.html -[ZoneIdCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/jdk8/ZoneIdCodec.html +[InstantCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/jdk8/InstantCodec.html +[LocalDateCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.html +[LocalDateTimeCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/jdk8/LocalDateTimeCodec.html +[LocalTimeCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.html +[ZonedDateTimeCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.html +[ZoneIdCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/jdk8/ZoneIdCodec.html [Instant]: https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html [LocalDate]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html [LocalDateTime]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html @@ -130,10 +130,10 @@ session.execute("INSERT INTO example (id, t) VALUES (1, ?)", DateTime.parse("2010-06-30T01:20:47.999+01:00")); ``` -[InstantCodec_joda]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/joda/InstantCodec.html -[LocalDateCodec_joda]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/joda/LocalDateCodec.html -[LocalTimeCodec_joda]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.html -[DateTimeCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/joda/DateTimeCodec.html +[InstantCodec_joda]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/joda/InstantCodec.html +[LocalDateCodec_joda]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/joda/LocalDateCodec.html +[LocalTimeCodec_joda]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.html +[DateTimeCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/joda/DateTimeCodec.html [DateTime]: http://www.joda.org/joda-time/apidocs/org/joda/time/DateTime.html [Instant_joda]: http://www.joda.org/joda-time/apidocs/org/joda/time/Instant.html [LocalDate_joda]: http://www.joda.org/joda-time/apidocs/org/joda/time/LocalDate.html @@ -151,8 +151,8 @@ Time can also be expressed as simple durations: There is no extra codec for `time`, because by default the driver already maps that type to a `long` representing the number of nanoseconds since midnight. -[SimpleTimestampCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.html -[SimpleDateCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/date/SimpleDateCodec.html +[SimpleTimestampCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.html +[SimpleDateCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/date/SimpleDateCodec.html ### Enums @@ -190,8 +190,8 @@ Note that if you registered an `EnumNameCodec` and an `EnumOrdinalCodec` _for th In practice, this is unlikely to happen, because you'll probably stick to a single CQL type for a given enum type; however, if you ever run into that issue, the workaround is to use [prepared statements](../../statements/prepared/), for which the driver knows the CQL type and can pick the exact codec. -[EnumNameCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/enums/EnumNameCodec.html -[EnumOrdinalCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.html +[EnumNameCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/enums/EnumNameCodec.html +[EnumOrdinalCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.html [name]: https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name-- [ordinal]: https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal-- @@ -236,7 +236,7 @@ session.execute("insert into example (id, owner) values (1, ?)", // owner saved as '{"id":1,"name":"root"}' ``` -[JacksonJsonCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.html +[JacksonJsonCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.html [Jackson]: https://github.com/FasterXML/jackson @@ -275,7 +275,7 @@ session.execute("insert into example (id, owner) values (1, ?)", ``` -[Jsr353JsonCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.html +[Jsr353JsonCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.html [JsonStructure]: https://docs.oracle.com/javaee/7/tutorial/jsonp002.htm @@ -328,7 +328,7 @@ For the same reason, we need to give a type hint when setting "v", in the form o anonymous inner class; we recommend storing these tokens as constants in a utility class, to avoid creating them too often. -[OptionalCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.html +[OptionalCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.html [Optional]: https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html [TypeToken]: http://google.github.io/guava/releases/19.0/api/docs/com/google/common/reflect/TypeToken.html @@ -372,7 +372,7 @@ session.execute(pst.bind() See the JDK8 Optional section above for explanations about [TypeToken]. -[OptionalCodec_guava]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/guava/OptionalCodec.html +[OptionalCodec_guava]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/guava/OptionalCodec.html [Optional_guava]: http://google.github.io/guava/releases/19.0/api/docs/com/google/common/base/Optional.html @@ -397,9 +397,9 @@ session.execute("insert into example (i, l) values (1, ?)", Package [com.datastax.driver.extras.codecs.arrays][arrays] contains similar codecs for all primitive types, and [ObjectArrayCodec] to map arrays of objects. -[IntArrayCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.html -[ObjectArrayCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.html -[arrays]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/arrays/package-summary.html +[IntArrayCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.html +[ObjectArrayCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.html +[arrays]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/arrays/package-summary.html ### Abstract utilities @@ -429,5 +429,5 @@ These two classes are convenient, but since they perform conversions in two step optimal approach. If performance is paramount, it's better to start from scratch and convert your objects to `ByteBuffer` directly. -[MappingCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/MappingCodec.html -[ParsingCodec]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/extras/codecs/ParsingCodec.html +[MappingCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/MappingCodec.html +[ParsingCodec]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/extras/codecs/ParsingCodec.html diff --git a/manual/custom_payloads/README.md b/manual/custom_payloads/README.md index a31cee5161b..7a4e726b9cd 100644 --- a/manual/custom_payloads/README.md +++ b/manual/custom_payloads/README.md @@ -241,8 +241,8 @@ The log message contains a pretty-printed version of the payload itself, and its [CASSANDRA-8553]: https://issues.apache.org/jira/browse/CASSANDRA-8553 [v4spec]: https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec [qh]: https://issues.apache.org/jira/browse/CASSANDRA-6659 -[nhae]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[nhae]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/NoHostAvailableException.html [chm]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html [immutablemap]: http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/ImmutableMap.html -[ufe]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/UnsupportedFeatureException.html +[ufe]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/UnsupportedFeatureException.html diff --git a/manual/idempotence/README.md b/manual/idempotence/README.md index 71246748735..6894d5e889a 100644 --- a/manual/idempotence/README.md +++ b/manual/idempotence/README.md @@ -125,8 +125,8 @@ broke linearizability by doing a transparent retry at step 6. If linearizability is important for you, you should ensure that lightweight transactions are appropriately flagged as not idempotent. -[isIdempotent]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Statement.html#isIdempotent-- -[setDefaultIdempotence]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/QueryOptions.html#setDefaultIdempotence-boolean- -[QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/querybuilder/QueryBuilder.html +[isIdempotent]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Statement.html#isIdempotent-- +[setDefaultIdempotence]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/QueryOptions.html#setDefaultIdempotence-boolean- +[QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/querybuilder/QueryBuilder.html [linearizability]: https://en.wikipedia.org/wiki/Linearizability#Definition_of_linearizability \ No newline at end of file diff --git a/manual/load_balancing/README.md b/manual/load_balancing/README.md index dad615adeb8..4568c8025b5 100644 --- a/manual/load_balancing/README.md +++ b/manual/load_balancing/README.md @@ -277,11 +277,11 @@ For any host, the distance returned by the policy is always the same as its chil Query plans are based on the child policy's, except that hosts that are currently excluded for being too slow are moved to the end of the plan. -[withExclusionThreshold]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withExclusionThreshold-double- -[withMininumMeasurements]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withMininumMeasurements-int- -[withRetryPeriod]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withRetryPeriod-long-java.util.concurrent.TimeUnit- -[withScale]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withScale-long-java.util.concurrent.TimeUnit- -[withUpdateRate]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withUpdateRate-long-java.util.concurrent.TimeUnit- +[withExclusionThreshold]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withExclusionThreshold-double- +[withMininumMeasurements]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withMininumMeasurements-int- +[withRetryPeriod]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withRetryPeriod-long-java.util.concurrent.TimeUnit- +[withScale]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withScale-long-java.util.concurrent.TimeUnit- +[withUpdateRate]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withUpdateRate-long-java.util.concurrent.TimeUnit- ### Filtering policies @@ -299,15 +299,15 @@ studying the existing implementations first: `RoundRobinPolicy` is a good place complex ones like `DCAwareRoundRobinPolicy`. -[LoadBalancingPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LoadBalancingPolicy.html -[RoundRobinPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RoundRobinPolicy.html -[DCAwareRoundRobinPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.html -[TokenAwarePolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/TokenAwarePolicy.html -[LatencyAwarePolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LatencyAwarePolicy.html -[HostFilterPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/HostFilterPolicy.html -[WhiteListPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/WhiteListPolicy.html -[HostDistance]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/HostDistance.html -[refreshConnectedHosts]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PoolingOptions.html#refreshConnectedHosts-- -[setMetadataEnabled]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/QueryOptions.html#setMetadataEnabled-boolean- -[Statement#getKeyspace]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Statement.html#getKeyspace-- -[Statement#getRoutingKey]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Statement.html#getRoutingKey-- +[LoadBalancingPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/LoadBalancingPolicy.html +[RoundRobinPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/RoundRobinPolicy.html +[DCAwareRoundRobinPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.html +[TokenAwarePolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/TokenAwarePolicy.html +[LatencyAwarePolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/LatencyAwarePolicy.html +[HostFilterPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/HostFilterPolicy.html +[WhiteListPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/WhiteListPolicy.html +[HostDistance]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/HostDistance.html +[refreshConnectedHosts]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/PoolingOptions.html#refreshConnectedHosts-- +[setMetadataEnabled]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/QueryOptions.html#setMetadataEnabled-boolean- +[Statement#getKeyspace]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Statement.html#getKeyspace-- +[Statement#getRoutingKey]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Statement.html#getRoutingKey-- diff --git a/manual/logging/README.md b/manual/logging/README.md index d68f0c2d45c..a421be520ad 100644 --- a/manual/logging/README.md +++ b/manual/logging/README.md @@ -208,12 +208,12 @@ Aggregation query used without partition key ``` These -[query warnings](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) +[query warnings](https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) are available programmatically from the -[ExecutionInfo](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ExecutionInfo.html) +[ExecutionInfo](https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ExecutionInfo.html) via -[ResultSet](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ResultSet.html)'s -[getExecutionInfo()](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PagingIterable.html#getExecutionInfo--) +[ResultSet](https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ResultSet.html)'s +[getExecutionInfo()](https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/PagingIterable.html#getExecutionInfo--) method. They are also logged by the driver: ``` @@ -340,4 +340,4 @@ It also turns on slow query tracing as described above. ``` -[query_logger]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/QueryLogger.html +[query_logger]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/QueryLogger.html diff --git a/manual/metadata/README.md b/manual/metadata/README.md index fd65ed90e4e..93dc169d9b4 100644 --- a/manual/metadata/README.md +++ b/manual/metadata/README.md @@ -4,7 +4,7 @@ The driver maintains global information about the Cassandra cluster it is connected to. It is available via [Cluster#getMetadata()][getMetadata]. -[getMetadata]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.html#getMetadata-- +[getMetadata]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.html#getMetadata-- ### Schema metadata @@ -12,8 +12,8 @@ Use [getKeyspace(String)][getKeyspace] or [getKeyspaces()][getKeyspaces] to get keyspace-level metadata. From there you can access the keyspace's objects (tables, and UDTs and UDFs if relevant). -[getKeyspace]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#getKeyspace-java.lang.String- -[getKeyspaces]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#getKeyspaces-- +[getKeyspace]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Metadata.html#getKeyspace-java.lang.String- +[getKeyspaces]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Metadata.html#getKeyspaces-- #### Refreshes @@ -47,8 +47,8 @@ Note that it is preferable to register a listener only *after* the cluster is fu otherwise the listener could be notified with a great deal of "Added" events as the driver builds the schema metadata from scratch for the first time. -[SchemaChangeListener]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SchemaChangeListener.html -[registerListener]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.html#register-com.datastax.driver.core.SchemaChangeListener- +[SchemaChangeListener]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SchemaChangeListener.html +[registerListener]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.html#register-com.datastax.driver.core.SchemaChangeListener- #### Schema agreement @@ -135,9 +135,9 @@ custom executor). Check out the API docs for the features in this section: -* [withMaxSchemaAgreementWaitSeconds(int)](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withMaxSchemaAgreementWaitSeconds-int-) -* [isSchemaInAgreement()](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ExecutionInfo.html#isSchemaInAgreement--) -* [checkSchemaAgreement()](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#checkSchemaAgreement--) +* [withMaxSchemaAgreementWaitSeconds(int)](https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.Builder.html#withMaxSchemaAgreementWaitSeconds-int-) +* [isSchemaInAgreement()](https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ExecutionInfo.html#isSchemaInAgreement--) +* [checkSchemaAgreement()](https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Metadata.html#checkSchemaAgreement--) ### Token metadata @@ -181,14 +181,14 @@ Starting with Cassandra 2.1.5, this information is available in a system table (see [CASSANDRA-7688](https://issues.apache.org/jira/browse/CASSANDRA-7688)). -[metadata]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html -[getTokenRanges]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#getTokenRanges-- -[getTokenRanges2]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#getTokenRanges-java.lang.String-com.datastax.driver.core.Host- -[getReplicas]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#getReplicas-java.lang.String-com.datastax.driver.core.TokenRange- -[newToken]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#newToken-java.lang.String- -[newTokenRange]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metadata.html#newTokenRange-com.datastax.driver.core.Token-com.datastax.driver.core.Token- -[TokenRange]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TokenRange.html -[getTokens]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Host.html#getTokens-- -[setToken]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/BoundStatement.html#setToken-int-com.datastax.driver.core.Token- -[getToken]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Row.html#getToken-int- -[getPKToken]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Row.html#getPartitionKeyToken-- +[metadata]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Metadata.html +[getTokenRanges]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Metadata.html#getTokenRanges-- +[getTokenRanges2]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Metadata.html#getTokenRanges-java.lang.String-com.datastax.driver.core.Host- +[getReplicas]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Metadata.html#getReplicas-java.lang.String-com.datastax.driver.core.TokenRange- +[newToken]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Metadata.html#newToken-java.lang.String- +[newTokenRange]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Metadata.html#newTokenRange-com.datastax.driver.core.Token-com.datastax.driver.core.Token- +[TokenRange]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TokenRange.html +[getTokens]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Host.html#getTokens-- +[setToken]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/BoundStatement.html#setToken-int-com.datastax.driver.core.Token- +[getToken]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Row.html#getToken-int- +[getPKToken]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Row.html#getPartitionKeyToken-- diff --git a/manual/metrics/README.md b/manual/metrics/README.md index 4f1d376d275..e751bcf5bcf 100644 --- a/manual/metrics/README.md +++ b/manual/metrics/README.md @@ -38,7 +38,7 @@ To do this in a maven project: com.datastax.cassandra cassandra-driver-core - 3.10.0 + 3.11.0 io.dropwizard.metrics @@ -146,8 +146,8 @@ reporter.start(); [Reporters]: http://metrics.dropwizard.io/3.2.2/manual/core.html#reporters [MetricRegistry]: http://metrics.dropwizard.io/3.2.2/apidocs/com/codahale/metrics/MetricRegistry.html [MXBeans]: https://docs.oracle.com/javase/tutorial/jmx/mbeans/mxbeans.html -[withClusterName]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withClusterName-java.lang.String- -[withoutMetrics]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- -[withoutJMXReporting]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withoutJMXReporting-- -[getMetrics]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.html#getMetrics-- -[Metrics]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metrics.html +[withClusterName]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.Builder.html#withClusterName-java.lang.String- +[withoutMetrics]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics-- +[withoutJMXReporting]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.Builder.html#withoutJMXReporting-- +[getMetrics]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.html#getMetrics-- +[Metrics]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Metrics.html diff --git a/manual/native_protocol/README.md b/manual/native_protocol/README.md index e07ff9fe8bd..2a99eb73704 100644 --- a/manual/native_protocol/README.md +++ b/manual/native_protocol/README.md @@ -64,7 +64,7 @@ All host(s) tried for query failed [/127.0.0.1:9042] Host /127.0.0.1:9042 does not support protocol version V3 but V2)) ``` -[gpv]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- +[gpv]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- #### Protocol version with mixed clusters @@ -95,19 +95,19 @@ To avoid this issue, you can use one the following workarounds: #### v1 to v2 * bound variables in simple statements - ([Session#execute(String, Object...)](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html#execute-java.lang.String-java.lang.Object...-)) -* [batch statements](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/BatchStatement.html) + ([Session#execute(String, Object...)](https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Session.html#execute-java.lang.String-java.lang.Object...-)) +* [batch statements](https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/BatchStatement.html) * [query paging](../paging/) #### v2 to v3 * the number of stream ids per connection goes from 128 to 32768 (see [Connection pooling](../pooling/)) -* [serial consistency on batch statements](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/BatchStatement.html#setSerialConsistencyLevel-com.datastax.driver.core.ConsistencyLevel-) +* [serial consistency on batch statements](https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/BatchStatement.html#setSerialConsistencyLevel-com.datastax.driver.core.ConsistencyLevel-) * [client-side timestamps](../query_timestamps/) #### v3 to v4 -* [query warnings](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) +* [query warnings](https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ExecutionInfo.html#getWarnings--) * allowed unset values in bound statements * [Custom payloads](../custom_payloads/) diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md index 617c324b304..4884383b8d6 100644 --- a/manual/object_mapper/README.md +++ b/manual/object_mapper/README.md @@ -11,7 +11,7 @@ The mapper is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-mapping - 3.10.0 + 3.11.0 ``` diff --git a/manual/object_mapper/creating/README.md b/manual/object_mapper/creating/README.md index dbd5fc5b826..c91b2a9c92e 100644 --- a/manual/object_mapper/creating/README.md +++ b/manual/object_mapper/creating/README.md @@ -149,9 +149,9 @@ User user = new User() .setName("John Doe"); ``` -[table]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Table.html +[table]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/Table.html [case-sensitive]:http://docs.datastax.com/en/cql/3.3/cql/cql_reference/ucase-lcase_r.html -[consistency level]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ConsistencyLevel.html +[consistency level]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ConsistencyLevel.html [java-beans]:https://docs.oracle.com/javase/tutorial/javabeans/writing/properties.html [set-accessible]:https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/AccessibleObject.html#setAccessible-boolean- @@ -189,7 +189,7 @@ CREATE TABLE users(id uuid PRIMARY KEY, "userName" text); private String userName; ``` -[column]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Column.html +[column]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/Column.html #### Primary key fields @@ -213,8 +213,8 @@ private String areaCode; The order of the indices must match that of the columns in the table declaration. -[pk]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/PartitionKey.html -[cc]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/ClusteringColumn.html +[pk]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/PartitionKey.html +[cc]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/ClusteringColumn.html [pks]:http://thelastpickle.com/blog/2013/01/11/primary-keys-in-cql.html #### Computed fields @@ -250,7 +250,7 @@ version (see [JAVA-832](https://datastax-oss.atlassian.net/browse/JAVA-832)). [User Defined Functions]:http://www.planetcassandra.org/blog/user-defined-functions-in-cassandra-3-0/ -[computed]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Computed.html +[computed]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/Computed.html #### Transient properties @@ -259,7 +259,7 @@ to table columns. [@Transient][transient] can be used to prevent a field or a Java bean property from being mapped. Like other column-level annotations, it should be placed on either the field declaration or the property getter method. -[transient]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Transient.html +[transient]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/Transient.html ### Mapping User Types @@ -322,8 +322,8 @@ This also works with UDTs inside collections or other UDTs, with any arbitrary nesting level. [User Defined Types]: ../../udts/ -[udt]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/UDT.html -[field]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Field.html +[udt]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/UDT.html +[field]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/Field.html ### Mapping collections @@ -381,10 +381,10 @@ to figure out how to appropriately handle UDT conversion, i.e.: mappingManager.udtCodec(Address.class); ``` -[frozen]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Frozen.html -[frozenkey]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/FrozenKey.html -[frozenvalue]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/FrozenValue.html -[udtCodec]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/MappingManager.html#udtCodec-java.lang.Class- +[frozen]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/Frozen.html +[frozenkey]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/FrozenKey.html +[frozenvalue]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/FrozenValue.html +[udtCodec]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/MappingManager.html#udtCodec-java.lang.Class- #### Prefer Frozen Collections diff --git a/manual/object_mapper/custom_codecs/README.md b/manual/object_mapper/custom_codecs/README.md index c68f59ba67f..821e1f619e4 100644 --- a/manual/object_mapper/custom_codecs/README.md +++ b/manual/object_mapper/custom_codecs/README.md @@ -98,9 +98,9 @@ instance (one per column) and cache it for future use. This also works with [@Field][field] and [@Param][param] annotations. -[column]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Column.html -[field]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Field.html -[param]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Param.html +[column]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/Column.html +[field]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/Field.html +[param]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/Param.html ## Implicit UDT codecs diff --git a/manual/object_mapper/using/README.md b/manual/object_mapper/using/README.md index f6367ecf203..4587f983d77 100644 --- a/manual/object_mapper/using/README.md +++ b/manual/object_mapper/using/README.md @@ -28,9 +28,9 @@ Mapper mapper = manager.mapper(User.class); calling `manager#mapper` more than once for the same class will return the previously generated mapper. -[Mapper]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/Mapper.html -[MappingManager]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/MappingManager.html -[Session]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html +[Mapper]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/Mapper.html +[MappingManager]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/MappingManager.html +[Session]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Session.html #### Basic CRUD operations @@ -179,7 +179,7 @@ It provides methods `one()`, `all()`, `iterator()`, `getExecutionInfo()` and `isExhausted()`. Note that iterating the `Result` will consume the `ResultSet`, and vice-versa. -[Result]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/Result.html +[Result]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/Result.html ### Accessors @@ -229,7 +229,7 @@ corresponds to which marker: ResultSet insert(@Param("u") UUID userId, @Param("n") String name); ``` -[param]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/Param.html +[param]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/Param.html If a method argument is a Java enumeration, it must be annotated with `@Enumerated` to indicate how to convert it to a CQL type (the rules are @@ -301,7 +301,7 @@ query with the annotation [@QueryParameters]. Then, options like public ListenableFuture> getAllAsync(); ``` -[@QueryParameters]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/annotations/QueryParameters.html +[@QueryParameters]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/annotations/QueryParameters.html ### Mapping configuration @@ -345,6 +345,6 @@ PropertyMapper propertyMapper = new DefaultPropertyMapper() There is more to `DefaultPropertyMapper`; see the Javadocs and implementation for details. -[MappingConfiguration]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/MappingConfiguration.html -[PropertyMapper]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/PropertyMapper.html -[DefaultPropertyMapper]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/mapping/DefaultPropertyMapper.html +[MappingConfiguration]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/MappingConfiguration.html +[PropertyMapper]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/PropertyMapper.html +[DefaultPropertyMapper]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/mapping/DefaultPropertyMapper.html diff --git a/manual/paging/README.md b/manual/paging/README.md index d3628cbfaa8..15343d3c7f0 100644 --- a/manual/paging/README.md +++ b/manual/paging/README.md @@ -176,8 +176,8 @@ if (nextPage != null) { } ``` -[result_set]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ResultSet.html -[paging_state]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PagingState.html +[result_set]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ResultSet.html +[paging_state]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/PagingState.html Due to internal implementation details, `PagingState` instances are not @@ -239,8 +239,8 @@ There are two situations where you might want to use the unsafe API: implementing your own validation logic (for example, signing the raw state with a private key). -[gpsu]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ExecutionInfo.html#getPagingStateUnsafe-- -[spsu]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Statement.html#setPagingStateUnsafe-byte:A- +[gpsu]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ExecutionInfo.html#getPagingStateUnsafe-- +[spsu]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Statement.html#setPagingStateUnsafe-byte:A- ### Offset queries diff --git a/manual/pooling/README.md b/manual/pooling/README.md index ab13653b481..3b2e8b0218b 100644 --- a/manual/pooling/README.md +++ b/manual/pooling/README.md @@ -285,16 +285,16 @@ either: [newConnectionThreshold][nct] so that enough connections are added by the time you reach the bottleneck. -[result_set_future]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ResultSetFuture.html -[pooling_options]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PoolingOptions.html -[lbp]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LoadBalancingPolicy.html -[nct]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PoolingOptions.html#setNewConnectionThreshold-com.datastax.driver.core.HostDistance-int- -[mrpc]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PoolingOptions.html#setMaxRequestsPerConnection-com.datastax.driver.core.HostDistance-int- -[sits]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PoolingOptions.html#setIdleTimeoutSeconds-int- -[rtm]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#getReadTimeoutMillis-- -[smqs]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PoolingOptions.html#setMaxQueueSize-int- -[sptm]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PoolingOptions.html#setPoolTimeoutMillis-int- -[nhae]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/NoHostAvailableException.html -[getErrors]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- -[get_state]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html#getState-- -[BusyPoolException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/BusyPoolException.html +[result_set_future]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ResultSetFuture.html +[pooling_options]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/PoolingOptions.html +[lbp]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/LoadBalancingPolicy.html +[nct]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/PoolingOptions.html#setNewConnectionThreshold-com.datastax.driver.core.HostDistance-int- +[mrpc]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/PoolingOptions.html#setMaxRequestsPerConnection-com.datastax.driver.core.HostDistance-int- +[sits]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/PoolingOptions.html#setIdleTimeoutSeconds-int- +[rtm]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SocketOptions.html#getReadTimeoutMillis-- +[smqs]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/PoolingOptions.html#setMaxQueueSize-int- +[sptm]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/PoolingOptions.html#setPoolTimeoutMillis-int- +[nhae]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[getErrors]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- +[get_state]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Session.html#getState-- +[BusyPoolException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/BusyPoolException.html diff --git a/manual/query_timestamps/README.md b/manual/query_timestamps/README.md index 20f4e9c6a47..fb24690ad95 100644 --- a/manual/query_timestamps/README.md +++ b/manual/query_timestamps/README.md @@ -140,10 +140,10 @@ following: Steps 2 and 3 only apply if native protocol v3 or above is in use. -[TimestampGenerator]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TimestampGenerator.html -[AtomicMonotonicTimestampGenerator]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.html -[ThreadLocalMonotonicTimestampGenerator]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.html -[ServerSideTimestampGenerator]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ServerSideTimestampGenerator.html +[TimestampGenerator]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TimestampGenerator.html +[AtomicMonotonicTimestampGenerator]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.html +[ThreadLocalMonotonicTimestampGenerator]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.html +[ServerSideTimestampGenerator]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ServerSideTimestampGenerator.html [gettimeofday]: http://man7.org/linux/man-pages/man2/settimeofday.2.html [JNR]: https://github.com/jnr/jnr-ffi diff --git a/manual/reconnection/README.md b/manual/reconnection/README.md index f99be3ef99f..a3a4733f0b4 100644 --- a/manual/reconnection/README.md +++ b/manual/reconnection/README.md @@ -29,7 +29,7 @@ You can also write your own policy; it must implement [ReconnectionPolicy]. For best results, use reasonable values: very low values (for example a constant delay of 10 milliseconds) will quickly saturate your system. -[ReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/ReconnectionPolicy.html -[Cluster.Builder.withReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Cluster.Builder.html#withReconnectionPolicy-com.datastax.driver.core.policies.ReconnectionPolicy- -[ExponentialReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.html -[ConstantReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/ConstantReconnectionPolicy.html +[ReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/ReconnectionPolicy.html +[Cluster.Builder.withReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.Builder.html#withReconnectionPolicy-com.datastax.driver.core.policies.ReconnectionPolicy- +[ExponentialReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.html +[ConstantReconnectionPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/ConstantReconnectionPolicy.html diff --git a/manual/retries/README.md b/manual/retries/README.md index 231707022c9..1770cd71cf9 100644 --- a/manual/retries/README.md +++ b/manual/retries/README.md @@ -146,33 +146,33 @@ implementations to handle idempotence (the new behavior is equivalent to what yo `IdempotenceAwareRetryPolicy` before). -[RetryDecision]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html -[retry()]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#retry-com.datastax.driver.core.ConsistencyLevel- -[tryNextHost()]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#tryNextHost-com.datastax.driver.core.ConsistencyLevel- -[rethrow()]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#rethrow-- -[ignore()]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#ignore-- -[NoHostAvailableException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/NoHostAvailableException.html -[getErrors()]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- -[RetryPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.html -[DefaultRetryPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/DefaultRetryPolicy.html -[onReadTimeout]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- -[onWriteTimeout]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onWriteTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.WriteType-int-int-int- -[onUnavailable]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onUnavailable-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-int- -[onRequestError]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- -[UnavailableException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/UnavailableException.html -[ReadTimeoutException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/ReadTimeoutException.html -[WriteTimeoutException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/WriteTimeoutException.html -[OverloadedException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/OverloadedException.html -[ServerError]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/ServerError.html -[OperationTimedOutException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/OperationTimedOutException.html -[ConnectionException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/ConnectionException.html -[QueryValidationException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/QueryValidationException.html -[InvalidQueryException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/InvalidQueryException.html -[InvalidConfigurationInQueryException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.html -[UnauthorizedException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/UnauthorizedException.html -[SyntaxError]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/SyntaxError.html -[AlreadyExistsException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/AlreadyExistsException.html -[TruncateException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/TruncateException.html +[RetryDecision]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html +[retry()]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#retry-com.datastax.driver.core.ConsistencyLevel- +[tryNextHost()]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#tryNextHost-com.datastax.driver.core.ConsistencyLevel- +[rethrow()]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#rethrow-- +[ignore()]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#ignore-- +[NoHostAvailableException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/NoHostAvailableException.html +[getErrors()]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors-- +[RetryPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/RetryPolicy.html +[DefaultRetryPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/DefaultRetryPolicy.html +[onReadTimeout]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- +[onWriteTimeout]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onWriteTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.WriteType-int-int-int- +[onUnavailable]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onUnavailable-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-int- +[onRequestError]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- +[UnavailableException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/UnavailableException.html +[ReadTimeoutException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/ReadTimeoutException.html +[WriteTimeoutException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/WriteTimeoutException.html +[OverloadedException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/OverloadedException.html +[ServerError]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/ServerError.html +[OperationTimedOutException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/OperationTimedOutException.html +[ConnectionException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/ConnectionException.html +[QueryValidationException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/QueryValidationException.html +[InvalidQueryException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/InvalidQueryException.html +[InvalidConfigurationInQueryException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.html +[UnauthorizedException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/UnauthorizedException.html +[SyntaxError]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/SyntaxError.html +[AlreadyExistsException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/AlreadyExistsException.html +[TruncateException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/TruncateException.html [query plan]: ../load_balancing/#query-plan [connection pool]: ../pooling/ diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md index 4346bc7dbfb..91ae8f440b8 100644 --- a/manual/shaded_jar/README.md +++ b/manual/shaded_jar/README.md @@ -12,7 +12,7 @@ package name: com.datastax.cassandra cassandra-driver-core - 3.10.0 + 3.11.0 shaded @@ -32,7 +32,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-core - 3.10.0 + 3.11.0 shaded @@ -44,7 +44,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-mapping - 3.10.0 + 3.11.0 com.datastax.cassandra @@ -74,5 +74,5 @@ detects that shaded Netty classes are being used: Detected shaded Netty classes in the classpath; native epoll transport will not work properly, defaulting to NIO. -[NettyOptions]:https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/NettyOptions.html +[NettyOptions]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/NettyOptions.html [Netty native transports]:http://netty.io/wiki/native-transports.html diff --git a/manual/socket_options/README.md b/manual/socket_options/README.md index 3edd9a74718..4b79fd684dc 100644 --- a/manual/socket_options/README.md +++ b/manual/socket_options/README.md @@ -117,15 +117,15 @@ To clarify: We might rename `SocketOptions.setReadTimeoutMillis` in a future version to clear up any confusion. -[SocketOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html -[setReadTimeoutMillis]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setReadTimeoutMillis-int- -[setConnectTimeoutMillis]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setConnectTimeoutMillis-int- -[setKeepAlive]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setKeepAlive-boolean- -[setReceiveBufferSize]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setReceiveBufferSize-int- -[setReuseAddress]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setReuseAddress-boolean- -[setSendBufferSize]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setSendBufferSize-int- -[setSoLinger]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setSoLinger-int- -[setTcpNoDelay]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SocketOptions.html#setTcpNoDelay-boolean- -[onReadTimeout]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- -[onRequestError]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- -[OperationTimedOutException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/OperationTimedOutException.html \ No newline at end of file +[SocketOptions]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SocketOptions.html +[setReadTimeoutMillis]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SocketOptions.html#setReadTimeoutMillis-int- +[setConnectTimeoutMillis]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SocketOptions.html#setConnectTimeoutMillis-int- +[setKeepAlive]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SocketOptions.html#setKeepAlive-boolean- +[setReceiveBufferSize]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SocketOptions.html#setReceiveBufferSize-int- +[setReuseAddress]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SocketOptions.html#setReuseAddress-boolean- +[setSendBufferSize]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SocketOptions.html#setSendBufferSize-int- +[setSoLinger]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SocketOptions.html#setSoLinger-int- +[setTcpNoDelay]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SocketOptions.html#setTcpNoDelay-boolean- +[onReadTimeout]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/RetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- +[onRequestError]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/RetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- +[OperationTimedOutException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/OperationTimedOutException.html \ No newline at end of file diff --git a/manual/speculative_execution/README.md b/manual/speculative_execution/README.md index 3ef65f60242..7a1fe5b4007 100644 --- a/manual/speculative_execution/README.md +++ b/manual/speculative_execution/README.md @@ -73,7 +73,7 @@ Speculative executions are controlled by an instance of `Cluster`. This policy defines the threshold after which a new speculative execution will be triggered. -[SpeculativeExecutionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html +[SpeculativeExecutionPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html Two implementations are provided with the driver: @@ -101,7 +101,7 @@ way: * if no response has been received at t0 + 1000 milliseconds, start another speculative execution on a third node. -[ConstantSpeculativeExecutionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/ConstantSpeculativeExecutionPolicy.html +[ConstantSpeculativeExecutionPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/ConstantSpeculativeExecutionPolicy.html #### [PercentileSpeculativeExecutionPolicy] @@ -160,10 +160,10 @@ Note that `PercentileTracker` may also be used with a slow query logger (see the [Logging](../logging/) section). In that case, you would create a single tracker object and share it with both components. -[PercentileSpeculativeExecutionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/PercentileSpeculativeExecutionPolicy.html -[PercentileTracker]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PercentileTracker.html -[ClusterWidePercentileTracker]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ClusterWidePercentileTracker.html -[PerHostPercentileTracker]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PerHostPercentileTracker.html +[PercentileSpeculativeExecutionPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/PercentileSpeculativeExecutionPolicy.html +[PercentileTracker]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/PercentileTracker.html +[ClusterWidePercentileTracker]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ClusterWidePercentileTracker.html +[PerHostPercentileTracker]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/PerHostPercentileTracker.html [hdr]: http://hdrhistogram.github.io/HdrHistogram/ #### Using your own @@ -210,7 +210,7 @@ client driver exec1 exec2 The only impact is that all executions of the same query always share the same query plan, so each host will be used by at most one execution. -[retry_policy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.html +[retry_policy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/RetryPolicy.html ### Tuning and practical details @@ -225,8 +225,8 @@ You can monitor how many speculative executions were triggered with the It should only be a few percents of the total number of requests ([cluster.getMetrics().getRequestsTimer().getCount()][request_metric]). -[se_metric]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metrics.Errors.html#getSpeculativeExecutions-- -[request_metric]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Metrics.html#getRequestsTimer-- +[se_metric]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Metrics.Errors.html#getSpeculativeExecutions-- +[request_metric]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Metrics.html#getRequestsTimer-- #### Stream id exhaustion @@ -255,8 +255,8 @@ sustained. If you're unsure of which native protocol version you're using, you can check with [cluster.getConfiguration().getProtocolOptions().getProtocolVersion()][protocol_version]. -[session_state]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.State.html -[protocol_version]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- +[session_state]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Session.State.html +[protocol_version]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion-- #### Request ordering and client timestamps diff --git a/manual/ssl/README.md b/manual/ssl/README.md index 9fb628bacd5..47dbd5f9863 100644 --- a/manual/ssl/README.md +++ b/manual/ssl/README.md @@ -207,8 +207,8 @@ Cluster cluster = Cluster.builder() .build(); ``` -[RemoteEndpointAwareSSLOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.html -[RemoteEndpointAwareJdkSSLOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html -[newSSLEngine]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html#newSSLEngine-io.netty.channel.socket.SocketChannel-java.net.InetSocketAddress- -[RemoteEndpointAwareNettySSLOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.html -[NettyOptions]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/NettyOptions.html +[RemoteEndpointAwareSSLOptions]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.html +[RemoteEndpointAwareJdkSSLOptions]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html +[newSSLEngine]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html#newSSLEngine-io.netty.channel.socket.SocketChannel-java.net.InetSocketAddress- +[RemoteEndpointAwareNettySSLOptions]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.html +[NettyOptions]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/NettyOptions.html diff --git a/manual/statements/README.md b/manual/statements/README.md index 865818796d0..18164778039 100644 --- a/manual/statements/README.md +++ b/manual/statements/README.md @@ -32,11 +32,11 @@ If you use custom policies ([RetryPolicy], [LoadBalancingPolicy], properties that influence statement execution. To achieve this, you can wrap your statements in a custom [StatementWrapper] implementation. -[Statement]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Statement.html -[QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/querybuilder/QueryBuilder.html -[StatementWrapper]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/StatementWrapper.html -[RetryPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/RetryPolicy.html -[LoadBalancingPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/LoadBalancingPolicy.html -[SpeculativeExecutionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html -[execute]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- -[executeAsync]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- +[Statement]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Statement.html +[QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/querybuilder/QueryBuilder.html +[StatementWrapper]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/StatementWrapper.html +[RetryPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/RetryPolicy.html +[LoadBalancingPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/LoadBalancingPolicy.html +[SpeculativeExecutionPolicy]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html +[execute]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- +[executeAsync]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- diff --git a/manual/statements/batch/README.md b/manual/statements/batch/README.md index e6db824424a..d54d79589d0 100644 --- a/manual/statements/batch/README.md +++ b/manual/statements/batch/README.md @@ -34,9 +34,9 @@ In addition, simple statements with named parameters are currently not supported due to a [protocol limitation][CASSANDRA-10246] that will be fixed in a future version). If you try to execute such a batch, an `IllegalArgumentException` is thrown. -[BatchStatement]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/BatchStatement.html +[BatchStatement]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/BatchStatement.html [batch_dse]: http://docs.datastax.com/en/dse/5.1/cql/cql/cql_using/useBatch.html -[LOGGED]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/BatchStatement.Type.html#LOGGED -[UNLOGGED]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/BatchStatement.Type.html#UNLOGGED +[LOGGED]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/BatchStatement.Type.html#LOGGED +[UNLOGGED]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/BatchStatement.Type.html#UNLOGGED [batch_size_fail_threshold]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html#configCassandra_yaml__batch_size_fail_threshold_in_kb [CASSANDRA-10246]: https://issues.apache.org/jira/browse/CASSANDRA-10246 diff --git a/manual/statements/built/README.md b/manual/statements/built/README.md index d54f6e30faa..eb1a51cb5cb 100644 --- a/manual/statements/built/README.md +++ b/manual/statements/built/README.md @@ -76,7 +76,7 @@ BuiltStatement ttlAndWriteTime = QueryBuilder.select().column("id").column("t") ``` You can also cast the value of the given column to another type by using the `cast` function, -[specifying](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/querybuilder/QueryBuilder.html#cast-java.lang.Object-com.datastax.driver.core.DataType-) +[specifying](https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/querybuilder/QueryBuilder.html#cast-java.lang.Object-com.datastax.driver.core.DataType-) the column for which it should be performed, and to what type it should be casted. #### Specifying conditions @@ -92,7 +92,7 @@ BuiltStatement selectOne = QueryBuilder.select().from("test", "test") The `where` function accepts the `Clause` object that is generated by calling `QueryBuilder`'s -[functions](https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/querybuilder/QueryBuilder.html#eq-java.lang.Iterable-java.lang.Iterable-), +[functions](https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/querybuilder/QueryBuilder.html#eq-java.lang.Iterable-java.lang.Iterable-), such as, `eq`, `ne`, `lt`, `in`, `contains`, `notNull`, etc. In most cases, these functions receive 2 arguments: the name of the column, and the value to compare, but there are also variants that receive 2 iterables for columns and values correspondingly. @@ -263,6 +263,6 @@ Note: the call to these functions changes the object type from `BuiltStatement` -[QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/querybuilder/QueryBuilder.html -[TableMetadata]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TableMetadata.html -[SchemaBuilder]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/schemabuilder/SchemaBuilder.html +[QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/querybuilder/QueryBuilder.html +[TableMetadata]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TableMetadata.html +[SchemaBuilder]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/schemabuilder/SchemaBuilder.html diff --git a/manual/statements/prepared/README.md b/manual/statements/prepared/README.md index d9dd7fee278..ff1dca78057 100644 --- a/manual/statements/prepared/README.md +++ b/manual/statements/prepared/README.md @@ -256,11 +256,11 @@ relying on `SELECT *`. This will be addressed in a future release of both Cassandra and the driver. Follow [CASSANDRA-10786] and [JAVA-1196] for more information. -[PreparedStatement]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/PreparedStatement.html -[BoundStatement]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/BoundStatement.html -[setPrepareOnAllHosts]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/QueryOptions.html#setPrepareOnAllHosts-boolean- -[setReprepareOnUp]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/QueryOptions.html#setReprepareOnUp-boolean- -[execute]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- -[executeAsync]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- +[PreparedStatement]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/PreparedStatement.html +[BoundStatement]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/BoundStatement.html +[setPrepareOnAllHosts]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/QueryOptions.html#setPrepareOnAllHosts-boolean- +[setReprepareOnUp]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/QueryOptions.html#setReprepareOnUp-boolean- +[execute]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement- +[executeAsync]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement- [CASSANDRA-10786]: https://issues.apache.org/jira/browse/CASSANDRA-10786 [JAVA-1196]: https://datastax-oss.atlassian.net/browse/JAVA-1196 diff --git a/manual/statements/simple/README.md b/manual/statements/simple/README.md index 1144ba64c83..b08adc7b018 100644 --- a/manual/statements/simple/README.md +++ b/manual/statements/simple/README.md @@ -128,4 +128,4 @@ session.execute( 1, bytes); ``` -[SimpleStatement]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SimpleStatement.html +[SimpleStatement]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SimpleStatement.html diff --git a/manual/tuples/README.md b/manual/tuples/README.md index b8842082c99..f0b9f0061b8 100644 --- a/manual/tuples/README.md +++ b/manual/tuples/README.md @@ -96,7 +96,7 @@ bs.setList("l", Arrays.asList(oneTimeUsageTuple.newValue("1", "1"), oneTimeUsage session.execute(bs); ``` -[TupleType]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TupleType.html -[TupleValue]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TupleValue.html -[newValueVararg]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TupleType.html#newValue-java.lang.Object...- -[newValue]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/TupleType.html#newValue-- +[TupleType]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TupleType.html +[TupleValue]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TupleValue.html +[newValueVararg]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TupleType.html#newValue-java.lang.Object...- +[newValue]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/TupleType.html#newValue-- diff --git a/manual/udts/README.md b/manual/udts/README.md index f2f4d514496..892a5a95b1b 100644 --- a/manual/udts/README.md +++ b/manual/udts/README.md @@ -95,5 +95,5 @@ session.execute(bs); [cql_doc]: https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlRefUDType.html -[UDTValue]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/UDTValue.html -[UserType]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/UserType.html +[UDTValue]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/UDTValue.html +[UserType]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/UserType.html diff --git a/pom.xml b/pom.xml index 39f5451d7ec..508dd581934 100644 --- a/pom.xml +++ b/pom.xml @@ -641,7 +641,7 @@ - 3.10.1 + 3.10.2 ../clirr-ignores.xml com/datastax/shaded/** From 196c1a09409ec4ae2014697583ae97f82c2f5441 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Thu, 11 Mar 2021 15:03:01 +0100 Subject: [PATCH 118/211] [maven-release-plugin] prepare release 3.11.0 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index a16af74b088..7e98c1c29c7 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.3-SNAPSHOT + 3.11.0 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index d3ebba22797..6aa2bed3536 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.3-SNAPSHOT + 3.11.0 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 8222ddaa145..c01fed9354a 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.3-SNAPSHOT + 3.11.0 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 2676c7ce1dc..fc3cafb37ef 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.3-SNAPSHOT + 3.11.0 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 8477da9c8b0..dba41e84286 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.3-SNAPSHOT + 3.11.0 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index decb2e70c78..03e7a3d25e1 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.3-SNAPSHOT + 3.11.0 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 208b2fa5f5a..54ac6236f4f 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.3-SNAPSHOT + 3.11.0 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index f2f3edd969e..2ff768f95de 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.3-SNAPSHOT + 3.11.0 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index bdc09dc32dd..a7cb377be4b 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.10.3-SNAPSHOT + 3.11.0 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 326dda89c06..5507a7c4047 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.10.3-SNAPSHOT + 3.11.0 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 1074db44442..a11e2a4775e 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.10.3-SNAPSHOT + 3.11.0 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 508dd581934..b8e7112e081 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.10.3-SNAPSHOT + 3.11.0 pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.11.0 From 3c45e327b3a00c59dbbc4f6b0268eb8a1e9c91bc Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Thu, 11 Mar 2021 15:03:12 +0100 Subject: [PATCH 119/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 7e98c1c29c7..5117aadb2b0 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.0 + 3.11.1-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 6aa2bed3536..3545491a439 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.0 + 3.11.1-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index c01fed9354a..d1bb15958f9 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.0 + 3.11.1-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index fc3cafb37ef..eac090745c7 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.0 + 3.11.1-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index dba41e84286..8f3496f47be 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.0 + 3.11.1-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 03e7a3d25e1..293951d4c35 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.0 + 3.11.1-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 54ac6236f4f..38aaea38c68 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.0 + 3.11.1-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 2ff768f95de..440f31064f0 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.0 + 3.11.1-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index a7cb377be4b..14f19b31ae2 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.0 + 3.11.1-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 5507a7c4047..e98fc0d581e 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.0 + 3.11.1-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index a11e2a4775e..f5520ece9a1 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.0 + 3.11.1-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index b8e7112e081..e3fbf2ac979 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.0 + 3.11.1-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.11.0 + HEAD From 0e80e4cc5622a71efd15ca895399adba935aeac9 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Thu, 11 Mar 2021 17:53:38 +0100 Subject: [PATCH 120/211] Fix wrong version in POM snippet --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6eaa9c43305..2847a53356d 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-dri com.datastax.cassandra cassandra-driver-core - 3.10.2 + 3.11.0 ``` From a7c8497d45f666487f8fbd766d791ed3a76d8dd4 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Thu, 11 Mar 2021 18:30:54 +0100 Subject: [PATCH 121/211] Update protocol versions compatibility matrix --- manual/native_protocol/README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/manual/native_protocol/README.md b/manual/native_protocol/README.md index 2a99eb73704..bccbcaa9e48 100644 --- a/manual/native_protocol/README.md +++ b/manual/native_protocol/README.md @@ -16,17 +16,23 @@ Cassandra when the first connection is established. Both sides are backward-compatible with older versions: - - - - - + + + + + + + + + + +
    Driver VersionCassandra: 1.2.x
    (DSE 3.2)
    2.0.x
    (DSE 4.0 to 4.6) -
    2.1.x
    (DSE 4.7)
    2.2.x3.0.x & 3.x
    (DSE 5.0+)
    1.0.x v1 v1 v1 v1 Unsupported (1)
    2.0.x to 2.1.1 v1 v2 v2 v2 Unsupported (1)
    2.1.2 to 2.1.x v1 v2 v3 v3 Unsupported (2)
    3.x v1 v2 v3 v4 v4
    Driver VersionCassandra 1.2.x
    (DSE 3.2)
    Cassandra 2.0.x
    (DSE 4.0 to 4.6)
    Cassandra 2.1.x
    (DSE 4.7)
    Cassandra 2.2.xCassandra 3.0.x & 3.x
    (DSE 5.0+)
    Cassandra 4.0+
    1.0.x v1 v1 v1 v1 Unsupported (1)Unsupported (1)
    2.0.x to 2.1.1 v1 v2 v2 v2Unsupported (1) Unsupported (1)
    2.1.2 to 2.1.x v1 v2 v3 v3Unsupported (2)Unsupported (2)
    3.x v1 v2 v3 v4 v4 v5
    -*(1) Cassandra 3.0 does not support protocol versions v1 and v2* +*(1) Cassandra 3.0+ does not support protocol versions v1 and v2* -*(2) There is a matching protocol version (v3), but the driver 2.1.x can't read the new system table format of Cassandra 3.0* +*(2) There is a matching protocol version (v3), but the driver 2.1.x can't read the new system table +format of Cassandra 3.0+* For example, if you use version 2.1.5 of the driver to connect to Cassandra 2.0.9, the maximum version you can use (and the one you'll get From a8eacec84a69acfa0056011d3a8758d62c7d50b7 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Thu, 11 Mar 2021 18:32:16 +0100 Subject: [PATCH 122/211] Fix broken link to driver 3.x manual page --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2847a53356d..838ad0dded2 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,8 @@ for the development version and that some features described here might not yet have been released. You can find the documentation for the latest version through the [Java driver -docs](http://docs.datastax.com/en/developer/java-driver/latest/index.html) or via the release tags, -[e.g. -3.11.0](https://github.com/datastax/java-driver/tree/3.11.0).* +docs](http://docs.datastax.com/en/developer/java-driver/3.11/index.html) or via the release tags, +[e.g. 3.11.0](https://github.com/datastax/java-driver/tree/3.11.0).* A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol @@ -102,7 +101,7 @@ is available for download. ## Compatibility The Java client driver 3.11.0 ([branch 3.x](https://github.com/datastax/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/latest/manual/native_protocol/) for +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)). From 673720f15578fc1b517e551d2be5c1d7f118437b Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Thu, 11 Mar 2021 18:36:14 +0100 Subject: [PATCH 123/211] Minor change to HTML table layout --- manual/native_protocol/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manual/native_protocol/README.md b/manual/native_protocol/README.md index bccbcaa9e48..d2ad6212847 100644 --- a/manual/native_protocol/README.md +++ b/manual/native_protocol/README.md @@ -20,13 +20,13 @@ backward-compatible with older versions: Cassandra 2.0.x
    (DSE 4.0 to 4.6)Cassandra 2.1.x
    (DSE 4.7) Cassandra 2.2.x Cassandra 3.0.x & 3.x
    (DSE 5.0+)Cassandra 4.0+ -1.0.x v1 v1 v1 v1 Unsupported (1) +1.0.x v1 v1 v1 v1 Unsupported (1) Unsupported (1) -2.0.x to 2.1.1 v1 v2 v2 v2 +2.0.x to 2.1.1 v1 v2 v2 v2 Unsupported (1) Unsupported (1) -2.1.2 to 2.1.x v1 v2 v3 v3 +2.1.2 to 2.1.x v1 v2 v3 v3 Unsupported (2)Unsupported (2) -3.x v1 v2 v3 v4 v4 v5 +3.x v1 v2 v3 v4 v4 v5 *(1) Cassandra 3.0+ does not support protocol versions v1 and v2* From edbccdeaa60b3328b8bfe09fbc8401e44b68ef9f Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Thu, 11 Mar 2021 19:53:19 +0100 Subject: [PATCH 124/211] Remove broken link to binary tarball --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 838ad0dded2..267a710eb9b 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,6 @@ The driver contains the following modules: - API: https://docs.datastax.com/en/drivers/java/3.11 - GITHUB REPOSITORY: https://github.com/datastax/java-driver - [changelog](changelog/) -- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.11.0.tar.gz) ## Getting the driver From 0df59d9ca5a3b4c834198fe5474e2df4ca728011 Mon Sep 17 00:00:00 2001 From: Ankit Barsainya <71305148+AnkitBarsainyaPSL@users.noreply.github.com> Date: Wed, 18 Aug 2021 15:14:06 +0530 Subject: [PATCH 125/211] Update log message to inform about incorrect CL for read repair (#1568) --- .../datastax/driver/core/exceptions/ReadTimeoutException.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadTimeoutException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadTimeoutException.java index b2bf6f3f416..71a266fdd19 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadTimeoutException.java +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadTimeoutException.java @@ -42,7 +42,8 @@ public ReadTimeoutException( super( endPoint, String.format( - "Cassandra timeout during read query at consistency %s (%s)", + "Cassandra timeout during read query at consistency %s (%s). " + + "In case this was generated during read repair, the consistency level is not representative of the actual consistency.", consistency, formatDetails(received, required, dataPresent)), consistency, received, From 7d58f9dbc613a2d4d6cf2732212ab3a2c249077a Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 7 Oct 2021 10:40:14 -0500 Subject: [PATCH 126/211] JAVA-2967: Support native_transport_(address|port) + native_transport_port_ssl for DSE 6.8 (#1573) --- .../driver/core/ControlConnection.java | 28 +- .../driver/core/DefaultEndPointFactory.java | 10 + .../driver/core/ControlConnectionTest.java | 299 ++++++++++++++++++ .../driver/core/ScassandraCluster.java | 16 + .../core/exceptions/ExceptionsTest.java | 4 +- 5 files changed, 354 insertions(+), 3 deletions(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java b/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java index 3558f006d9d..24f7b815c23 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java @@ -611,6 +611,17 @@ private static void updateInfo( InetAddress nativeAddress = row.getInet("native_address"); int nativePort = row.getInt("native_port"); broadcastRpcAddress = new InetSocketAddress(nativeAddress, nativePort); + } else if (row.getColumnDefinitions().contains("native_transport_address")) { + // DSE 6.8 introduced native_transport_address and native_transport_port for the + // listen address. Also included is native_transport_port_ssl (in case users + // want to setup a different port for SSL and non-SSL conns). + InetAddress nativeAddress = row.getInet("native_transport_address"); + int nativePort = row.getInt("native_transport_port"); + if (cluster.getCluster().getConfiguration().getProtocolOptions().getSSLOptions() != null + && !row.isNull("native_transport_port_ssl")) { + nativePort = row.getInt("native_transport_port_ssl"); + } + broadcastRpcAddress = new InetSocketAddress(nativeAddress, nativePort); } else if (row.getColumnDefinitions().contains("rpc_address")) { InetAddress rpcAddress = row.getInet("rpc_address"); broadcastRpcAddress = new InetSocketAddress(rpcAddress, cluster.connectionFactory.getPort()); @@ -831,6 +842,14 @@ private void refreshNodeListAndTokenMap( InetAddress nativeAddress = row.getInet("native_address"); int nativePort = row.getInt("native_port"); broadcastRpcAddress = new InetSocketAddress(nativeAddress, nativePort); + } else if (row.getColumnDefinitions().contains("native_transport_address")) { + InetAddress nativeAddress = row.getInet("native_transport_address"); + int nativePort = row.getInt("native_transport_port"); + if (cluster.getCluster().getConfiguration().getProtocolOptions().getSSLOptions() != null + && !row.isNull("native_transport_port_ssl")) { + nativePort = row.getInt("native_transport_port_ssl"); + } + broadcastRpcAddress = new InetSocketAddress(nativeAddress, nativePort); } else { InetAddress rpcAddress = row.getInet("rpc_address"); broadcastRpcAddress = @@ -956,7 +975,11 @@ private boolean isValidPeer(Row peerRow, boolean logIfInvalid) { && !peerRow.isNull("native_port"); } else { isValid &= - peerRow.getColumnDefinitions().contains("rpc_address") && !peerRow.isNull("rpc_address"); + (peerRow.getColumnDefinitions().contains("rpc_address") && !peerRow.isNull("rpc_address")) + || (peerRow.getColumnDefinitions().contains("native_transport_address") + && peerRow.getColumnDefinitions().contains("native_transport_port") + && !peerRow.isNull("native_transport_address") + && !peerRow.isNull("native_transport_port")); } if (EXTENDED_PEER_CHECK) { @@ -984,6 +1007,9 @@ private String formatInvalidPeer(Row peerRow) { formatMissingOrNullColumn(peerRow, "native_address", sb); formatMissingOrNullColumn(peerRow, "native_port", sb); } else { + formatMissingOrNullColumn(peerRow, "native_transport_address", sb); + formatMissingOrNullColumn(peerRow, "native_transport_port", sb); + formatMissingOrNullColumn(peerRow, "native_transport_port_ssl", sb); formatMissingOrNullColumn(peerRow, "rpc_address", sb); } if (EXTENDED_PEER_CHECK) { diff --git a/driver-core/src/main/java/com/datastax/driver/core/DefaultEndPointFactory.java b/driver-core/src/main/java/com/datastax/driver/core/DefaultEndPointFactory.java index c1378abf27d..b9caa3ea1a4 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/DefaultEndPointFactory.java +++ b/driver-core/src/main/java/com/datastax/driver/core/DefaultEndPointFactory.java @@ -49,6 +49,16 @@ public EndPoint create(Row peersRow) { InetSocketAddress translateAddress = cluster.manager.translateAddress(new InetSocketAddress(nativeAddress, nativePort)); return new TranslatedAddressEndPoint(translateAddress); + } else if (peersRow.getColumnDefinitions().contains("native_transport_address")) { + InetAddress nativeAddress = peersRow.getInet("native_transport_address"); + int nativePort = peersRow.getInt("native_transport_port"); + if (cluster.getConfiguration().getProtocolOptions().getSSLOptions() != null + && !peersRow.isNull("native_transport_port_ssl")) { + nativePort = peersRow.getInt("native_transport_port_ssl"); + } + InetSocketAddress translateAddress = + cluster.manager.translateAddress(new InetSocketAddress(nativeAddress, nativePort)); + return new TranslatedAddressEndPoint(translateAddress); } else { InetAddress broadcastAddress = peersRow.getInet("peer"); InetAddress rpcAddress = peersRow.getInet("rpc_address"); diff --git a/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java b/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java index a406bbf8e00..83f54e7861a 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java @@ -17,7 +17,10 @@ import static com.datastax.driver.core.Assertions.assertThat; import static com.datastax.driver.core.CreateCCM.TestMode.PER_METHOD; +import static com.datastax.driver.core.ScassandraCluster.SELECT_LOCAL; import static com.datastax.driver.core.ScassandraCluster.SELECT_PEERS; +import static com.datastax.driver.core.ScassandraCluster.SELECT_PEERS_DSE68; +import static com.datastax.driver.core.ScassandraCluster.SELECT_PEERS_V2; import static com.datastax.driver.core.ScassandraCluster.datacenter; import static com.datastax.driver.core.TestUtils.nonQuietClusterCloseOptions; import static com.google.common.collect.Lists.newArrayList; @@ -30,6 +33,8 @@ import com.datastax.driver.core.policies.ReconnectionPolicy; import com.datastax.driver.core.utils.CassandraVersion; import com.google.common.base.Function; +import com.google.common.base.Optional; +import com.google.common.collect.Collections2; import com.google.common.collect.HashMultiset; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -41,11 +46,16 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Map; +import java.util.Random; import java.util.Set; +import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import org.apache.log4j.Level; +import org.junit.Ignore; +import org.scassandra.http.client.PrimingClient; import org.scassandra.http.client.PrimingRequest; +import org.scassandra.http.client.Result; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.annotations.DataProvider; @@ -560,6 +570,295 @@ public void should_connect_when_peers_v2_table_not_present() { } } + /** + * Cassandra 4.0 supports native_address and native_port columns in system.peers_v2. We want to + * validate our ability to build correct metadata when drawing data from these tables. + */ + @Test(groups = "short") + @CCMConfig(createCcm = false) + public void should_extract_hosts_using_native_address_port_from_peersv2() + throws UnknownHostException { + + InetAddress expectedAddress = InetAddress.getByName("4.3.2.1"); + int expectedPort = 2409; + PeerRowState state = + PeerRowState.builder() + .peersV2("native_address", expectedAddress) + .peersV2("native_port", expectedPort) + .expectedAddress(expectedAddress) + .expectedPort(expectedPort) + .build(); + runPeerTest(state); + } + + /** DSE 6.8 includes native_transport_address and native_transport_port in system.peers. */ + @Test(groups = "short") + @CCMConfig(createCcm = false) + public void should_extract_hosts_using_native_transport_address_port_from_peers() + throws UnknownHostException { + + InetAddress expectedAddress = InetAddress.getByName("4.3.2.1"); + int expectedPort = 2409; + PeerRowState state = + PeerRowState.builder() + .peers("native_transport_address", expectedAddress) + .peers("native_transport_port", expectedPort) + .expectedAddress(expectedAddress) + .expectedPort(expectedPort) + .build(); + runPeerTest(state); + } + + /** + * If both native_transport_port and native_transport_port_ssl are present we expect the latter to + * be selected if the Cluster is created with SSL support (i.e. if {@link + * Cluster.Builder#withSSL()} is used). + */ + @Test(groups = "short") + @CCMConfig(createCcm = false) + @Ignore("Requires SSL support in scassandra") + public void should_extract_hosts_using_native_transport_address_port_ssl_from_peers() + throws UnknownHostException { + + InetAddress expectedAddress = InetAddress.getByName("4.3.2.1"); + int expectedPort = 2409; + PeerRowState state = + PeerRowState.builder() + .peers("native_transport_address", expectedAddress) + .peers("native_transport_port", expectedPort - 100) + .peers("native_transport_port_ssl", expectedPort) + .expectedAddress(expectedAddress) + .expectedPort(expectedPort) + .build(); + runPeerTest(state); + } + + /** + * The default case. If we can't get native_address/port out of system.peers_v2 or + * native_transport_address/port out of system.peers the fall back to rpc_address + a default port + */ + @Test(groups = "short") + @CCMConfig(createCcm = false) + public void should_extract_hosts_using_rpc_address_from_peers() throws UnknownHostException { + + InetAddress expectedAddress = InetAddress.getByName("4.3.2.1"); + PeerRowState state = + PeerRowState.builder() + .peers("rpc_address", expectedAddress) + /* DefaultEndPointFactory isn't happy if we don't have a value for + * both peer and rpc_address */ + .peers("peer", InetAddress.getByName("1.2.3.4")) + .expectedAddress(expectedAddress) + .build(); + runPeerTest(state); + } + + private void runPeerTest(PeerRowState state) { + + ScassandraCluster scassandras = + ScassandraCluster.builder().withNodes(2).withPeersV2(state.usePeersV2()).build(); + scassandras.init(); + + Cluster cluster = null; + try { + + scassandras.node(1).primingClient().clearAllPrimes(); + + PrimingClient primingClient = scassandras.node(1).primingClient(); + + /* Note that we always prime system.local; ControlConnection.refreshNodeAndTokenMap() gets angry + * if this is empty */ + primingClient.prime( + PrimingRequest.queryBuilder() + .withQuery("SELECT * FROM system.local WHERE key='local'") + .withThen(then().withColumnTypes(SELECT_LOCAL).withRows(state.getLocalRow()).build()) + .build()); + + if (state.shouldPrimePeers()) { + + primingClient.prime( + PrimingRequest.queryBuilder() + .withQuery("SELECT * FROM system.peers") + .withThen( + then() + .withColumnTypes(state.isDse68() ? SELECT_PEERS_DSE68 : SELECT_PEERS) + .withRows(state.getPeersRow()) + .build()) + .build()); + } + if (state.shouldPrimePeersV2()) { + + primingClient.prime( + PrimingRequest.queryBuilder() + .withQuery("SELECT * FROM system.peers_v2") + .withThen( + then().withColumnTypes(SELECT_PEERS_V2).withRows(state.getPeersV2Row()).build()) + .build()); + } else { + + /* Must return an error code in this case in order to trigger the driver's downgrade to system.peers */ + primingClient.prime( + PrimingRequest.queryBuilder() + .withQuery("SELECT * FROM system.peers_v2") + .withThen(then().withResult(Result.invalid).build())); + } + + cluster = + Cluster.builder() + .addContactPoints(scassandras.address(1).getAddress()) + .withPort(scassandras.getBinaryPort()) + .withNettyOptions(nonQuietClusterCloseOptions) + .build(); + cluster.connect(); + + Collection hostEndPoints = + Collections2.transform( + cluster.getMetadata().allHosts(), + new Function() { + public EndPoint apply(Host host) { + return host.getEndPoint(); + } + }); + assertThat(hostEndPoints).contains(state.getExpectedEndPoint(scassandras)); + } finally { + if (cluster != null) cluster.close(); + scassandras.stop(); + } + } + + static class PeerRowState { + + private final ImmutableMap peers; + private final ImmutableMap peersV2; + private final ImmutableMap local; + + private final InetAddress expectedAddress; + private final Optional expectedPort; + + private final boolean shouldPrimePeers; + private final boolean shouldPrimePeersV2; + + private PeerRowState( + ImmutableMap peers, + ImmutableMap peersV2, + ImmutableMap local, + InetAddress expectedAddress, + Optional expectedPort, + boolean shouldPrimePeers, + boolean shouldPrimePeersV2) { + this.peers = peers; + this.peersV2 = peersV2; + this.local = local; + + this.expectedAddress = expectedAddress; + this.expectedPort = expectedPort; + + this.shouldPrimePeers = shouldPrimePeers; + this.shouldPrimePeersV2 = shouldPrimePeersV2; + } + + public static Builder builder() { + return new Builder(); + } + + public boolean usePeersV2() { + return !this.peersV2.isEmpty(); + } + + public boolean isDse68() { + return this.peers.containsKey("native_transport_address") + || this.peers.containsKey("native_transport_port") + || this.peers.containsKey("native_transport_port_ssl"); + } + + public boolean shouldPrimePeers() { + return this.shouldPrimePeers; + } + + public boolean shouldPrimePeersV2() { + return this.shouldPrimePeersV2; + } + + public ImmutableMap getPeersRow() { + return this.peers; + } + + public ImmutableMap getPeersV2Row() { + return this.peersV2; + } + + public ImmutableMap getLocalRow() { + return this.local; + } + + public EndPoint getExpectedEndPoint(ScassandraCluster cluster) { + return new TranslatedAddressEndPoint( + new InetSocketAddress( + this.expectedAddress, this.expectedPort.or(cluster.getBinaryPort()))); + } + + static class Builder { + + private ImmutableMap.Builder peers = this.basePeerRow(); + private ImmutableMap.Builder peersV2 = this.basePeerRow(); + private ImmutableMap.Builder local = this.basePeerRow(); + + private InetAddress expectedAddress; + private Optional expectedPort = Optional.absent(); + + private boolean shouldPrimePeers = false; + private boolean shouldPrimePeersV2 = false; + + public PeerRowState build() { + return new PeerRowState( + this.peers.build(), + this.peersV2.build(), + this.local.build(), + this.expectedAddress, + this.expectedPort, + this.shouldPrimePeers, + this.shouldPrimePeersV2); + } + + public Builder peers(String name, Object val) { + this.peers.put(name, val); + this.shouldPrimePeers = true; + return this; + } + + public Builder peersV2(String name, Object val) { + this.peersV2.put(name, val); + this.shouldPrimePeersV2 = true; + return this; + } + + public Builder local(String name, Object val) { + this.local.put(name, val); + return this; + } + + public Builder expectedAddress(InetAddress address) { + this.expectedAddress = address; + return this; + } + + public Builder expectedPort(int port) { + this.expectedPort = Optional.of(port); + return this; + } + + private ImmutableMap.Builder basePeerRow() { + return ImmutableMap.builder() + /* Required to support Metadata.addIfAbsent(Host) which is used by host loading code */ + .put("host_id", UUID.randomUUID()) + /* Elements below required to pass peer row validation */ + .put("data_center", datacenter(1)) + .put("rack", "rack1") + .put("tokens", ImmutableSet.of(Long.toString(new Random().nextLong()))); + } + } + } + static class QueryPlanCountingPolicy extends DelegatingLoadBalancingPolicy { final AtomicInteger counter = new AtomicInteger(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java b/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java index e281720f8a5..62bd2ece358 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java @@ -619,6 +619,22 @@ private Object getPeerInfo(int dc, int node, String property, Object defaultValu column("schema_version", UUID) }; + /* system.peers was re-worked for DSE 6.8 */ + public static final org.scassandra.http.client.types.ColumnMetadata[] SELECT_PEERS_DSE68 = { + column("peer", INET), + column("rpc_address", INET), + column("data_center", TEXT), + column("rack", TEXT), + column("release_version", TEXT), + column("tokens", set(TEXT)), + column("host_id", UUID), + column("graph", BOOLEAN), + column("schema_version", UUID), + column("native_transport_address", INET), + column("native_transport_port", INT), + column("native_transport_port_ssl", INT) + }; + public static final org.scassandra.http.client.types.ColumnMetadata[] SELECT_PEERS_V2 = { column("peer", INET), column("peer_port", INT), diff --git a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsTest.java b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsTest.java index 31f3c958227..3d913b81f92 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsTest.java @@ -283,7 +283,7 @@ public void should_create_proper_unprepared_exception() { public void should_create_proper_read_timeout_exception() { ReadTimeoutException e = new ReadTimeoutException(endPoint1, LOCAL_QUORUM, 2, 3, true); assertThat(e.getMessage()) - .isEqualTo( + .contains( "Cassandra timeout during read query at consistency LOCAL_QUORUM (3 responses were required but only 2 replica responded)"); assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_QUORUM); assertThat(e.getReceivedAcknowledgements()).isEqualTo(2); @@ -292,7 +292,7 @@ public void should_create_proper_read_timeout_exception() { assertThat(e.getEndPoint()).isEqualTo(endPoint1); e = e.copy(endPoint2); assertThat(e.getMessage()) - .isEqualTo( + .contains( "Cassandra timeout during read query at consistency LOCAL_QUORUM (3 responses were required but only 2 replica responded)"); assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_QUORUM); assertThat(e.getReceivedAcknowledgements()).isEqualTo(2); From 6aa2487c51aa517c530be27c403f07504b17f796 Mon Sep 17 00:00:00 2001 From: Jeff DiNoto Date: Tue, 1 Feb 2022 18:19:11 -0500 Subject: [PATCH 127/211] Fossa scanning (#1579) --- .github/workflows/dep-lic-scan.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/dep-lic-scan.yaml diff --git a/.github/workflows/dep-lic-scan.yaml b/.github/workflows/dep-lic-scan.yaml new file mode 100644 index 00000000000..afb197bf137 --- /dev/null +++ b/.github/workflows/dep-lic-scan.yaml @@ -0,0 +1,23 @@ +name: Dependency and License Scan +on: + push: + branches: + - '4.x' + - '3.x' + paths-ignore: + - 'manual/**' + - 'faq/**' + - 'upgrade_guide/**' + - 'changelog/**' +jobs: + scan-repo: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: Install Fossa CLI + run: | + curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash -s -- -b . + - name: Scan for dependencies and licenses + run: | + FOSSA_API_KEY=${{ secrets.FOSSA_PUSH_ONLY_API_KEY }} ./fossa analyze From 83967fd170f1eb46611974a8314d858f95120672 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Wed, 16 Feb 2022 10:32:28 -0600 Subject: [PATCH 128/211] JAVA-2976: Protocol v5 error codes CAS_WRITE_UNKNOWN, CDC_WRITE_FAILURE not supported (3.x) (#1585) --- .../datastax/driver/core/ExceptionCode.java | 2 + .../com/datastax/driver/core/Responses.java | 12 +++ .../exceptions/CASWriteUnknownException.java | 91 +++++++++++++++++++ .../core/exceptions/CDCWriteException.java | 61 +++++++++++++ 4 files changed, 166 insertions(+) create mode 100644 driver-core/src/main/java/com/datastax/driver/core/exceptions/CASWriteUnknownException.java create mode 100644 driver-core/src/main/java/com/datastax/driver/core/exceptions/CDCWriteException.java diff --git a/driver-core/src/main/java/com/datastax/driver/core/ExceptionCode.java b/driver-core/src/main/java/com/datastax/driver/core/ExceptionCode.java index b6c6d0af50f..4a745da5ff0 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ExceptionCode.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ExceptionCode.java @@ -36,6 +36,8 @@ enum ExceptionCode { READ_FAILURE(0x1300), FUNCTION_FAILURE(0x1400), WRITE_FAILURE(0x1500), + CDC_WRITE_FAILURE(0x1600), + CAS_WRITE_UNKNOWN(0x1700), // 2xx: problem validating the request SYNTAX_ERROR(0x2000), diff --git a/driver-core/src/main/java/com/datastax/driver/core/Responses.java b/driver-core/src/main/java/com/datastax/driver/core/Responses.java index d9402f5b189..d160cd0332c 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Responses.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Responses.java @@ -24,6 +24,8 @@ import com.datastax.driver.core.exceptions.AlreadyExistsException; import com.datastax.driver.core.exceptions.AuthenticationException; import com.datastax.driver.core.exceptions.BootstrappingException; +import com.datastax.driver.core.exceptions.CASWriteUnknownException; +import com.datastax.driver.core.exceptions.CDCWriteException; import com.datastax.driver.core.exceptions.DriverException; import com.datastax.driver.core.exceptions.DriverInternalError; import com.datastax.driver.core.exceptions.FunctionExecutionException; @@ -119,6 +121,12 @@ public Error decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRe clt, received, blockFor, failures, failuresMap, dataPresent != 0); } break; + case CAS_WRITE_UNKNOWN: + clt = CBUtil.readConsistencyLevel(body); + received = body.readInt(); + blockFor = body.readInt(); + infos = new CASWriteUnknownException(clt, received, blockFor); + break; case UNPREPARED: infos = MD5Digest.wrap(CBUtil.readBytes(body)); break; @@ -173,6 +181,10 @@ DriverException asException(EndPoint endPoint) { return ((ReadFailureException) infos).copy(endPoint); case FUNCTION_FAILURE: return new FunctionExecutionException(endPoint, message); + case CDC_WRITE_FAILURE: + return new CDCWriteException(endPoint, message); + case CAS_WRITE_UNKNOWN: + return ((CASWriteUnknownException) infos).copy(endPoint); case SYNTAX_ERROR: return new SyntaxError(endPoint, message); case UNAUTHORIZED: diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/CASWriteUnknownException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/CASWriteUnknownException.java new file mode 100644 index 00000000000..751a403991d --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/CASWriteUnknownException.java @@ -0,0 +1,91 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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.exceptions; + +import com.datastax.driver.core.ConsistencyLevel; +import com.datastax.driver.core.EndPoint; + +public class CASWriteUnknownException extends QueryConsistencyException { + + private static final long serialVersionUID = 0; + + /** + * This constructor should only be used internally by the driver when decoding error responses. + */ + public CASWriteUnknownException(ConsistencyLevel consistency, int received, int required) { + this(null, consistency, received, required); + } + + public CASWriteUnknownException( + EndPoint endPoint, ConsistencyLevel consistency, int received, int required) { + super( + endPoint, + String.format( + "CAS operation result is unknown - proposal was not accepted by a quorum. (%d / %d)", + received, required), + consistency, + received, + required); + } + + private CASWriteUnknownException( + EndPoint endPoint, + String msg, + Throwable cause, + ConsistencyLevel consistency, + int received, + int required) { + super(endPoint, msg, cause, consistency, received, required); + } + + @Override + public CASWriteUnknownException copy() { + return new CASWriteUnknownException( + getEndPoint(), + getMessage(), + this, + getConsistencyLevel(), + getReceivedAcknowledgements(), + getRequiredAcknowledgements()); + } + + /** + * Create a copy of this exception with a nicer stack trace, and including the coordinator address + * that caused this exception to be raised. + * + *

    This method is mainly intended for internal use by the driver and exists mainly because: + * + *

      + *
    1. the original exception was decoded from a response frame and at that time, the + * coordinator address was not available; and + *
    2. the newly-created exception will refer to the current thread in its stack trace, which + * generally yields a more user-friendly stack trace that the original one. + *
    + * + * @param endPoint The full address of the host that caused this exception to be thrown. + * @return a copy/clone of this exception, but with the given host address instead of the original + * one. + */ + public CASWriteUnknownException copy(EndPoint endPoint) { + return new CASWriteUnknownException( + endPoint, + getMessage(), + this, + getConsistencyLevel(), + getReceivedAcknowledgements(), + getRequiredAcknowledgements()); + } +} diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/CDCWriteException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/CDCWriteException.java new file mode 100644 index 00000000000..f4ac21c1663 --- /dev/null +++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/CDCWriteException.java @@ -0,0 +1,61 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed 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.exceptions; + +import com.datastax.driver.core.EndPoint; +import java.net.InetAddress; +import java.net.InetSocketAddress; + +/** An error occurred when trying to write a CDC mutation to the commitlog * */ +public class CDCWriteException extends QueryExecutionException implements CoordinatorException { + + private static final long serialVersionUID = 0; + + private final EndPoint endPoint; + + public CDCWriteException(EndPoint endPoint, String message) { + super(message); + this.endPoint = endPoint; + } + + /** Private constructor used solely when copying exceptions. */ + private CDCWriteException(EndPoint endPoint, String message, CDCWriteException cause) { + super(message, cause); + this.endPoint = endPoint; + } + + @Override + public EndPoint getEndPoint() { + return endPoint; + } + + @Override + @Deprecated + public InetSocketAddress getAddress() { + return (endPoint == null) ? null : endPoint.resolve(); + } + + @Override + @Deprecated + public InetAddress getHost() { + return (endPoint == null) ? null : endPoint.resolve().getAddress(); + } + + @Override + public CDCWriteException copy() { + return new CDCWriteException(endPoint, getMessage(), this); + } +} From b9e4908f30d1f79382361950166e95df5b298a4d Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Wed, 16 Feb 2022 10:53:09 -0600 Subject: [PATCH 129/211] Changelog updates in prep for release --- changelog/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/changelog/README.md b/changelog/README.md index a91d0e1a917..4fe403d5bf2 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,6 +5,11 @@ 3.x versions get published. --> +## 3.11.1 +- [bug] JAVA-2967: Support native transport peer information for DSE 6.8 +- [bug] JAVA-2976: Support missing protocol v5 error codes CAS_WRITE_UNKNOWN, CDC_WRITE_FAILURE + + ## 3.11.0 - [improvement] JAVA-2705: Remove protocol v5 beta status, add v6-beta. From 4b8f63e3922f13e3a955748494cac1603e7a7b01 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Wed, 16 Feb 2022 10:56:16 -0600 Subject: [PATCH 130/211] Add periods for changelog messages --- changelog/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 4fe403d5bf2..dc14e0f5d76 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -6,8 +6,8 @@ --> ## 3.11.1 -- [bug] JAVA-2967: Support native transport peer information for DSE 6.8 -- [bug] JAVA-2976: Support missing protocol v5 error codes CAS_WRITE_UNKNOWN, CDC_WRITE_FAILURE +- [bug] JAVA-2967: Support native transport peer information for DSE 6.8. +- [bug] JAVA-2976: Support missing protocol v5 error codes CAS_WRITE_UNKNOWN, CDC_WRITE_FAILURE. ## 3.11.0 From 01c4521096e810b876bb88b745a295ef7a7c8a25 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Wed, 16 Feb 2022 17:26:45 -0600 Subject: [PATCH 131/211] Update version in docs --- README.md | 12 ++++++------ faq/README.md | 2 +- manual/compression/README.md | 2 +- manual/custom_codecs/extras/README.md | 2 +- manual/metrics/README.md | 2 +- manual/object_mapper/README.md | 2 +- manual/shaded_jar/README.md | 6 +++--- pom.xml | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 267a710eb9b..97c5067c979 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ for the development version and that some features described here might not yet have been released. You can find the documentation for the latest version through the [Java driver docs](http://docs.datastax.com/en/developer/java-driver/3.11/index.html) or via the release tags, -[e.g. 3.11.0](https://github.com/datastax/java-driver/tree/3.11.0).* +[e.g. 3.11.1](https://github.com/datastax/java-driver/tree/3.11.1).* A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol @@ -65,7 +65,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-dri com.datastax.cassandra cassandra-driver-core - 3.11.0 + 3.11.1 ``` @@ -75,7 +75,7 @@ Note that the object mapper is published as a separate artifact: com.datastax.cassandra cassandra-driver-mapping - 3.11.0 + 3.11.1 ``` @@ -85,7 +85,7 @@ The 'extras' module is also published as a separate artifact: com.datastax.cassandra cassandra-driver-extras - 3.11.0 + 3.11.1 ``` @@ -94,12 +94,12 @@ 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](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.11.0.tar.gz) +[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.11.1.tar.gz) is available for download. ## Compatibility -The Java client driver 3.11.0 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache +The Java client driver 3.11.1 ([branch 3.x](https://github.com/datastax/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). diff --git a/faq/README.md b/faq/README.md index d806a414f71..ea48a598a23 100644 --- a/faq/README.md +++ b/faq/README.md @@ -289,7 +289,7 @@ version is available, you may want to reach out to the maintainer of that tool t an update with compatibility to this driver version. -[Blobs.java]: https://github.com/datastax/java-driver/tree/3.11.0/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java +[Blobs.java]: https://github.com/datastax/java-driver/tree/3.11.1/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304 [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding [Mapper options]: ../manual/object_mapper/using/#mapper-options diff --git a/manual/compression/README.md b/manual/compression/README.md index ab96172418e..fb39e6771dd 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -88,4 +88,4 @@ cluster = Cluster.builder() .build(); ``` -[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.11.0/cassandra-driver-parent-3.11.0.pom +[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.11.1/cassandra-driver-parent-3.11.1.pom diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index 9e253aa60e3..ec0f56a17e9 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -10,7 +10,7 @@ The module is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-extras - 3.11.0 + 3.11.1 ``` diff --git a/manual/metrics/README.md b/manual/metrics/README.md index e751bcf5bcf..5ad2a8084f6 100644 --- a/manual/metrics/README.md +++ b/manual/metrics/README.md @@ -38,7 +38,7 @@ To do this in a maven project: com.datastax.cassandra cassandra-driver-core - 3.11.0 + 3.11.1 io.dropwizard.metrics diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md index 4884383b8d6..fd8ccad89d9 100644 --- a/manual/object_mapper/README.md +++ b/manual/object_mapper/README.md @@ -11,7 +11,7 @@ The mapper is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-mapping - 3.11.0 + 3.11.1 ``` diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md index 91ae8f440b8..ee25d56f0d1 100644 --- a/manual/shaded_jar/README.md +++ b/manual/shaded_jar/README.md @@ -12,7 +12,7 @@ package name: com.datastax.cassandra cassandra-driver-core - 3.11.0 + 3.11.1 shaded @@ -32,7 +32,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-core - 3.11.0 + 3.11.1 shaded @@ -44,7 +44,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-mapping - 3.11.0 + 3.11.1 com.datastax.cassandra diff --git a/pom.xml b/pom.xml index e3fbf2ac979..76a47cb291e 100644 --- a/pom.xml +++ b/pom.xml @@ -641,7 +641,7 @@ - 3.10.2 + 3.11.0 ../clirr-ignores.xml com/datastax/shaded/** From 32be7838bc932c8c6163526910d5825bf089f147 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 17 Feb 2022 11:13:10 -0600 Subject: [PATCH 132/211] [maven-release-plugin] prepare release 3.11.1 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 5117aadb2b0..71068f08659 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 3545491a439..c1533c068f6 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index d1bb15958f9..4a96380b14c 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index eac090745c7..e129f17abbb 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 8f3496f47be..cda650db9a2 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 293951d4c35..6f93a9f6396 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 38aaea38c68..fbd4f4ebf71 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 440f31064f0..46ce5d429b9 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.1 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 14f19b31ae2..427a2ccacae 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index e98fc0d581e..882f407a7d4 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index f5520ece9a1..e6359083f7e 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 76a47cb291e..3ea59a4b2c8 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.11.1 From b5fcaa789f16e15d75f2e0515d6a2335c2a535da Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 17 Feb 2022 11:13:14 -0600 Subject: [PATCH 133/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 71068f08659..6d68864cba4 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index c1533c068f6..835df270641 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 4a96380b14c..6f3797d7777 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index e129f17abbb..9cea0eb7431 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index cda650db9a2..66586f7e800 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 6f93a9f6396..182a734fc82 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index fbd4f4ebf71..b111c8d1ea5 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 46ce5d429b9..0ad8d1a266b 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.2-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 427a2ccacae..6810194ba9c 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 882f407a7d4..0090a151a83 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index e6359083f7e..162a55d75c4 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 3ea59a4b2c8..267313bed7f 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.11.1 + HEAD From d3d5c81b63df22685a101a7ce6df76b2ff29d33a Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 17 Feb 2022 23:45:58 -0600 Subject: [PATCH 134/211] Revert "[maven-release-plugin] prepare for next development iteration" This reverts commit b5fcaa789f16e15d75f2e0515d6a2335c2a535da. --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 6d68864cba4..71068f08659 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 835df270641..c1533c068f6 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 6f3797d7777..4a96380b14c 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 9cea0eb7431..e129f17abbb 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 66586f7e800..cda650db9a2 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 182a734fc82..6f93a9f6396 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index b111c8d1ea5..fbd4f4ebf71 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 0ad8d1a266b..46ce5d429b9 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2-SNAPSHOT + 3.11.1 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 6810194ba9c..427a2ccacae 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 0090a151a83..882f407a7d4 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 162a55d75c4..e6359083f7e 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 267313bed7f..3ea59a4b2c8 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1 pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.11.1 From a19715743fe8b92eafa004a17403c77bcc1190f1 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 17 Feb 2022 23:46:18 -0600 Subject: [PATCH 135/211] Revert "[maven-release-plugin] prepare release 3.11.1" This reverts commit 32be7838bc932c8c6163526910d5825bf089f147. --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 71068f08659..5117aadb2b0 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index c1533c068f6..3545491a439 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 4a96380b14c..d1bb15958f9 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index e129f17abbb..eac090745c7 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index cda650db9a2..8f3496f47be 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 6f93a9f6396..293951d4c35 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index fbd4f4ebf71..38aaea38c68 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 46ce5d429b9..440f31064f0 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.1-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 427a2ccacae..14f19b31ae2 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 882f407a7d4..e98fc0d581e 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index e6359083f7e..f5520ece9a1 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 3ea59a4b2c8..76a47cb291e 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.11.1 + HEAD From 3e665c96e4c690111900d95b4585b5c4eb983b0c Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 17 Feb 2022 23:47:04 -0600 Subject: [PATCH 136/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 5117aadb2b0..6d68864cba4 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.2-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 3545491a439..835df270641 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.2-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index d1bb15958f9..6f3797d7777 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.2-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index eac090745c7..9cea0eb7431 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.2-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 8f3496f47be..66586f7e800 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.2-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 293951d4c35..182a734fc82 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.2-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 38aaea38c68..b111c8d1ea5 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.2-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 440f31064f0..0ad8d1a266b 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.2-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 14f19b31ae2..6810194ba9c 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1-SNAPSHOT + 3.11.2-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index e98fc0d581e..0090a151a83 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1-SNAPSHOT + 3.11.2-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index f5520ece9a1..162a55d75c4 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.2-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 76a47cb291e..267313bed7f 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.2-SNAPSHOT pom DataStax Java Driver for Apache Cassandra From 9c534977f72eec2f92beea7057c684bcd41ff743 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 17 Feb 2022 23:50:25 -0600 Subject: [PATCH 137/211] Revert "[maven-release-plugin] prepare for next development iteration" This reverts commit 3e665c96e4c690111900d95b4585b5c4eb983b0c. --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 6d68864cba4..5117aadb2b0 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 835df270641..3545491a439 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 6f3797d7777..d1bb15958f9 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 9cea0eb7431..eac090745c7 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 66586f7e800..8f3496f47be 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 182a734fc82..293951d4c35 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2-SNAPSHOT + 3.11.1-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index b111c8d1ea5..38aaea38c68 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 0ad8d1a266b..440f31064f0 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2-SNAPSHOT + 3.11.1-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 6810194ba9c..14f19b31ae2 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.2-SNAPSHOT + 3.11.1-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 0090a151a83..e98fc0d581e 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.2-SNAPSHOT + 3.11.1-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 162a55d75c4..f5520ece9a1 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2-SNAPSHOT + 3.11.1-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 267313bed7f..76a47cb291e 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1-SNAPSHOT pom DataStax Java Driver for Apache Cassandra From 11eb92e15a84765a1b9a43c3ef318cd2ef41aeb1 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 17 Feb 2022 23:55:10 -0600 Subject: [PATCH 138/211] [maven-release-plugin] prepare release 3.11.1 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 5117aadb2b0..71068f08659 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 3545491a439..c1533c068f6 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index d1bb15958f9..4a96380b14c 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index eac090745c7..e129f17abbb 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 8f3496f47be..cda650db9a2 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 293951d4c35..6f93a9f6396 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 38aaea38c68..fbd4f4ebf71 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 440f31064f0..46ce5d429b9 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.1 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 14f19b31ae2..427a2ccacae 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index e98fc0d581e..882f407a7d4 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index f5520ece9a1..e6359083f7e 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 76a47cb291e..3ea59a4b2c8 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.11.1 From 442e30087570cc4bc3e3eed411f83f0cb211ce67 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 17 Feb 2022 23:56:23 -0600 Subject: [PATCH 139/211] Revert "[maven-release-plugin] prepare release 3.11.1" This reverts commit 11eb92e15a84765a1b9a43c3ef318cd2ef41aeb1. --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 71068f08659..5117aadb2b0 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index c1533c068f6..3545491a439 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 4a96380b14c..d1bb15958f9 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index e129f17abbb..eac090745c7 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index cda650db9a2..8f3496f47be 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 6f93a9f6396..293951d4c35 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index fbd4f4ebf71..38aaea38c68 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 46ce5d429b9..440f31064f0 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.1-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 427a2ccacae..14f19b31ae2 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 882f407a7d4..e98fc0d581e 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index e6359083f7e..f5520ece9a1 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 3ea59a4b2c8..76a47cb291e 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.11.1 + HEAD From a4220e109f30532599895ca0fd2879a8a3034584 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 17 Feb 2022 23:59:32 -0600 Subject: [PATCH 140/211] [maven-release-plugin] prepare release 3.11.1 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 5117aadb2b0..71068f08659 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 3545491a439..c1533c068f6 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index d1bb15958f9..4a96380b14c 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index eac090745c7..e129f17abbb 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 8f3496f47be..cda650db9a2 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 293951d4c35..6f93a9f6396 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 38aaea38c68..fbd4f4ebf71 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 440f31064f0..46ce5d429b9 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.1 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 14f19b31ae2..427a2ccacae 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index e98fc0d581e..882f407a7d4 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index f5520ece9a1..e6359083f7e 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 76a47cb291e..3ea59a4b2c8 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.11.1 From 48dcbbe80d43637a422847893d96f5741344e6a3 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 17 Feb 2022 23:59:35 -0600 Subject: [PATCH 141/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 71068f08659..6d68864cba4 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index c1533c068f6..835df270641 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 4a96380b14c..6f3797d7777 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index e129f17abbb..9cea0eb7431 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index cda650db9a2..66586f7e800 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 6f93a9f6396..182a734fc82 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index fbd4f4ebf71..b111c8d1ea5 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 46ce5d429b9..0ad8d1a266b 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.2-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 427a2ccacae..6810194ba9c 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 882f407a7d4..0090a151a83 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index e6359083f7e..162a55d75c4 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 3ea59a4b2c8..267313bed7f 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.11.1 + HEAD From af01c42f50d4f4180802438349cebd9a161f21e9 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Fri, 18 Feb 2022 00:07:46 -0600 Subject: [PATCH 142/211] Revert "[maven-release-plugin] prepare for next development iteration" This reverts commit 48dcbbe80d43637a422847893d96f5741344e6a3. --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 6d68864cba4..71068f08659 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 835df270641..c1533c068f6 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 6f3797d7777..4a96380b14c 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 9cea0eb7431..e129f17abbb 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 66586f7e800..cda650db9a2 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 182a734fc82..6f93a9f6396 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index b111c8d1ea5..fbd4f4ebf71 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 0ad8d1a266b..46ce5d429b9 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2-SNAPSHOT + 3.11.1 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 6810194ba9c..427a2ccacae 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 0090a151a83..882f407a7d4 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 162a55d75c4..e6359083f7e 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2-SNAPSHOT + 3.11.1 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 267313bed7f..3ea59a4b2c8 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.1 pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.11.1 From e40cc75397a14f9db468aa3669e01e110a4d3a10 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Fri, 18 Feb 2022 00:08:21 -0600 Subject: [PATCH 143/211] Revert "[maven-release-plugin] prepare release 3.11.1" This reverts commit a4220e109f30532599895ca0fd2879a8a3034584. --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 71068f08659..5117aadb2b0 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index c1533c068f6..3545491a439 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 4a96380b14c..d1bb15958f9 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index e129f17abbb..eac090745c7 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index cda650db9a2..8f3496f47be 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 6f93a9f6396..293951d4c35 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index fbd4f4ebf71..38aaea38c68 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 46ce5d429b9..440f31064f0 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.1-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 427a2ccacae..14f19b31ae2 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 882f407a7d4..e98fc0d581e 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index e6359083f7e..f5520ece9a1 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.1-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 3ea59a4b2c8..76a47cb291e 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.1-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.11.1 + HEAD From 2bdcb4dbf2f2f38c91e12788cee9a0a00c233264 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Fri, 18 Feb 2022 00:19:27 -0600 Subject: [PATCH 144/211] [maven-release-plugin] prepare release 3.11.1 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 5117aadb2b0..71068f08659 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 3545491a439..c1533c068f6 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index d1bb15958f9..4a96380b14c 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index eac090745c7..e129f17abbb 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 8f3496f47be..cda650db9a2 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 293951d4c35..6f93a9f6396 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 38aaea38c68..fbd4f4ebf71 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 440f31064f0..46ce5d429b9 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.1 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 14f19b31ae2..427a2ccacae 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index e98fc0d581e..882f407a7d4 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index f5520ece9a1..e6359083f7e 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1-SNAPSHOT + 3.11.1 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 76a47cb291e..3ea59a4b2c8 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1-SNAPSHOT + 3.11.1 pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.11.1 From 27186d2c16771c96cc2723431d7aa7dbc4d0faa2 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Fri, 18 Feb 2022 00:19:30 -0600 Subject: [PATCH 145/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 71068f08659..6d68864cba4 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index c1533c068f6..835df270641 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 4a96380b14c..6f3797d7777 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index e129f17abbb..9cea0eb7431 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index cda650db9a2..66586f7e800 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 6f93a9f6396..182a734fc82 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index fbd4f4ebf71..b111c8d1ea5 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 46ce5d429b9..0ad8d1a266b 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.2-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 427a2ccacae..6810194ba9c 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 882f407a7d4..0090a151a83 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index e6359083f7e..162a55d75c4 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.1 + 3.11.2-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 3ea59a4b2c8..267313bed7f 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.1 + 3.11.2-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.11.1 + HEAD From d4a604445926ff78d5c26c0381084b58ca589863 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 26 Apr 2022 09:23:04 -0500 Subject: [PATCH 146/211] JAVA-2984: Upgrade jackson-databind to latest 2.7.x (#1593) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 267313bed7f..445b2595641 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 2.1.10 2.8.11 - 2.7.9.3 + 2.7.9.7 2.9.9 1.0 1.0.4 From 19a9cf80503e16f5ae5a271af3021607ec2bb97f Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 26 Apr 2022 12:19:18 -0500 Subject: [PATCH 147/211] JAVA-3008: Upgrade to Netty 4.1.75 to address CVEs (3.x) (#1594) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 445b2595641..753ebc1da55 100644 --- a/pom.xml +++ b/pom.xml @@ -51,8 +51,8 @@ 1.7.25 1.7.25 19.0 - 4.0.56.Final - 2.0.7.Final + 4.1.75.Final + 2.0.50.Final 3.2.2 1.1.2.6 1.4.1 From 20a210533c31094af08455a03242fdc12671fea3 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 28 Apr 2022 14:12:33 -0500 Subject: [PATCH 148/211] Update version in docs to 3.11.2 --- README.md | 12 ++++++------ changelog/README.md | 5 +++++ faq/README.md | 2 +- manual/compression/README.md | 2 +- manual/custom_codecs/extras/README.md | 2 +- manual/metrics/README.md | 2 +- manual/object_mapper/README.md | 2 +- manual/shaded_jar/README.md | 6 +++--- pom.xml | 2 +- 9 files changed, 20 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 97c5067c979..ab93de8f62e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ for the development version and that some features described here might not yet have been released. You can find the documentation for the latest version through the [Java driver docs](http://docs.datastax.com/en/developer/java-driver/3.11/index.html) or via the release tags, -[e.g. 3.11.1](https://github.com/datastax/java-driver/tree/3.11.1).* +[e.g. 3.11.2](https://github.com/datastax/java-driver/tree/3.11.2).* A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol @@ -65,7 +65,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-dri com.datastax.cassandra cassandra-driver-core - 3.11.1 + 3.11.2 ``` @@ -75,7 +75,7 @@ Note that the object mapper is published as a separate artifact: com.datastax.cassandra cassandra-driver-mapping - 3.11.1 + 3.11.2 ``` @@ -85,7 +85,7 @@ The 'extras' module is also published as a separate artifact: com.datastax.cassandra cassandra-driver-extras - 3.11.1 + 3.11.2 ``` @@ -94,12 +94,12 @@ 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](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.11.1.tar.gz) +[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.11.2.tar.gz) is available for download. ## Compatibility -The Java client driver 3.11.1 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache +The Java client driver 3.11.2 ([branch 3.x](https://github.com/datastax/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). diff --git a/changelog/README.md b/changelog/README.md index dc14e0f5d76..017332aa7d2 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,6 +5,11 @@ 3.x versions get published. --> +## 3.11.2 +- [improvement] JAVA-3008: Upgrade Netty to 4.1.75, 3.x edition +- [improvement] JAVA-2984: Upgrade Jackson to resolve high-priority CVEs + + ## 3.11.1 - [bug] JAVA-2967: Support native transport peer information for DSE 6.8. - [bug] JAVA-2976: Support missing protocol v5 error codes CAS_WRITE_UNKNOWN, CDC_WRITE_FAILURE. diff --git a/faq/README.md b/faq/README.md index ea48a598a23..f2481fd5807 100644 --- a/faq/README.md +++ b/faq/README.md @@ -289,7 +289,7 @@ version is available, you may want to reach out to the maintainer of that tool t an update with compatibility to this driver version. -[Blobs.java]: https://github.com/datastax/java-driver/tree/3.11.1/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java +[Blobs.java]: https://github.com/datastax/java-driver/tree/3.11.2/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304 [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding [Mapper options]: ../manual/object_mapper/using/#mapper-options diff --git a/manual/compression/README.md b/manual/compression/README.md index fb39e6771dd..ff4358dacd4 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -88,4 +88,4 @@ cluster = Cluster.builder() .build(); ``` -[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.11.1/cassandra-driver-parent-3.11.1.pom +[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.11.2/cassandra-driver-parent-3.11.2.pom diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index ec0f56a17e9..91c5e665957 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -10,7 +10,7 @@ The module is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-extras - 3.11.1 + 3.11.2 ``` diff --git a/manual/metrics/README.md b/manual/metrics/README.md index 5ad2a8084f6..2b005364f98 100644 --- a/manual/metrics/README.md +++ b/manual/metrics/README.md @@ -38,7 +38,7 @@ To do this in a maven project: com.datastax.cassandra cassandra-driver-core - 3.11.1 + 3.11.2 io.dropwizard.metrics diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md index fd8ccad89d9..7e542b0d076 100644 --- a/manual/object_mapper/README.md +++ b/manual/object_mapper/README.md @@ -11,7 +11,7 @@ The mapper is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-mapping - 3.11.1 + 3.11.2 ``` diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md index ee25d56f0d1..d3063df685f 100644 --- a/manual/shaded_jar/README.md +++ b/manual/shaded_jar/README.md @@ -12,7 +12,7 @@ package name: com.datastax.cassandra cassandra-driver-core - 3.11.1 + 3.11.2 shaded @@ -32,7 +32,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-core - 3.11.1 + 3.11.2 shaded @@ -44,7 +44,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-mapping - 3.11.1 + 3.11.2 com.datastax.cassandra diff --git a/pom.xml b/pom.xml index 753ebc1da55..db4a6180b61 100644 --- a/pom.xml +++ b/pom.xml @@ -641,7 +641,7 @@ - 3.11.0 + 3.11.1 ../clirr-ignores.xml com/datastax/shaded/** From 38dd37a0515fa1a2fb3cc6861822a74ebc395678 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 28 Apr 2022 14:16:28 -0500 Subject: [PATCH 149/211] [maven-release-plugin] prepare release 3.11.2 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 6d68864cba4..3b217705488 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.2 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 835df270641..999b0709817 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.2 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 6f3797d7777..f8bc314bd56 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.2 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 9cea0eb7431..b802dcfd61b 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.2 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 66586f7e800..5bd443161fa 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.2 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 182a734fc82..934dd61a35e 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2-SNAPSHOT + 3.11.2 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index b111c8d1ea5..79824be7834 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.2 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 0ad8d1a266b..63c7f3829b7 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2-SNAPSHOT + 3.11.2 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 6810194ba9c..2af2323ac33 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.2-SNAPSHOT + 3.11.2 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 0090a151a83..068be18153f 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.2-SNAPSHOT + 3.11.2 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 162a55d75c4..6c24da21c5b 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2-SNAPSHOT + 3.11.2 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index db4a6180b61..8cd07935530 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2-SNAPSHOT + 3.11.2 pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.11.2 From e50d8125fb9f08f208ce6a5c771b0b73397b8772 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 28 Apr 2022 14:16:31 -0500 Subject: [PATCH 150/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 3b217705488..fa7d3860089 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2 + 3.11.3-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 999b0709817..31c1939b15d 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2 + 3.11.3-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index f8bc314bd56..3e208171132 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2 + 3.11.3-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index b802dcfd61b..754b6c1873f 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2 + 3.11.3-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 5bd443161fa..a5ab92ff477 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2 + 3.11.3-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 934dd61a35e..f53d8e2827f 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2 + 3.11.3-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 79824be7834..729357977c2 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2 + 3.11.3-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 63c7f3829b7..2eea607c279 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2 + 3.11.3-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 2af2323ac33..4b9d8af3b50 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.2 + 3.11.3-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 068be18153f..ad0add0f640 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.2 + 3.11.3-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 6c24da21c5b..39f65877fed 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.2 + 3.11.3-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 8cd07935530..0ea61a4b52c 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.2 + 3.11.3-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.11.2 + HEAD From 4b586c35ff2bd657cb9bd52805e6ad01a1d67045 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 21 Jun 2022 17:05:07 -0500 Subject: [PATCH 151/211] JAVA-3023: Upgrade Netty to 4.1.77 (3.x) (#1601) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0ea61a4b52c..83575fe0075 100644 --- a/pom.xml +++ b/pom.xml @@ -51,8 +51,8 @@ 1.7.25 1.7.25 19.0 - 4.1.75.Final - 2.0.50.Final + 4.1.77.Final + 2.0.52.Final 3.2.2 1.1.2.6 1.4.1 From 0920c63809d5f9ef033d1b99efdc6901d731a0c9 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Mon, 19 Sep 2022 20:12:35 -0500 Subject: [PATCH 152/211] Update version in docs to 3.11.3 --- README.md | 12 ++++++------ changelog/README.md | 4 ++++ faq/README.md | 2 +- manual/compression/README.md | 2 +- manual/custom_codecs/extras/README.md | 2 +- manual/metrics/README.md | 2 +- manual/object_mapper/README.md | 2 +- manual/shaded_jar/README.md | 6 +++--- 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index ab93de8f62e..7926e239719 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ for the development version and that some features described here might not yet have been released. You can find the documentation for the latest version through the [Java driver docs](http://docs.datastax.com/en/developer/java-driver/3.11/index.html) or via the release tags, -[e.g. 3.11.2](https://github.com/datastax/java-driver/tree/3.11.2).* +[e.g. 3.11.3](https://github.com/datastax/java-driver/tree/3.11.3).* A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol @@ -65,7 +65,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-dri com.datastax.cassandra cassandra-driver-core - 3.11.2 + 3.11.3 ``` @@ -75,7 +75,7 @@ Note that the object mapper is published as a separate artifact: com.datastax.cassandra cassandra-driver-mapping - 3.11.2 + 3.11.3 ``` @@ -85,7 +85,7 @@ The 'extras' module is also published as a separate artifact: com.datastax.cassandra cassandra-driver-extras - 3.11.2 + 3.11.3 ``` @@ -94,12 +94,12 @@ 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](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.11.2.tar.gz) +[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.11.3.tar.gz) is available for download. ## Compatibility -The Java client driver 3.11.2 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache +The Java client driver 3.11.3 ([branch 3.x](https://github.com/datastax/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). diff --git a/changelog/README.md b/changelog/README.md index 017332aa7d2..09514ca1dc5 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,6 +5,10 @@ 3.x versions get published. --> +## 3.11.3 +- [improvement] JAVA-3023: Upgrade Netty to 4.1.77, 3.x edition + + ## 3.11.2 - [improvement] JAVA-3008: Upgrade Netty to 4.1.75, 3.x edition - [improvement] JAVA-2984: Upgrade Jackson to resolve high-priority CVEs diff --git a/faq/README.md b/faq/README.md index f2481fd5807..9fdb4da1e0f 100644 --- a/faq/README.md +++ b/faq/README.md @@ -289,7 +289,7 @@ version is available, you may want to reach out to the maintainer of that tool t an update with compatibility to this driver version. -[Blobs.java]: https://github.com/datastax/java-driver/tree/3.11.2/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java +[Blobs.java]: https://github.com/datastax/java-driver/tree/3.11.3/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304 [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding [Mapper options]: ../manual/object_mapper/using/#mapper-options diff --git a/manual/compression/README.md b/manual/compression/README.md index ff4358dacd4..5cb527ced75 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -88,4 +88,4 @@ cluster = Cluster.builder() .build(); ``` -[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.11.2/cassandra-driver-parent-3.11.2.pom +[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.11.3/cassandra-driver-parent-3.11.3.pom diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index 91c5e665957..1ab3b80c95e 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -10,7 +10,7 @@ The module is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-extras - 3.11.2 + 3.11.3 ``` diff --git a/manual/metrics/README.md b/manual/metrics/README.md index 2b005364f98..8764a0e7918 100644 --- a/manual/metrics/README.md +++ b/manual/metrics/README.md @@ -38,7 +38,7 @@ To do this in a maven project: com.datastax.cassandra cassandra-driver-core - 3.11.2 + 3.11.3 io.dropwizard.metrics diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md index 7e542b0d076..9ba3f70f780 100644 --- a/manual/object_mapper/README.md +++ b/manual/object_mapper/README.md @@ -11,7 +11,7 @@ The mapper is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-mapping - 3.11.2 + 3.11.3 ``` diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md index d3063df685f..f09ae88bcb8 100644 --- a/manual/shaded_jar/README.md +++ b/manual/shaded_jar/README.md @@ -12,7 +12,7 @@ package name: com.datastax.cassandra cassandra-driver-core - 3.11.2 + 3.11.3 shaded @@ -32,7 +32,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-core - 3.11.2 + 3.11.3 shaded @@ -44,7 +44,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-mapping - 3.11.2 + 3.11.3 com.datastax.cassandra From 522e04375d2a3c5c033eaf2a2ab90d8893d44877 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 20 Sep 2022 04:50:05 +0000 Subject: [PATCH 153/211] Update previous version for clirr --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 83575fe0075..74232878791 100644 --- a/pom.xml +++ b/pom.xml @@ -641,7 +641,7 @@ - 3.11.1 + 3.11.2 ../clirr-ignores.xml com/datastax/shaded/** From ceba2bc331a419bdbc442d1e99e334a9e285094f Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 20 Sep 2022 04:52:50 +0000 Subject: [PATCH 154/211] [maven-release-plugin] prepare release 3.11.3 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index fa7d3860089..b3b57241221 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.3-SNAPSHOT + 3.11.3 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 31c1939b15d..ec723f94920 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.3-SNAPSHOT + 3.11.3 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 3e208171132..8af1fd2bd4e 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.3-SNAPSHOT + 3.11.3 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 754b6c1873f..c2e4841ea98 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.3-SNAPSHOT + 3.11.3 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index a5ab92ff477..32ae727a19e 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.3-SNAPSHOT + 3.11.3 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index f53d8e2827f..da35fb59b18 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.3-SNAPSHOT + 3.11.3 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 729357977c2..814c3271d48 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.3-SNAPSHOT + 3.11.3 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 2eea607c279..c60e7c8bb0b 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.3-SNAPSHOT + 3.11.3 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 4b9d8af3b50..2242864cbe8 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.3-SNAPSHOT + 3.11.3 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index ad0add0f640..ee4db96f604 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.3-SNAPSHOT + 3.11.3 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 39f65877fed..5e1d229f200 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.3-SNAPSHOT + 3.11.3 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 74232878791..b03c70dbd80 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.3-SNAPSHOT + 3.11.3 pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.11.3 From f921bd434990e5588ee95ef401fd2100aa42bd4c Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 20 Sep 2022 04:52:55 +0000 Subject: [PATCH 155/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index b3b57241221..af36a7f5c5b 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.3 + 3.11.4-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index ec723f94920..8592a72adba 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.3 + 3.11.4-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 8af1fd2bd4e..304dafa776c 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.3 + 3.11.4-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index c2e4841ea98..dc7dc66b6c8 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.3 + 3.11.4-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 32ae727a19e..579c804899b 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.3 + 3.11.4-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index da35fb59b18..2ca85c103d3 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.3 + 3.11.4-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 814c3271d48..00258a0dd45 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.3 + 3.11.4-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index c60e7c8bb0b..10d3ca1cfe4 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.3 + 3.11.4-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 2242864cbe8..3a597858092 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.3 + 3.11.4-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index ee4db96f604..77994336cf9 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.3 + 3.11.4-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 5e1d229f200..d971c04a581 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.3 + 3.11.4-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index b03c70dbd80..62f71ba31ac 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.3 + 3.11.4-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1147,7 +1147,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.11.3 + HEAD From a9f13f468f73a76f69cfb267a406a3c2dd8199d9 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Thu, 15 Dec 2022 22:32:01 -0600 Subject: [PATCH 156/211] Applying 4.x fixes to Jenkinsfile to get build working on AWS --- Jenkinsfile | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 45d02d3d9d5..388395b7615 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -140,25 +140,6 @@ ${status} after ${currentBuild.durationString - ' and counting'}""" } } -def submitCIMetrics(buildType) { - long durationMs = currentBuild.duration - long durationSec = durationMs / 1000 - long nowSec = (currentBuild.startTimeInMillis + durationMs) / 1000 - def branchNameNoPeriods = env.BRANCH_NAME.replaceAll('\\.', '_') - def durationMetric = "okr.ci.java.${env.DRIVER_METRIC_TYPE}.${buildType}.${branchNameNoPeriods} ${durationSec} ${nowSec}" - - timeout(time: 1, unit: 'MINUTES') { - withCredentials([string(credentialsId: 'lab-grafana-address', variable: 'LAB_GRAFANA_ADDRESS'), - string(credentialsId: 'lab-grafana-port', variable: 'LAB_GRAFANA_PORT')]) { - withEnv(["DURATION_METRIC=${durationMetric}"]) { - sh label: 'Send runtime metrics to labgrafana', script: '''#!/bin/bash -le - echo "${DURATION_METRIC}" | nc -q 5 ${LAB_GRAFANA_ADDRESS} ${LAB_GRAFANA_PORT} - ''' - } - } - } -} - def describePerCommitStage() { script { currentBuild.displayName = "Per-Commit build" @@ -182,7 +163,9 @@ def describeAdhocAndScheduledTestingStage() { // branch pattern for cron // should match 3.x, 4.x, 4.5.x, etc -def branchPatternCron = ~"((\\d+(\\.[\\dx]+)+))" +def branchPatternCron() { + ~"((\\d+(\\.[\\dx]+)+))" +} pipeline { agent none @@ -327,7 +310,7 @@ pipeline { triggers { // schedules only run against release branches (i.e. 3.x, 4.x, 4.5.x, etc.) - parameterizedCron(branchPatternCron.matcher(env.BRANCH_NAME).matches() ? """ + parameterizedCron(branchPatternCron().matcher(env.BRANCH_NAME).matches() ? """ # Every weeknight (Monday - Friday) around 3:00 AM ### JDK8 tests against 2.1, 3.0, 3.11 and 4.0 H 3 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=2.1 3.0 3.11 4.0;CI_SCHEDULE_JABBA_VERSION=1.8;CI_SCHEDULE_TEST_PROFILE=long @@ -428,11 +411,6 @@ pipeline { } } post { - always { - node('master') { - submitCIMetrics('commit') - } - } aborted { notifySlack('aborted') } From c3ee3f14def9cc488e3c508e0a1b1901c10bce1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Przytu=C5=82a?= <59482568+wprzytula@users.noreply.github.com> Date: Fri, 7 Jul 2023 00:21:41 +0200 Subject: [PATCH 157/211] Fix LatencyAwarePolicy scale docstring (#1671) A parenthesis was too far to the right. --- .../com/datastax/driver/core/policies/LatencyAwarePolicy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/LatencyAwarePolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/LatencyAwarePolicy.java index e92c9599ab3..34152601258 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/policies/LatencyAwarePolicy.java +++ b/driver-core/src/main/java/com/datastax/driver/core/policies/LatencyAwarePolicy.java @@ -709,7 +709,7 @@ public Builder withExclusionThreshold(double exclusionThreshold) { * *
    {@code d = (t - t') / scale
          * alpha = 1 - (ln(d+1) / d)
    -     * avg = alpha * l + (1 - alpha * prev)}
    + * avg = alpha * l + (1 - alpha) * prev} * * Typically, with a {@code scale} of 100 milliseconds (the default), if a new latency is * measured and the previous measure is 10 millisecond old (so {@code d=0.1}), then {@code From 1b7db3a9be5d9fab48e3293bc6eba457d52b5c78 Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Thu, 6 Jul 2023 13:51:46 -0700 Subject: [PATCH 158/211] JAVA-3082: fix maven compile + test steps on apple-silicon pom.xml: - add apple-silicon-dev profile which switches netty-tcnative for netty-tcnative-boringssl-static and updates to newer jffi (only at build-time, reference links in pom.xml) - upgrade animal-sniffer plugin to 1.16 to address error IllegalArgumentException during check-jdk6 step (see https://github.com/mojohaus/animal-sniffer/issues/29) --- driver-core/pom.xml | 2 +- pom.xml | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index af36a7f5c5b..27324e4debf 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -125,7 +125,7 @@ io.netty - netty-tcnative + ${netty-tcnative.artifact} ${os.detected.classifier} test diff --git a/pom.xml b/pom.xml index 62f71ba31ac..0f277e104e2 100644 --- a/pom.xml +++ b/pom.xml @@ -52,6 +52,7 @@ 1.7.25 19.0 4.1.77.Final + netty-tcnative 2.0.52.Final 3.2.2 1.1.2.6 @@ -350,7 +351,7 @@ io.netty - netty-tcnative + ${netty-tcnative.artifact} ${netty-tcnative.version} ${os.detected.classifier} @@ -717,7 +718,7 @@ limitations under the License. org.codehaus.mojo animal-sniffer-maven-plugin - 1.15 + 1.16 check-jdk6 @@ -1125,6 +1126,24 @@ limitations under the License. true + + + apple-silicon-dev + + + mac os x + mac + aarch64 + + + + + netty-tcnative-boringssl-static + + 2.2.10 + + + From e0a4edc914a8d5a183b1d542ccbaa9c9779abee5 Mon Sep 17 00:00:00 2001 From: hhughes Date: Thu, 20 Jul 2023 08:09:30 -0700 Subject: [PATCH 159/211] JAVA-3079: upgrade netty.version to 4.1.94.Final + netty-tcnative.version to 2.0.61.Final (#1675) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0f277e104e2..a5eef53ecdb 100644 --- a/pom.xml +++ b/pom.xml @@ -51,9 +51,9 @@ 1.7.25 1.7.25 19.0 - 4.1.77.Final + 4.1.94.Final netty-tcnative - 2.0.52.Final + 2.0.61.Final 3.2.2 1.1.2.6 1.4.1 From 2e6c5f338f5653a2284313989c86e3385ead9c8a Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Tue, 25 Jul 2023 09:10:41 -0700 Subject: [PATCH 160/211] Update version in docs to 3.11.4 --- README.md | 12 ++++++------ changelog/README.md | 5 +++++ faq/README.md | 2 +- manual/compression/README.md | 2 +- manual/custom_codecs/extras/README.md | 2 +- manual/metrics/README.md | 2 +- manual/object_mapper/README.md | 2 +- manual/shaded_jar/README.md | 6 +++--- 8 files changed, 19 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 7926e239719..8296e636bd4 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ for the development version and that some features described here might not yet have been released. You can find the documentation for the latest version through the [Java driver docs](http://docs.datastax.com/en/developer/java-driver/3.11/index.html) or via the release tags, -[e.g. 3.11.3](https://github.com/datastax/java-driver/tree/3.11.3).* +[e.g. 3.11.4](https://github.com/datastax/java-driver/tree/3.11.4).* A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol @@ -65,7 +65,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-dri com.datastax.cassandra cassandra-driver-core - 3.11.3 + 3.11.4 ``` @@ -75,7 +75,7 @@ Note that the object mapper is published as a separate artifact: com.datastax.cassandra cassandra-driver-mapping - 3.11.3 + 3.11.4 ``` @@ -85,7 +85,7 @@ The 'extras' module is also published as a separate artifact: com.datastax.cassandra cassandra-driver-extras - 3.11.3 + 3.11.4/version> ``` @@ -94,12 +94,12 @@ 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](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.11.3.tar.gz) +[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.11.4.tar.gz) is available for download. ## Compatibility -The Java client driver 3.11.3 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache +The Java client driver 3.11.4 ([branch 3.x](https://github.com/datastax/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). diff --git a/changelog/README.md b/changelog/README.md index 09514ca1dc5..8a49b38bb13 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,6 +5,11 @@ 3.x versions get published. --> +## 3.11.4 +- [improvement] JAVA-3079: Upgrade Netty to 4.1.94, 3.x edition +- [improvement] JAVA-3082: Fix maven build for Apple-silicon +- [improvement] PR 1671: Fix LatencyAwarePolicy scale docstring + ## 3.11.3 - [improvement] JAVA-3023: Upgrade Netty to 4.1.77, 3.x edition diff --git a/faq/README.md b/faq/README.md index 9fdb4da1e0f..541602059fe 100644 --- a/faq/README.md +++ b/faq/README.md @@ -289,7 +289,7 @@ version is available, you may want to reach out to the maintainer of that tool t an update with compatibility to this driver version. -[Blobs.java]: https://github.com/datastax/java-driver/tree/3.11.3/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java +[Blobs.java]: https://github.com/datastax/java-driver/tree/3.11.4/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304 [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding [Mapper options]: ../manual/object_mapper/using/#mapper-options diff --git a/manual/compression/README.md b/manual/compression/README.md index 5cb527ced75..1718837a62a 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -88,4 +88,4 @@ cluster = Cluster.builder() .build(); ``` -[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.11.3/cassandra-driver-parent-3.11.3.pom +[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.11.4/cassandra-driver-parent-3.11.4.pom diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index 1ab3b80c95e..75a64454e0e 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -10,7 +10,7 @@ The module is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-extras - 3.11.3 + 3.11.4 ``` diff --git a/manual/metrics/README.md b/manual/metrics/README.md index 8764a0e7918..00b865111d4 100644 --- a/manual/metrics/README.md +++ b/manual/metrics/README.md @@ -38,7 +38,7 @@ To do this in a maven project: com.datastax.cassandra cassandra-driver-core - 3.11.3 + 3.11.4 io.dropwizard.metrics diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md index 9ba3f70f780..d8178267f89 100644 --- a/manual/object_mapper/README.md +++ b/manual/object_mapper/README.md @@ -11,7 +11,7 @@ The mapper is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-mapping - 3.11.3 + 3.11.4 ``` diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md index f09ae88bcb8..b402e3b9656 100644 --- a/manual/shaded_jar/README.md +++ b/manual/shaded_jar/README.md @@ -12,7 +12,7 @@ package name: com.datastax.cassandra cassandra-driver-core - 3.11.3 + 3.11.4 shaded @@ -32,7 +32,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-core - 3.11.3 + 3.11.4 shaded @@ -44,7 +44,7 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-mapping - 3.11.3 + 3.11.4 com.datastax.cassandra From 1f49eef178e23a4c2660312a8fde14ba22f829d1 Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Tue, 25 Jul 2023 09:59:20 -0700 Subject: [PATCH 161/211] Update previous version for clirr --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a5eef53ecdb..be1e9fe6fbb 100644 --- a/pom.xml +++ b/pom.xml @@ -642,7 +642,7 @@ - 3.11.2 + 3.11.3 ../clirr-ignores.xml com/datastax/shaded/** From 71e75b39d5dbb874392b90bbe6e6264fcf769e53 Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Wed, 26 Jul 2023 14:14:45 -0700 Subject: [PATCH 162/211] [maven-release-plugin] prepare release 3.11.4 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 27324e4debf..0f2899b40c9 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.4-SNAPSHOT + 3.11.4 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 8592a72adba..75aa14c3608 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.4-SNAPSHOT + 3.11.4 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 304dafa776c..94e862b0abb 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.4-SNAPSHOT + 3.11.4 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index dc7dc66b6c8..d8c8353356c 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.4-SNAPSHOT + 3.11.4 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 579c804899b..121d2862374 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.4-SNAPSHOT + 3.11.4 cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 2ca85c103d3..f126d79e678 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.4-SNAPSHOT + 3.11.4 cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 00258a0dd45..c053a5b48c9 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.4-SNAPSHOT + 3.11.4 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 10d3ca1cfe4..5c878c81a54 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.4-SNAPSHOT + 3.11.4 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 3a597858092..8891602597b 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.4-SNAPSHOT + 3.11.4 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 77994336cf9..ca7c2dddc0b 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.4-SNAPSHOT + 3.11.4 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index d971c04a581..a95e8e8f2ee 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.4-SNAPSHOT + 3.11.4 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index be1e9fe6fbb..e0af2268392 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.4-SNAPSHOT + 3.11.4 pom DataStax Java Driver for Apache Cassandra @@ -1166,7 +1166,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.11.4 From e9633e9cf8e440e0592012c2d6ebc11a71bd274c Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Wed, 26 Jul 2023 14:14:48 -0700 Subject: [PATCH 163/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 0f2899b40c9..2c8d06c79d7 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.4 + 3.11.5-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 75aa14c3608..6b9de0500b7 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.4 + 3.11.5-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 94e862b0abb..bdd3d98b8f6 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.4 + 3.11.5-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index d8c8353356c..9f2dce4802d 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.4 + 3.11.5-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 121d2862374..cd08fa7e3da 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.4 + 3.11.5-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index f126d79e678..f30355bf816 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.4 + 3.11.5-SNAPSHOT cassandra-driver-tests-osgi diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index c053a5b48c9..fecee78b300 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.4 + 3.11.5-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 5c878c81a54..d4fca2ab5e9 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.4 + 3.11.5-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 8891602597b..544912b5a30 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.4 + 3.11.5-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index ca7c2dddc0b..27dc8636ecc 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.4 + 3.11.5-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index a95e8e8f2ee..3924529919b 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.4 + 3.11.5-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index e0af2268392..0466d979ec5 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.4 + 3.11.5-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1166,7 +1166,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.11.4 + HEAD From 031eda1d94e7ce11c082825fda0c3fd79d311b5b Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Wed, 16 Aug 2023 19:25:53 -0500 Subject: [PATCH 164/211] Update clirr version after 3.11.4 release (#1706) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0466d979ec5..46f1d8273b7 100644 --- a/pom.xml +++ b/pom.xml @@ -642,7 +642,7 @@ - 3.11.3 + 3.11.4 ../clirr-ignores.xml com/datastax/shaded/** From 916c4b82666412ad9ef5220175d024806f6bf7f5 Mon Sep 17 00:00:00 2001 From: hhughes Date: Wed, 23 Aug 2023 12:25:40 -0700 Subject: [PATCH 165/211] JAVA-3115: SimpleStrategy#equals should compare replicationFactor using ReplicationFactor#equals (#1718) --- .../driver/core/ReplicationStategy.java | 2 +- .../driver/core/ReplicationStrategyTest.java | 74 +++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/ReplicationStategy.java b/driver-core/src/main/java/com/datastax/driver/core/ReplicationStategy.java index aaaefd9a6b7..06351604570 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ReplicationStategy.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ReplicationStategy.java @@ -106,7 +106,7 @@ public boolean equals(Object o) { SimpleStrategy that = (SimpleStrategy) o; - return replicationFactor == that.replicationFactor; + return replicationFactor.equals(that.replicationFactor); } @Override diff --git a/driver-core/src/test/java/com/datastax/driver/core/ReplicationStrategyTest.java b/driver-core/src/test/java/com/datastax/driver/core/ReplicationStrategyTest.java index 5615623cbc2..12f284faa22 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ReplicationStrategyTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ReplicationStrategyTest.java @@ -15,6 +15,7 @@ */ package com.datastax.driver.core; +import static org.assertj.core.api.Assertions.assertThat; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; @@ -87,4 +88,77 @@ public void createUnspecifiedStrategyTest() throws Exception { assertNull(strategy); } + + @Test(groups = "unit") + public void simpleStrategyEqualsTest() { + ReplicationStrategy rf3_1 = + ReplicationStrategy.create( + ImmutableMap.builder() + .put("class", "SimpleStrategy") + .put("replication_factor", "3") + .build()); + + ReplicationStrategy rf3_2 = + ReplicationStrategy.create( + ImmutableMap.builder() + .put("class", "SimpleStrategy") + .put("replication_factor", "3") + .build()); + + ReplicationStrategy rf2_1 = + ReplicationStrategy.create( + ImmutableMap.builder() + .put("class", "SimpleStrategy") + .put("replication_factor", "2") + .build()); + + //noinspection EqualsWithItself + assertThat(rf3_1).isEqualTo(rf3_1); + assertThat(rf3_1).isEqualTo(rf3_2); + assertThat(rf3_1).isNotEqualTo(rf2_1); + } + + public void networkTopologyStrategyEqualsTest() { + ReplicationStrategy network_dc1x2_dc2x2_1 = + ReplicationStrategy.create( + ImmutableMap.builder() + .put("class", "NetworkTopologyStrategy") + .put("dc1", "2") + .put("dc2", "2") + .build()); + ReplicationStrategy network_dc1x2_dc2x2_2 = + ReplicationStrategy.create( + ImmutableMap.builder() + .put("class", "NetworkTopologyStrategy") + .put("dc1", "2") + .put("dc2", "2") + .build()); + ReplicationStrategy network_dc1x1_dc2x2_1 = + ReplicationStrategy.create( + ImmutableMap.builder() + .put("class", "NetworkTopologyStrategy") + .put("dc1", "1") + .put("dc2", "2") + .build()); + ReplicationStrategy network_dc1x2_dc3x2_1 = + ReplicationStrategy.create( + ImmutableMap.builder() + .put("class", "NetworkTopologyStrategy") + .put("dc1", "2") + .put("dc3", "2") + .build()); + ReplicationStrategy network_dc1x2_1 = + ReplicationStrategy.create( + ImmutableMap.builder() + .put("class", "NetworkTopologyStrategy") + .put("dc1", "2") + .build()); + + //noinspection EqualsWithItself + assertThat(network_dc1x2_dc2x2_1).isEqualTo(network_dc1x2_dc2x2_1); + assertThat(network_dc1x2_dc2x2_1).isEqualTo(network_dc1x2_dc2x2_2); + assertThat(network_dc1x2_dc2x2_1).isNotEqualTo(network_dc1x1_dc2x2_1); + assertThat(network_dc1x2_dc2x2_1).isNotEqualTo(network_dc1x2_dc3x2_1); + assertThat(network_dc1x2_dc2x2_1).isNotEqualTo(network_dc1x2_1); + } } From 4a9bad0b97536e8a7347f3423f57cf0642c1dad6 Mon Sep 17 00:00:00 2001 From: hhughes Date: Wed, 23 Aug 2023 13:41:29 -0700 Subject: [PATCH 166/211] JAVA-3099: Fix failing integration tests (#1701) should_extract_hosts_using_native_transport_address_port_ssl_from_peers - use testng style ignore should_function_with_snappy_compression - skip for cassandra 4.0.0 and greater (not supported) should_handle_failing_or_missing_contact_points - use V4 protocol to avoid initial retry with default V5 should_ignore_and_warn_peers_with_null_entries_by_default - encode expected "missing native_transport_*" strings when not using v2-style peers should_init_policy_with_up_contact_points - since adding SNI support for astra, only contact points will have state INIT should_throw_proper_read_timeout_exception - update expected error message string should_throw_exception_when_frame_exceeds_configured_max - use V4 protocol for cassandra 4.0+ OPPTokenIntegrationTest/OPPTokenVnodeIntegrationTest - not applicable for cassandra 4.0+ MailboxServiceSnappyIT - not applicable for cassandra 4.0+ osgi/BundleOptions - add missing dependencies for recent library upgrades override org.ops4j.pax.url.mvn.repositories in osgi tests because https is now required by maven central --- .../datastax/driver/core/CCMTestsSupport.java | 10 +++++++ .../datastax/driver/core/ClusterInitTest.java | 2 ++ .../driver/core/ControlConnectionTest.java | 12 ++++++--- .../driver/core/DirectCompressionTest.java | 1 + .../datastax/driver/core/FrameLengthTest.java | 27 ++++++++++++++++--- .../driver/core/HeapCompressionTest.java | 1 + .../LoadBalancingPolicyBootstrapTest.java | 5 +++- .../driver/core/OPPTokenIntegrationTest.java | 6 +++++ .../core/OPPTokenVnodeIntegrationTest.java | 6 +++++ .../exceptions/ExceptionsScassandraTest.java | 2 +- driver-tests/osgi/pom.xml | 3 +++ .../datastax/driver/osgi/impl/Activator.java | 6 ++++- .../datastax/driver/osgi/BundleOptions.java | 4 ++- .../driver/osgi/MailboxServiceSnappyIT.java | 6 +++++ pom.xml | 1 + 15 files changed, 81 insertions(+), 11 deletions(-) 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 6bcb65fd88a..ca9f5e45d6f 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 @@ -56,6 +56,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.ITestResult; +import org.testng.SkipException; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -1137,4 +1138,13 @@ private static T instantiate(Class clazz) return (T) constructor.newInstance(enclosingInstance); } } + + protected void skipTestWithCassandraVersionOrHigher(String version, String testKind) { + if (CCMBridge.getGlobalCassandraVersion().compareTo(VersionNumber.parse(version)) >= 0) { + throw new SkipException( + String.format( + "%s tests not applicable to cassandra version >= %s (configured: %s)", + testKind, version, CCMBridge.getGlobalCassandraVersion())); + } + } } diff --git a/driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java b/driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java index dfc538732e0..ed2bdbabbe6 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java @@ -107,6 +107,8 @@ public void should_handle_failing_or_missing_contact_points() throws UnknownHost cluster = Cluster.builder() .withPort(scassandra.getBinaryPort()) + // scassandra supports max V4 protocol + .withProtocolVersion(ProtocolVersion.V4) .addContactPoints( ipOfNode(1), failingHosts.get(0).address, diff --git a/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java b/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java index 83f54e7861a..62decf5ec07 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java @@ -52,7 +52,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import org.apache.log4j.Level; -import org.junit.Ignore; import org.scassandra.http.client.PrimingClient; import org.scassandra.http.client.PrimingRequest; import org.scassandra.http.client.Result; @@ -335,11 +334,17 @@ static void run_with_null_peer_info(String columns, boolean expectPeer2, boolean cluster.init(); InetAddress node2Address = scassandraCluster.address(2).getAddress(); + String invalidValues = + withPeersV2 + ? columnData + : String.format( + "missing native_transport_address, missing native_transport_port, missing native_transport_port_ssl, %s", + columnData); String expectedError = String.format( "Found invalid row in system.peers: [peer=%s, %s]. " + "This is likely a gossip or snitch issue, this host will be ignored.", - node2Address, columnData); + node2Address, invalidValues); String log = logs.get(); // then: A peer with a null rack should not show up in host metadata, unless allowed via // system property. @@ -614,9 +619,8 @@ public void should_extract_hosts_using_native_transport_address_port_from_peers( * be selected if the Cluster is created with SSL support (i.e. if {@link * Cluster.Builder#withSSL()} is used). */ - @Test(groups = "short") + @Test(groups = "short", enabled = false /* Requires SSL support in scassandra */) @CCMConfig(createCcm = false) - @Ignore("Requires SSL support in scassandra") public void should_extract_hosts_using_native_transport_address_port_ssl_from_peers() throws UnknownHostException { diff --git a/driver-core/src/test/java/com/datastax/driver/core/DirectCompressionTest.java b/driver-core/src/test/java/com/datastax/driver/core/DirectCompressionTest.java index 6bfa4a93618..0c71326c3ad 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/DirectCompressionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/DirectCompressionTest.java @@ -29,6 +29,7 @@ public class DirectCompressionTest extends CompressionTest { */ @Test(groups = "short") public void should_function_with_snappy_compression() throws Exception { + skipTestWithCassandraVersionOrHigher("4.0.0", "snappy"); compressionTest(ProtocolOptions.Compression.SNAPPY); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/FrameLengthTest.java b/driver-core/src/test/java/com/datastax/driver/core/FrameLengthTest.java index 7258f76d5f8..7bfaae3f723 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/FrameLengthTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/FrameLengthTest.java @@ -26,6 +26,7 @@ import com.datastax.driver.core.querybuilder.Insert; import com.datastax.driver.core.schemabuilder.Create; import com.datastax.driver.core.schemabuilder.SchemaBuilder; +import com.datastax.driver.core.utils.CassandraVersion; import java.nio.ByteBuffer; import java.util.Collection; import java.util.Random; @@ -105,22 +106,42 @@ public void onTestContextInitialized() { */ @Test(groups = "isolated") public void should_throw_exception_when_frame_exceeds_configured_max() { + skipTestWithCassandraVersionOrHigher("4.0.0", "frame-size exceeding with default-protocol"); + run_frame_size_exceeding_queries(session()); + } + + /** + * With cassandra 4.0.0+, V5 protocol is default which breaks requests into segments. Force V4 + * protocol to allow us to test frame-size limitation code. + */ + @CassandraVersion("4.0.0") + @Test(groups = "isolated") + public void should_throw_exception_when_frame_exceeds_configured_max_v4_protocol_cassandra4() { + Cluster cluster = + register(createClusterBuilder().withProtocolVersion(ProtocolVersion.V4).build()); + Session session = register(cluster.connect()); + useKeyspace(session, keyspace); + + run_frame_size_exceeding_queries(session); + } + + private void run_frame_size_exceeding_queries(Session session) { try { - session().execute(select().from(tableName).where(eq("k", 0))); + session.execute(select().from(tableName).where(eq("k", 0))); fail("Exception expected"); } catch (FrameTooLongException ftle) { // Expected. } // Both hosts should remain up. - Collection hosts = session().getState().getConnectedHosts(); + Collection hosts = session.getState().getConnectedHosts(); assertThat(hosts).hasSize(2).extractingResultOf("isUp").containsOnly(true); // Should be able to make a query that is less than the max frame size. // Execute multiple time to exercise all hosts. for (int i = 0; i < 10; i++) { ResultSet result = - session().execute(select().from(tableName).where(eq("k", 0)).and(eq("c", 0))); + session.execute(select().from(tableName).where(eq("k", 0)).and(eq("c", 0))); assertThat(result.getAvailableWithoutFetching()).isEqualTo(1); } } diff --git a/driver-core/src/test/java/com/datastax/driver/core/HeapCompressionTest.java b/driver-core/src/test/java/com/datastax/driver/core/HeapCompressionTest.java index d27309eee4f..2153639d8d2 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/HeapCompressionTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/HeapCompressionTest.java @@ -37,6 +37,7 @@ public void beforeTestClass() throws Exception { */ @Test(groups = "isolated") public void should_function_with_snappy_compression() throws Exception { + skipTestWithCassandraVersionOrHigher("4.0.0", "snappy"); compressionTest(ProtocolOptions.Compression.SNAPPY); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java b/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java index 8cb4d6c316c..5069d33c569 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java @@ -57,10 +57,13 @@ public void should_init_policy_with_up_contact_points() throws Exception { try { cluster.init(); + // To support astra, only hosts in Metadata#getContactPoints are passed to init() + // TestUtils#configureClusterBuilder only uses the first host as the contact point + // Remaining hosts are learned after connection via onAdd() assertThat(policy.history) .containsOnly( entry(INIT, TestUtils.findHost(cluster, 1)), - entry(INIT, TestUtils.findHost(cluster, 2))); + entry(ADD, TestUtils.findHost(cluster, 2))); } finally { cluster.close(); } diff --git a/driver-core/src/test/java/com/datastax/driver/core/OPPTokenIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/OPPTokenIntegrationTest.java index ab6f5905596..680195fbf99 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/OPPTokenIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/OPPTokenIntegrationTest.java @@ -28,4 +28,10 @@ public OPPTokenIntegrationTest() { protected Token.Factory tokenFactory() { return OPPToken.FACTORY; } + + @Override + public void beforeTestClass(Object testInstance) throws Exception { + skipTestWithCassandraVersionOrHigher("4.0.0", "ByteOrderedPartitioner"); + super.beforeTestClass(testInstance); + } } diff --git a/driver-core/src/test/java/com/datastax/driver/core/OPPTokenVnodeIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/OPPTokenVnodeIntegrationTest.java index 084f8a7a8b3..4a9419630fe 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/OPPTokenVnodeIntegrationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/OPPTokenVnodeIntegrationTest.java @@ -26,4 +26,10 @@ public OPPTokenVnodeIntegrationTest() { protected Token.Factory tokenFactory() { return Token.OPPToken.FACTORY; } + + @Override + public void beforeTestClass(Object testInstance) throws Exception { + skipTestWithCassandraVersionOrHigher("4.0.0", "ByteOrderedPartitioner"); + super.beforeTestClass(testInstance); + } } diff --git a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsScassandraTest.java b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsScassandraTest.java index 1e9b6cbc1ff..54c40369614 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsScassandraTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsScassandraTest.java @@ -78,7 +78,7 @@ public void should_throw_proper_read_timeout_exception() { } catch (ReadTimeoutException e) { assertThat(e.getMessage()) .isEqualTo( - "Cassandra timeout during read query at consistency LOCAL_ONE (1 responses were required but only 0 replica responded)"); + "Cassandra timeout during read query at consistency LOCAL_ONE (1 responses were required but only 0 replica responded). In case this was generated during read repair, the consistency level is not representative of the actual consistency."); assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_ONE); assertThat(e.getReceivedAcknowledgements()).isEqualTo(0); assertThat(e.getRequiredAcknowledgements()).isEqualTo(1); diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index f30355bf816..f47d7f04f6d 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -180,6 +180,9 @@ ${jackson.version} ${jackson-databind.version} ${ipprefix} + false + + https://repo1.maven.org/maven2@id=central diff --git a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/Activator.java b/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/Activator.java index 46f675170b2..6c52a0f745d 100644 --- a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/Activator.java +++ b/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/Activator.java @@ -16,6 +16,7 @@ package com.datastax.driver.osgi.impl; import static com.datastax.driver.core.ProtocolOptions.Compression.LZ4; +import static com.datastax.driver.core.ProtocolOptions.Compression.SNAPPY; import static com.datastax.driver.osgi.api.MailboxMessage.TABLE; import com.datastax.driver.core.Cluster; @@ -69,7 +70,10 @@ public void start(BundleContext context) throws Exception { String compression = context.getProperty("cassandra.compression"); if (compression != null) { if (ver.getMajor() < 2 && compression.equals(LZ4.name())) { - LOGGER.warn("Requested LZ4 compression but C* version is not compatible, disabling"); + LOGGER.warn("Requested LZ4 compression but C* version < 2.0 is not compatible, disabling"); + } else if (ver.getMajor() >= 4 && compression.equals(SNAPPY.name())) { + LOGGER.warn( + "Requested snappy compression but C* version >= 4.0 is not compatible, disabling"); } else { LOGGER.info("Compression: {}", compression); builder.withCompression(ProtocolOptions.Compression.valueOf(compression)); diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java index f3c4dbebc42..7a58b16d866 100644 --- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java +++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java @@ -136,7 +136,9 @@ public Option[] getOptions() { mavenBundle("io.netty", "netty-codec", nettyVersion), mavenBundle("io.netty", "netty-common", nettyVersion), mavenBundle("io.netty", "netty-handler", nettyVersion), - mavenBundle("io.netty", "netty-transport", nettyVersion)); + mavenBundle("io.netty", "netty-transport", nettyVersion), + mavenBundle("io.netty", "netty-transport-native-unix-common", nettyVersion), + mavenBundle("io.netty", "netty-resolver", nettyVersion)); } }; } diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java index 8d8ae4afa72..6c3304dba91 100644 --- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java +++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java @@ -25,10 +25,12 @@ import static com.datastax.driver.osgi.BundleOptions.snappyBundle; import static org.ops4j.pax.exam.CoreOptions.options; +import com.datastax.driver.core.VersionNumber; import com.datastax.driver.osgi.api.MailboxException; import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.testng.listener.PaxExam; +import org.testng.SkipException; import org.testng.annotations.Listeners; import org.testng.annotations.Test; @@ -59,6 +61,10 @@ public Option[] snappyConfig() { */ @Test(groups = "short") public void test_snappy() throws MailboxException { + VersionNumber ver = VersionNumber.parse(bundleContext.getProperty("cassandra.version")); + if (ver.getMajor() >= 4) { + throw new SkipException("Snappy not supported with cassandra 4.0+"); + } checkService(); } } diff --git a/pom.xml b/pom.xml index 46f1d8273b7..2a560b8d437 100644 --- a/pom.xml +++ b/pom.xml @@ -1141,6 +1141,7 @@ limitations under the License. netty-tcnative-boringssl-static 2.2.10 + 1.1.10.1 From 0ad3014e22d552f219486263c6cc1134b15a65d1 Mon Sep 17 00:00:00 2001 From: Maxim Muzafarov <3415046+Mmuzaf@users.noreply.github.com> Date: Thu, 24 Aug 2023 16:16:03 +0200 Subject: [PATCH 167/211] JAVA-3114 Include dropwizard metrics into the shaded dependencies list for 3.x driver (#1685) --- driver-core/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 2c8d06c79d7..db51c4d6c0d 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -271,6 +271,7 @@ io.netty:* + io.dropwizard.metrics:metrics-core io.netty:netty-transport-native-epoll @@ -281,6 +282,10 @@ io.netty com.datastax.shaded.netty + + com.codahale.metrics + com.datastax.shaded.metrics + From e96d148a1f1f7eaf3fb2e397a4c2bca62e6c4117 Mon Sep 17 00:00:00 2001 From: hhughes Date: Thu, 24 Aug 2023 12:39:24 -0700 Subject: [PATCH 168/211] JAVA-3099: fix failing LoadBalancingPolicyBootstrapTest and SchemaChangesCCTest (#1721) --- .../com/datastax/driver/core/CCMTestsSupport.java | 6 +++++- .../core/LoadBalancingPolicyBootstrapTest.java | 10 +++++++++- .../datastax/driver/core/SchemaChangesCCTest.java | 14 +++++++++++--- 3 files changed, 25 insertions(+), 5 deletions(-) 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 ca9f5e45d6f..02345c42cc8 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 @@ -1139,8 +1139,12 @@ private static T instantiate(Class clazz) } } + protected boolean isCassandraVersionOrHigher(String version) { + return CCMBridge.getGlobalCassandraVersion().compareTo(VersionNumber.parse(version)) >= 0; + } + protected void skipTestWithCassandraVersionOrHigher(String version, String testKind) { - if (CCMBridge.getGlobalCassandraVersion().compareTo(VersionNumber.parse(version)) >= 0) { + if (isCassandraVersionOrHigher(version)) { throw new SkipException( String.format( "%s tests not applicable to cassandra version >= %s (configured: %s)", diff --git a/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java b/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java index 5069d33c569..efe0f6f16dc 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java @@ -99,8 +99,16 @@ public void should_send_down_notifications_after_init_when_contact_points_are_do ccm().stop(nodeToStop); ccm().waitForDown(nodeToStop); + // usually only one contact point is used to build the test cluster + // here we explicitly add both endpoints so we can test load + // balancing initial connection when the first connection point is down HistoryPolicy policy = new HistoryPolicy(new RoundRobinPolicy()); - Cluster cluster = register(createClusterBuilder().withLoadBalancingPolicy(policy).build()); + Cluster cluster = + register( + createClusterBuilder() + .addContactPoints(ccm().getContactPoints().get(1)) + .withLoadBalancingPolicy(policy) + .build()); try { cluster.init(); diff --git a/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesCCTest.java b/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesCCTest.java index 2340b45678b..0538cf87e07 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesCCTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesCCTest.java @@ -98,7 +98,12 @@ public void should_receive_changes_made_while_control_connection_is_down_on_reco // Perform some schema changes that we'll validate when the control connection comes back. session2.execute("drop keyspace ks2"); session2.execute("drop table ks1.tbl2"); - session2.execute("alter keyspace ks1 with durable_writes=false"); + + // Modifying keyspaces with a node down is not possible in 4.0+ (CASSANDRA-14404) + if (!isCassandraVersionOrHigher("4.0.0")) { + session2.execute("alter keyspace ks1 with durable_writes=false"); + } + session2.execute("alter table ks1.tbl1 add new_col varchar"); session2.execute(String.format(CREATE_KEYSPACE_SIMPLE_FORMAT, "ks3", 1)); session2.execute("create table ks1.tbl3 (k text primary key, v text)"); @@ -152,8 +157,11 @@ public void should_receive_changes_made_while_control_connection_is_down_on_reco .isDurableWrites() .isEqualTo(prealteredKeyspace); - // New metadata should reflect that the durable writes attribute changed. - assertThat(alteredKeyspace.getValue()).hasName("ks1").isNotDurableWrites(); + // Modifying keyspaces with a node down is not possible in 4.0+ (CASSANDRA-14404) + if (!isCassandraVersionOrHigher("4.0.0")) { + // New metadata should reflect that the durable writes attribute changed. + assertThat(alteredKeyspace.getValue()).hasName("ks1").isNotDurableWrites(); + } // Ensure the alter table event shows up. ArgumentCaptor alteredTable = ArgumentCaptor.forClass(TableMetadata.class); From 4af251a97e205a0d14320a7f94df78243fcc8bde Mon Sep 17 00:00:00 2001 From: hhughes Date: Thu, 31 Aug 2023 13:32:44 -0700 Subject: [PATCH 169/211] Fix MailboxServiceShadedIT for shaded dropwizard deps (#1724) * Don't load dropwizard dependency for shaded osgi tests * Remove com.codahale.metrics import from shaded jar manifest and add javax.management (required by dropwizard) * Separate osgi tests into shaded and non-shaded to each compile with respective version of driver-code * Move common osgi test harness to separate subproject, osgi-unshaded and osgi-shaded depend on osgi-common sources which they recompile with the respective version of the driver-core jar --------- Co-authored-by: Bret McGuire --- driver-core/pom.xml | 5 +- driver-tests/osgi/common/pom.xml | 44 +++++ .../driver/osgi/api/MailboxException.java | 0 .../driver/osgi/api/MailboxMessage.java | 0 .../driver/osgi/api/MailboxService.java | 0 .../datastax/driver/osgi/impl/Activator.java | 0 .../driver/osgi/impl/MailboxImpl.java | 0 .../datastax/driver/osgi/BundleOptions.java | 22 ++- .../driver/osgi/CCMBridgeListener.java | 0 .../driver/osgi/MailboxServiceTests.java | 0 driver-tests/osgi/pom.xml | 50 ++---- driver-tests/osgi/shaded/pom.xml | 161 ++++++++++++++++++ .../driver/osgi/MailboxServiceShadedIT.java | 0 .../src/test/resources/exam.properties | 2 +- .../src/test/resources/logback.xml | 0 driver-tests/osgi/unshaded/pom.xml | 160 +++++++++++++++++ .../driver/osgi/MailboxServiceDefaultIT.java | 2 + .../driver/osgi/MailboxServiceGuava17IT.java | 2 + .../driver/osgi/MailboxServiceGuava18IT.java | 2 + .../driver/osgi/MailboxServiceGuava19IT.java | 2 + .../driver/osgi/MailboxServiceGuava20IT.java | 2 + .../driver/osgi/MailboxServiceGuava21IT.java | 2 + .../osgi/MailboxServiceHdrHistogramIT.java | 2 + .../driver/osgi/MailboxServiceLZ4IT.java | 2 + .../driver/osgi/MailboxServiceSnappyIT.java | 2 + .../src/test/resources/exam.properties | 18 ++ .../unshaded/src/test/resources/logback.xml | 50 ++++++ driver-tests/shading/shaded/pom.xml | 10 ++ 28 files changed, 493 insertions(+), 47 deletions(-) create mode 100644 driver-tests/osgi/common/pom.xml rename driver-tests/osgi/{ => common}/src/main/java/com/datastax/driver/osgi/api/MailboxException.java (100%) rename driver-tests/osgi/{ => common}/src/main/java/com/datastax/driver/osgi/api/MailboxMessage.java (100%) rename driver-tests/osgi/{ => common}/src/main/java/com/datastax/driver/osgi/api/MailboxService.java (100%) rename driver-tests/osgi/{ => common}/src/main/java/com/datastax/driver/osgi/impl/Activator.java (100%) rename driver-tests/osgi/{ => common}/src/main/java/com/datastax/driver/osgi/impl/MailboxImpl.java (100%) rename driver-tests/osgi/{ => common}/src/test/java/com/datastax/driver/osgi/BundleOptions.java (92%) rename driver-tests/osgi/{ => common}/src/test/java/com/datastax/driver/osgi/CCMBridgeListener.java (100%) rename driver-tests/osgi/{ => common}/src/test/java/com/datastax/driver/osgi/MailboxServiceTests.java (100%) create mode 100644 driver-tests/osgi/shaded/pom.xml rename driver-tests/osgi/{ => shaded}/src/test/java/com/datastax/driver/osgi/MailboxServiceShadedIT.java (100%) rename driver-tests/osgi/{ => shaded}/src/test/resources/exam.properties (96%) rename driver-tests/osgi/{ => shaded}/src/test/resources/logback.xml (100%) create mode 100644 driver-tests/osgi/unshaded/pom.xml rename driver-tests/osgi/{ => unshaded}/src/test/java/com/datastax/driver/osgi/MailboxServiceDefaultIT.java (95%) rename driver-tests/osgi/{ => unshaded}/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava17IT.java (95%) rename driver-tests/osgi/{ => unshaded}/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava18IT.java (95%) rename driver-tests/osgi/{ => unshaded}/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava19IT.java (95%) rename driver-tests/osgi/{ => unshaded}/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava20IT.java (95%) rename driver-tests/osgi/{ => unshaded}/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava21IT.java (96%) rename driver-tests/osgi/{ => unshaded}/src/test/java/com/datastax/driver/osgi/MailboxServiceHdrHistogramIT.java (95%) rename driver-tests/osgi/{ => unshaded}/src/test/java/com/datastax/driver/osgi/MailboxServiceLZ4IT.java (95%) rename driver-tests/osgi/{ => unshaded}/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java (95%) create mode 100644 driver-tests/osgi/unshaded/src/test/resources/exam.properties create mode 100644 driver-tests/osgi/unshaded/src/test/resources/logback.xml diff --git a/driver-core/pom.xml b/driver-core/pom.xml index db51c4d6c0d..d323e4968ac 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -256,8 +256,9 @@ JNR does not provide OSGi bundles, so exclude it; the driver can live without it Explicitly import javax.security.cert because it's required by Netty, but Netty has been explicitly excluded --> - + com.datastax.shaded.* + com.datastax.shaded.metrics;*
    @@ -302,6 +303,8 @@ META-INF/maven/io.netty/netty-handler/pom.xml META-INF/maven/io.netty/netty-transport/pom.properties META-INF/maven/io.netty/netty-transport/pom.xml + META-INF/maven/io.dropwizard.metrics/metrics-core/pom.properties + META-INF/maven/io.dropwizard.metrics/metrics-core/pom.xml diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml new file mode 100644 index 00000000000..607d20259a4 --- /dev/null +++ b/driver-tests/osgi/common/pom.xml @@ -0,0 +1,44 @@ + + + + 4.0.0 + + + com.datastax.cassandra + cassandra-driver-tests-osgi + 3.11.5-SNAPSHOT + + + jar + cassandra-driver-tests-osgi-common + DataStax Java Driver for Apache Cassandra Tests - OSGi - Shaded + Common classes for testing DataStax Java Driver in an OSGi container. + + + + diff --git a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxException.java b/driver-tests/osgi/common/src/main/java/com/datastax/driver/osgi/api/MailboxException.java similarity index 100% rename from driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxException.java rename to driver-tests/osgi/common/src/main/java/com/datastax/driver/osgi/api/MailboxException.java diff --git a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxMessage.java b/driver-tests/osgi/common/src/main/java/com/datastax/driver/osgi/api/MailboxMessage.java similarity index 100% rename from driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxMessage.java rename to driver-tests/osgi/common/src/main/java/com/datastax/driver/osgi/api/MailboxMessage.java diff --git a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxService.java b/driver-tests/osgi/common/src/main/java/com/datastax/driver/osgi/api/MailboxService.java similarity index 100% rename from driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxService.java rename to driver-tests/osgi/common/src/main/java/com/datastax/driver/osgi/api/MailboxService.java diff --git a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/Activator.java b/driver-tests/osgi/common/src/main/java/com/datastax/driver/osgi/impl/Activator.java similarity index 100% rename from driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/Activator.java rename to driver-tests/osgi/common/src/main/java/com/datastax/driver/osgi/impl/Activator.java diff --git a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/MailboxImpl.java b/driver-tests/osgi/common/src/main/java/com/datastax/driver/osgi/impl/MailboxImpl.java similarity index 100% rename from driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/MailboxImpl.java rename to driver-tests/osgi/common/src/main/java/com/datastax/driver/osgi/impl/MailboxImpl.java diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java b/driver-tests/osgi/common/src/test/java/com/datastax/driver/osgi/BundleOptions.java similarity index 92% rename from driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java rename to driver-tests/osgi/common/src/test/java/com/datastax/driver/osgi/BundleOptions.java index 7a58b16d866..17ae95da7d1 100644 --- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java +++ b/driver-tests/osgi/common/src/test/java/com/datastax/driver/osgi/BundleOptions.java @@ -15,7 +15,7 @@ */ package com.datastax.driver.osgi; -import static org.ops4j.pax.exam.CoreOptions.bootDelegationPackage; +import static org.ops4j.pax.exam.CoreOptions.bootDelegationPackages; import static org.ops4j.pax.exam.CoreOptions.bundle; import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.CoreOptions.options; @@ -60,7 +60,7 @@ public static UrlProvisionOption driverBundle(boolean useShaded) { return bundle( "reference:file:" + PathUtils.getBaseDir() - + "/../../driver-core/target/cassandra-driver-core-" + + "/../../../driver-core/target/cassandra-driver-core-" + Cluster.getDriverVersion() + classifier + ".jar"); @@ -70,7 +70,7 @@ public static UrlProvisionOption mappingBundle() { return bundle( "reference:file:" + PathUtils.getBaseDir() - + "/../../driver-mapping/target/cassandra-driver-mapping-" + + "/../../../driver-mapping/target/cassandra-driver-mapping-" + Cluster.getDriverVersion() + ".jar"); } @@ -79,7 +79,7 @@ public static UrlProvisionOption extrasBundle() { return bundle( "reference:file:" + PathUtils.getBaseDir() - + "/../../driver-extras/target/cassandra-driver-extras-" + + "/../../../driver-extras/target/cassandra-driver-extras-" + Cluster.getDriverVersion() + ".jar"); } @@ -143,6 +143,17 @@ public Option[] getOptions() { }; } + public static CompositeOption dropwizardMetricsBundle() { + return new CompositeOption() { + + @Override + public Option[] getOptions() { + return options( + mavenBundle("io.dropwizard.metrics", "metrics-core", getVersion("metrics.version"))); + } + }; + } + public static UrlProvisionOption mailboxBundle() { return bundle("reference:file:" + PathUtils.getBaseDir() + "/target/classes"); } @@ -157,7 +168,7 @@ public Option[] getOptions() { // Delegate javax.security.cert to the parent classloader. // javax.security.cert.X509Certificate is used in // io.netty.util.internal.EmptyArrays, but not directly by the driver. - bootDelegationPackage("javax.security.cert"), + bootDelegationPackages("javax.security.cert", "javax.management"), systemProperty("cassandra.version") .value(CCMBridge.getGlobalCassandraVersion().toString()), systemProperty("cassandra.contactpoints").value(TestUtils.IP_PREFIX + 1), @@ -166,7 +177,6 @@ public Option[] getOptions() { mavenBundle("org.slf4j", "slf4j-api", getVersion("slf4j.version")), mavenBundle("ch.qos.logback", "logback-classic", getVersion("logback.version")), mavenBundle("ch.qos.logback", "logback-core", getVersion("logback.version")), - mavenBundle("io.dropwizard.metrics", "metrics-core", getVersion("metrics.version")), mavenBundle( "com.fasterxml.jackson.core", "jackson-databind", diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/CCMBridgeListener.java b/driver-tests/osgi/common/src/test/java/com/datastax/driver/osgi/CCMBridgeListener.java similarity index 100% rename from driver-tests/osgi/src/test/java/com/datastax/driver/osgi/CCMBridgeListener.java rename to driver-tests/osgi/common/src/test/java/com/datastax/driver/osgi/CCMBridgeListener.java diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceTests.java b/driver-tests/osgi/common/src/test/java/com/datastax/driver/osgi/MailboxServiceTests.java similarity index 100% rename from driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceTests.java rename to driver-tests/osgi/common/src/test/java/com/datastax/driver/osgi/MailboxServiceTests.java diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index f47d7f04f6d..2c329831d45 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -25,27 +25,18 @@ 3.11.5-SNAPSHOT + pom cassandra-driver-tests-osgi DataStax Java Driver for Apache Cassandra Tests - OSGi A test for the DataStax Java Driver in an OSGi container. - - - - com.datastax.cassandra - cassandra-driver-core - - - com.github.jnr - jnr-ffi - - - com.github.jnr - jnr-posix - - - + + common + shaded + unshaded + + com.datastax.cassandra cassandra-driver-mapping @@ -61,11 +52,6 @@ org.apache.felix.framework - - io.dropwizard.metrics - metrics-core - - com.google.guava guava @@ -163,7 +149,7 @@ maven-failsafe-plugin - ${test.osgi.skip} + true ${cassandra.version} @@ -188,25 +174,11 @@ - org.apache.felix - maven-bundle-plugin + org.codehaus.mojo + animal-sniffer-maven-plugin - - com.datastax.driver.osgi - com.datastax.driver.osgi.api,!com.datastax.driver.osgi.impl - com.datastax.driver.osgi.impl.Activator - <_include>-osgi.bnd - + true - - - bundle-manifest - process-classes - - manifest - - - diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml new file mode 100644 index 00000000000..0e1a7d071f1 --- /dev/null +++ b/driver-tests/osgi/shaded/pom.xml @@ -0,0 +1,161 @@ + + + + 4.0.0 + + + com.datastax.cassandra + cassandra-driver-tests-osgi + 3.11.5-SNAPSHOT + + + cassandra-driver-tests-osgi-shaded + DataStax Java Driver for Apache Cassandra Tests - OSGi - Shaded + A test for the shaded DataStax Java Driver in an OSGi container. + + + + com.datastax.cassandra + cassandra-driver-core + + shaded + + + com.github.jnr + jnr-ffi + + + com.github.jnr + jnr-posix + + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + + copy-common-sources + process-sources + + copy-resources + + + ${project.build.directory}/dependency-sources/cassandra-driver-tests-osgi-common + true + + + ../common/src/main/java/ + + **/*.* + + + + + + + copy-common-test-sources + process-test-sources + + copy-resources + + + ${project.build.directory}/dependency-test-sources/cassandra-driver-tests-osgi-common + true + + + ../common/src/test/java/ + + **/*.* + + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source + generate-sources + + add-source + + + + ${project.build.directory}/dependency-sources/cassandra-driver-tests-osgi-common + + + + + add-test-source + generate-test-sources + + add-test-source + + + + ${project.build.directory}/dependency-test-sources/cassandra-driver-tests-osgi-common + + + + + + + + maven-failsafe-plugin + + ${test.osgi.skip} + + + + + org.apache.felix + maven-bundle-plugin + + + bundle-manifest + process-classes + + manifest + + + ${project.build.outputDirectory}/META-INF + + com.datastax.driver.osgi + com.datastax.driver.osgi.api,!com.datastax.driver.osgi.impl + com.datastax.driver.osgi.impl.Activator + <_include>-osgi.bnd + + + + + + + + diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceShadedIT.java b/driver-tests/osgi/shaded/src/test/java/com/datastax/driver/osgi/MailboxServiceShadedIT.java similarity index 100% rename from driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceShadedIT.java rename to driver-tests/osgi/shaded/src/test/java/com/datastax/driver/osgi/MailboxServiceShadedIT.java diff --git a/driver-tests/osgi/src/test/resources/exam.properties b/driver-tests/osgi/shaded/src/test/resources/exam.properties similarity index 96% rename from driver-tests/osgi/src/test/resources/exam.properties rename to driver-tests/osgi/shaded/src/test/resources/exam.properties index 21438ef0edc..fdf38ebf95a 100644 --- a/driver-tests/osgi/src/test/resources/exam.properties +++ b/driver-tests/osgi/shaded/src/test/resources/exam.properties @@ -15,4 +15,4 @@ # pax.exam.system=test -pax.exam.logging=none \ No newline at end of file +pax.exam.logging=none diff --git a/driver-tests/osgi/src/test/resources/logback.xml b/driver-tests/osgi/shaded/src/test/resources/logback.xml similarity index 100% rename from driver-tests/osgi/src/test/resources/logback.xml rename to driver-tests/osgi/shaded/src/test/resources/logback.xml diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml new file mode 100644 index 00000000000..a5f079e96d3 --- /dev/null +++ b/driver-tests/osgi/unshaded/pom.xml @@ -0,0 +1,160 @@ + + + + 4.0.0 + + + com.datastax.cassandra + cassandra-driver-tests-osgi + 3.11.5-SNAPSHOT + + + cassandra-driver-tests-osgi-unshaded + DataStax Java Driver for Apache Cassandra Tests - OSGi - Unshaded + A test for the unshaded DataStax Java Driver in an OSGi container. + + + + com.datastax.cassandra + cassandra-driver-core + + + + com.github.jnr + jnr-ffi + + + com.github.jnr + jnr-posix + + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + + copy-common-sources + process-sources + + copy-resources + + + ${project.build.directory}/dependency-sources/cassandra-driver-tests-osgi-common + true + + + ../common/src/main/java/ + + **/*.* + + + + + + + copy-common-test-sources + process-test-sources + + copy-resources + + + ${project.build.directory}/dependency-test-sources/cassandra-driver-tests-osgi-common + true + + + ../common/src/test/java/ + + **/*.* + + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source + generate-sources + + add-source + + + + ${project.build.directory}/dependency-sources/cassandra-driver-tests-osgi-common + + + + + add-test-source + generate-test-sources + + add-test-source + + + + ${project.build.directory}/dependency-test-sources/cassandra-driver-tests-osgi-common + + + + + + + + maven-failsafe-plugin + + ${test.osgi.skip} + + + + + org.apache.felix + maven-bundle-plugin + + + bundle-manifest + process-classes + + manifest + + + ${project.build.outputDirectory}/META-INF + + com.datastax.driver.osgi + com.datastax.driver.osgi.api,!com.datastax.driver.osgi.impl + com.datastax.driver.osgi.impl.Activator + <_include>-osgi.bnd + + + + + + + + diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceDefaultIT.java b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceDefaultIT.java similarity index 95% rename from driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceDefaultIT.java rename to driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceDefaultIT.java index cd75f3afad4..1439afb60ef 100644 --- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceDefaultIT.java +++ b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceDefaultIT.java @@ -17,6 +17,7 @@ import static com.datastax.driver.osgi.BundleOptions.defaultOptions; import static com.datastax.driver.osgi.BundleOptions.driverBundle; +import static com.datastax.driver.osgi.BundleOptions.dropwizardMetricsBundle; import static com.datastax.driver.osgi.BundleOptions.extrasBundle; import static com.datastax.driver.osgi.BundleOptions.guavaBundle; import static com.datastax.driver.osgi.BundleOptions.mailboxBundle; @@ -39,6 +40,7 @@ public Option[] defaultConfig() { return options( defaultOptions(), nettyBundles(), + dropwizardMetricsBundle(), guavaBundle(), driverBundle(), extrasBundle(), diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava17IT.java b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava17IT.java similarity index 95% rename from driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava17IT.java rename to driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava17IT.java index 1830df37679..fbe0804c00d 100644 --- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava17IT.java +++ b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava17IT.java @@ -17,6 +17,7 @@ import static com.datastax.driver.osgi.BundleOptions.defaultOptions; import static com.datastax.driver.osgi.BundleOptions.driverBundle; +import static com.datastax.driver.osgi.BundleOptions.dropwizardMetricsBundle; import static com.datastax.driver.osgi.BundleOptions.extrasBundle; import static com.datastax.driver.osgi.BundleOptions.guavaBundle; import static com.datastax.driver.osgi.BundleOptions.mailboxBundle; @@ -39,6 +40,7 @@ public Option[] guava17Config() { return options( defaultOptions(), nettyBundles(), + dropwizardMetricsBundle(), guavaBundle().version("17.0"), driverBundle(), mappingBundle(), diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava18IT.java b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava18IT.java similarity index 95% rename from driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava18IT.java rename to driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava18IT.java index c31cd576df0..86fd33e1d8f 100644 --- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava18IT.java +++ b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava18IT.java @@ -17,6 +17,7 @@ import static com.datastax.driver.osgi.BundleOptions.defaultOptions; import static com.datastax.driver.osgi.BundleOptions.driverBundle; +import static com.datastax.driver.osgi.BundleOptions.dropwizardMetricsBundle; import static com.datastax.driver.osgi.BundleOptions.extrasBundle; import static com.datastax.driver.osgi.BundleOptions.guavaBundle; import static com.datastax.driver.osgi.BundleOptions.mailboxBundle; @@ -39,6 +40,7 @@ public Option[] guava18Config() { return options( defaultOptions(), nettyBundles(), + dropwizardMetricsBundle(), guavaBundle().version("18.0"), driverBundle(), extrasBundle(), diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava19IT.java b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava19IT.java similarity index 95% rename from driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava19IT.java rename to driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava19IT.java index f6fa756a643..17e68809db4 100644 --- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava19IT.java +++ b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava19IT.java @@ -17,6 +17,7 @@ import static com.datastax.driver.osgi.BundleOptions.defaultOptions; import static com.datastax.driver.osgi.BundleOptions.driverBundle; +import static com.datastax.driver.osgi.BundleOptions.dropwizardMetricsBundle; import static com.datastax.driver.osgi.BundleOptions.extrasBundle; import static com.datastax.driver.osgi.BundleOptions.guavaBundle; import static com.datastax.driver.osgi.BundleOptions.mailboxBundle; @@ -39,6 +40,7 @@ public Option[] guava19Config() { return options( defaultOptions(), nettyBundles(), + dropwizardMetricsBundle(), guavaBundle().version("19.0"), driverBundle(), extrasBundle(), diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava20IT.java b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava20IT.java similarity index 95% rename from driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava20IT.java rename to driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava20IT.java index 807e7bfc40e..78d466a0d86 100644 --- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava20IT.java +++ b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava20IT.java @@ -17,6 +17,7 @@ import static com.datastax.driver.osgi.BundleOptions.defaultOptions; import static com.datastax.driver.osgi.BundleOptions.driverBundle; +import static com.datastax.driver.osgi.BundleOptions.dropwizardMetricsBundle; import static com.datastax.driver.osgi.BundleOptions.extrasBundle; import static com.datastax.driver.osgi.BundleOptions.guavaBundle; import static com.datastax.driver.osgi.BundleOptions.mailboxBundle; @@ -39,6 +40,7 @@ public Option[] guava20Config() { return options( defaultOptions(), nettyBundles(), + dropwizardMetricsBundle(), guavaBundle().version("20.0"), driverBundle(), extrasBundle(), diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava21IT.java b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava21IT.java similarity index 96% rename from driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava21IT.java rename to driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava21IT.java index bfacb06a058..ff73418834c 100644 --- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava21IT.java +++ b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava21IT.java @@ -17,6 +17,7 @@ import static com.datastax.driver.osgi.BundleOptions.defaultOptions; import static com.datastax.driver.osgi.BundleOptions.driverBundle; +import static com.datastax.driver.osgi.BundleOptions.dropwizardMetricsBundle; import static com.datastax.driver.osgi.BundleOptions.extrasBundle; import static com.datastax.driver.osgi.BundleOptions.guavaBundle; import static com.datastax.driver.osgi.BundleOptions.mailboxBundle; @@ -49,6 +50,7 @@ public Option[] guava21Config() { return options( defaultOptions(), nettyBundles(), + dropwizardMetricsBundle(), guavaBundle, driverBundle(), extrasBundle(), diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceHdrHistogramIT.java b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceHdrHistogramIT.java similarity index 95% rename from driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceHdrHistogramIT.java rename to driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceHdrHistogramIT.java index 3f25f426c65..ef4feb2be66 100644 --- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceHdrHistogramIT.java +++ b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceHdrHistogramIT.java @@ -17,6 +17,7 @@ import static com.datastax.driver.osgi.BundleOptions.defaultOptions; import static com.datastax.driver.osgi.BundleOptions.driverBundle; +import static com.datastax.driver.osgi.BundleOptions.dropwizardMetricsBundle; import static com.datastax.driver.osgi.BundleOptions.extrasBundle; import static com.datastax.driver.osgi.BundleOptions.guavaBundle; import static com.datastax.driver.osgi.BundleOptions.hdrHistogramBundle; @@ -41,6 +42,7 @@ public Option[] hdrHistogramConfig() { defaultOptions(), hdrHistogramBundle(), nettyBundles(), + dropwizardMetricsBundle(), guavaBundle(), extrasBundle(), mappingBundle(), diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceLZ4IT.java b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceLZ4IT.java similarity index 95% rename from driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceLZ4IT.java rename to driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceLZ4IT.java index 548a03f8ea6..e952f4ef647 100644 --- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceLZ4IT.java +++ b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceLZ4IT.java @@ -17,6 +17,7 @@ import static com.datastax.driver.osgi.BundleOptions.defaultOptions; import static com.datastax.driver.osgi.BundleOptions.driverBundle; +import static com.datastax.driver.osgi.BundleOptions.dropwizardMetricsBundle; import static com.datastax.driver.osgi.BundleOptions.extrasBundle; import static com.datastax.driver.osgi.BundleOptions.guavaBundle; import static com.datastax.driver.osgi.BundleOptions.lz4Bundle; @@ -41,6 +42,7 @@ public Option[] lz4Config() { defaultOptions(), lz4Bundle(), nettyBundles(), + dropwizardMetricsBundle(), guavaBundle(), extrasBundle(), mappingBundle(), diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java similarity index 95% rename from driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java rename to driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java index 6c3304dba91..875227472f1 100644 --- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java +++ b/driver-tests/osgi/unshaded/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java @@ -17,6 +17,7 @@ import static com.datastax.driver.osgi.BundleOptions.defaultOptions; import static com.datastax.driver.osgi.BundleOptions.driverBundle; +import static com.datastax.driver.osgi.BundleOptions.dropwizardMetricsBundle; import static com.datastax.driver.osgi.BundleOptions.extrasBundle; import static com.datastax.driver.osgi.BundleOptions.guavaBundle; import static com.datastax.driver.osgi.BundleOptions.mailboxBundle; @@ -43,6 +44,7 @@ public Option[] snappyConfig() { defaultOptions(), snappyBundle(), nettyBundles(), + dropwizardMetricsBundle(), guavaBundle(), extrasBundle(), mappingBundle(), diff --git a/driver-tests/osgi/unshaded/src/test/resources/exam.properties b/driver-tests/osgi/unshaded/src/test/resources/exam.properties new file mode 100644 index 00000000000..fdf38ebf95a --- /dev/null +++ b/driver-tests/osgi/unshaded/src/test/resources/exam.properties @@ -0,0 +1,18 @@ +# +# Copyright DataStax, Inc. +# +# Licensed 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. +# + +pax.exam.system=test +pax.exam.logging=none diff --git a/driver-tests/osgi/unshaded/src/test/resources/logback.xml b/driver-tests/osgi/unshaded/src/test/resources/logback.xml new file mode 100644 index 00000000000..cd3ec75c4e8 --- /dev/null +++ b/driver-tests/osgi/unshaded/src/test/resources/logback.xml @@ -0,0 +1,50 @@ + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 544912b5a30..01f8835f6a4 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -40,6 +40,10 @@ * io.netty
    + + io.dropwizard.metrics + metrics-core +
    @@ -53,6 +57,12 @@ test
    + + io.dropwizard.metrics + metrics-core + test + + org.testng testng From 15830d0479307761f9001976cc39519b869a92ad Mon Sep 17 00:00:00 2001 From: hhughes Date: Tue, 5 Sep 2023 14:57:20 -0700 Subject: [PATCH 170/211] Update changelog and docs for 3.11.5 release (#1727) --- README.md | 12 ++++++------ changelog/README.md | 4 ++++ faq/README.md | 2 +- manual/compression/README.md | 2 +- manual/custom_codecs/extras/README.md | 2 +- manual/metrics/README.md | 2 +- manual/object_mapper/README.md | 2 +- manual/shaded_jar/README.md | 14 +++++++++++--- 8 files changed, 26 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 8296e636bd4..eef132ac85f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ for the development version and that some features described here might not yet have been released. You can find the documentation for the latest version through the [Java driver docs](http://docs.datastax.com/en/developer/java-driver/3.11/index.html) or via the release tags, -[e.g. 3.11.4](https://github.com/datastax/java-driver/tree/3.11.4).* +[e.g. 3.11.5](https://github.com/datastax/java-driver/tree/3.11.5).* A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol @@ -65,7 +65,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-dri com.datastax.cassandra cassandra-driver-core - 3.11.4 + 3.11.5 ``` @@ -75,7 +75,7 @@ Note that the object mapper is published as a separate artifact: com.datastax.cassandra cassandra-driver-mapping - 3.11.4 + 3.11.5 ``` @@ -85,7 +85,7 @@ The 'extras' module is also published as a separate artifact: com.datastax.cassandra cassandra-driver-extras - 3.11.4/version> + 3.11.5/version> ``` @@ -94,12 +94,12 @@ 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](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.11.4.tar.gz) +[binary tarball](https://github.com/datastax/java-driver/releases/3.11.5) is available for download. ## Compatibility -The Java client driver 3.11.4 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache +The Java client driver 3.11.5 ([branch 3.x](https://github.com/datastax/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). diff --git a/changelog/README.md b/changelog/README.md index 8a49b38bb13..822b9f3fef1 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -5,6 +5,10 @@ 3.x versions get published. --> +## 3.11.5 +- [improvement] JAVA-3114: Shade io.dropwizard.metrics:metrics-core in shaded driver +- [improvement] JAVA-3115: SchemaChangeListener#onKeyspaceChanged can fire when keyspace has not changed if using SimpleStrategy replication + ## 3.11.4 - [improvement] JAVA-3079: Upgrade Netty to 4.1.94, 3.x edition - [improvement] JAVA-3082: Fix maven build for Apple-silicon diff --git a/faq/README.md b/faq/README.md index 541602059fe..de17879b763 100644 --- a/faq/README.md +++ b/faq/README.md @@ -289,7 +289,7 @@ version is available, you may want to reach out to the maintainer of that tool t an update with compatibility to this driver version. -[Blobs.java]: https://github.com/datastax/java-driver/tree/3.11.4/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java +[Blobs.java]: https://github.com/datastax/java-driver/tree/3.11.5/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304 [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding [Mapper options]: ../manual/object_mapper/using/#mapper-options diff --git a/manual/compression/README.md b/manual/compression/README.md index 1718837a62a..44cb9accced 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -88,4 +88,4 @@ cluster = Cluster.builder() .build(); ``` -[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.11.4/cassandra-driver-parent-3.11.4.pom +[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.11.5/cassandra-driver-parent-3.11.5.pom diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index 75a64454e0e..adbc533ff6e 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -10,7 +10,7 @@ The module is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-extras - 3.11.4 + 3.11.5 ``` diff --git a/manual/metrics/README.md b/manual/metrics/README.md index 00b865111d4..7915317fae8 100644 --- a/manual/metrics/README.md +++ b/manual/metrics/README.md @@ -38,7 +38,7 @@ To do this in a maven project: com.datastax.cassandra cassandra-driver-core - 3.11.4 + 3.11.5 io.dropwizard.metrics diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md index d8178267f89..207b470dda7 100644 --- a/manual/object_mapper/README.md +++ b/manual/object_mapper/README.md @@ -11,7 +11,7 @@ The mapper is published as a separate Maven artifact: com.datastax.cassandra cassandra-driver-mapping - 3.11.4 + 3.11.5 ``` diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md index b402e3b9656..44d6fec2905 100644 --- a/manual/shaded_jar/README.md +++ b/manual/shaded_jar/README.md @@ -12,7 +12,7 @@ package name: com.datastax.cassandra cassandra-driver-core - 3.11.4 + 3.11.5 shaded @@ -21,6 +21,10 @@ package name: io.netty * + + io.dropwizard.metrics + metrics-core + ``` @@ -32,19 +36,23 @@ non-shaded JAR: com.datastax.cassandra cassandra-driver-core - 3.11.4 + 3.11.5 shaded io.netty * + + io.dropwizard.metrics + metrics-core + com.datastax.cassandra cassandra-driver-mapping - 3.11.4 + 3.11.5 com.datastax.cassandra From 1531e748704f2f4eac945aeafa3abcd0e8fd3dfe Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Tue, 5 Sep 2023 16:23:37 -0700 Subject: [PATCH 171/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/common/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/osgi/shaded/pom.xml | 2 +- driver-tests/osgi/unshaded/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index d323e4968ac..801e124bf4e 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 6b9de0500b7..3f7e1677e38 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index bdd3d98b8f6..8e4dbe0e012 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 9f2dce4802d..8fbc89c0206 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index cd08fa7e3da..59cd707e81c 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml index 607d20259a4..8da73e1d14f 100644 --- a/driver-tests/osgi/common/pom.xml +++ b/driver-tests/osgi/common/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT jar diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 2c329831d45..a32c6a669b4 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT pom diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml index 0e1a7d071f1..7c8dd5172d7 100644 --- a/driver-tests/osgi/shaded/pom.xml +++ b/driver-tests/osgi/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT cassandra-driver-tests-osgi-shaded diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml index a5f079e96d3..f728ba195ec 100644 --- a/driver-tests/osgi/unshaded/pom.xml +++ b/driver-tests/osgi/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT cassandra-driver-tests-osgi-unshaded diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index fecee78b300..90cb7b2c11f 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index d4fca2ab5e9..3582a609719 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 01f8835f6a4..72561ba2cc8 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 27dc8636ecc..56d33590cde 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 3924529919b..f2b9c23b600 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 2a560b8d437..1b879bc8959 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.6-SNAPSHOT pom DataStax Java Driver for Apache Cassandra From 1750cb596df27ce0a2abd003b557ee98aad5321f Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Tue, 5 Sep 2023 16:28:32 -0700 Subject: [PATCH 172/211] [maven-release-plugin] rollback the release of 3.11.5 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/common/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/osgi/shaded/pom.xml | 2 +- driver-tests/osgi/unshaded/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 801e124bf4e..d323e4968ac 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 3f7e1677e38..6b9de0500b7 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 8e4dbe0e012..bdd3d98b8f6 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 8fbc89c0206..9f2dce4802d 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 59cd707e81c..cd08fa7e3da 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml index 8da73e1d14f..607d20259a4 100644 --- a/driver-tests/osgi/common/pom.xml +++ b/driver-tests/osgi/common/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT jar diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index a32c6a669b4..2c329831d45 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT pom diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml index 7c8dd5172d7..0e1a7d071f1 100644 --- a/driver-tests/osgi/shaded/pom.xml +++ b/driver-tests/osgi/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT cassandra-driver-tests-osgi-shaded diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml index f728ba195ec..a5f079e96d3 100644 --- a/driver-tests/osgi/unshaded/pom.xml +++ b/driver-tests/osgi/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT cassandra-driver-tests-osgi-unshaded diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index 90cb7b2c11f..fecee78b300 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index 3582a609719..d4fca2ab5e9 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 72561ba2cc8..01f8835f6a4 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 56d33590cde..27dc8636ecc 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index f2b9c23b600..3924529919b 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 1b879bc8959..2a560b8d437 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.6-SNAPSHOT + 3.11.5-SNAPSHOT pom DataStax Java Driver for Apache Cassandra From 5b80646100ea4b61fc3ca7fc1c599eeff2c3a70d Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Tue, 5 Sep 2023 16:35:26 -0700 Subject: [PATCH 173/211] [maven-release-plugin] prepare release 3.11.5 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/common/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/osgi/shaded/pom.xml | 2 +- driver-tests/osgi/unshaded/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index d323e4968ac..1db54e06725 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 6b9de0500b7..541a96cdf3a 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index bdd3d98b8f6..e25e15e2990 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 9f2dce4802d..34902a21e37 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index cd08fa7e3da..4b8ddb120c4 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-mapping diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml index 607d20259a4..f96a49e9b53 100644 --- a/driver-tests/osgi/common/pom.xml +++ b/driver-tests/osgi/common/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5-SNAPSHOT + 3.11.5 jar diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 2c329831d45..c95d83923f8 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5-SNAPSHOT + 3.11.5 pom diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml index 0e1a7d071f1..db032608711 100644 --- a/driver-tests/osgi/shaded/pom.xml +++ b/driver-tests/osgi/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-tests-osgi-shaded diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml index a5f079e96d3..e6ce35cee7b 100644 --- a/driver-tests/osgi/unshaded/pom.xml +++ b/driver-tests/osgi/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-tests-osgi-unshaded diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index fecee78b300..df9682e7779 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index d4fca2ab5e9..d979a7077a7 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5-SNAPSHOT + 3.11.5 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 01f8835f6a4..f34136073ba 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 27dc8636ecc..4e2bc673368 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 3924529919b..34edb42c52f 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 2a560b8d437..9bfd45b41c4 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.5 pom DataStax Java Driver for Apache Cassandra @@ -1167,7 +1167,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.11.5 From 7fd265f8da9b29bcda68f1e3e6144cbaac3e4da1 Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Tue, 5 Sep 2023 16:42:38 -0700 Subject: [PATCH 174/211] [maven-release-plugin] rollback the release of 3.11.5 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/common/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/osgi/shaded/pom.xml | 2 +- driver-tests/osgi/unshaded/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 1db54e06725..d323e4968ac 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5 + 3.11.5-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 541a96cdf3a..6b9de0500b7 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5 + 3.11.5-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index e25e15e2990..bdd3d98b8f6 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5 + 3.11.5-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 34902a21e37..9f2dce4802d 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5 + 3.11.5-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 4b8ddb120c4..cd08fa7e3da 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5 + 3.11.5-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml index f96a49e9b53..607d20259a4 100644 --- a/driver-tests/osgi/common/pom.xml +++ b/driver-tests/osgi/common/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5 + 3.11.5-SNAPSHOT jar diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index c95d83923f8..2c329831d45 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5 + 3.11.5-SNAPSHOT pom diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml index db032608711..0e1a7d071f1 100644 --- a/driver-tests/osgi/shaded/pom.xml +++ b/driver-tests/osgi/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5 + 3.11.5-SNAPSHOT cassandra-driver-tests-osgi-shaded diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml index e6ce35cee7b..a5f079e96d3 100644 --- a/driver-tests/osgi/unshaded/pom.xml +++ b/driver-tests/osgi/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5 + 3.11.5-SNAPSHOT cassandra-driver-tests-osgi-unshaded diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index df9682e7779..fecee78b300 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5 + 3.11.5-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index d979a7077a7..d4fca2ab5e9 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5 + 3.11.5-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index f34136073ba..01f8835f6a4 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.5 + 3.11.5-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 4e2bc673368..27dc8636ecc 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.5 + 3.11.5-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 34edb42c52f..3924529919b 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5 + 3.11.5-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 9bfd45b41c4..2a560b8d437 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5 + 3.11.5-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1167,7 +1167,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.11.5 + HEAD From 62248810f2ab3ce612c7c5eb53fcc96baa8ec5f8 Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Wed, 6 Sep 2023 09:40:23 -0700 Subject: [PATCH 175/211] [maven-release-plugin] prepare release 3.11.5 --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/common/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/osgi/shaded/pom.xml | 2 +- driver-tests/osgi/unshaded/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index d323e4968ac..1db54e06725 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 6b9de0500b7..541a96cdf3a 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index bdd3d98b8f6..e25e15e2990 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 9f2dce4802d..34902a21e37 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index cd08fa7e3da..4b8ddb120c4 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-mapping diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml index 607d20259a4..f96a49e9b53 100644 --- a/driver-tests/osgi/common/pom.xml +++ b/driver-tests/osgi/common/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5-SNAPSHOT + 3.11.5 jar diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index 2c329831d45..c95d83923f8 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5-SNAPSHOT + 3.11.5 pom diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml index 0e1a7d071f1..db032608711 100644 --- a/driver-tests/osgi/shaded/pom.xml +++ b/driver-tests/osgi/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-tests-osgi-shaded diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml index a5f079e96d3..e6ce35cee7b 100644 --- a/driver-tests/osgi/unshaded/pom.xml +++ b/driver-tests/osgi/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-tests-osgi-unshaded diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index fecee78b300..df9682e7779 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index d4fca2ab5e9..d979a7077a7 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5-SNAPSHOT + 3.11.5 pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index 01f8835f6a4..f34136073ba 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 27dc8636ecc..4e2bc673368 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 3924529919b..34edb42c52f 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5-SNAPSHOT + 3.11.5 cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 2a560b8d437..9bfd45b41c4 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5-SNAPSHOT + 3.11.5 pom DataStax Java Driver for Apache Cassandra @@ -1167,7 +1167,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - HEAD + 3.11.5 From 9502512afdff3fa3cd3967302ba201477bc0ce5a Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Wed, 6 Sep 2023 09:40:27 -0700 Subject: [PATCH 176/211] [maven-release-plugin] prepare for next development iteration --- driver-core/pom.xml | 2 +- driver-dist/pom.xml | 2 +- driver-examples/pom.xml | 2 +- driver-extras/pom.xml | 2 +- driver-mapping/pom.xml | 2 +- driver-tests/osgi/common/pom.xml | 2 +- driver-tests/osgi/pom.xml | 2 +- driver-tests/osgi/shaded/pom.xml | 2 +- driver-tests/osgi/unshaded/pom.xml | 2 +- driver-tests/pom.xml | 2 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 2 +- driver-tests/shading/unshaded/pom.xml | 2 +- driver-tests/stress/pom.xml | 2 +- pom.xml | 4 ++-- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 1db54e06725..801e124bf4e 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5 + 3.11.6-SNAPSHOT cassandra-driver-core diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 541a96cdf3a..3f7e1677e38 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5 + 3.11.6-SNAPSHOT cassandra-driver-dist diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index e25e15e2990..8e4dbe0e012 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5 + 3.11.6-SNAPSHOT cassandra-driver-examples diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 34902a21e37..8fbc89c0206 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5 + 3.11.6-SNAPSHOT cassandra-driver-extras diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 4b8ddb120c4..59cd707e81c 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5 + 3.11.6-SNAPSHOT cassandra-driver-mapping diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml index f96a49e9b53..8da73e1d14f 100644 --- a/driver-tests/osgi/common/pom.xml +++ b/driver-tests/osgi/common/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5 + 3.11.6-SNAPSHOT jar diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml index c95d83923f8..a32c6a669b4 100644 --- a/driver-tests/osgi/pom.xml +++ b/driver-tests/osgi/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5 + 3.11.6-SNAPSHOT pom diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml index db032608711..7c8dd5172d7 100644 --- a/driver-tests/osgi/shaded/pom.xml +++ b/driver-tests/osgi/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5 + 3.11.6-SNAPSHOT cassandra-driver-tests-osgi-shaded diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml index e6ce35cee7b..f728ba195ec 100644 --- a/driver-tests/osgi/unshaded/pom.xml +++ b/driver-tests/osgi/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-osgi - 3.11.5 + 3.11.6-SNAPSHOT cassandra-driver-tests-osgi-unshaded diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml index df9682e7779..90cb7b2c11f 100644 --- a/driver-tests/pom.xml +++ b/driver-tests/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5 + 3.11.6-SNAPSHOT cassandra-driver-tests-parent diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml index d979a7077a7..3582a609719 100644 --- a/driver-tests/shading/pom.xml +++ b/driver-tests/shading/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5 + 3.11.6-SNAPSHOT pom diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml index f34136073ba..72561ba2cc8 100644 --- a/driver-tests/shading/shaded/pom.xml +++ b/driver-tests/shading/shaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.5 + 3.11.6-SNAPSHOT cassandra-driver-tests-shading-shaded diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml index 4e2bc673368..56d33590cde 100644 --- a/driver-tests/shading/unshaded/pom.xml +++ b/driver-tests/shading/unshaded/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-shading - 3.11.5 + 3.11.6-SNAPSHOT cassandra-driver-tests-shading-unshaded diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml index 34edb42c52f..f2b9c23b600 100644 --- a/driver-tests/stress/pom.xml +++ b/driver-tests/stress/pom.xml @@ -22,7 +22,7 @@ com.datastax.cassandra cassandra-driver-tests-parent - 3.11.5 + 3.11.6-SNAPSHOT cassandra-driver-tests-stress diff --git a/pom.xml b/pom.xml index 9bfd45b41c4..1b879bc8959 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.datastax.cassandra cassandra-driver-parent - 3.11.5 + 3.11.6-SNAPSHOT pom DataStax Java Driver for Apache Cassandra @@ -1167,7 +1167,7 @@ limitations under the License. scm:git:git@github.com:datastax/java-driver.git scm:git:git@github.com:datastax/java-driver.git https://github.com/datastax/java-driver - 3.11.5 + HEAD From 0178ad872f3f7081a7e024f566a25f35f9d6998f Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Mon, 11 Sep 2023 08:10:04 -0700 Subject: [PATCH 177/211] Update clirr version after 3.11.5 release (#1730) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1b879bc8959..901bd17fa38 100644 --- a/pom.xml +++ b/pom.xml @@ -642,7 +642,7 @@ - 3.11.4 + 3.11.5 ../clirr-ignores.xml com/datastax/shaded/** From cc906f7361999974cd319140be63adce20f1c26b Mon Sep 17 00:00:00 2001 From: mck Date: Thu, 28 Sep 2023 21:53:40 +0200 Subject: [PATCH 178/211] Copyright to ASF (see https://incubator.apache.org/ip-clearance/cassandra-java-driver.html ) patch by Mick Semb Wever; reviewed by Henry Hughes for CASSANDRA-18611 --- NOTICE.txt | 20 +++++++ README.md | 14 ++--- doxyfile | 2 +- driver-core/pom.xml | 16 ++--- .../core/AbstractAddressableByIndexData.java | 14 +++-- .../datastax/driver/core/AbstractData.java | 14 +++-- .../core/AbstractGettableByIndexData.java | 14 +++-- .../driver/core/AbstractGettableData.java | 14 +++-- .../AbstractMonotonicTimestampGenerator.java | 14 +++-- .../core/AbstractReconnectionHandler.java | 14 +++-- .../datastax/driver/core/AbstractSession.java | 14 +++-- .../driver/core/AbstractTableMetadata.java | 14 +++-- .../driver/core/AggregateMetadata.java | 14 +++-- .../driver/core/ArrayBackedResultSet.java | 14 +++-- .../datastax/driver/core/ArrayBackedRow.java | 14 +++-- .../AtomicMonotonicTimestampGenerator.java | 14 +++-- .../datastax/driver/core/AuthProvider.java | 14 +++-- .../datastax/driver/core/Authenticator.java | 14 +++-- .../datastax/driver/core/BatchStatement.java | 14 +++-- .../datastax/driver/core/BoundStatement.java | 14 +++-- .../driver/core/BytesToSegmentDecoder.java | 14 +++-- .../java/com/datastax/driver/core/CBUtil.java | 14 +++-- ...ancelledSpeculativeExecutionException.java | 14 +++-- .../driver/core/ChainedResultSetFuture.java | 14 +++-- .../java/com/datastax/driver/core/Clock.java | 14 +++-- .../com/datastax/driver/core/CloseFuture.java | 14 +++-- .../com/datastax/driver/core/CloudConfig.java | 14 +++-- .../driver/core/CloudConfigFactory.java | 14 +++-- .../com/datastax/driver/core/Cluster.java | 16 ++--- .../core/ClusterNameMismatchException.java | 14 +++-- .../core/ClusterWidePercentileTracker.java | 14 +++-- .../datastax/driver/core/ClusteringOrder.java | 14 +++-- .../datastax/driver/core/CodecRegistry.java | 16 ++--- .../com/datastax/driver/core/CodecUtils.java | 14 +++-- .../driver/core/ColumnDefinitions.java | 14 +++-- .../datastax/driver/core/ColumnMetadata.java | 14 +++-- .../datastax/driver/core/Configuration.java | 14 +++-- .../com/datastax/driver/core/Connection.java | 14 +++-- .../driver/core/ConsistencyLevel.java | 14 +++-- .../driver/core/ControlConnection.java | 14 +++-- .../driver/core/ConvictionPolicy.java | 14 +++-- .../java/com/datastax/driver/core/Crc.java | 14 +++-- .../com/datastax/driver/core/DataType.java | 14 +++-- .../driver/core/DataTypeClassNameParser.java | 14 +++-- .../driver/core/DataTypeCqlNameParser.java | 14 +++-- .../driver/core/DefaultEndPointFactory.java | 14 +++-- .../driver/core/DefaultPreparedStatement.java | 14 +++-- .../driver/core/DefaultResultSetFuture.java | 14 +++-- .../driver/core/DelegatingCluster.java | 14 +++-- .../datastax/driver/core/DirectedGraph.java | 14 +++-- .../driver/core/DriverThrowables.java | 14 +++-- .../com/datastax/driver/core/Duration.java | 14 +++-- .../com/datastax/driver/core/EndPoint.java | 14 +++-- .../datastax/driver/core/EndPointFactory.java | 14 +++-- .../datastax/driver/core/EventDebouncer.java | 14 +++-- .../core/ExceptionCatchingRunnable.java | 14 +++-- .../datastax/driver/core/ExceptionCode.java | 14 +++-- .../datastax/driver/core/ExecutionInfo.java | 14 +++-- .../driver/core/ExtendedAuthProvider.java | 14 +++-- ...ExtendedRemoteEndpointAwareSslOptions.java | 14 +++-- .../java/com/datastax/driver/core/Frame.java | 14 +++-- .../datastax/driver/core/FrameCompressor.java | 14 +++-- .../driver/core/FramingFormatHandler.java | 14 +++-- .../driver/core/FunctionMetadata.java | 14 +++-- .../driver/core/GettableByIndexData.java | 14 +++-- .../driver/core/GettableByNameData.java | 14 +++-- .../datastax/driver/core/GettableData.java | 14 +++-- .../driver/core/GuavaCompatibility.java | 14 +++-- .../java/com/datastax/driver/core/Host.java | 20 ++++--- .../driver/core/HostConnectionPool.java | 14 +++-- .../datastax/driver/core/HostDistance.java | 14 +++-- .../driver/core/IgnoreJDK6Requirement.java | 14 +++-- .../driver/core/InboundTrafficMeter.java | 14 +++-- .../datastax/driver/core/IndexMetadata.java | 14 +++-- .../datastax/driver/core/JdkSSLOptions.java | 14 +++-- .../driver/core/KeyspaceMetadata.java | 14 +++-- .../datastax/driver/core/LZ4Compressor.java | 14 +++-- .../datastax/driver/core/LatencyTracker.java | 14 +++-- .../com/datastax/driver/core/LocalDate.java | 14 +++-- .../LoggingMonotonicTimestampGenerator.java | 14 +++-- .../com/datastax/driver/core/MD5Digest.java | 14 +++-- .../driver/core/MaterializedViewMetadata.java | 14 +++-- .../com/datastax/driver/core/Message.java | 14 +++-- .../driver/core/MessageToSegmentEncoder.java | 14 +++-- .../com/datastax/driver/core/Metadata.java | 14 +++-- .../com/datastax/driver/core/Metrics.java | 14 +++-- .../datastax/driver/core/MetricsOptions.java | 14 +++-- .../com/datastax/driver/core/MetricsUtil.java | 14 +++-- .../java/com/datastax/driver/core/Native.java | 14 +++-- .../datastax/driver/core/NettyOptions.java | 14 +++-- .../datastax/driver/core/NettySSLOptions.java | 14 +++-- .../com/datastax/driver/core/NettyUtil.java | 14 +++-- .../driver/core/OutboundTrafficMeter.java | 14 +++-- .../datastax/driver/core/PagingIterable.java | 14 +++-- .../com/datastax/driver/core/PagingState.java | 14 +++-- .../com/datastax/driver/core/ParseUtils.java | 14 +++-- .../driver/core/PerHostPercentileTracker.java | 14 +++-- .../driver/core/PercentileTracker.java | 14 +++-- .../driver/core/PlainTextAuthProvider.java | 14 +++-- .../datastax/driver/core/PoolingOptions.java | 14 +++-- .../com/datastax/driver/core/PreparedId.java | 14 +++-- .../driver/core/PreparedStatement.java | 14 +++-- .../datastax/driver/core/ProtocolEvent.java | 14 +++-- .../datastax/driver/core/ProtocolFeature.java | 14 +++-- .../datastax/driver/core/ProtocolOptions.java | 14 +++-- .../driver/core/ProtocolV1Authenticator.java | 14 +++-- .../datastax/driver/core/ProtocolVersion.java | 14 +++-- .../com/datastax/driver/core/QueryLogger.java | 14 +++-- .../datastax/driver/core/QueryOptions.java | 14 +++-- .../com/datastax/driver/core/QueryTrace.java | 14 +++-- .../driver/core/RegularStatement.java | 14 +++-- .../RemoteEndpointAwareJdkSSLOptions.java | 14 +++-- .../RemoteEndpointAwareNettySSLOptions.java | 14 +++-- .../core/RemoteEndpointAwareSSLOptions.java | 14 +++-- .../driver/core/ReplicationFactor.java | 14 +++-- .../driver/core/ReplicationStategy.java | 14 +++-- .../datastax/driver/core/RequestHandler.java | 14 +++-- .../com/datastax/driver/core/Requests.java | 16 ++--- .../com/datastax/driver/core/Responses.java | 14 +++-- .../com/datastax/driver/core/ResultSet.java | 14 +++-- .../datastax/driver/core/ResultSetFuture.java | 14 +++-- .../java/com/datastax/driver/core/Row.java | 14 +++-- .../com/datastax/driver/core/SSLOptions.java | 14 +++-- .../driver/core/SchemaChangeListener.java | 14 +++-- .../driver/core/SchemaChangeListenerBase.java | 14 +++-- .../datastax/driver/core/SchemaElement.java | 14 +++-- .../datastax/driver/core/SchemaParser.java | 14 +++-- .../com/datastax/driver/core/Segment.java | 14 +++-- .../datastax/driver/core/SegmentBuilder.java | 14 +++-- .../datastax/driver/core/SegmentCodec.java | 14 +++-- .../driver/core/SegmentToBytesEncoder.java | 14 +++-- .../driver/core/SegmentToFrameDecoder.java | 14 +++-- .../core/ServerSideTimestampGenerator.java | 14 +++-- .../com/datastax/driver/core/Session.java | 14 +++-- .../datastax/driver/core/SessionManager.java | 14 +++-- .../driver/core/SettableByIndexData.java | 14 +++-- .../driver/core/SettableByNameData.java | 14 +++-- .../datastax/driver/core/SettableData.java | 14 +++-- .../driver/core/SimpleJSONParser.java | 14 +++-- .../datastax/driver/core/SimpleStatement.java | 14 +++-- .../driver/core/SnappyCompressor.java | 14 +++-- .../com/datastax/driver/core/SniEndPoint.java | 14 +++-- .../driver/core/SniEndPointFactory.java | 14 +++-- .../datastax/driver/core/SniSSLOptions.java | 14 +++-- .../datastax/driver/core/SocketOptions.java | 14 +++-- .../com/datastax/driver/core/Statement.java | 14 +++-- .../driver/core/StatementWrapper.java | 14 +++-- .../driver/core/StreamIdGenerator.java | 14 +++-- .../driver/core/SystemProperties.java | 14 +++-- .../datastax/driver/core/TableMetadata.java | 14 +++-- .../driver/core/TableOptionsMetadata.java | 14 +++-- ...hreadLocalMonotonicTimestampGenerator.java | 14 +++-- .../driver/core/ThreadingOptions.java | 14 +++-- .../driver/core/TimestampGenerator.java | 14 +++-- .../java/com/datastax/driver/core/Token.java | 14 +++-- .../com/datastax/driver/core/TokenRange.java | 14 +++-- .../core/TranslatedAddressEndPoint.java | 14 +++-- .../com/datastax/driver/core/TupleType.java | 14 +++-- .../com/datastax/driver/core/TupleValue.java | 14 +++-- .../com/datastax/driver/core/TypeCodec.java | 14 +++-- .../com/datastax/driver/core/TypeTokens.java | 14 +++-- .../com/datastax/driver/core/UDTValue.java | 14 +++-- .../com/datastax/driver/core/UserType.java | 14 +++-- .../com/datastax/driver/core/VIntCoding.java | 14 +++-- .../datastax/driver/core/VersionNumber.java | 14 +++-- .../com/datastax/driver/core/WriteType.java | 14 +++-- .../exceptions/AlreadyExistsException.java | 14 +++-- .../exceptions/AuthenticationException.java | 14 +++-- .../exceptions/BootstrappingException.java | 14 +++-- .../exceptions/BusyConnectionException.java | 14 +++-- .../core/exceptions/BusyPoolException.java | 14 +++-- .../exceptions/CASWriteUnknownException.java | 14 +++-- .../core/exceptions/CDCWriteException.java | 14 +++-- .../exceptions/CodecNotFoundException.java | 14 +++-- .../core/exceptions/ConnectionException.java | 14 +++-- .../core/exceptions/CoordinatorException.java | 14 +++-- .../core/exceptions/CrcMismatchException.java | 14 +++-- .../core/exceptions/DriverException.java | 14 +++-- .../core/exceptions/DriverInternalError.java | 14 +++-- .../exceptions/FrameTooLongException.java | 14 +++-- .../FunctionExecutionException.java | 14 +++-- .../InvalidConfigurationInQueryException.java | 14 +++-- .../exceptions/InvalidQueryException.java | 14 +++-- .../core/exceptions/InvalidTypeException.java | 14 +++-- .../exceptions/NoHostAvailableException.java | 14 +++-- .../OperationTimedOutException.java | 14 +++-- .../core/exceptions/OverloadedException.java | 14 +++-- .../core/exceptions/PagingStateException.java | 14 +++-- .../driver/core/exceptions/ProtocolError.java | 14 +++-- .../exceptions/QueryConsistencyException.java | 14 +++-- .../exceptions/QueryExecutionException.java | 14 +++-- .../exceptions/QueryValidationException.java | 14 +++-- .../core/exceptions/ReadFailureException.java | 14 +++-- .../core/exceptions/ReadTimeoutException.java | 14 +++-- .../driver/core/exceptions/ServerError.java | 14 +++-- .../driver/core/exceptions/SyntaxError.java | 14 +++-- .../exceptions/TraceRetrievalException.java | 14 +++-- .../core/exceptions/TransportException.java | 14 +++-- .../core/exceptions/TruncateException.java | 14 +++-- .../exceptions/UnauthorizedException.java | 14 +++-- .../core/exceptions/UnavailableException.java | 14 +++-- .../core/exceptions/UnpreparedException.java | 14 +++-- .../UnresolvedUserTypeException.java | 14 +++-- .../UnsupportedFeatureException.java | 14 +++-- .../UnsupportedProtocolVersionException.java | 14 +++-- .../core/exceptions/WrappingEndPoint.java | 14 +++-- .../exceptions/WriteFailureException.java | 14 +++-- .../exceptions/WriteTimeoutException.java | 14 +++-- .../driver/core/exceptions/package-info.java | 16 ++--- .../datastax/driver/core/package-info.java | 16 ++--- .../core/policies/AddressTranslator.java | 14 +++-- .../ChainableLoadBalancingPolicy.java | 14 +++-- .../datastax/driver/core/policies/Clock.java | 14 +++-- .../policies/ConstantReconnectionPolicy.java | 14 +++-- .../ConstantSpeculativeExecutionPolicy.java | 14 +++-- .../policies/DCAwareRoundRobinPolicy.java | 14 +++-- .../core/policies/DefaultRetryPolicy.java | 14 +++-- .../DowngradingConsistencyRetryPolicy.java | 14 +++-- .../EC2MultiRegionAddressTranslator.java | 14 +++-- .../core/policies/ErrorAwarePolicy.java | 14 +++-- .../ExponentialReconnectionPolicy.java | 14 +++-- .../core/policies/FallthroughRetryPolicy.java | 14 +++-- .../core/policies/HostFilterPolicy.java | 14 +++-- .../policies/IdempotenceAwareRetryPolicy.java | 14 +++-- .../core/policies/IdentityTranslator.java | 14 +++-- .../core/policies/LatencyAwarePolicy.java | 14 +++-- .../core/policies/LoadBalancingPolicy.java | 14 +++-- .../core/policies/LoggingRetryPolicy.java | 14 +++-- .../NoSpeculativeExecutionPolicy.java | 14 +++-- .../PercentileSpeculativeExecutionPolicy.java | 14 +++-- .../driver/core/policies/Policies.java | 14 +++-- .../core/policies/ReconnectionPolicy.java | 14 +++-- .../driver/core/policies/RetryPolicy.java | 14 +++-- .../driver/core/policies/RollingCount.java | 14 +++-- .../core/policies/RoundRobinPolicy.java | 14 +++-- .../policies/SpeculativeExecutionPolicy.java | 14 +++-- .../core/policies/TokenAwarePolicy.java | 14 +++-- .../driver/core/policies/WhiteListPolicy.java | 14 +++-- .../driver/core/policies/package-info.java | 16 ++--- .../driver/core/querybuilder/Assignment.java | 14 +++-- .../driver/core/querybuilder/Batch.java | 14 +++-- .../driver/core/querybuilder/BindMarker.java | 14 +++-- .../core/querybuilder/BuiltStatement.java | 14 +++-- .../driver/core/querybuilder/Clause.java | 14 +++-- .../driver/core/querybuilder/Delete.java | 14 +++-- .../driver/core/querybuilder/Insert.java | 14 +++-- .../driver/core/querybuilder/Ordering.java | 14 +++-- .../core/querybuilder/QueryBuilder.java | 14 +++-- .../driver/core/querybuilder/Select.java | 14 +++-- .../driver/core/querybuilder/Truncate.java | 14 +++-- .../driver/core/querybuilder/Update.java | 14 +++-- .../driver/core/querybuilder/Using.java | 14 +++-- .../driver/core/querybuilder/Utils.java | 14 +++-- .../core/querybuilder/package-info.java | 14 +++-- .../AbstractCreateStatement.java | 14 +++-- .../driver/core/schemabuilder/Alter.java | 14 +++-- .../core/schemabuilder/AlterKeyspace.java | 14 +++-- .../driver/core/schemabuilder/ColumnType.java | 14 +++-- .../driver/core/schemabuilder/Create.java | 14 +++-- .../core/schemabuilder/CreateIndex.java | 14 +++-- .../core/schemabuilder/CreateKeyspace.java | 14 +++-- .../driver/core/schemabuilder/CreateType.java | 14 +++-- .../driver/core/schemabuilder/Drop.java | 14 +++-- .../core/schemabuilder/DropKeyspace.java | 14 +++-- .../core/schemabuilder/KeyspaceOptions.java | 14 +++-- .../core/schemabuilder/NativeColumnType.java | 14 +++-- .../core/schemabuilder/SchemaBuilder.java | 14 +++-- .../core/schemabuilder/SchemaStatement.java | 14 +++-- .../core/schemabuilder/StatementStart.java | 14 +++-- .../core/schemabuilder/TableOptions.java | 14 +++-- .../driver/core/schemabuilder/UDTType.java | 14 +++-- .../core/schemabuilder/package-info.java | 14 +++-- .../com/datastax/driver/core/utils/Bytes.java | 14 +++-- .../driver/core/utils/MoreFutures.java | 14 +++-- .../driver/core/utils/MoreObjects.java | 14 +++-- .../com/datastax/driver/core/utils/UUIDs.java | 14 +++-- .../datastax/driver/core/Driver.properties | 14 +++-- .../core/AbstractBatchIdempotencyTest.java | 14 +++-- .../driver/core/AbstractPoliciesTest.java | 14 +++-- .../core/AbstractReconnectionHandlerTest.java | 14 +++-- .../core/AbstractReplicationStrategyTest.java | 14 +++-- .../core/AdditionalWritePolicyTest.java | 14 +++-- .../driver/core/AggregateMetadataAssert.java | 14 +++-- .../driver/core/AggregateMetadataTest.java | 14 +++-- .../com/datastax/driver/core/Assertions.java | 16 ++--- .../datastax/driver/core/AsyncQueryTest.java | 14 +++-- .../driver/core/AsyncResultSetTest.java | 14 +++-- ...AtomicMonotonicTimestampGeneratorTest.java | 14 +++-- .../driver/core/AuthenticationTest.java | 14 +++-- .../core/BatchStatementIdempotencyTest.java | 14 +++-- .../driver/core/BatchStatementTest.java | 14 +++-- .../driver/core/BoundStatementTest.java | 14 +++-- .../core/BytesToSegmentDecoderTest.java | 14 +++-- .../com/datastax/driver/core/CCMAccess.java | 18 +++--- .../com/datastax/driver/core/CCMBridge.java | 18 +++--- .../datastax/driver/core/CCMBridgeTest.java | 14 +++-- .../com/datastax/driver/core/CCMCache.java | 14 +++-- .../com/datastax/driver/core/CCMConfig.java | 14 +++-- .../datastax/driver/core/CCMException.java | 14 +++-- .../datastax/driver/core/CCMTestsSupport.java | 14 +++-- .../com/datastax/driver/core/CCMWorkload.java | 14 +++-- .../driver/core/CaseSensitivityTest.java | 14 +++-- .../driver/core/ClockFactoryTest.java | 14 +++-- .../driver/core/CloudConfigFactoryTest.java | 14 +++-- .../datastax/driver/core/ClusterAssert.java | 14 +++-- .../datastax/driver/core/ClusterInitTest.java | 14 +++-- .../driver/core/ClusterStressTest.java | 14 +++-- .../ClusterWidePercentileTrackerTest.java | 14 +++-- .../driver/core/CodecRegistryTest.java | 14 +++-- .../driver/core/ColumnDefinitionsAssert.java | 14 +++-- .../driver/core/ColumnDefinitionsTest.java | 14 +++-- .../driver/core/ColumnMetadataAssert.java | 14 +++-- .../datastax/driver/core/CompressionTest.java | 14 +++-- .../driver/core/ConditionChecker.java | 14 +++-- .../driver/core/ConditionalUpdateTest.java | 14 +++-- .../driver/core/ConnectionReleaseTest.java | 14 +++-- .../datastax/driver/core/ConsistencyTest.java | 14 +++-- .../driver/core/ControlConnectionTest.java | 14 +++-- .../core/CountingReconnectionPolicy.java | 14 +++-- .../com/datastax/driver/core/CreateCCM.java | 14 +++-- .../driver/core/CustomPayloadTest.java | 14 +++-- .../core/CustomPercentileTrackerTest.java | 14 +++-- .../datastax/driver/core/CustomTypeTest.java | 14 +++-- .../datastax/driver/core/DataProviders.java | 14 +++-- .../datastax/driver/core/DataTypeAssert.java | 14 +++-- .../core/DataTypeClassNameParserTest.java | 14 +++-- .../core/DataTypeCqlNameParserTest.java | 14 +++-- .../driver/core/DataTypeIntegrationTest.java | 14 +++-- .../datastax/driver/core/DataTypeTest.java | 14 +++-- .../DelegatingClusterIntegrationTest.java | 14 +++-- .../driver/core/DelegatingClusterTest.java | 14 +++-- .../driver/core/DirectCompressionTest.java | 14 +++-- .../driver/core/DirectedGraphTest.java | 14 +++-- .../driver/core/DseCCMClusterTest.java | 16 ++--- .../driver/core/DurationCodecTest.java | 14 +++-- .../driver/core/DurationIntegrationTest.java | 14 +++-- .../datastax/driver/core/DurationTest.java | 14 +++-- .../com/datastax/driver/core/EndPoints.java | 14 +++-- .../core/EventDebouncerIntegrationTest.java | 14 +++-- .../driver/core/EventDebouncerTest.java | 14 +++-- .../driver/core/ExportAsStringTest.java | 14 +++-- .../core/ExtendedPeerCheckDisabledTest.java | 14 +++-- .../com/datastax/driver/core/FakeHost.java | 14 +++-- .../datastax/driver/core/FetchingTest.java | 14 +++-- .../datastax/driver/core/FrameLengthTest.java | 14 +++-- .../driver/core/FunctionMetadataAssert.java | 14 +++-- .../driver/core/FunctionMetadataTest.java | 14 +++-- .../core/GettableDataIntegrationTest.java | 14 +++-- .../driver/core/HeapCompressionTest.java | 14 +++-- .../datastax/driver/core/HeartbeatTest.java | 14 +++-- .../com/datastax/driver/core/HostAssert.java | 14 +++-- .../core/HostConnectionPoolMultiTest.java | 14 +++-- .../driver/core/HostConnectionPoolTest.java | 14 +++-- .../core/HostMetadataIntegrationTest.java | 14 +++-- .../driver/core/HostTargetingTest.java | 14 +++-- .../driver/core/IndexMetadataAssert.java | 14 +++-- .../driver/core/IndexMetadataTest.java | 14 +++-- .../driver/core/Jdk8SSLEncryptionTest.java | 14 +++-- .../driver/core/KeyspaceMetadataAssert.java | 14 +++-- .../datastax/driver/core/LargeDataTest.java | 14 +++-- .../LoadBalancingPolicyBootstrapTest.java | 14 +++-- .../core/LoadBalancingPolicyRefreshTest.java | 14 +++-- .../datastax/driver/core/LocalDateAssert.java | 14 +++-- .../datastax/driver/core/LocalDateTest.java | 14 +++-- .../driver/core/M3PTokenFactoryTest.java | 14 +++-- .../driver/core/M3PTokenIntegrationTest.java | 14 +++-- .../core/M3PTokenVnodeIntegrationTest.java | 14 +++-- .../datastax/driver/core/MappingCodec.java | 14 +++-- .../core/MaterializedViewMetadataAssert.java | 14 +++-- .../core/MaterializedViewMetadataTest.java | 14 +++-- .../datastax/driver/core/MemoryAppender.java | 14 +++-- .../datastax/driver/core/MetadataTest.java | 14 +++-- .../driver/core/MetricsInFlightTest.java | 14 +++-- .../com/datastax/driver/core/MetricsTest.java | 14 +++-- .../driver/core/MissingRpcAddressTest.java | 14 +++-- .../com/datastax/driver/core/MockClocks.java | 14 +++-- .../com/datastax/driver/core/NativeTest.java | 14 +++-- .../driver/core/NettyOptionsTest.java | 14 +++-- .../core/NetworkTopologyStrategyTest.java | 14 +++-- .../core/NodeListRefreshDebouncerTest.java | 14 +++-- .../driver/core/NodeRefreshDebouncerTest.java | 14 +++-- .../driver/core/NowInSecondsTest.java | 14 +++-- .../driver/core/OPPTokenFactoryTest.java | 14 +++-- .../driver/core/OPPTokenIntegrationTest.java | 14 +++-- .../core/OPPTokenVnodeIntegrationTest.java | 14 +++-- .../datastax/driver/core/PagingStateTest.java | 14 +++-- .../datastax/driver/core/ParseUtilsTest.java | 14 +++-- .../core/PerHostPercentileTrackerTest.java | 14 +++-- .../driver/core/PercentileTrackerTest.java | 14 +++-- .../core/PoolingOptionsIntegrationTest.java | 14 +++-- .../driver/core/PoolingOptionsTest.java | 14 +++-- .../datastax/driver/core/PreparedIdTest.java | 14 +++-- .../PreparedStatementInvalidationTest.java | 14 +++-- .../driver/core/PreparedStatementTest.java | 14 +++-- .../driver/core/PrimitiveTypeSamples.java | 14 +++-- .../driver/core/ProtocolBetaVersionTest.java | 14 +++-- .../driver/core/ProtocolOptionsTest.java | 14 +++-- .../datastax/driver/core/ProtocolV1Test.java | 14 +++-- .../ProtocolVersionRenegotiationTest.java | 14 +++-- .../driver/core/QueryLoggerErrorsTest.java | 14 +++-- .../datastax/driver/core/QueryLoggerTest.java | 14 +++-- .../driver/core/QueryOptionsTest.java | 14 +++-- .../driver/core/QueryTimestampTest.java | 14 +++-- .../datastax/driver/core/QueryTracker.java | 14 +++-- .../driver/core/RPTokenFactoryTest.java | 14 +++-- .../driver/core/RPTokenIntegrationTest.java | 14 +++-- .../core/RPTokenVnodeIntegrationTest.java | 14 +++-- .../datastax/driver/core/ReadTimeoutTest.java | 14 +++-- .../driver/core/RecommissionedNodeTest.java | 14 +++-- .../driver/core/ReconnectionPolicyTest.java | 14 +++-- .../driver/core/ReconnectionTest.java | 14 +++-- .../driver/core/RefreshConnectedHostTest.java | 14 +++-- .../driver/core/ReplicationFactorTest.java | 14 +++-- .../driver/core/ReplicationStrategyTest.java | 14 +++-- .../driver/core/RequestHandlerTest.java | 14 +++-- .../datastax/driver/core/ResultSetAssert.java | 14 +++-- .../driver/core/ReusedStreamIdTest.java | 14 +++-- .../core/SSLAuthenticatedEncryptionTest.java | 14 +++-- .../driver/core/SSLEncryptionTest.java | 14 +++-- .../com/datastax/driver/core/SSLTestBase.java | 14 +++-- .../driver/core/ScassandraCluster.java | 14 +++-- .../driver/core/ScassandraTestBase.java | 14 +++-- .../driver/core/SchemaAgreementTest.java | 14 +++-- .../driver/core/SchemaChangesCCTest.java | 14 +++-- .../driver/core/SchemaChangesTest.java | 14 +++-- .../core/SchemaRefreshDebouncerTest.java | 14 +++-- .../driver/core/SegmentBuilderTest.java | 14 +++-- .../driver/core/SegmentCodecTest.java | 14 +++-- .../core/SegmentToFrameDecoderTest.java | 14 +++-- .../datastax/driver/core/SessionAssert.java | 14 +++-- .../driver/core/SessionErrorTest.java | 14 +++-- .../datastax/driver/core/SessionLeakTest.java | 14 +++-- .../driver/core/SessionStressTest.java | 14 +++-- .../com/datastax/driver/core/SessionTest.java | 14 +++-- .../driver/core/SimpleJSONParserTest.java | 14 +++-- .../core/SimpleStatementIntegrationTest.java | 14 +++-- .../driver/core/SimpleStatementTest.java | 14 +++-- .../driver/core/SimpleStrategyTest.java | 14 +++-- .../driver/core/SingleConnectionPoolTest.java | 14 +++-- .../core/SingleTokenIntegrationTest.java | 14 +++-- .../core/SortingLoadBalancingPolicy.java | 14 +++-- .../driver/core/SpeculativeExecutionTest.java | 14 +++-- .../driver/core/StartupOptionTest.java | 16 ++--- .../driver/core/StateListenerBase.java | 14 +++-- .../driver/core/StateListenerTest.java | 14 +++-- .../driver/core/StatementIdempotenceTest.java | 14 +++-- .../driver/core/StatementSizeTest.java | 14 +++-- .../driver/core/StatementWrapperTest.java | 14 +++-- .../driver/core/StreamIdGeneratorTest.java | 14 +++-- .../driver/core/TableMetadataAssert.java | 14 +++-- .../driver/core/TableMetadataCDCTest.java | 14 +++-- .../driver/core/TableMetadataTest.java | 14 +++-- .../datastax/driver/core/TestListener.java | 14 +++-- .../com/datastax/driver/core/TestUtils.java | 14 +++-- ...dLocalMonotonicTimestampGeneratorTest.java | 14 +++-- .../driver/core/ThreadingOptionsTest.java | 14 +++-- .../driver/core/TimeoutStressTest.java | 14 +++-- .../driver/core/TokenIntegrationTest.java | 14 +++-- .../driver/core/TokenRangeAssert.java | 14 +++-- .../datastax/driver/core/TokenRangeTest.java | 14 +++-- .../com/datastax/driver/core/TracingTest.java | 14 +++-- .../driver/core/TrafficMetersTest.java | 14 +++-- .../driver/core/TransientReplicationTest.java | 14 +++-- .../com/datastax/driver/core/TupleTest.java | 14 +++-- .../datastax/driver/core/TypeCodecAssert.java | 14 +++-- .../TypeCodecCollectionsIntegrationTest.java | 14 +++-- ...TypeCodecEncapsulationIntegrationTest.java | 14 +++-- ...CodecNestedCollectionsIntegrationTest.java | 14 +++-- ...CodecNestedUDTAndTupleIntegrationTest.java | 14 +++-- .../core/TypeCodecNumbersIntegrationTest.java | 14 +++-- ...decOverlappingJavaTypeIntegrationTest.java | 14 +++-- .../datastax/driver/core/TypeCodecTest.java | 14 +++-- .../core/TypeCodecTupleIntegrationTest.java | 14 +++-- .../core/TypeCodecUDTIntegrationTest.java | 14 +++-- .../driver/core/UnresolvedUserTypeTest.java | 14 +++-- .../datastax/driver/core/UserTypesTest.java | 14 +++-- .../driver/core/VersionNumberAssert.java | 14 +++-- .../driver/core/VersionNumberTest.java | 14 +++-- .../driver/core/VirtualTableMetadataTest.java | 14 +++-- .../datastax/driver/core/WarningsTest.java | 14 +++-- .../datastax/driver/core/cloud/CloudTest.java | 14 +++-- .../driver/core/cloud/SniProxyServer.java | 14 +++-- .../exceptions/ConnectionExceptionTest.java | 14 +++-- .../exceptions/ExceptionsScassandraTest.java | 14 +++-- .../core/exceptions/ExceptionsTest.java | 14 +++-- .../FunctionExecutionExceptionTest.java | 14 +++-- .../NoHostAvailableExceptionTest.java | 14 +++-- .../ReadWriteFailureExceptionTest.java | 14 +++-- .../AbstractRetryPolicyIntegrationTest.java | 14 +++-- .../CloseableLoadBalancingPolicyTest.java | 14 +++-- .../CustomRetryPolicyIntegrationTest.java | 14 +++-- .../policies/DCAwareRoundRobinPolicyTest.java | 14 +++-- .../DefaultRetryPolicyIntegrationTest.java | 14 +++-- .../DelegatingLoadBalancingPolicy.java | 14 +++-- .../DelegatingSpeculativeExecutionPolicy.java | 14 +++-- ...ConsistencyRetryPolicyIntegrationTest.java | 14 +++-- .../EC2MultiRegionAddressTranslatorTest.java | 14 +++-- .../ErrorAwarePolicyIntegrationTest.java | 14 +++-- ...FallthroughRetryPolicyIntegrationTest.java | 14 +++-- .../core/policies/HostFilterPolicyTest.java | 14 +++-- ...otenceAwareRetryPolicyIntegrationTest.java | 14 +++-- .../core/policies/LatencyAwarePolicyTest.java | 14 +++-- .../policies/LimitingLoadBalancingPolicy.java | 14 +++-- .../LoggingRetryPolicyIntegrationTest.java | 14 +++-- .../core/policies/RetryDecisionTest.java | 14 +++-- .../core/policies/RollingCountTest.java | 14 +++-- .../core/policies/RoundRobinPolicyTest.java | 14 +++-- .../core/policies/TokenAwarePolicyTest.java | 14 +++-- .../core/policies/WhiteListPolicyTest.java | 14 +++-- .../querybuilder/BatchIdempotencyTest.java | 14 +++-- .../QueryBuilder21ExecutionTest.java | 14 +++-- .../QueryBuilderExecutionTest.java | 14 +++-- .../core/querybuilder/QueryBuilderITest.java | 14 +++-- .../QueryBuilderRoutingKeyTest.java | 14 +++-- .../core/querybuilder/QueryBuilderTest.java | 14 +++-- .../QueryBuilderTupleExecutionTest.java | 14 +++-- .../QueryBuilderUDTExecutionTest.java | 14 +++-- .../core/schemabuilder/AlterKeyspaceTest.java | 14 +++-- .../driver/core/schemabuilder/AlterTest.java | 14 +++-- .../schemabuilder/CompactionOptionsTest.java | 14 +++-- .../schemabuilder/CompressionOptionsTest.java | 14 +++-- .../core/schemabuilder/CreateIndexTest.java | 14 +++-- .../schemabuilder/CreateKeyspaceTest.java | 14 +++-- .../driver/core/schemabuilder/CreateTest.java | 14 +++-- .../core/schemabuilder/CreateTypeTest.java | 14 +++-- .../core/schemabuilder/DropKeyspaceTest.java | 14 +++-- .../driver/core/schemabuilder/DropTest.java | 14 +++-- .../core/schemabuilder/SchemaBuilderIT.java | 14 +++-- .../driver/core/utils/CassandraVersion.java | 14 +++-- .../driver/core/utils/DseVersion.java | 14 +++-- .../core/utils/SocketChannelMonitor.java | 14 +++-- .../core/utils/UUIDsPIDFromPropertyTest.java | 14 +++-- .../driver/core/utils/UUIDsPIDNativeTest.java | 14 +++-- .../utils/UUIDsPIDPropertyInvalidTest.java | 14 +++-- .../datastax/driver/core/utils/UUIDsTest.java | 14 +++-- .../src/test/resources/log4j.properties | 14 +++-- driver-dist/pom.xml | 16 ++--- driver-dist/src/assembly/binary-tarball.xml | 16 ++--- driver-examples/README.md | 4 +- driver-examples/pom.xml | 18 +++--- .../astra/AstraReadCassandraVersion.java | 16 ++--- .../basic/CreateAndPopulateKeyspace.java | 16 ++--- .../examples/basic/ReadCassandraVersion.java | 16 ++--- .../basic/ReadTopologyAndSchemaMetadata.java | 16 ++--- .../driver/examples/datatypes/Blobs.java | 16 ++--- .../examples/json/JacksonJsonColumn.java | 14 +++-- .../examples/json/JacksonJsonFunction.java | 14 +++-- .../driver/examples/json/JacksonJsonRow.java | 14 +++-- .../examples/json/Jsr353JsonColumn.java | 14 +++-- .../examples/json/Jsr353JsonFunction.java | 14 +++-- .../driver/examples/json/Jsr353JsonRow.java | 14 +++-- .../driver/examples/json/PlainTextJson.java | 14 +++-- .../examples/paging/ForwardPagingRestUi.java | 14 +++-- .../examples/paging/RandomPagingRestUi.java | 14 +++-- .../examples/retry/DowngradingRetry.java | 16 ++--- .../src/main/resources/logback.xml | 16 ++--- driver-extras/pom.xml | 18 +++--- .../driver/extras/codecs/MappingCodec.java | 14 +++-- .../driver/extras/codecs/ParsingCodec.java | 14 +++-- .../codecs/arrays/AbstractArrayCodec.java | 14 +++-- .../arrays/AbstractPrimitiveArrayCodec.java | 14 +++-- .../codecs/arrays/DoubleArrayCodec.java | 14 +++-- .../extras/codecs/arrays/FloatArrayCodec.java | 14 +++-- .../extras/codecs/arrays/IntArrayCodec.java | 14 +++-- .../extras/codecs/arrays/LongArrayCodec.java | 14 +++-- .../codecs/arrays/ObjectArrayCodec.java | 14 +++-- .../extras/codecs/arrays/package-info.java | 14 +++-- .../extras/codecs/date/SimpleDateCodec.java | 14 +++-- .../codecs/date/SimpleTimestampCodec.java | 14 +++-- .../extras/codecs/date/package-info.java | 14 +++-- .../extras/codecs/enums/EnumNameCodec.java | 14 +++-- .../extras/codecs/enums/EnumOrdinalCodec.java | 14 +++-- .../extras/codecs/enums/package-info.java | 14 +++-- .../extras/codecs/guava/OptionalCodec.java | 14 +++-- .../extras/codecs/guava/package-info.java | 14 +++-- .../extras/codecs/jdk8/InstantCodec.java | 14 +++-- .../extras/codecs/jdk8/LocalDateCodec.java | 14 +++-- .../codecs/jdk8/LocalDateTimeCodec.java | 14 +++-- .../extras/codecs/jdk8/LocalTimeCodec.java | 14 +++-- .../extras/codecs/jdk8/OptionalCodec.java | 14 +++-- .../extras/codecs/jdk8/ZoneIdCodec.java | 14 +++-- .../codecs/jdk8/ZonedDateTimeCodec.java | 14 +++-- .../extras/codecs/jdk8/package-info.java | 14 +++-- .../extras/codecs/joda/DateTimeCodec.java | 14 +++-- .../extras/codecs/joda/InstantCodec.java | 14 +++-- .../extras/codecs/joda/LocalDateCodec.java | 14 +++-- .../extras/codecs/joda/LocalTimeCodec.java | 14 +++-- .../extras/codecs/joda/package-info.java | 14 +++-- .../extras/codecs/json/JacksonJsonCodec.java | 14 +++-- .../extras/codecs/json/Jsr353JsonCodec.java | 14 +++-- .../extras/codecs/json/package-info.java | 14 +++-- .../driver/extras/codecs/package-info.java | 14 +++-- .../extras/codecs/arrays/ArrayCodecsTest.java | 14 +++-- .../codecs/date/SimpleDateCodecTest.java | 14 +++-- .../codecs/date/SimpleDateCodecsTest.java | 14 +++-- .../codecs/date/SimpleTimestampCodecTest.java | 14 +++-- .../extras/codecs/enums/EnumCodecsTest.java | 14 +++-- .../codecs/guava/OptionalCodecTest.java | 14 +++-- .../extras/codecs/jdk8/InstantCodecTest.java | 14 +++-- .../codecs/jdk8/Jdk8TimeCodecsTest.java | 14 +++-- .../codecs/jdk8/LocalDateCodecTest.java | 14 +++-- .../codecs/jdk8/LocalDateTimeCodecTest.java | 14 +++-- .../codecs/jdk8/LocalTimeCodecTest.java | 14 +++-- .../extras/codecs/jdk8/OptionalCodecTest.java | 14 +++-- .../extras/codecs/jdk8/ZoneIdCodecTest.java | 14 +++-- .../codecs/jdk8/ZonedDateTimeCodecTest.java | 14 +++-- .../extras/codecs/joda/DateTimeCodecTest.java | 14 +++-- .../extras/codecs/joda/InstantCodecTest.java | 14 +++-- .../codecs/joda/JodaTimeCodecsTest.java | 14 +++-- .../codecs/joda/LocalDateCodecTest.java | 14 +++-- .../codecs/joda/LocalTimeCodecTest.java | 14 +++-- .../codecs/json/JacksonJsonCodecTest.java | 14 +++-- .../codecs/json/Jsr353JsonCodecTest.java | 14 +++-- .../src/test/resources/log4j.properties | 14 +++-- driver-mapping/pom.xml | 16 ++--- .../mapping/AccessorInvocationHandler.java | 14 +++-- .../driver/mapping/AccessorMapper.java | 14 +++-- .../driver/mapping/AliasedMappedProperty.java | 14 +++-- .../driver/mapping/AnnotationChecks.java | 14 +++-- .../driver/mapping/AnnotationParser.java | 14 +++-- .../mapping/DefaultHierarchyScanStrategy.java | 14 +++-- .../driver/mapping/DefaultMappedProperty.java | 14 +++-- .../driver/mapping/DefaultNamingStrategy.java | 14 +++-- .../driver/mapping/DefaultPropertyMapper.java | 14 +++-- .../driver/mapping/DriverThrowables.java | 14 +++-- .../datastax/driver/mapping/EntityMapper.java | 14 +++-- .../driver/mapping/HierarchyScanStrategy.java | 14 +++-- ...appedClassesOnlyHierarchyScanStrategy.java | 14 +++-- .../driver/mapping/MappedProperty.java | 14 +++-- .../driver/mapping/MappedUDTCodec.java | 14 +++-- .../com/datastax/driver/mapping/Mapper.java | 14 +++-- .../driver/mapping/MapperBoundStatement.java | 14 +++-- .../driver/mapping/MappingConfiguration.java | 14 +++-- .../driver/mapping/MappingManager.java | 14 +++-- .../datastax/driver/mapping/MethodMapper.java | 14 +++-- .../driver/mapping/NamingConvention.java | 14 +++-- .../driver/mapping/NamingConventions.java | 14 +++-- .../driver/mapping/NamingStrategy.java | 14 +++-- .../mapping/PropertyAccessStrategy.java | 14 +++-- .../driver/mapping/PropertyMapper.java | 14 +++-- .../mapping/PropertyTransienceStrategy.java | 14 +++-- .../datastax/driver/mapping/QueryType.java | 14 +++-- .../driver/mapping/ReflectionUtils.java | 14 +++-- .../com/datastax/driver/mapping/Result.java | 14 +++-- .../datastax/driver/mapping/TypeMappings.java | 14 +++-- .../com/datastax/driver/mapping/Word.java | 14 +++-- .../driver/mapping/annotations/Accessor.java | 14 +++-- .../mapping/annotations/ClusteringColumn.java | 14 +++-- .../driver/mapping/annotations/Column.java | 14 +++-- .../driver/mapping/annotations/Computed.java | 14 +++-- .../driver/mapping/annotations/Defaults.java | 14 +++-- .../driver/mapping/annotations/Field.java | 14 +++-- .../driver/mapping/annotations/Frozen.java | 14 +++-- .../driver/mapping/annotations/FrozenKey.java | 14 +++-- .../mapping/annotations/FrozenValue.java | 14 +++-- .../driver/mapping/annotations/Param.java | 14 +++-- .../mapping/annotations/PartitionKey.java | 14 +++-- .../driver/mapping/annotations/Query.java | 14 +++-- .../mapping/annotations/QueryParameters.java | 14 +++-- .../driver/mapping/annotations/Table.java | 14 +++-- .../driver/mapping/annotations/Transient.java | 14 +++-- .../driver/mapping/annotations/UDT.java | 14 +++-- .../mapping/MapperAccessorParamsTest.java | 14 +++-- .../driver/mapping/MapperAccessorTest.java | 14 +++-- .../driver/mapping/MapperAsyncResultTest.java | 14 +++-- .../driver/mapping/MapperAsyncTest.java | 14 +++-- .../mapping/MapperCaseSensitivityTest.java | 14 +++-- .../mapping/MapperCompositeKeyTest.java | 14 +++-- .../mapping/MapperComputedFieldsTest.java | 14 +++-- .../driver/mapping/MapperCustomCodecTest.java | 14 +++-- .../mapping/MapperInvalidAnnotationsTest.java | 14 +++-- .../driver/mapping/MapperKeyspaceTest.java | 14 +++-- .../mapping/MapperMaterializedViewTest.java | 14 +++-- .../mapping/MapperNestedCollectionsTest.java | 14 +++-- .../driver/mapping/MapperNestedUDTTest.java | 14 +++-- .../driver/mapping/MapperOptionTest.java | 14 +++-- .../mapping/MapperPolymorphismTest.java | 14 +++-- .../mapping/MapperPrimitiveTypes22Test.java | 14 +++-- .../mapping/MapperPrimitiveTypesTest.java | 14 +++-- .../mapping/MapperReconnectionTest.java | 14 +++-- .../mapping/MapperSaveNullFieldsTest.java | 14 +++-- .../datastax/driver/mapping/MapperTest.java | 14 +++-- .../mapping/MapperUDTCollectionsTest.java | 14 +++-- .../driver/mapping/MapperUDTTest.java | 14 +++-- ...onfigurationHierarchyScanStrategyTest.java | 14 +++-- ...appingConfigurationNamingStrategyTest.java | 14 +++-- ...appingConfigurationPropertyAccessTest.java | 14 +++-- ...ngConfigurationTransienceStrategyTest.java | 14 +++-- .../MappingConfigurationTransientTest.java | 14 +++-- .../driver/mapping/NamingConventionsTest.java | 14 +++-- .../mapping/SyntheticFieldsMapperTest.java | 14 +++-- .../driver/mapping/UDTFieldMapperTest.java | 14 +++-- .../src/test/resources/log4j.properties | 14 +++-- driver-tests/osgi/README.md | 2 +- driver-tests/osgi/common/pom.xml | 18 +++--- .../driver/osgi/api/MailboxException.java | 14 +++-- .../driver/osgi/api/MailboxMessage.java | 14 +++-- .../driver/osgi/api/MailboxService.java | 14 +++-- .../datastax/driver/osgi/impl/Activator.java | 14 +++-- .../driver/osgi/impl/MailboxImpl.java | 14 +++-- .../datastax/driver/osgi/BundleOptions.java | 14 +++-- .../driver/osgi/CCMBridgeListener.java | 14 +++-- .../driver/osgi/MailboxServiceTests.java | 14 +++-- driver-tests/osgi/pom.xml | 18 +++--- driver-tests/osgi/shaded/pom.xml | 18 +++--- .../driver/osgi/MailboxServiceShadedIT.java | 14 +++-- .../shaded/src/test/resources/exam.properties | 14 +++-- .../shaded/src/test/resources/logback.xml | 16 ++--- driver-tests/osgi/unshaded/pom.xml | 18 +++--- .../driver/osgi/MailboxServiceDefaultIT.java | 14 +++-- .../driver/osgi/MailboxServiceGuava17IT.java | 14 +++-- .../driver/osgi/MailboxServiceGuava18IT.java | 14 +++-- .../driver/osgi/MailboxServiceGuava19IT.java | 14 +++-- .../driver/osgi/MailboxServiceGuava20IT.java | 14 +++-- .../driver/osgi/MailboxServiceGuava21IT.java | 14 +++-- .../osgi/MailboxServiceHdrHistogramIT.java | 14 +++-- .../driver/osgi/MailboxServiceLZ4IT.java | 14 +++-- .../driver/osgi/MailboxServiceSnappyIT.java | 14 +++-- .../src/test/resources/exam.properties | 14 +++-- .../unshaded/src/test/resources/logback.xml | 16 ++--- driver-tests/pom.xml | 18 +++--- driver-tests/shading/pom.xml | 16 ++--- driver-tests/shading/shaded/pom.xml | 16 ++--- .../com/datastax/driver/core/NettyUtilIT.java | 14 +++-- driver-tests/shading/unshaded/pom.xml | 16 ++--- .../com/datastax/driver/core/NettyUtilIT.java | 14 +++-- driver-tests/stress/README.md | 4 +- driver-tests/stress/pom.xml | 18 +++--- .../driver/stress/AsynchronousConsumer.java | 14 +++-- .../driver/stress/BlockingConsumer.java | 14 +++-- .../stress/ConsistencyLevelConverter.java | 14 +++-- .../com/datastax/driver/stress/Consumer.java | 14 +++-- .../datastax/driver/stress/Generators.java | 14 +++-- .../driver/stress/QueryGenerator.java | 14 +++-- .../com/datastax/driver/stress/Reporter.java | 14 +++-- .../com/datastax/driver/stress/Stress.java | 14 +++-- faq/osgi/README.md | 4 +- manual/cloud/README.md | 6 +- manual/custom_payloads/README.md | 6 +- manual/logging/README.md | 4 +- manual/tuples/README.md | 6 +- pom.xml | 30 +++++----- upgrade_guide/README.md | 2 +- .../migrating_from_astyanax/README.md | 4 +- .../configuration/README.md | 58 +++++++++---------- .../queries_and_results/README.md | 14 ++--- 746 files changed, 5990 insertions(+), 4506 deletions(-) create mode 100644 NOTICE.txt diff --git a/NOTICE.txt b/NOTICE.txt new file mode 100644 index 00000000000..477f0645ed9 --- /dev/null +++ b/NOTICE.txt @@ -0,0 +1,20 @@ +Apache Cassandra Java Driver +Copyright 2012- The Apache Software Foundation + +This product includes software developed by The Apache Software +Foundation (http://www.apache.org/). + +JNR project +Copyright (C) 2008-2010 Wayne Meissner +This product includes software developed as part of the JNR project ( https://github.com/jnr/jnr-ffi )s. +see core/src/main/java/com/datastax/oss/driver/internal/core/os/CpuInfo.java + +Protocol Buffers +Copyright 2008 Google Inc. +This product includes software developed as part of the Protocol Buffers project ( https://developers.google.com/protocol-buffers/ ). +see core/src/main/java/com/datastax/oss/driver/internal/core/type/util/VIntCoding.java + +Guava +Copyright (C) 2007 The Guava Authors +This product includes software developed as part of the Guava project ( https://guava.dev ). +see core/src/main/java/com/datastax/oss/driver/internal/core/util/CountingIterator.java \ No newline at end of file diff --git a/README.md b/README.md index eef132ac85f..8aaa096e4d2 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -# Datastax Java Driver for Apache Cassandra® +# Java Driver for Apache Cassandra® *If you're reading this on github.com, please note that this is the readme for the development version and that some features described here might not yet have been released. You can find the documentation for the latest -version through the [Java driver +version through the [Java Driver docs](http://docs.datastax.com/en/developer/java-driver/3.11/index.html) or via the release tags, [e.g. 3.11.5](https://github.com/datastax/java-driver/tree/3.11.5).* A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol -and Cassandra Query Language v3. _Use the [DataStax Enterprise Java driver][dse-driver] +and Cassandra Query Language v3. _Use the [DataStax Enterprise Java Driver][dse-driver] for better compatibility and support for DataStax Enterprise._ **Features:** @@ -35,7 +35,7 @@ The driver contains the following modules: - driver-core: the core layer. - driver-mapping: the object mapper. -- driver-extras: optional features for the Java driver. +- driver-extras: optional features for the Java Driver. - driver-examples: example applications using the other modules which are only meant for demonstration purposes. - driver-tests: tests for the java-driver. @@ -59,7 +59,7 @@ The driver contains the following modules: The last release of the driver is available on Maven Central. You can install it in your application using the following Maven dependency (_if -using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-driver] instead_): +using DataStax Enterprise, install the [DataStax Enterprise Java Driver][dse-driver] instead_): ```xml @@ -114,7 +114,7 @@ an [UnsupportedFeatureException](https://github.com/datastax/java-driver/blob/3. The java driver supports Java JDK versions 6 and above. -If using _DataStax Enterprise_, the [DataStax Enterprise Java driver][dse-driver] provides +If using _DataStax Enterprise_, the [DataStax Enterprise Java Driver][dse-driver] provides more features and better compatibility. __Disclaimer__: Some _DataStax/DataStax Enterprise_ products might partially work on @@ -125,7 +125,7 @@ big-endian systems, but _DataStax_ does not officially support these systems. If you are upgrading from a previous version of the driver, be sure to have a look at the [upgrade guide](/upgrade_guide/). -If you are upgrading to _DataStax Enterprise_, use the [DataStax Enterprise Java driver][dse-driver] for more +If you are upgrading to _DataStax Enterprise_, use the [DataStax Enterprise Java Driver][dse-driver] for more features and better compatibility. ## License diff --git a/doxyfile b/doxyfile index 414bdbd7ec4..e6a12d63a2e 100644 --- a/doxyfile +++ b/doxyfile @@ -4,7 +4,7 @@ # Project related configuration options #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = "DataStax Java Driver" +PROJECT_NAME = "Java Driver" PROJECT_NUMBER = PROJECT_BRIEF = PROJECT_LOGO = diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 801e124bf4e..57efddf9194 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -1,12 +1,14 @@ jar - DataStax Java Driver for Apache Cassandra - Binary distribution + Java Driver for Apache Cassandra - Binary distribution diff --git a/driver-dist/src/assembly/binary-tarball.xml b/driver-dist/src/assembly/binary-tarball.xml index 1b9d2adf796..208638492f1 100644 --- a/driver-dist/src/assembly/binary-tarball.xml +++ b/driver-dist/src/assembly/binary-tarball.xml @@ -1,12 +1,14 @@ + # Contributing guidelines ## Code formatting diff --git a/Jenkinsfile b/Jenkinsfile index 388395b7615..e8e6a1ecf3d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,22 @@ #!groovy +/* + * 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. + */ def initializeEnvironment() { env.DRIVER_DISPLAY_NAME = 'CassandraⓇ Java Driver 3.x' diff --git a/changelog/README.md b/changelog/README.md index 822b9f3fef1..1b8feae01bd 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -1,3 +1,22 @@ + + ## Changelog + + # Doxyfile 1.8.10 #--------------------------------------------------------------------------- @@ -333,4 +353,4 @@ MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES -DOT_CLEANUP = YES \ No newline at end of file +DOT_CLEANUP = YES 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 index 9ad5fe1a9a9..a2e180ad8af 100644 --- 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 @@ -1,3 +1,22 @@ +/* + * 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 ( 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 index 89c4b7df256..71257fbdfd8 100644 --- 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 @@ -1,3 +1,22 @@ +/* + * 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 ( 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 index 3257a4b9275..b86ee43b132 100644 --- 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 @@ -1,3 +1,22 @@ +/* + * 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 ( 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_3.0.cql index b656ce9e6c7..90a91603e26 100644 --- a/driver-core/src/test/resources/export_as_string_test_3.0.cql +++ b/driver-core/src/test/resources/export_as_string_test_3.0.cql @@ -1,3 +1,22 @@ +/* + * 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 ( 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_3.11.cql index 2bb2e726ae9..c7edb57bae0 100644 --- a/driver-core/src/test/resources/export_as_string_test_3.11.cql +++ b/driver-core/src/test/resources/export_as_string_test_3.11.cql @@ -1,3 +1,22 @@ +/* + * 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 ( diff --git a/driver-core/src/test/resources/export_as_string_test_4.0.cql b/driver-core/src/test/resources/export_as_string_test_4.0.cql index cc83ebabcee..3c02a337113 100644 --- a/driver-core/src/test/resources/export_as_string_test_4.0.cql +++ b/driver-core/src/test/resources/export_as_string_test_4.0.cql @@ -1,3 +1,22 @@ +/* + * 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 ( diff --git a/driver-core/src/test/resources/reference.conf b/driver-core/src/test/resources/reference.conf index 6da0ce3a055..4f5a14da64c 100644 --- a/driver-core/src/test/resources/reference.conf +++ b/driver-core/src/test/resources/reference.conf @@ -1,3 +1,20 @@ +# 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. + # Adjust Scassandra's log level # (it seems some messages are conditioned by log4j.properties and others by reference.conf, so we need both) akka { diff --git a/driver-examples/README.md b/driver-examples/README.md index 0e1e87b85ea..63e8c59726c 100644 --- a/driver-examples/README.md +++ b/driver-examples/README.md @@ -1,3 +1,22 @@ + + # Java Driver for Apache Cassandra - Examples This module contains examples of how to use the Java Driver for diff --git a/driver-mapping/src/test/groovy/com/datastax/driver/mapping/MapperGroovyTest.groovy b/driver-mapping/src/test/groovy/com/datastax/driver/mapping/MapperGroovyTest.groovy index 85ff18fa7fa..80cd2dd61d7 100644 --- a/driver-mapping/src/test/groovy/com/datastax/driver/mapping/MapperGroovyTest.groovy +++ b/driver-mapping/src/test/groovy/com/datastax/driver/mapping/MapperGroovyTest.groovy @@ -1,3 +1,21 @@ +/* + * 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.mapping import com.datastax.driver.core.CCMTestsSupport diff --git a/driver-tests/osgi/README.md b/driver-tests/osgi/README.md index f5f6709e0ed..81de3367faa 100644 --- a/driver-tests/osgi/README.md +++ b/driver-tests/osgi/README.md @@ -1,3 +1,22 @@ + + # OSGi Tests A collection of simple tests for the Java Driver in an OSGi environment. diff --git a/driver-tests/stress/README.md b/driver-tests/stress/README.md index 17e44b5f50d..063cf025fc4 100644 --- a/driver-tests/stress/README.md +++ b/driver-tests/stress/README.md @@ -1,3 +1,22 @@ + + # Stress application A simple example application that uses the Java Driver to stress test diff --git a/driver-tests/stress/bin/stress b/driver-tests/stress/bin/stress old mode 100755 new mode 100644 index e47ec0d7955..7aa9b52405d --- a/driver-tests/stress/bin/stress +++ b/driver-tests/stress/bin/stress @@ -1,4 +1,20 @@ #!/bin/sh +# 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. SCRIPT_DIR=$( cd "$( dirname "$0" )" && pwd ) CURRENT_DIR=$( pwd ) diff --git a/faq/README.md b/faq/README.md index de17879b763..3454669f500 100644 --- a/faq/README.md +++ b/faq/README.md @@ -1,3 +1,22 @@ + + ## Frequently Asked Questions ### How do I implement paging? diff --git a/faq/osgi/README.md b/faq/osgi/README.md index afc729b8a11..964ec0fca92 100644 --- a/faq/osgi/README.md +++ b/faq/osgi/README.md @@ -1,3 +1,22 @@ + + ## Frequently Asked Questions - OSGi ### How to use the Java Driver in an OSGi environment? diff --git a/manual/README.md b/manual/README.md index aebd1c91673..99d3f292e75 100644 --- a/manual/README.md +++ b/manual/README.md @@ -1,3 +1,22 @@ + + ## Manual ### Quick start @@ -304,4 +323,4 @@ simply navigate to each sub-directory. [LatencyTracker]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/LatencyTracker.html [SchemaChangeListener]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SchemaChangeListener.html [NoHostAvailableException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/NoHostAvailableException.html -[LocalDate]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/LocalDate.html \ No newline at end of file +[LocalDate]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/LocalDate.html diff --git a/manual/address_resolution/README.md b/manual/address_resolution/README.md index 0662ab92295..412b3866c71 100644 --- a/manual/address_resolution/README.md +++ b/manual/address_resolution/README.md @@ -1,3 +1,22 @@ + + ## Address resolution Each node in the Cassandra cluster is uniquely identified by an IP address that the driver will use to establish diff --git a/manual/async/README.md b/manual/async/README.md index 43523cd548c..da7df365331 100644 --- a/manual/async/README.md +++ b/manual/async/README.md @@ -1,3 +1,22 @@ + + ## Asynchronous programming The driver exposes an asynchronous API that allows you to write programs diff --git a/manual/auth/README.md b/manual/auth/README.md index 22838a4836d..7b315fa3642 100644 --- a/manual/auth/README.md +++ b/manual/auth/README.md @@ -1,3 +1,22 @@ + + ## Authentication Cassandra’s binary protocol supports [SASL]-based authentication. To enable it, use diff --git a/manual/cloud/README.md b/manual/cloud/README.md index 5eae641514f..3ff7e63558c 100644 --- a/manual/cloud/README.md +++ b/manual/cloud/README.md @@ -1,3 +1,22 @@ + + ## Connecting to Astra (Cloud) Using the Java Driver to connect to a DataStax Astra database is almost identical to using diff --git a/manual/compression/README.md b/manual/compression/README.md index 44cb9accced..fb4b49bffd8 100644 --- a/manual/compression/README.md +++ b/manual/compression/README.md @@ -1,3 +1,22 @@ + + ## Compression Cassandra's binary protocol supports optional compression of diff --git a/manual/control_connection/README.md b/manual/control_connection/README.md index 189ba31b82b..d2cde319bbf 100644 --- a/manual/control_connection/README.md +++ b/manual/control_connection/README.md @@ -1,3 +1,22 @@ + + ## Control connection The control connection is a dedicated connection used for administrative tasks: @@ -18,4 +37,4 @@ used exclusively for administrative requests. It is included in [Session.State.g as well as the `open-connections` [metric](../metrics); for example, if you've configured a pool size of 2, the control node will have 3 connections. -[Session.State.getOpenConnections]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Session.State.html#getOpenConnections-com.datastax.driver.core.Host- \ No newline at end of file +[Session.State.getOpenConnections]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Session.State.html#getOpenConnections-com.datastax.driver.core.Host- diff --git a/manual/custom_codecs/README.md b/manual/custom_codecs/README.md index 3d586a028f8..6737d923dbd 100644 --- a/manual/custom_codecs/README.md +++ b/manual/custom_codecs/README.md @@ -1,3 +1,22 @@ + + ## Custom Codecs Custom codecs support transparent, user-configurable mapping of CQL types to arbitrary Java objects. diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md index adbc533ff6e..5c934ec2720 100644 --- a/manual/custom_codecs/extras/README.md +++ b/manual/custom_codecs/extras/README.md @@ -1,3 +1,22 @@ + + ## Optional codecs The driver's "extras" module provides additional [codec](../) implementations: these codecs are not required by core diff --git a/manual/custom_payloads/README.md b/manual/custom_payloads/README.md index 2587cb71b1d..778dbd72ea3 100644 --- a/manual/custom_payloads/README.md +++ b/manual/custom_payloads/README.md @@ -1,3 +1,22 @@ + + ## Custom Payloads The [native protocol](../native_protocol/) version 4 introduces a new feature called [Custom Payloads][CASSANDRA-8553]. diff --git a/manual/idempotence/README.md b/manual/idempotence/README.md index 6894d5e889a..24c4ac95c40 100644 --- a/manual/idempotence/README.md +++ b/manual/idempotence/README.md @@ -1,3 +1,22 @@ + + ## Query idempotence A query is *idempotent* if it can be applied multiple times without changing the result of the initial application. For @@ -129,4 +148,4 @@ not idempotent. [setDefaultIdempotence]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/QueryOptions.html#setDefaultIdempotence-boolean- [QueryBuilder]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/querybuilder/QueryBuilder.html -[linearizability]: https://en.wikipedia.org/wiki/Linearizability#Definition_of_linearizability \ No newline at end of file +[linearizability]: https://en.wikipedia.org/wiki/Linearizability#Definition_of_linearizability diff --git a/manual/load_balancing/README.md b/manual/load_balancing/README.md index 4568c8025b5..8fd3fb06f2d 100644 --- a/manual/load_balancing/README.md +++ b/manual/load_balancing/README.md @@ -1,3 +1,22 @@ + + ## Load balancing A Cassandra cluster is typically composed of multiple hosts; the [LoadBalancingPolicy] \(sometimes abbreviated LBP) is a diff --git a/manual/logging/README.md b/manual/logging/README.md index 70ffaa32e4b..109a4d0bb83 100644 --- a/manual/logging/README.md +++ b/manual/logging/README.md @@ -1,3 +1,22 @@ + + ## Logging ### Setup diff --git a/manual/metadata/README.md b/manual/metadata/README.md index 93dc169d9b4..817587f947d 100644 --- a/manual/metadata/README.md +++ b/manual/metadata/README.md @@ -1,3 +1,22 @@ + + ## Metadata The driver maintains global information about the Cassandra cluster it diff --git a/manual/metrics/README.md b/manual/metrics/README.md index 7915317fae8..9c563d3fd9a 100644 --- a/manual/metrics/README.md +++ b/manual/metrics/README.md @@ -1,3 +1,22 @@ + + ## Metrics The driver exposes measurements of its internal behavior through the popular [Dropwizard Metrics] diff --git a/manual/native_protocol/README.md b/manual/native_protocol/README.md index d2ad6212847..7aab925ea9f 100644 --- a/manual/native_protocol/README.md +++ b/manual/native_protocol/README.md @@ -1,3 +1,22 @@ + + ## Native protocol The native protocol defines the format of the binary messages exchanged diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md index 207b470dda7..93433622fca 100644 --- a/manual/object_mapper/README.md +++ b/manual/object_mapper/README.md @@ -1,3 +1,22 @@ + + # Object Mapper The driver provides a simple object mapper, which diff --git a/manual/object_mapper/creating/README.md b/manual/object_mapper/creating/README.md index c91b2a9c92e..200fccf571e 100644 --- a/manual/object_mapper/creating/README.md +++ b/manual/object_mapper/creating/README.md @@ -1,3 +1,22 @@ + + ## Definition of mapped classes The object mapper is configured by annotations on the mapped classes. diff --git a/manual/object_mapper/custom_codecs/README.md b/manual/object_mapper/custom_codecs/README.md index 821e1f619e4..d3b5414fbe8 100644 --- a/manual/object_mapper/custom_codecs/README.md +++ b/manual/object_mapper/custom_codecs/README.md @@ -1,3 +1,22 @@ + + # Using custom codecs The mapper can take advantage of [custom codecs](../../custom_codecs/) diff --git a/manual/object_mapper/using/README.md b/manual/object_mapper/using/README.md index 4587f983d77..35fdc54e088 100644 --- a/manual/object_mapper/using/README.md +++ b/manual/object_mapper/using/README.md @@ -1,3 +1,22 @@ + + ## Using the mapper First, create a [MappingManager]. It wraps an existing [Session] diff --git a/manual/osgi/README.md b/manual/osgi/README.md index 36a91b7155d..b37507fee73 100644 --- a/manual/osgi/README.md +++ b/manual/osgi/README.md @@ -1,3 +1,22 @@ + + # OSGi The driver is available as an [OSGi] bundle. More specifically, diff --git a/manual/paging/README.md b/manual/paging/README.md index 15343d3c7f0..34ca70e8672 100644 --- a/manual/paging/README.md +++ b/manual/paging/README.md @@ -1,3 +1,22 @@ + + ## Paging When a query returns many rows, it would be inefficient to return them diff --git a/manual/pooling/README.md b/manual/pooling/README.md index 3b2e8b0218b..9bad1a995a4 100644 --- a/manual/pooling/README.md +++ b/manual/pooling/README.md @@ -1,3 +1,22 @@ + + ## Connection pooling ### Basics diff --git a/manual/query_timestamps/README.md b/manual/query_timestamps/README.md index fb24690ad95..27d60bdf20a 100644 --- a/manual/query_timestamps/README.md +++ b/manual/query_timestamps/README.md @@ -1,3 +1,22 @@ + + ## Query timestamps In Cassandra, each mutation has a microsecond-precision timestamp, which diff --git a/manual/reconnection/README.md b/manual/reconnection/README.md index a3a4733f0b4..797e8fc0ea4 100644 --- a/manual/reconnection/README.md +++ b/manual/reconnection/README.md @@ -1,3 +1,22 @@ + + ## Reconnection If the driver loses a connection to a node, it tries to re-establish it according to a configurable diff --git a/manual/retries/README.md b/manual/retries/README.md index 1770cd71cf9..27091ad1526 100644 --- a/manual/retries/README.md +++ b/manual/retries/README.md @@ -1,3 +1,22 @@ + + ## Retries When a query fails, it sometimes makes sense to retry it: the error might be temporary, or the query might work on a @@ -179,4 +198,4 @@ implementations to handle idempotence (the new behavior is equivalent to what yo [prepared]: ../statements/prepared/#preparing-on-multiple-nodes [driver read timeout]: ../socket_options/#driver-read-timeout [hinted handoffs]: https://docs.datastax.com/en/cassandra/2.1/cassandra/dml/dml_about_hh_c.html?scroll=concept_ds_ifg_jqx_zj__performance -[idempotence]: ../idempotence/ \ No newline at end of file +[idempotence]: ../idempotence/ diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md index 44d6fec2905..26f3ec6a637 100644 --- a/manual/shaded_jar/README.md +++ b/manual/shaded_jar/README.md @@ -1,3 +1,22 @@ + + ## Using the shaded JAR The default driver JAR depends on [Netty](http://netty.io/), which is diff --git a/manual/socket_options/README.md b/manual/socket_options/README.md index 4b79fd684dc..47021853d81 100644 --- a/manual/socket_options/README.md +++ b/manual/socket_options/README.md @@ -1,3 +1,22 @@ + + ## Socket options [SocketOptions] controls various low-level parameters related to TCP connections between the driver and Cassandra. @@ -128,4 +147,4 @@ We might rename `SocketOptions.setReadTimeoutMillis` in a future version to clea [setTcpNoDelay]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/SocketOptions.html#setTcpNoDelay-boolean- [onReadTimeout]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/RetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int- [onRequestError]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/policies/RetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int- -[OperationTimedOutException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/OperationTimedOutException.html \ No newline at end of file +[OperationTimedOutException]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/exceptions/OperationTimedOutException.html diff --git a/manual/speculative_execution/README.md b/manual/speculative_execution/README.md index 7a1fe5b4007..90915bb2b8c 100644 --- a/manual/speculative_execution/README.md +++ b/manual/speculative_execution/README.md @@ -1,3 +1,22 @@ + + ## Speculative query execution Sometimes a Cassandra node might be experiencing difficulties (ex: long diff --git a/manual/ssl/README.md b/manual/ssl/README.md index 47dbd5f9863..e9d56d69d46 100644 --- a/manual/ssl/README.md +++ b/manual/ssl/README.md @@ -1,3 +1,22 @@ + + ## SSL You can secure traffic between the driver and Cassandra with SSL. There diff --git a/manual/statements/README.md b/manual/statements/README.md index 18164778039..a078eec4446 100644 --- a/manual/statements/README.md +++ b/manual/statements/README.md @@ -1,3 +1,22 @@ + + ## Statements To execute a query, you create a [Statement] instance and pass it to [Session#execute()][execute] or diff --git a/manual/statements/batch/README.md b/manual/statements/batch/README.md index d54d79589d0..776afb56227 100644 --- a/manual/statements/batch/README.md +++ b/manual/statements/batch/README.md @@ -1,3 +1,22 @@ + + ## Batch statements Use [BatchStatement] to execute a set of queries as a single operation (refer to diff --git a/manual/statements/built/README.md b/manual/statements/built/README.md index eb1a51cb5cb..ac0ba28b1e6 100644 --- a/manual/statements/built/README.md +++ b/manual/statements/built/README.md @@ -1,3 +1,22 @@ + + ## Built statements Built statements are generated via [QueryBuilder]'s Fluent API. Use of Fluent API allows diff --git a/manual/statements/prepared/README.md b/manual/statements/prepared/README.md index ff1dca78057..ccb0a33167a 100644 --- a/manual/statements/prepared/README.md +++ b/manual/statements/prepared/README.md @@ -1,3 +1,22 @@ + + ## Prepared statements Use [PreparedStatement] for queries that are executed multiple times in your application: diff --git a/manual/statements/simple/README.md b/manual/statements/simple/README.md index b08adc7b018..35ba0e4c9ab 100644 --- a/manual/statements/simple/README.md +++ b/manual/statements/simple/README.md @@ -1,3 +1,22 @@ + + ## Simple statements Use [SimpleStatement] for queries that will be executed only once (or a few times) in your application: diff --git a/manual/tuples/README.md b/manual/tuples/README.md index 9bb3532df45..6e7f844718f 100644 --- a/manual/tuples/README.md +++ b/manual/tuples/README.md @@ -1,3 +1,22 @@ + + ## Using Tuples with the Java Driver Cassandra allows to use `tuple` data types [in tables and user-defined types](https://docs.datastax.com/en/cql/3.1/cql/cql_reference/tupleType.html): diff --git a/manual/udts/README.md b/manual/udts/README.md index 892a5a95b1b..f8d15885b0b 100644 --- a/manual/udts/README.md +++ b/manual/udts/README.md @@ -1,3 +1,22 @@ + + ## User-defined types [CQL user-defined types][cql_doc] are ordered sets of named, typed fields. They must be defined in a diff --git a/testing/README.md b/testing/README.md index 4dfbb525351..d1d97a6620b 100644 --- a/testing/README.md +++ b/testing/README.md @@ -1,3 +1,22 @@ + + ## Testing Prerequisites ### Install CCM diff --git a/testing/bin/coverage b/testing/bin/coverage old mode 100755 new mode 100644 index c920e9fa6d1..82702a91f4b --- a/testing/bin/coverage +++ b/testing/bin/coverage @@ -1,4 +1,20 @@ #!/usr/bin/env python +# 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. import argparse import ConfigParser diff --git a/upgrade_guide/README.md b/upgrade_guide/README.md index c8988e4fe04..3fdcfbf4ca8 100644 --- a/upgrade_guide/README.md +++ b/upgrade_guide/README.md @@ -1,3 +1,22 @@ + + ## Upgrade guide The purpose of this guide is to detail changes made by successive diff --git a/upgrade_guide/migrating_from_astyanax/README.md b/upgrade_guide/migrating_from_astyanax/README.md index db4406f0876..72bd82f9c58 100644 --- a/upgrade_guide/migrating_from_astyanax/README.md +++ b/upgrade_guide/migrating_from_astyanax/README.md @@ -1,3 +1,22 @@ + + # Migrating from Astyanax This section is a guide for users previously using *Astyanax* and looking for diff --git a/upgrade_guide/migrating_from_astyanax/configuration/README.md b/upgrade_guide/migrating_from_astyanax/configuration/README.md index 686dd02c63f..6e94149dc47 100644 --- a/upgrade_guide/migrating_from_astyanax/configuration/README.md +++ b/upgrade_guide/migrating_from_astyanax/configuration/README.md @@ -1,3 +1,22 @@ + + # Configuration ## How Configuring the Java Driver works diff --git a/upgrade_guide/migrating_from_astyanax/language_level_changes/README.md b/upgrade_guide/migrating_from_astyanax/language_level_changes/README.md index 8116e82b566..8b17c78b81d 100644 --- a/upgrade_guide/migrating_from_astyanax/language_level_changes/README.md +++ b/upgrade_guide/migrating_from_astyanax/language_level_changes/README.md @@ -1,3 +1,22 @@ + + # Language change : from Thrift to CQL The data model changes when using *CQL* (Cassandra Query Language). *CQL* is providing an abstraction of the low-level data stored in *Cassandra*, in diff --git a/upgrade_guide/migrating_from_astyanax/queries_and_results/README.md b/upgrade_guide/migrating_from_astyanax/queries_and_results/README.md index f30043441b3..6fee3b2705e 100644 --- a/upgrade_guide/migrating_from_astyanax/queries_and_results/README.md +++ b/upgrade_guide/migrating_from_astyanax/queries_and_results/README.md @@ -1,3 +1,22 @@ + + # Queries and Results There are many resources such as [this post][planetCCqlLink] or [this post][dsBlogCqlLink] to learn how to transform previous Thrift operations to CQL queries. @@ -103,4 +122,4 @@ with the *Java Driver*. [planetCCqlLink]: http://www.planetcassandra.org/making-the-change-from-thrift-to-cql/ -[dsBlogCqlLink]: http://www.datastax.com/dev/blog/thrift-to-cql3 \ No newline at end of file +[dsBlogCqlLink]: http://www.datastax.com/dev/blog/thrift-to-cql3 From 3aa0d632ef43c5d88de493a990cf2a1ee0de22c9 Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Wed, 8 Nov 2023 12:46:35 -0800 Subject: [PATCH 181/211] Copyright fixes patch by Claude Warren; reviewed by Henry Hughes, Mick Semb Wever for CASSANDRA-18969 --- NOTICE.txt | 12 +----------- .../core/PreparedStatementInvalidationTest.java | 16 ---------------- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/NOTICE.txt b/NOTICE.txt index 477f0645ed9..5084d4e90cd 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -4,17 +4,7 @@ Copyright 2012- The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). -JNR project -Copyright (C) 2008-2010 Wayne Meissner -This product includes software developed as part of the JNR project ( https://github.com/jnr/jnr-ffi )s. -see core/src/main/java/com/datastax/oss/driver/internal/core/os/CpuInfo.java - Protocol Buffers Copyright 2008 Google Inc. This product includes software developed as part of the Protocol Buffers project ( https://developers.google.com/protocol-buffers/ ). -see core/src/main/java/com/datastax/oss/driver/internal/core/type/util/VIntCoding.java - -Guava -Copyright (C) 2007 The Guava Authors -This product includes software developed as part of the Guava project ( https://guava.dev ). -see core/src/main/java/com/datastax/oss/driver/internal/core/util/CountingIterator.java \ No newline at end of file +see driver-core/src/main/java/com/datastax/driver/core/VIntCoding.java \ No newline at end of file diff --git a/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementInvalidationTest.java b/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementInvalidationTest.java index 2117e5b5412..853e638d99b 100644 --- a/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementInvalidationTest.java +++ b/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementInvalidationTest.java @@ -15,22 +15,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -/* - * Copyright (C) 2012-2017 DataStax Inc. - * - * Licensed 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; import static com.datastax.driver.core.Assertions.assertThat; From a3ab8576b25d75f701dc68e463c18feb1a3b0786 Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Mon, 13 Nov 2023 17:05:35 -0800 Subject: [PATCH 182/211] Move copyright notices to LICENSE, add bundled ASL dep notices to NOTICE patch by Claude Warren; reviewed by Henry Hughes, Mick Semb Wever for CASSANDRA-18969 --- LICENSE | 7 ++ NOTICE.txt | 244 ++++++++++++++++++++++++++++++++++++++++++++++++++++- README.md | 9 +- 3 files changed, 255 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index d6456956733..38f06999ef6 100644 --- a/LICENSE +++ b/LICENSE @@ -200,3 +200,10 @@ 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. + +Apache Cassandra Java Driver bundles code and files from the following projects: + +Protocol Buffers +Copyright 2008 Google Inc. +This product includes software developed as part of the Protocol Buffers project ( https://developers.google.com/protocol-buffers/ ). +see driver-core/src/main/java/com/datastax/driver/core/VIntCoding.java diff --git a/NOTICE.txt b/NOTICE.txt index 5084d4e90cd..b7a91be2318 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -4,7 +4,243 @@ Copyright 2012- The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). -Protocol Buffers -Copyright 2008 Google Inc. -This product includes software developed as part of the Protocol Buffers project ( https://developers.google.com/protocol-buffers/ ). -see driver-core/src/main/java/com/datastax/driver/core/VIntCoding.java \ No newline at end of file +================================================================== +io.netty:netty-handler NOTICE.txt +================================================================== +This product contains the extensions to Java Collections Framework which has +been derived from the works by JSR-166 EG, Doug Lea, and Jason T. Greene: + + * LICENSE: + * license/LICENSE.jsr166y.txt (Public Domain) + * HOMEPAGE: + * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/ + * http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbosscache/experimental/jsr166/ + +This product contains a modified version of Robert Harder's Public Domain +Base64 Encoder and Decoder, which can be obtained at: + + * LICENSE: + * license/LICENSE.base64.txt (Public Domain) + * HOMEPAGE: + * http://iharder.sourceforge.net/current/java/base64/ + +This product contains a modified portion of 'Webbit', an event based +WebSocket and HTTP server, which can be obtained at: + + * LICENSE: + * license/LICENSE.webbit.txt (BSD License) + * HOMEPAGE: + * https://github.com/joewalnes/webbit + +This product contains a modified portion of 'SLF4J', a simple logging +facade for Java, which can be obtained at: + + * LICENSE: + * license/LICENSE.slf4j.txt (MIT License) + * HOMEPAGE: + * https://www.slf4j.org/ + +This product contains a modified portion of 'Apache Harmony', an open source +Java SE, which can be obtained at: + + * NOTICE: + * license/NOTICE.harmony.txt + * LICENSE: + * license/LICENSE.harmony.txt (Apache License 2.0) + * HOMEPAGE: + * https://archive.apache.org/dist/harmony/ + +This product contains a modified portion of 'jbzip2', a Java bzip2 compression +and decompression library written by Matthew J. Francis. It can be obtained at: + + * LICENSE: + * license/LICENSE.jbzip2.txt (MIT License) + * HOMEPAGE: + * https://code.google.com/p/jbzip2/ + +This product contains a modified portion of 'libdivsufsort', a C API library to construct +the suffix array and the Burrows-Wheeler transformed string for any input string of +a constant-size alphabet written by Yuta Mori. It can be obtained at: + + * LICENSE: + * license/LICENSE.libdivsufsort.txt (MIT License) + * HOMEPAGE: + * https://github.com/y-256/libdivsufsort + +This product contains a modified portion of Nitsan Wakart's 'JCTools', Java Concurrency Tools for the JVM, + which can be obtained at: + + * LICENSE: + * license/LICENSE.jctools.txt (ASL2 License) + * HOMEPAGE: + * https://github.com/JCTools/JCTools + +This product optionally depends on 'JZlib', a re-implementation of zlib in +pure Java, which can be obtained at: + + * LICENSE: + * license/LICENSE.jzlib.txt (BSD style License) + * HOMEPAGE: + * http://www.jcraft.com/jzlib/ + +This product optionally depends on 'Compress-LZF', a Java library for encoding and +decoding data in LZF format, written by Tatu Saloranta. It can be obtained at: + + * LICENSE: + * license/LICENSE.compress-lzf.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/ning/compress + +This product optionally depends on 'lz4', a LZ4 Java compression +and decompression library written by Adrien Grand. It can be obtained at: + + * LICENSE: + * license/LICENSE.lz4.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/jpountz/lz4-java + +This product optionally depends on 'lzma-java', a LZMA Java compression +and decompression library, which can be obtained at: + + * LICENSE: + * license/LICENSE.lzma-java.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/jponge/lzma-java + +This product optionally depends on 'zstd-jni', a zstd-jni Java compression +and decompression library, which can be obtained at: + + * LICENSE: + * license/LICENSE.zstd-jni.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/luben/zstd-jni + +This product contains a modified portion of 'jfastlz', a Java port of FastLZ compression +and decompression library written by William Kinney. It can be obtained at: + + * LICENSE: + * license/LICENSE.jfastlz.txt (MIT License) + * HOMEPAGE: + * https://code.google.com/p/jfastlz/ + +This product contains a modified portion of and optionally depends on 'Protocol Buffers', Google's data +interchange format, which can be obtained at: + + * LICENSE: + * license/LICENSE.protobuf.txt (New BSD License) + * HOMEPAGE: + * https://github.com/google/protobuf + +This product optionally depends on 'Bouncy Castle Crypto APIs' to generate +a temporary self-signed X.509 certificate when the JVM does not provide the +equivalent functionality. It can be obtained at: + + * LICENSE: + * license/LICENSE.bouncycastle.txt (MIT License) + * HOMEPAGE: + * https://www.bouncycastle.org/ + +This product optionally depends on 'Snappy', a compression library produced +by Google Inc, which can be obtained at: + + * LICENSE: + * license/LICENSE.snappy.txt (New BSD License) + * HOMEPAGE: + * https://github.com/google/snappy + +This product optionally depends on 'JBoss Marshalling', an alternative Java +serialization API, which can be obtained at: + + * LICENSE: + * license/LICENSE.jboss-marshalling.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/jboss-remoting/jboss-marshalling + +This product optionally depends on 'Caliper', Google's micro- +benchmarking framework, which can be obtained at: + + * LICENSE: + * license/LICENSE.caliper.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/google/caliper + +This product optionally depends on 'Apache Commons Logging', a logging +framework, which can be obtained at: + + * LICENSE: + * license/LICENSE.commons-logging.txt (Apache License 2.0) + * HOMEPAGE: + * https://commons.apache.org/logging/ + +This product optionally depends on 'Apache Log4J', a logging framework, which +can be obtained at: + + * LICENSE: + * license/LICENSE.log4j.txt (Apache License 2.0) + * HOMEPAGE: + * https://logging.apache.org/log4j/ + +This product optionally depends on 'Aalto XML', an ultra-high performance +non-blocking XML processor, which can be obtained at: + + * LICENSE: + * license/LICENSE.aalto-xml.txt (Apache License 2.0) + * HOMEPAGE: + * https://wiki.fasterxml.com/AaltoHome + +This product contains a modified version of 'HPACK', a Java implementation of +the HTTP/2 HPACK algorithm written by Twitter. It can be obtained at: + + * LICENSE: + * license/LICENSE.hpack.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/twitter/hpack + +This product contains a modified version of 'HPACK', a Java implementation of +the HTTP/2 HPACK algorithm written by Cory Benfield. It can be obtained at: + + * LICENSE: + * license/LICENSE.hyper-hpack.txt (MIT License) + * HOMEPAGE: + * https://github.com/python-hyper/hpack/ + +This product contains a modified version of 'HPACK', a Java implementation of +the HTTP/2 HPACK algorithm written by Tatsuhiro Tsujikawa. It can be obtained at: + + * LICENSE: + * license/LICENSE.nghttp2-hpack.txt (MIT License) + * HOMEPAGE: + * https://github.com/nghttp2/nghttp2/ + +This product contains a modified portion of 'Apache Commons Lang', a Java library +provides utilities for the java.lang API, which can be obtained at: + + * LICENSE: + * license/LICENSE.commons-lang.txt (Apache License 2.0) + * HOMEPAGE: + * https://commons.apache.org/proper/commons-lang/ + + +This product contains the Maven wrapper scripts from 'Maven Wrapper', that provides an easy way to ensure a user has everything necessary to run the Maven build. + + * LICENSE: + * license/LICENSE.mvn-wrapper.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/takari/maven-wrapper + +This product contains the dnsinfo.h header file, that provides a way to retrieve the system DNS configuration on MacOS. +This private header is also used by Apple's open source + mDNSResponder (https://opensource.apple.com/tarballs/mDNSResponder/). + + * LICENSE: + * license/LICENSE.dnsinfo.txt (Apple Public Source License 2.0) + * HOMEPAGE: + * https://www.opensource.apple.com/source/configd/configd-453.19/dnsinfo/dnsinfo.h + +This product optionally depends on 'Brotli4j', Brotli compression and +decompression for Java., which can be obtained at: + + * LICENSE: + * license/LICENSE.brotli4j.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/hyperxpro/Brotli4j diff --git a/README.md b/README.md index 8aaa096e4d2..96a338cac36 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,8 @@ If you are upgrading to _DataStax Enterprise_, use the [DataStax Enterprise Java features and better compatibility. ## License -© DataStax, Inc. + +© The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -143,4 +144,10 @@ 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. +---- + +Apache Cassandra, Apache, Tomcat, Lucene, Solr, Hadoop, Spark, TinkerPop, and Cassandra are +trademarks of the [Apache Software Foundation](http://www.apache.org/) or its subsidiaries in +Canada, the United States and/or other countries. + [dse-driver]: http://docs.datastax.com/en/developer/java-driver-dse/latest/ From e1f397e2ac0dad04bfe4f05fe1b78b270f41d9e8 Mon Sep 17 00:00:00 2001 From: Henry Hughes Date: Thu, 16 Nov 2023 23:15:10 -0800 Subject: [PATCH 183/211] Add LICENSE and NOTICE.txt/NOTICE_binary to published jars LICENSE + NOTICE.txt is added to source jars, LICENSE + NOTICE_binary.txt is added to regular jars. Make parent project inherit from apache pom. Updated NOTICE wording to "developed at ..." per latest instructions. patch by Henry Hughes; reviewed by Mick Semb Wever for CASSANDRA-18969 --- NOTICE.txt | 243 +------------------ NOTICE_binary.txt | 249 ++++++++++++++++++++ driver-core/pom.xml | 8 + driver-dist/src/assembly/binary-tarball.xml | 1 + driver-examples/pom.xml | 14 ++ driver-extras/pom.xml | 14 ++ driver-mapping/pom.xml | 14 ++ pom.xml | 30 ++- 8 files changed, 330 insertions(+), 243 deletions(-) create mode 100644 NOTICE_binary.txt diff --git a/NOTICE.txt b/NOTICE.txt index b7a91be2318..8e27ae3e52f 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,246 +1,5 @@ Apache Cassandra Java Driver Copyright 2012- The Apache Software Foundation -This product includes software developed by The Apache Software +This product includes software developed at The Apache Software Foundation (http://www.apache.org/). - -================================================================== -io.netty:netty-handler NOTICE.txt -================================================================== -This product contains the extensions to Java Collections Framework which has -been derived from the works by JSR-166 EG, Doug Lea, and Jason T. Greene: - - * LICENSE: - * license/LICENSE.jsr166y.txt (Public Domain) - * HOMEPAGE: - * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/ - * http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbosscache/experimental/jsr166/ - -This product contains a modified version of Robert Harder's Public Domain -Base64 Encoder and Decoder, which can be obtained at: - - * LICENSE: - * license/LICENSE.base64.txt (Public Domain) - * HOMEPAGE: - * http://iharder.sourceforge.net/current/java/base64/ - -This product contains a modified portion of 'Webbit', an event based -WebSocket and HTTP server, which can be obtained at: - - * LICENSE: - * license/LICENSE.webbit.txt (BSD License) - * HOMEPAGE: - * https://github.com/joewalnes/webbit - -This product contains a modified portion of 'SLF4J', a simple logging -facade for Java, which can be obtained at: - - * LICENSE: - * license/LICENSE.slf4j.txt (MIT License) - * HOMEPAGE: - * https://www.slf4j.org/ - -This product contains a modified portion of 'Apache Harmony', an open source -Java SE, which can be obtained at: - - * NOTICE: - * license/NOTICE.harmony.txt - * LICENSE: - * license/LICENSE.harmony.txt (Apache License 2.0) - * HOMEPAGE: - * https://archive.apache.org/dist/harmony/ - -This product contains a modified portion of 'jbzip2', a Java bzip2 compression -and decompression library written by Matthew J. Francis. It can be obtained at: - - * LICENSE: - * license/LICENSE.jbzip2.txt (MIT License) - * HOMEPAGE: - * https://code.google.com/p/jbzip2/ - -This product contains a modified portion of 'libdivsufsort', a C API library to construct -the suffix array and the Burrows-Wheeler transformed string for any input string of -a constant-size alphabet written by Yuta Mori. It can be obtained at: - - * LICENSE: - * license/LICENSE.libdivsufsort.txt (MIT License) - * HOMEPAGE: - * https://github.com/y-256/libdivsufsort - -This product contains a modified portion of Nitsan Wakart's 'JCTools', Java Concurrency Tools for the JVM, - which can be obtained at: - - * LICENSE: - * license/LICENSE.jctools.txt (ASL2 License) - * HOMEPAGE: - * https://github.com/JCTools/JCTools - -This product optionally depends on 'JZlib', a re-implementation of zlib in -pure Java, which can be obtained at: - - * LICENSE: - * license/LICENSE.jzlib.txt (BSD style License) - * HOMEPAGE: - * http://www.jcraft.com/jzlib/ - -This product optionally depends on 'Compress-LZF', a Java library for encoding and -decoding data in LZF format, written by Tatu Saloranta. It can be obtained at: - - * LICENSE: - * license/LICENSE.compress-lzf.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/ning/compress - -This product optionally depends on 'lz4', a LZ4 Java compression -and decompression library written by Adrien Grand. It can be obtained at: - - * LICENSE: - * license/LICENSE.lz4.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/jpountz/lz4-java - -This product optionally depends on 'lzma-java', a LZMA Java compression -and decompression library, which can be obtained at: - - * LICENSE: - * license/LICENSE.lzma-java.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/jponge/lzma-java - -This product optionally depends on 'zstd-jni', a zstd-jni Java compression -and decompression library, which can be obtained at: - - * LICENSE: - * license/LICENSE.zstd-jni.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/luben/zstd-jni - -This product contains a modified portion of 'jfastlz', a Java port of FastLZ compression -and decompression library written by William Kinney. It can be obtained at: - - * LICENSE: - * license/LICENSE.jfastlz.txt (MIT License) - * HOMEPAGE: - * https://code.google.com/p/jfastlz/ - -This product contains a modified portion of and optionally depends on 'Protocol Buffers', Google's data -interchange format, which can be obtained at: - - * LICENSE: - * license/LICENSE.protobuf.txt (New BSD License) - * HOMEPAGE: - * https://github.com/google/protobuf - -This product optionally depends on 'Bouncy Castle Crypto APIs' to generate -a temporary self-signed X.509 certificate when the JVM does not provide the -equivalent functionality. It can be obtained at: - - * LICENSE: - * license/LICENSE.bouncycastle.txt (MIT License) - * HOMEPAGE: - * https://www.bouncycastle.org/ - -This product optionally depends on 'Snappy', a compression library produced -by Google Inc, which can be obtained at: - - * LICENSE: - * license/LICENSE.snappy.txt (New BSD License) - * HOMEPAGE: - * https://github.com/google/snappy - -This product optionally depends on 'JBoss Marshalling', an alternative Java -serialization API, which can be obtained at: - - * LICENSE: - * license/LICENSE.jboss-marshalling.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/jboss-remoting/jboss-marshalling - -This product optionally depends on 'Caliper', Google's micro- -benchmarking framework, which can be obtained at: - - * LICENSE: - * license/LICENSE.caliper.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/google/caliper - -This product optionally depends on 'Apache Commons Logging', a logging -framework, which can be obtained at: - - * LICENSE: - * license/LICENSE.commons-logging.txt (Apache License 2.0) - * HOMEPAGE: - * https://commons.apache.org/logging/ - -This product optionally depends on 'Apache Log4J', a logging framework, which -can be obtained at: - - * LICENSE: - * license/LICENSE.log4j.txt (Apache License 2.0) - * HOMEPAGE: - * https://logging.apache.org/log4j/ - -This product optionally depends on 'Aalto XML', an ultra-high performance -non-blocking XML processor, which can be obtained at: - - * LICENSE: - * license/LICENSE.aalto-xml.txt (Apache License 2.0) - * HOMEPAGE: - * https://wiki.fasterxml.com/AaltoHome - -This product contains a modified version of 'HPACK', a Java implementation of -the HTTP/2 HPACK algorithm written by Twitter. It can be obtained at: - - * LICENSE: - * license/LICENSE.hpack.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/twitter/hpack - -This product contains a modified version of 'HPACK', a Java implementation of -the HTTP/2 HPACK algorithm written by Cory Benfield. It can be obtained at: - - * LICENSE: - * license/LICENSE.hyper-hpack.txt (MIT License) - * HOMEPAGE: - * https://github.com/python-hyper/hpack/ - -This product contains a modified version of 'HPACK', a Java implementation of -the HTTP/2 HPACK algorithm written by Tatsuhiro Tsujikawa. It can be obtained at: - - * LICENSE: - * license/LICENSE.nghttp2-hpack.txt (MIT License) - * HOMEPAGE: - * https://github.com/nghttp2/nghttp2/ - -This product contains a modified portion of 'Apache Commons Lang', a Java library -provides utilities for the java.lang API, which can be obtained at: - - * LICENSE: - * license/LICENSE.commons-lang.txt (Apache License 2.0) - * HOMEPAGE: - * https://commons.apache.org/proper/commons-lang/ - - -This product contains the Maven wrapper scripts from 'Maven Wrapper', that provides an easy way to ensure a user has everything necessary to run the Maven build. - - * LICENSE: - * license/LICENSE.mvn-wrapper.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/takari/maven-wrapper - -This product contains the dnsinfo.h header file, that provides a way to retrieve the system DNS configuration on MacOS. -This private header is also used by Apple's open source - mDNSResponder (https://opensource.apple.com/tarballs/mDNSResponder/). - - * LICENSE: - * license/LICENSE.dnsinfo.txt (Apple Public Source License 2.0) - * HOMEPAGE: - * https://www.opensource.apple.com/source/configd/configd-453.19/dnsinfo/dnsinfo.h - -This product optionally depends on 'Brotli4j', Brotli compression and -decompression for Java., which can be obtained at: - - * LICENSE: - * license/LICENSE.brotli4j.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/hyperxpro/Brotli4j diff --git a/NOTICE_binary.txt b/NOTICE_binary.txt new file mode 100644 index 00000000000..c60d8ceb245 --- /dev/null +++ b/NOTICE_binary.txt @@ -0,0 +1,249 @@ +Apache Cassandra Java Driver +Copyright 2012- The Apache Software Foundation + +This product includes software developed at The Apache Software +Foundation (http://www.apache.org/). + +This compiled product also includes Apache-licensed dependencies +that contain the following NOTICE information: + +================================================================== +io.netty:netty-handler NOTICE.txt +================================================================== +This product contains the extensions to Java Collections Framework which has +been derived from the works by JSR-166 EG, Doug Lea, and Jason T. Greene: + + * LICENSE: + * license/LICENSE.jsr166y.txt (Public Domain) + * HOMEPAGE: + * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/ + * http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbosscache/experimental/jsr166/ + +This product contains a modified version of Robert Harder's Public Domain +Base64 Encoder and Decoder, which can be obtained at: + + * LICENSE: + * license/LICENSE.base64.txt (Public Domain) + * HOMEPAGE: + * http://iharder.sourceforge.net/current/java/base64/ + +This product contains a modified portion of 'Webbit', an event based +WebSocket and HTTP server, which can be obtained at: + + * LICENSE: + * license/LICENSE.webbit.txt (BSD License) + * HOMEPAGE: + * https://github.com/joewalnes/webbit + +This product contains a modified portion of 'SLF4J', a simple logging +facade for Java, which can be obtained at: + + * LICENSE: + * license/LICENSE.slf4j.txt (MIT License) + * HOMEPAGE: + * https://www.slf4j.org/ + +This product contains a modified portion of 'Apache Harmony', an open source +Java SE, which can be obtained at: + + * NOTICE: + * license/NOTICE.harmony.txt + * LICENSE: + * license/LICENSE.harmony.txt (Apache License 2.0) + * HOMEPAGE: + * https://archive.apache.org/dist/harmony/ + +This product contains a modified portion of 'jbzip2', a Java bzip2 compression +and decompression library written by Matthew J. Francis. It can be obtained at: + + * LICENSE: + * license/LICENSE.jbzip2.txt (MIT License) + * HOMEPAGE: + * https://code.google.com/p/jbzip2/ + +This product contains a modified portion of 'libdivsufsort', a C API library to construct +the suffix array and the Burrows-Wheeler transformed string for any input string of +a constant-size alphabet written by Yuta Mori. It can be obtained at: + + * LICENSE: + * license/LICENSE.libdivsufsort.txt (MIT License) + * HOMEPAGE: + * https://github.com/y-256/libdivsufsort + +This product contains a modified portion of Nitsan Wakart's 'JCTools', Java Concurrency Tools for the JVM, + which can be obtained at: + + * LICENSE: + * license/LICENSE.jctools.txt (ASL2 License) + * HOMEPAGE: + * https://github.com/JCTools/JCTools + +This product optionally depends on 'JZlib', a re-implementation of zlib in +pure Java, which can be obtained at: + + * LICENSE: + * license/LICENSE.jzlib.txt (BSD style License) + * HOMEPAGE: + * http://www.jcraft.com/jzlib/ + +This product optionally depends on 'Compress-LZF', a Java library for encoding and +decoding data in LZF format, written by Tatu Saloranta. It can be obtained at: + + * LICENSE: + * license/LICENSE.compress-lzf.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/ning/compress + +This product optionally depends on 'lz4', a LZ4 Java compression +and decompression library written by Adrien Grand. It can be obtained at: + + * LICENSE: + * license/LICENSE.lz4.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/jpountz/lz4-java + +This product optionally depends on 'lzma-java', a LZMA Java compression +and decompression library, which can be obtained at: + + * LICENSE: + * license/LICENSE.lzma-java.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/jponge/lzma-java + +This product optionally depends on 'zstd-jni', a zstd-jni Java compression +and decompression library, which can be obtained at: + + * LICENSE: + * license/LICENSE.zstd-jni.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/luben/zstd-jni + +This product contains a modified portion of 'jfastlz', a Java port of FastLZ compression +and decompression library written by William Kinney. It can be obtained at: + + * LICENSE: + * license/LICENSE.jfastlz.txt (MIT License) + * HOMEPAGE: + * https://code.google.com/p/jfastlz/ + +This product contains a modified portion of and optionally depends on 'Protocol Buffers', Google's data +interchange format, which can be obtained at: + + * LICENSE: + * license/LICENSE.protobuf.txt (New BSD License) + * HOMEPAGE: + * https://github.com/google/protobuf + +This product optionally depends on 'Bouncy Castle Crypto APIs' to generate +a temporary self-signed X.509 certificate when the JVM does not provide the +equivalent functionality. It can be obtained at: + + * LICENSE: + * license/LICENSE.bouncycastle.txt (MIT License) + * HOMEPAGE: + * https://www.bouncycastle.org/ + +This product optionally depends on 'Snappy', a compression library produced +by Google Inc, which can be obtained at: + + * LICENSE: + * license/LICENSE.snappy.txt (New BSD License) + * HOMEPAGE: + * https://github.com/google/snappy + +This product optionally depends on 'JBoss Marshalling', an alternative Java +serialization API, which can be obtained at: + + * LICENSE: + * license/LICENSE.jboss-marshalling.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/jboss-remoting/jboss-marshalling + +This product optionally depends on 'Caliper', Google's micro- +benchmarking framework, which can be obtained at: + + * LICENSE: + * license/LICENSE.caliper.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/google/caliper + +This product optionally depends on 'Apache Commons Logging', a logging +framework, which can be obtained at: + + * LICENSE: + * license/LICENSE.commons-logging.txt (Apache License 2.0) + * HOMEPAGE: + * https://commons.apache.org/logging/ + +This product optionally depends on 'Apache Log4J', a logging framework, which +can be obtained at: + + * LICENSE: + * license/LICENSE.log4j.txt (Apache License 2.0) + * HOMEPAGE: + * https://logging.apache.org/log4j/ + +This product optionally depends on 'Aalto XML', an ultra-high performance +non-blocking XML processor, which can be obtained at: + + * LICENSE: + * license/LICENSE.aalto-xml.txt (Apache License 2.0) + * HOMEPAGE: + * https://wiki.fasterxml.com/AaltoHome + +This product contains a modified version of 'HPACK', a Java implementation of +the HTTP/2 HPACK algorithm written by Twitter. It can be obtained at: + + * LICENSE: + * license/LICENSE.hpack.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/twitter/hpack + +This product contains a modified version of 'HPACK', a Java implementation of +the HTTP/2 HPACK algorithm written by Cory Benfield. It can be obtained at: + + * LICENSE: + * license/LICENSE.hyper-hpack.txt (MIT License) + * HOMEPAGE: + * https://github.com/python-hyper/hpack/ + +This product contains a modified version of 'HPACK', a Java implementation of +the HTTP/2 HPACK algorithm written by Tatsuhiro Tsujikawa. It can be obtained at: + + * LICENSE: + * license/LICENSE.nghttp2-hpack.txt (MIT License) + * HOMEPAGE: + * https://github.com/nghttp2/nghttp2/ + +This product contains a modified portion of 'Apache Commons Lang', a Java library +provides utilities for the java.lang API, which can be obtained at: + + * LICENSE: + * license/LICENSE.commons-lang.txt (Apache License 2.0) + * HOMEPAGE: + * https://commons.apache.org/proper/commons-lang/ + + +This product contains the Maven wrapper scripts from 'Maven Wrapper', that provides an easy way to ensure a user has everything necessary to run the Maven build. + + * LICENSE: + * license/LICENSE.mvn-wrapper.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/takari/maven-wrapper + +This product contains the dnsinfo.h header file, that provides a way to retrieve the system DNS configuration on MacOS. +This private header is also used by Apple's open source + mDNSResponder (https://opensource.apple.com/tarballs/mDNSResponder/). + + * LICENSE: + * license/LICENSE.dnsinfo.txt (Apple Public Source License 2.0) + * HOMEPAGE: + * https://www.opensource.apple.com/source/configd/configd-453.19/dnsinfo/dnsinfo.h + +This product optionally depends on 'Brotli4j', Brotli compression and +decompression for Java., which can be obtained at: + + * LICENSE: + * license/LICENSE.brotli4j.txt (Apache License 2.0) + * HOMEPAGE: + * https://github.com/hyperxpro/Brotli4j diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 57efddf9194..5f5ea3470e0 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -176,6 +176,14 @@ src/main/resources true + + ${project.basedir}/.. + + LICENSE + NOTICE_binary.txt + + META-INF + diff --git a/driver-dist/src/assembly/binary-tarball.xml b/driver-dist/src/assembly/binary-tarball.xml index 208638492f1..5028b745cb4 100644 --- a/driver-dist/src/assembly/binary-tarball.xml +++ b/driver-dist/src/assembly/binary-tarball.xml @@ -148,6 +148,7 @@ README* LICENSE* + NOTICE* diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index f6817337bd8..0e5277f899e 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -136,6 +136,20 @@ + + + src/main/resources + + + ${project.basedir}/.. + + LICENSE + NOTICE_binary.txt + + META-INF + + + diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml index 13e372db3d4..47e10046572 100644 --- a/driver-extras/pom.xml +++ b/driver-extras/pom.xml @@ -127,6 +127,20 @@ + + + src/main/resources + + + ${project.basedir}/.. + + LICENSE + NOTICE_binary.txt + + META-INF + + + diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml index 6f3af716c9a..5dd512dff47 100644 --- a/driver-mapping/pom.xml +++ b/driver-mapping/pom.xml @@ -108,6 +108,20 @@ + + + src/main/resources + + + ${project.basedir}/.. + + LICENSE + NOTICE_binary.txt + + META-INF + + + diff --git a/pom.xml b/pom.xml index 156107ef3fb..37e9d97e603 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,11 @@ 4.0.0 - + + org.apache + apache + 23 + com.datastax.cassandra cassandra-driver-parent 3.11.6-SNAPSHOT @@ -499,6 +503,14 @@ jar-no-fork + + + NOTICE.txt + + + NOTICE_binary.txt + + @@ -905,6 +917,14 @@ limitations under the License. + + org.apache.maven.plugins + maven-remote-resources-plugin + 1.7.0 + + true + + @@ -1023,6 +1043,14 @@ limitations under the License. jar-no-fork + + + NOTICE.txt + + + NOTICE_binary.txt + + From a7553ccdeacb23efff454747463d4550b04a03bf Mon Sep 17 00:00:00 2001 From: "Siyao (Jane) He" Date: Tue, 13 Aug 2024 16:58:29 -0700 Subject: [PATCH 184/211] Add Jenkinsfile-asf for OSS CI patch by Siyao (Jane) He; reviewed by Mick Semb Wever for CASSANDRA-19832 --- Jenkinsfile-asf | 73 +++++++++++++++++++++++++++++ Jenkinsfile => Jenkinsfile-datastax | 0 ci/run-tests.sh | 9 ++++ 3 files changed, 82 insertions(+) create mode 100644 Jenkinsfile-asf rename Jenkinsfile => Jenkinsfile-datastax (100%) create mode 100755 ci/run-tests.sh diff --git a/Jenkinsfile-asf b/Jenkinsfile-asf new file mode 100644 index 00000000000..a3429d80583 --- /dev/null +++ b/Jenkinsfile-asf @@ -0,0 +1,73 @@ +#!groovy + +/* + * 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. + */ + +pipeline { + agent { + label 'cassandra-small' + } + + triggers { + // schedules only run against release branches (i.e. 3.x, 4.x, 4.5.x, etc.) + cron(branchPatternCron().matcher(env.BRANCH_NAME).matches() ? "@weekly" : "") + } + + stages { + stage('Matrix') { + matrix { + axes { + axis { + name 'TEST_JAVA_VERSION' + values 'openjdk@1.8.0-292', 'openjdk@1.11.0-9' + } + axis { + name 'SERVER_VERSION' + values '2.1', '3.0', '3.11', '4.0' + } + } + stages { + stage('Tests') { + agent { + label 'cassandra-medium' + } + steps { + script { + executeTests() + junit testResults: '**/target/surefire-reports/TEST-*.xml', allowEmptyResults: true + junit testResults: '**/target/failsafe-reports/TEST-*.xml', allowEmptyResults: true + } + } + } + } + } + } + } +} + +def executeTests() { + sh "docker run -e TEST_JAVA_VERSION=${TEST_JAVA_VERSION} -e SERVER_VERSION=${SERVER_VERSION} -v \$(pwd):/home/docker/cassandra-java-driver apache.jfrog.io/cassan-docker/apache/cassandra-java-driver-testing-ubuntu2204 cassandra-java-driver/ci/run-tests.sh" +} + +// branch pattern for cron +// should match 3.x, 4.x, 4.5.x, etc +def branchPatternCron() { + ~"((\\d+(\\.[\\dx]+)+))" +} + diff --git a/Jenkinsfile b/Jenkinsfile-datastax similarity index 100% rename from Jenkinsfile rename to Jenkinsfile-datastax diff --git a/ci/run-tests.sh b/ci/run-tests.sh new file mode 100755 index 00000000000..b1bf201442b --- /dev/null +++ b/ci/run-tests.sh @@ -0,0 +1,9 @@ +#!/bin/bash -x + +. ~/env.txt +printenv | sort +cd $(dirname "$(readlink -f "$0")")/.. +mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true +jabba use ${TEST_JAVA_VERSION} +printenv | sort +mvn -B -V verify -T 1 -Dcassandra.version=${SERVER_VERSION} -Ddse=false -Dmaven.test.failure.ignore=true -Dmaven.javadoc.skip=true; From 692a92279210cdf11c08bb7f15b91191b6f3a0d7 Mon Sep 17 00:00:00 2001 From: mck Date: Wed, 11 Sep 2024 21:37:59 +0200 Subject: [PATCH 185/211] Switch all archs to netty-tcnative-boringssl-static patch by Mick Semb Wever; reviewed by Siyao He for CASSANDRA-18971 --- driver-core/pom.xml | 2 +- pom.xml | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/driver-core/pom.xml b/driver-core/pom.xml index 5f5ea3470e0..c607c8f4819 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -127,7 +127,7 @@ io.netty - ${netty-tcnative.artifact} + netty-tcnative-boringssl-static ${os.detected.classifier} test diff --git a/pom.xml b/pom.xml index 37e9d97e603..c967b64af36 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,6 @@ 1.7.25 19.0 4.1.94.Final - netty-tcnative 2.0.61.Final 3.2.2 1.1.2.6 @@ -357,7 +356,7 @@ io.netty - ${netty-tcnative.artifact} + netty-tcnative-boringssl-static ${netty-tcnative.version} ${os.detected.classifier} @@ -1169,8 +1168,6 @@ limitations under the License. - - netty-tcnative-boringssl-static 2.2.10 1.1.10.1 From 2c753aaad276e64cf10845437dfedc16ede418e2 Mon Sep 17 00:00:00 2001 From: janehe Date: Sat, 14 Sep 2024 00:54:43 +0000 Subject: [PATCH 186/211] CI docker uses correct uid/gip with use of create-user.sh script patch by Siyao He; reviewed by Mick Semb Wever for CASSANDRA-18971 --- Jenkinsfile-asf | 7 +++++- ci/create-user.sh | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 ci/create-user.sh diff --git a/Jenkinsfile-asf b/Jenkinsfile-asf index a3429d80583..2bc42bea379 100644 --- a/Jenkinsfile-asf +++ b/Jenkinsfile-asf @@ -62,7 +62,12 @@ pipeline { } def executeTests() { - sh "docker run -e TEST_JAVA_VERSION=${TEST_JAVA_VERSION} -e SERVER_VERSION=${SERVER_VERSION} -v \$(pwd):/home/docker/cassandra-java-driver apache.jfrog.io/cassan-docker/apache/cassandra-java-driver-testing-ubuntu2204 cassandra-java-driver/ci/run-tests.sh" + sh """ + container_id=\$(docker run -td -e TEST_JAVA_VERSION=${TEST_JAVA_VERSION} -e SERVER_VERSION=${SERVER_VERSION} -v \$(pwd):/home/docker/cassandra-java-driver apache.jfrog.io/cassan-docker/apache/cassandra-java-driver-testing-ubuntu2204 'sleep 2h') + docker exec --user root \$container_id bash -c \"sudo bash /home/docker/cassandra-java-driver/ci/create-user.sh docker \$(id -u) \$(id -g) /home/docker/cassandra-java-driver\" + docker exec --user docker \$container_id './cassandra-java-driver/ci/run-tests.sh' + ( nohup docker stop \$container_id >/dev/null 2>/dev/null & ) + """ } // branch pattern for cron diff --git a/ci/create-user.sh b/ci/create-user.sh new file mode 100644 index 00000000000..fb193df9a00 --- /dev/null +++ b/ci/create-user.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# 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. + +################################ +# +# Prep +# +################################ + +if [ "$1" == "-h" ]; then + echo "$0 [-h] " + echo " this script is used internally by other scripts in the same directory to create a user with the running host user's same uid and gid" + exit 1 +fi + +# arguments +username=$1 +uid=$2 +gid=$3 +BUILD_HOME=$4 + +################################ +# +# Main +# +################################ + +# disable git directory ownership checks +su ${username} -c "git config --global safe.directory '*'" + +if grep "^ID=" /etc/os-release | grep -q 'debian\|ubuntu' ; then + deluser docker + adduser --quiet --disabled-login --no-create-home --uid $uid --gecos ${username} ${username} + groupmod --non-unique -g $gid $username + gpasswd -a ${username} sudo >/dev/null +else + adduser --no-create-home --uid $uid ${username} +fi + +# sudo priviledges +echo "${username} ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/${username} +chmod 0440 /etc/sudoers.d/${username} + +# proper permissions +chown -R ${username}:${username} /home/docker +chmod og+wx ${BUILD_HOME} \ No newline at end of file From cbd50c6e411bbd23c296a1f556c91969444042cb Mon Sep 17 00:00:00 2001 From: mck Date: Sat, 26 Oct 2024 21:15:44 +0200 Subject: [PATCH 187/211] Compliance changes for generated source and binary distributable tarballs * New submodule to generate distribution source tarball * Binary/source tarball artifacts should be prefixed with apache-cassandra * Change groupId to org.apache.cassandra * Create binary versions for LICENSE and NOTICE, with licenses and entries for asm, HdrHistogram, jnr-posix, jnr-x86asm, slf4j-api * Add checksums to distribution tarballs, and clean toplevel readme a little patch by Mick Semb Wever; reviewed by Bret McGuire for CASSANDRA-18969 --- LICENSE_binary | 229 ++++ README.md | 56 +- docs.yaml | 2 +- driver-core/pom.xml | 4 +- .../java/com/datastax/driver/core/Host.java | 12 +- driver-dist-source/pom.xml | 125 ++ .../src/assembly/source-tarball.xml | 43 + driver-dist/pom.xml | 44 +- driver-dist/src/assembly/binary-tarball.xml | 41 +- driver-examples/pom.xml | 15 +- .../examples/json/JacksonJsonColumn.java | 2 +- .../examples/json/JacksonJsonFunction.java | 2 +- .../driver/examples/json/JacksonJsonRow.java | 2 +- .../examples/json/Jsr353JsonColumn.java | 2 +- .../examples/json/Jsr353JsonFunction.java | 2 +- .../driver/examples/json/Jsr353JsonRow.java | 2 +- driver-extras/pom.xml | 10 +- driver-mapping/pom.xml | 8 +- driver-tests/osgi/README.md | 2 +- driver-tests/osgi/common/pom.xml | 2 +- driver-tests/osgi/pom.xml | 8 +- driver-tests/osgi/shaded/pom.xml | 4 +- driver-tests/osgi/unshaded/pom.xml | 4 +- driver-tests/pom.xml | 9 +- driver-tests/shading/pom.xml | 2 +- driver-tests/shading/shaded/pom.xml | 4 +- driver-tests/shading/unshaded/pom.xml | 4 +- driver-tests/stress/pom.xml | 4 +- faq/README.md | 4 +- faq/osgi/README.md | 2 +- licenses/HdrHistogram.txt | 41 + licenses/asm.txt | 27 + licenses/jnr-posix.txt | 1076 +++++++++++++++++ licenses/jnr-x86asm.txt | 24 + licenses/slf4j-api.txt | 21 + manual/README.md | 2 +- manual/custom_codecs/extras/README.md | 2 +- manual/metrics/README.md | 2 +- manual/object_mapper/README.md | 2 +- manual/osgi/README.md | 2 +- manual/shaded_jar/README.md | 8 +- pom.xml | 106 +- upgrade_guide/README.md | 2 +- 43 files changed, 1715 insertions(+), 250 deletions(-) create mode 100644 LICENSE_binary create mode 100644 driver-dist-source/pom.xml create mode 100644 driver-dist-source/src/assembly/source-tarball.xml create mode 100644 licenses/HdrHistogram.txt create mode 100644 licenses/asm.txt create mode 100644 licenses/jnr-posix.txt create mode 100644 licenses/jnr-x86asm.txt create mode 100644 licenses/slf4j-api.txt diff --git a/LICENSE_binary b/LICENSE_binary new file mode 100644 index 00000000000..5232779c907 --- /dev/null +++ b/LICENSE_binary @@ -0,0 +1,229 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. + +Apache Cassandra Java Driver bundles code and files from the following projects: + +Protocol Buffers +Copyright 2008 Google Inc. +This product includes software developed as part of the Protocol Buffers project ( https://developers.google.com/protocol-buffers/ ). +see driver-core/src/main/java/com/datastax/driver/core/VIntCoding.java + +This product bundles Java Native Runtime - POSIX 3.1.15, +which is available under the Eclipse Public License version 2.0. +see licenses/jnr-posix.txt + +This product bundles jnr-x86asm 1.0.2, +which is available under the MIT License. +see licenses/jnr-x86asm.txt + +This product bundles ASM 9.2: a very small and fast Java bytecode manipulation framework, +which is available under the 3-Clause BSD License. +see licenses/asm.txt + +This product bundles HdrHistogram 2.1.12: A High Dynamic Range (HDR) Histogram, +which is available under the 2-Clause BSD License. +see licenses/HdrHistogram.txt + +This product bundles The Simple Logging Facade for Java (SLF4J) API 1.7.26, +which is available under the MIT License. +see licenses/slf4j-api.txt diff --git a/README.md b/README.md index 96a338cac36..207c646e3fb 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ # Java Driver for Apache Cassandra® +:warning: The java-driver has recently been donated by Datastax to The Apache Software Foundation and the Apache Cassandra project. Bear with us as we move assets and coordinates. + *If you're reading this on github.com, please note that this is the readme for the development version and that some features described here might not yet have been released. You can find the documentation for the latest version through the [Java Driver docs](http://docs.datastax.com/en/developer/java-driver/3.11/index.html) or via the release tags, -[e.g. 3.11.5](https://github.com/datastax/java-driver/tree/3.11.5).* +[e.g. 3.11.5](https://github.com/apache/cassandra-java-driver/tree/3.11.5).* A modern, [feature-rich](manual/) and highly tunable Java client library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol @@ -42,17 +44,12 @@ The driver contains the following modules: **Useful links:** -- JIRA (bug tracking): https://datastax-oss.atlassian.net/browse/JAVA -- MAILING LIST: https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user -- DATASTAX ACADEMY SLACK: #datastax-drivers on https://academy.datastax.com/slack -- TWITTER: [@dsJavaDriver](https://twitter.com/dsJavaDriver) tweets Java - driver releases and important announcements (low frequency). - [@DataStaxEng](https://twitter.com/datastaxeng) has more news including - other drivers, Cassandra, and DSE. +- JIRA (bug tracking): https://issues.apache.org/jira/projects/CASSJAVA +- MAILING LIST: https://cassandra.apache.org/_/community.html#discussions - DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.11/manual/) has quick start material and technical details about the driver and its features. - API: https://docs.datastax.com/en/drivers/java/3.11 -- GITHUB REPOSITORY: https://github.com/datastax/java-driver +- GITHUB REPOSITORY: https://github.com/apache/cassandra-java-driver - [changelog](changelog/) ## Getting the driver @@ -63,7 +60,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java Driver][dse-dri ```xml - com.datastax.cassandra + org.apache.cassandra cassandra-driver-core 3.11.5 @@ -73,7 +70,7 @@ Note that the object mapper is published as a separate artifact: ```xml - com.datastax.cassandra + org.apache.cassandra cassandra-driver-mapping 3.11.5 @@ -83,7 +80,7 @@ The 'extras' module is also published as a separate artifact: ```xml - com.datastax.cassandra + org.apache.cassandra cassandra-driver-extras 3.11.5/version> @@ -94,55 +91,31 @@ 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://github.com/datastax/java-driver/releases/3.11.5) +[binary tarball](https://cassandra.apache.org/_/download.html) is available for download. ## Compatibility -The Java client driver 3.11.5 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache +The Java client driver 3.11.5 ([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/datastax/java-driver/blob/3.x/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java), +[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/datastax/java-driver/blob/3.x/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedFeatureException.java) being thrown. +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. -If using _DataStax Enterprise_, the [DataStax Enterprise Java Driver][dse-driver] provides -more features and better compatibility. - -__Disclaimer__: Some _DataStax/DataStax Enterprise_ products might partially work on -big-endian systems, but _DataStax_ does not officially support these systems. - ## Upgrading from previous versions If you are upgrading from a previous version of the driver, be sure to have a look at the [upgrade guide](/upgrade_guide/). -If you are upgrading to _DataStax Enterprise_, use the [DataStax Enterprise Java Driver][dse-driver] for more -features and better compatibility. - -## License - -© The Apache Software Foundation - -Licensed 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. ---- @@ -150,4 +123,5 @@ Apache Cassandra, Apache, Tomcat, Lucene, Solr, Hadoop, Spark, TinkerPop, and Ca trademarks of the [Apache Software Foundation](http://www.apache.org/) or its subsidiaries in Canada, the United States and/or other countries. -[dse-driver]: http://docs.datastax.com/en/developer/java-driver-dse/latest/ + +Binary artifacts of this product bundle Java Native Runtime libraries, which is available under the Eclipse Public License version 2.0. diff --git a/docs.yaml b/docs.yaml index 6b934e0bf10..4b30dcd5813 100644 --- a/docs.yaml +++ b/docs.yaml @@ -50,7 +50,7 @@ sections: files: 'faq/**/*.md' links: - title: Code - href: https://github.com/datastax/java-driver/ + href: https://github.com/apache/cassandra-java-driver/ - title: Docs href: http://docs.datastax.com/en/developer/java-driver/ - title: Issues diff --git a/driver-core/pom.xml b/driver-core/pom.xml index c607c8f4819..56a0f7458ce 100644 --- a/driver-core/pom.xml +++ b/driver-core/pom.xml @@ -22,7 +22,7 @@ 4.0.0 - com.datastax.cassandra + org.apache.cassandra cassandra-driver-parent 3.11.6-SNAPSHOT @@ -179,8 +179,10 @@ ${project.basedir}/.. + LICENSE_binary LICENSE NOTICE_binary.txt + NOTICE.txt META-INF diff --git a/driver-core/src/main/java/com/datastax/driver/core/Host.java b/driver-core/src/main/java/com/datastax/driver/core/Host.java index cce9a5673f6..c904f7957eb 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/Host.java +++ b/driver-core/src/main/java/com/datastax/driver/core/Host.java @@ -359,9 +359,9 @@ public VersionNumber getDseVersion() { * {@code null}, and the caller should always be aware of this possibility. * * @return the DSE workload the host is running. - * @deprecated Please use the Java Driver - * for DSE if you are connecting to a DataStax Enterprise (DSE) cluster. This method might - * not function properly with future versions of DSE. + * @deprecated Please use the Java + * Driver for DSE if you are connecting to a DataStax Enterprise (DSE) cluster. This + * method might not function properly with future versions of DSE. */ @Deprecated public String getDseWorkload() { @@ -372,9 +372,9 @@ public String getDseWorkload() { * Returns whether the host is running DSE Graph. * * @return whether the node is running DSE Graph. - * @deprecated Please use the Java Driver - * for DSE if you are connecting to a DataStax Enterprise (DSE) cluster. This method might - * not function properly with future versions of DSE. + * @deprecated Please use the Java + * Driver for DSE if you are connecting to a DataStax Enterprise (DSE) cluster. This + * method might not function properly with future versions of DSE. */ @Deprecated public boolean isDseGraphEnabled() { diff --git a/driver-dist-source/pom.xml b/driver-dist-source/pom.xml new file mode 100644 index 00000000000..0e77ca6530a --- /dev/null +++ b/driver-dist-source/pom.xml @@ -0,0 +1,125 @@ + + + + 4.0.0 + + org.apache.cassandra + cassandra-driver-parent + 3.11.6-SNAPSHOT + + java-driver-distribution-source + pom + Apache Cassandra Java Driver - source distribution + + apache-cassandra-java-driver-${project.version}-source + + + maven-jar-plugin + + + + default-jar + none + + + + + maven-source-plugin + + true + + + + maven-install-plugin + + true + + + + maven-deploy-plugin + + true + + + + org.revapi + revapi-maven-plugin + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + + true + + + + + + + release + + + + maven-assembly-plugin + + + assemble-source-tarball + package + + single + + + + + false + + src/assembly/source-tarball.xml + + posix + + + + net.nicoulaj.maven.plugins + checksum-maven-plugin + 1.7 + + + + artifacts + + + + + true + + sha256 + sha512 + + + + + + + + diff --git a/driver-dist-source/src/assembly/source-tarball.xml b/driver-dist-source/src/assembly/source-tarball.xml new file mode 100644 index 00000000000..b3e2d0f463a --- /dev/null +++ b/driver-dist-source/src/assembly/source-tarball.xml @@ -0,0 +1,43 @@ + + + + source-tarball + + tar.gz + + + + .. + . + true + + + **/*.iml + **/.classpath + **/.project + **/.java-version + **/.flattened-pom.xml + **/dependency-reduced-pom.xml + **/${project.build.directory}/** + + + + diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml index 8687ad6fe22..8a87430ea9f 100644 --- a/driver-dist/pom.xml +++ b/driver-dist/pom.xml @@ -22,7 +22,7 @@ 4.0.0 - com.datastax.cassandra + org.apache.cassandra cassandra-driver-parent 3.11.6-SNAPSHOT @@ -36,17 +36,17 @@ - com.datastax.cassandra + org.apache.cassandra cassandra-driver-core - com.datastax.cassandra + org.apache.cassandra cassandra-driver-mapping - com.datastax.cassandra + org.apache.cassandra cassandra-driver-extras @@ -54,7 +54,7 @@ - cassandra-java-driver-${project.version} + apache-cassandra-java-driver-${project.version} @@ -100,21 +100,6 @@ release - - maven-javadoc-plugin - - - dependencies-javadoc - package - - jar - - - true - - - - maven-assembly-plugin @@ -141,6 +126,25 @@ true
    + + net.nicoulaj.maven.plugins + checksum-maven-plugin + 1.7 + + + + artifacts + + + + + true + + sha256 + sha512 + + + diff --git a/driver-dist/src/assembly/binary-tarball.xml b/driver-dist/src/assembly/binary-tarball.xml index 5028b745cb4..baf4579ca55 100644 --- a/driver-dist/src/assembly/binary-tarball.xml +++ b/driver-dist/src/assembly/binary-tarball.xml @@ -32,7 +32,7 @@ true - com.datastax.cassandra:cassandra-driver-core + org.apache.cassandra:cassandra-driver-core false @@ -41,9 +41,9 @@ lib - com.datastax.cassandra:cassandra-driver-core - com.datastax.cassandra:cassandra-driver-mapping - com.datastax.cassandra:cassandra-driver-extras + org.apache.cassandra:cassandra-driver-core + org.apache.cassandra:cassandra-driver-mapping + org.apache.cassandra:cassandra-driver-extras io.netty:netty-transport-native-epoll:* @@ -65,7 +65,7 @@ true - com.datastax.cassandra:cassandra-driver-mapping + org.apache.cassandra:cassandra-driver-mapping false @@ -74,9 +74,9 @@ lib/mapping - com.datastax.cassandra:cassandra-driver-core - com.datastax.cassandra:cassandra-driver-mapping - com.datastax.cassandra:cassandra-driver-extras + org.apache.cassandra:cassandra-driver-core + org.apache.cassandra:cassandra-driver-mapping + org.apache.cassandra:cassandra-driver-extras com.google.guava:guava org.slf4j:slf4j-api @@ -91,7 +91,7 @@ true - com.datastax.cassandra:cassandra-driver-extras + org.apache.cassandra:cassandra-driver-extras false @@ -100,9 +100,9 @@ lib/extras - com.datastax.cassandra:cassandra-driver-core - com.datastax.cassandra:cassandra-driver-mapping - com.datastax.cassandra:cassandra-driver-extras + org.apache.cassandra:cassandra-driver-core + org.apache.cassandra:cassandra-driver-mapping + org.apache.cassandra:cassandra-driver-extras com.google.guava:guava org.slf4j:slf4j-api @@ -117,10 +117,10 @@ true - com.datastax.cassandra:cassandra-driver-core - com.datastax.cassandra:cassandra-driver-mapping - com.datastax.cassandra:cassandra-driver-extras - com.datastax.cassandra:cassandra-driver-examples + org.apache.cassandra:cassandra-driver-core + org.apache.cassandra:cassandra-driver-mapping + org.apache.cassandra:cassandra-driver-extras + org.apache.cassandra:cassandra-driver-examples false @@ -137,18 +137,13 @@ - - target/apidocs - apidocs - - .. . README* - LICENSE* - NOTICE* + LICENSE_binary + NOTICE_binary.txt diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml index 0e5277f899e..9d58e408f0a 100644 --- a/driver-examples/pom.xml +++ b/driver-examples/pom.xml @@ -22,7 +22,7 @@ 4.0.0 - com.datastax.cassandra + org.apache.cassandra cassandra-driver-parent 3.11.6-SNAPSHOT @@ -36,12 +36,12 @@ - com.datastax.cassandra + org.apache.cassandra cassandra-driver-core - com.datastax.cassandra + org.apache.cassandra cassandra-driver-extras true @@ -143,8 +143,10 @@ ${project.basedir}/.. + LICENSE_binary LICENSE NOTICE_binary.txt + NOTICE.txt META-INF @@ -168,13 +170,6 @@
    - - maven-javadoc-plugin - - true - - - maven-gpg-plugin diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonColumn.java b/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonColumn.java index 479e7675094..9990049d6a8 100644 --- a/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonColumn.java +++ b/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonColumn.java @@ -44,7 +44,7 @@ * *
    {@code
      * 
    - *     com.datastax.cassandra
    + *     org.apache.cassandra
      *     cassandra-driver-extras
      *     ${driver.version}
      * 
    diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonFunction.java b/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonFunction.java
    index 2a33c8a5a20..bd94e716d1e 100644
    --- a/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonFunction.java
    +++ b/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonFunction.java
    @@ -49,7 +49,7 @@
      *
      * 
    {@code
      * 
    - *     com.datastax.cassandra
    + *     org.apache.cassandra
      *     cassandra-driver-extras
      *     ${driver.version}
      * 
    diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonRow.java b/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonRow.java
    index 5fe4cc7dd8a..32d44d28eee 100644
    --- a/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonRow.java
    +++ b/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonRow.java
    @@ -45,7 +45,7 @@
      *
      * 
    {@code
      * 
    - *     com.datastax.cassandra
    + *     org.apache.cassandra
      *     cassandra-driver-extras
      *     ${driver.version}
      * 
    diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonColumn.java b/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonColumn.java
    index aabebde01b7..5eb58ffabea 100644
    --- a/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonColumn.java
    +++ b/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonColumn.java
    @@ -46,7 +46,7 @@
      *
      * 
    {@code
      * 
    - *     com.datastax.cassandra
    + *     org.apache.cassandra
      *     cassandra-driver-extras
      *     ${driver.version}
      * 
    diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonFunction.java b/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonFunction.java
    index 8931a16081b..377f82764d4 100644
    --- a/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonFunction.java
    +++ b/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonFunction.java
    @@ -47,7 +47,7 @@
      *
      * 
    {@code
      * 
    - *     com.datastax.cassandra
    + *     org.apache.cassandra
      *     cassandra-driver-extras
      *     ${driver.version}
      * 
    diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonRow.java b/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonRow.java
    index 9df46e920bb..05aa1cea1ab 100644
    --- a/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonRow.java
    +++ b/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonRow.java
    @@ -46,7 +46,7 @@
      *
      * 
    {@code
      * 
    - *     com.datastax.cassandra
    + *     org.apache.cassandra
      *     cassandra-driver-extras
      *     ${driver.version}
      * 
    diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml
    index 47e10046572..3800e34dcf1 100644
    --- a/driver-extras/pom.xml
    +++ b/driver-extras/pom.xml
    @@ -22,7 +22,7 @@
         4.0.0
     
         
    -        com.datastax.cassandra
    +        org.apache.cassandra
             cassandra-driver-parent
             3.11.6-SNAPSHOT
         
    @@ -35,7 +35,7 @@
         
     
             
    -            com.datastax.cassandra
    +            org.apache.cassandra
                 cassandra-driver-core
             
     
    @@ -69,14 +69,14 @@
             
     
             
    -            com.datastax.cassandra
    +            org.apache.cassandra
                 cassandra-driver-core
                 test-jar
                 test
             
     
             
    -            com.datastax.cassandra
    +            org.apache.cassandra
                 cassandra-driver-mapping
                 test
             
    @@ -134,8 +134,10 @@
                 
                     ${project.basedir}/..
                     
    +                    LICENSE_binary
                         LICENSE
                         NOTICE_binary.txt
    +                    NOTICE.txt
                     
                     META-INF
                 
    diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml
    index 5dd512dff47..4585544a03c 100644
    --- a/driver-mapping/pom.xml
    +++ b/driver-mapping/pom.xml
    @@ -22,7 +22,7 @@
         4.0.0
     
         
    -        com.datastax.cassandra
    +        org.apache.cassandra
             cassandra-driver-parent
             3.11.6-SNAPSHOT
         
    @@ -35,7 +35,7 @@
         
     
             
    -            com.datastax.cassandra
    +            org.apache.cassandra
                 cassandra-driver-core
             
     
    @@ -56,7 +56,7 @@
             
     
             
    -            com.datastax.cassandra
    +            org.apache.cassandra
                 cassandra-driver-core
                 test-jar
                 test
    @@ -115,8 +115,10 @@
                 
                     ${project.basedir}/..
                     
    +                    LICENSE_binary
                         LICENSE
                         NOTICE_binary.txt
    +                    NOTICE.txt
                     
                     META-INF
                 
    diff --git a/driver-tests/osgi/README.md b/driver-tests/osgi/README.md
    index 81de3367faa..f427fdc5652 100644
    --- a/driver-tests/osgi/README.md
    +++ b/driver-tests/osgi/README.md
    @@ -28,7 +28,7 @@ It is _not_ meant as an example application.
     If you are looking for examples demonstrating usage of the driver in an OSGi
     environment, please refer to our [OSGi examples repository].
     
    -[OSGi examples repository]:https://github.com/datastax/java-driver-examples-osgi
    +[OSGi examples repository]:https://github.com/apache/cassandra-java-driver-examples-osgi
     
     ## Usage
     
    diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml
    index d375962fa61..e82cf4c5117 100644
    --- a/driver-tests/osgi/common/pom.xml
    +++ b/driver-tests/osgi/common/pom.xml
    @@ -22,7 +22,7 @@
         4.0.0
     
         
    -        com.datastax.cassandra
    +        org.apache.cassandra
             cassandra-driver-tests-osgi
             3.11.6-SNAPSHOT
         
    diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml
    index f29c6deedad..fb597bb890f 100644
    --- a/driver-tests/osgi/pom.xml
    +++ b/driver-tests/osgi/pom.xml
    @@ -22,7 +22,7 @@
         4.0.0
     
         
    -        com.datastax.cassandra
    +        org.apache.cassandra
             cassandra-driver-tests-parent
             3.11.6-SNAPSHOT
         
    @@ -40,12 +40,12 @@
     
         
             
    -            com.datastax.cassandra
    +            org.apache.cassandra
                 cassandra-driver-mapping
             
     
             
    -            com.datastax.cassandra
    +            org.apache.cassandra
                 cassandra-driver-extras
             
     
    @@ -65,7 +65,7 @@
             
     
             
    -            com.datastax.cassandra
    +            org.apache.cassandra
                 cassandra-driver-core
                 test-jar
                 test
    diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml
    index 2040341261b..99f8120cbe3 100644
    --- a/driver-tests/osgi/shaded/pom.xml
    +++ b/driver-tests/osgi/shaded/pom.xml
    @@ -22,7 +22,7 @@
         4.0.0
     
         
    -        com.datastax.cassandra
    +        org.apache.cassandra
             cassandra-driver-tests-osgi
             3.11.6-SNAPSHOT
         
    @@ -33,7 +33,7 @@
     
         
             
    -            com.datastax.cassandra
    +            org.apache.cassandra
                 cassandra-driver-core
                 
                 shaded
    diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml
    index 1541ac2b9f6..9653b51f9a1 100644
    --- a/driver-tests/osgi/unshaded/pom.xml
    +++ b/driver-tests/osgi/unshaded/pom.xml
    @@ -22,7 +22,7 @@
         4.0.0
     
         
    -        com.datastax.cassandra
    +        org.apache.cassandra
             cassandra-driver-tests-osgi
             3.11.6-SNAPSHOT
         
    @@ -33,7 +33,7 @@
     
         
             
    -            com.datastax.cassandra
    +            org.apache.cassandra
                 cassandra-driver-core
                 
                 
    diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml
    index b763a1ba6c3..87dead1decc 100644
    --- a/driver-tests/pom.xml
    +++ b/driver-tests/pom.xml
    @@ -22,7 +22,7 @@
         4.0.0
     
         
    -        com.datastax.cassandra
    +        org.apache.cassandra
             cassandra-driver-parent
             3.11.6-SNAPSHOT
         
    @@ -57,13 +57,6 @@
                     
                 
     
    -            
    -                maven-javadoc-plugin
    -                
    -                    true
    -                
    -            
    -
                 
                     maven-gpg-plugin
                     
    diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml
    index ed0d864afb9..1c4ebe74037 100644
    --- a/driver-tests/shading/pom.xml
    +++ b/driver-tests/shading/pom.xml
    @@ -22,7 +22,7 @@
         4.0.0
     
         
    -        com.datastax.cassandra
    +        org.apache.cassandra
             cassandra-driver-tests-parent
             3.11.6-SNAPSHOT
         
    diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml
    index 6f55b1ca0ad..7661694569e 100644
    --- a/driver-tests/shading/shaded/pom.xml
    +++ b/driver-tests/shading/shaded/pom.xml
    @@ -22,7 +22,7 @@
         4.0.0
     
         
    -        com.datastax.cassandra
    +        org.apache.cassandra
             cassandra-driver-tests-shading
             3.11.6-SNAPSHOT
         
    @@ -34,7 +34,7 @@
         
     
             
    -            com.datastax.cassandra
    +            org.apache.cassandra
                 cassandra-driver-core
                 shaded
                 
    diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml
    index e77dd970254..0043f941d17 100644
    --- a/driver-tests/shading/unshaded/pom.xml
    +++ b/driver-tests/shading/unshaded/pom.xml
    @@ -22,7 +22,7 @@
         4.0.0
     
         
    -        com.datastax.cassandra
    +        org.apache.cassandra
             cassandra-driver-tests-shading
             3.11.6-SNAPSHOT
         
    @@ -34,7 +34,7 @@
         
     
             
    -            com.datastax.cassandra
    +            org.apache.cassandra
                 cassandra-driver-core
             
     
    diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml
    index 95520299455..87119fc92f4 100644
    --- a/driver-tests/stress/pom.xml
    +++ b/driver-tests/stress/pom.xml
    @@ -22,7 +22,7 @@
         4.0.0
     
         
    -        com.datastax.cassandra
    +        org.apache.cassandra
             cassandra-driver-tests-parent
             3.11.6-SNAPSHOT
         
    @@ -34,7 +34,7 @@
         
     
             
    -            com.datastax.cassandra
    +            org.apache.cassandra
                 cassandra-driver-core
             
     
    diff --git a/faq/README.md b/faq/README.md
    index 3454669f500..a6a60c1ed9c 100644
    --- a/faq/README.md
    +++ b/faq/README.md
    @@ -176,7 +176,7 @@ and we've had many reports where the problem turned out to be in user code.
     
     See [Blobs.java] in the `driver-examples` module for some examples and explanations.
     
    -[Blobs.java]: https://github.com/datastax/java-driver/tree/3.x/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java
    +[Blobs.java]: https://github.com/apache/cassandra-java-driver/tree/3.x/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java
     
     
     ### How do I use the driver in an OSGi application?
    @@ -308,7 +308,7 @@ version is available, you may want to reach out to the maintainer of that tool t
     an update with compatibility to this driver version.
     
     
    -[Blobs.java]: https://github.com/datastax/java-driver/tree/3.11.5/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java
    +[Blobs.java]: https://github.com/apache/cassandra-java-driver/tree/3.11.5/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java
     [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304
     [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding
     [Mapper options]: ../manual/object_mapper/using/#mapper-options
    diff --git a/faq/osgi/README.md b/faq/osgi/README.md
    index 964ec0fca92..82b4b788947 100644
    --- a/faq/osgi/README.md
    +++ b/faq/osgi/README.md
    @@ -175,7 +175,7 @@ it is also normal to see the following log lines when starting the driver:
     [JAVA-1127]:https://datastax-oss.atlassian.net/browse/JAVA-1127
     [BND]:http://bnd.bndtools.org/
     [Maven bundle plugin]:https://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Maven+Bundle+Plugin+%28BND%29
    -[OSGi examples repository]:https://github.com/datastax/java-driver-examples-osgi
    +[OSGi examples repository]:https://github.com/apache/cassandra-java-driver-examples-osgi
     [without metrics]:https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics--
     [SLF4J]:http://www.slf4j.org/
     [Logback]:http://logback.qos.ch/
    diff --git a/licenses/HdrHistogram.txt b/licenses/HdrHistogram.txt
    new file mode 100644
    index 00000000000..401ccfb0ec5
    --- /dev/null
    +++ b/licenses/HdrHistogram.txt
    @@ -0,0 +1,41 @@
    +The code in this repository code was Written by Gil Tene, Michael Barker,
    +and Matt Warren, and released to the public domain, as explained at
    +http://creativecommons.org/publicdomain/zero/1.0/
    +
    +For users of this code who wish to consume it under the "BSD" license
    +rather than under the public domain or CC0 contribution text mentioned
    +above, the code found under this directory is *also* provided under the
    +following license (commonly referred to as the BSD 2-Clause License). This
    +license does not detract from the above stated release of the code into
    +the public domain, and simply represents an additional license granted by
    +the Author.
    +
    +-----------------------------------------------------------------------------
    +** Beginning of "BSD 2-Clause License" text. **
    +
    + Copyright (c) 2012, 2013, 2014, 2015, 2016 Gil Tene
    + Copyright (c) 2014 Michael Barker
    + Copyright (c) 2014 Matt Warren
    + All rights reserved.
    +
    + Redistribution and use in source and binary forms, with or without
    + modification, are permitted provided that the following conditions are met:
    +
    + 1. Redistributions of source code must retain the above copyright notice,
    +    this list of conditions and the following disclaimer.
    +
    + 2. Redistributions in binary form must reproduce the above copyright notice,
    +    this list of conditions and the following disclaimer in the documentation
    +    and/or other materials provided with the distribution.
    +
    + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
    + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
    + THE POSSIBILITY OF SUCH DAMAGE.
    diff --git a/licenses/asm.txt b/licenses/asm.txt
    new file mode 100644
    index 00000000000..c71bb7bac5d
    --- /dev/null
    +++ b/licenses/asm.txt
    @@ -0,0 +1,27 @@
    +ASM: a very small and fast Java bytecode manipulation framework
    +Copyright (c) 2000-2011 INRIA, France Telecom
    +All rights reserved.
    +
    +Redistribution and use in source and binary forms, with or without
    +modification, are permitted provided that the following conditions
    +are met:
    +1. Redistributions of source code must retain the above copyright
    +  notice, this list of conditions and the following disclaimer.
    +2. Redistributions in binary form must reproduce the above copyright
    +  notice, this list of conditions and the following disclaimer in the
    +  documentation and/or other materials provided with the distribution.
    +3. Neither the name of the copyright holders nor the names of its
    +  contributors may be used to endorse or promote products derived from
    +  this software without specific prior written permission.
    +
    +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
    +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
    +THE POSSIBILITY OF SUCH DAMAGE.
    diff --git a/licenses/jnr-posix.txt b/licenses/jnr-posix.txt
    new file mode 100644
    index 00000000000..4dc4217a306
    --- /dev/null
    +++ b/licenses/jnr-posix.txt
    @@ -0,0 +1,1076 @@
    +jnr-posix is released under a tri EPL/GPL/LGPL license. You can use it,
    +redistribute it and/or modify it under the terms of the:
    +
    +  Eclipse Public License version 2.0
    +    OR
    +  GNU General Public License version 2
    +    OR
    +  GNU Lesser General Public License version 2.1
    +
    +The complete text of the Eclipse Public License is as follows:
    +
    +  Eclipse Public License - v 2.0
    +
    +      THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
    +      PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
    +      OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
    +
    +  1. DEFINITIONS
    +
    +  "Contribution" means:
    +
    +    a) in the case of the initial Contributor, the initial content
    +       Distributed under this Agreement, and
    +
    +    b) in the case of each subsequent Contributor:
    +       i) changes to the Program, and
    +       ii) additions to the Program;
    +    where such changes and/or additions to the Program originate from
    +    and are Distributed by that particular Contributor. A Contribution
    +    "originates" from a Contributor if it was added to the Program by
    +    such Contributor itself or anyone acting on such Contributor's behalf.
    +    Contributions do not include changes or additions to the Program that
    +    are not Modified Works.
    +
    +  "Contributor" means any person or entity that Distributes the Program.
    +
    +  "Licensed Patents" mean patent claims licensable by a Contributor which
    +  are necessarily infringed by the use or sale of its Contribution alone
    +  or when combined with the Program.
    +
    +  "Program" means the Contributions Distributed in accordance with this
    +  Agreement.
    +
    +  "Recipient" means anyone who receives the Program under this Agreement
    +  or any Secondary License (as applicable), including Contributors.
    +
    +  "Derivative Works" shall mean any work, whether in Source Code or other
    +  form, that is based on (or derived from) the Program and for which the
    +  editorial revisions, annotations, elaborations, or other modifications
    +  represent, as a whole, an original work of authorship.
    +
    +  "Modified Works" shall mean any work in Source Code or other form that
    +  results from an addition to, deletion from, or modification of the
    +  contents of the Program, including, for purposes of clarity any new file
    +  in Source Code form that contains any contents of the Program. Modified
    +  Works shall not include works that contain only declarations,
    +  interfaces, types, classes, structures, or files of the Program solely
    +  in each case in order to link to, bind by name, or subclass the Program
    +  or Modified Works thereof.
    +
    +  "Distribute" means the acts of a) distributing or b) making available
    +  in any manner that enables the transfer of a copy.
    +
    +  "Source Code" means the form of a Program preferred for making
    +  modifications, including but not limited to software source code,
    +  documentation source, and configuration files.
    +
    +  "Secondary License" means either the GNU General Public License,
    +  Version 2.0, or any later versions of that license, including any
    +  exceptions or additional permissions as identified by the initial
    +  Contributor.
    +
    +  2. GRANT OF RIGHTS
    +
    +    a) Subject to the terms of this Agreement, each Contributor hereby
    +    grants Recipient a non-exclusive, worldwide, royalty-free copyright
    +    license to reproduce, prepare Derivative Works of, publicly display,
    +    publicly perform, Distribute and sublicense the Contribution of such
    +    Contributor, if any, and such Derivative Works.
    +
    +    b) Subject to the terms of this Agreement, each Contributor hereby
    +    grants Recipient a non-exclusive, worldwide, royalty-free patent
    +    license under Licensed Patents to make, use, sell, offer to sell,
    +    import and otherwise transfer the Contribution of such Contributor,
    +    if any, in Source Code or other form. This patent license shall
    +    apply to the combination of the Contribution and the Program if, at
    +    the time the Contribution is added by the Contributor, such addition
    +    of the Contribution causes such combination to be covered by the
    +    Licensed Patents. The patent license shall not apply to any other
    +    combinations which include the Contribution. No hardware per se is
    +    licensed hereunder.
    +
    +    c) Recipient understands that although each Contributor grants the
    +    licenses to its Contributions set forth herein, no assurances are
    +    provided by any Contributor that the Program does not infringe the
    +    patent or other intellectual property rights of any other entity.
    +    Each Contributor disclaims any liability to Recipient for claims
    +    brought by any other entity based on infringement of intellectual
    +    property rights or otherwise. As a condition to exercising the
    +    rights and licenses granted hereunder, each Recipient hereby
    +    assumes sole responsibility to secure any other intellectual
    +    property rights needed, if any. For example, if a third party
    +    patent license is required to allow Recipient to Distribute the
    +    Program, it is Recipient's responsibility to acquire that license
    +    before distributing the Program.
    +
    +    d) Each Contributor represents that to its knowledge it has
    +    sufficient copyright rights in its Contribution, if any, to grant
    +    the copyright license set forth in this Agreement.
    +
    +    e) Notwithstanding the terms of any Secondary License, no
    +    Contributor makes additional grants to any Recipient (other than
    +    those set forth in this Agreement) as a result of such Recipient's
    +    receipt of the Program under the terms of a Secondary License
    +    (if permitted under the terms of Section 3).
    +
    +  3. REQUIREMENTS
    +
    +  3.1 If a Contributor Distributes the Program in any form, then:
    +
    +    a) the Program must also be made available as Source Code, in
    +    accordance with section 3.2, and the Contributor must accompany
    +    the Program with a statement that the Source Code for the Program
    +    is available under this Agreement, and informs Recipients how to
    +    obtain it in a reasonable manner on or through a medium customarily
    +    used for software exchange; and
    +
    +    b) the Contributor may Distribute the Program under a license
    +    different than this Agreement, provided that such license:
    +       i) effectively disclaims on behalf of all other Contributors all
    +       warranties and conditions, express and implied, including
    +       warranties or conditions of title and non-infringement, and
    +       implied warranties or conditions of merchantability and fitness
    +       for a particular purpose;
    +
    +       ii) effectively excludes on behalf of all other Contributors all
    +       liability for damages, including direct, indirect, special,
    +       incidental and consequential damages, such as lost profits;
    +
    +       iii) does not attempt to limit or alter the recipients' rights
    +       in the Source Code under section 3.2; and
    +
    +       iv) requires any subsequent distribution of the Program by any
    +       party to be under a license that satisfies the requirements
    +       of this section 3.
    +
    +  3.2 When the Program is Distributed as Source Code:
    +
    +    a) it must be made available under this Agreement, or if the
    +    Program (i) is combined with other material in a separate file or
    +    files made available under a Secondary License, and (ii) the initial
    +    Contributor attached to the Source Code the notice described in
    +    Exhibit A of this Agreement, then the Program may be made available
    +    under the terms of such Secondary Licenses, and
    +
    +    b) a copy of this Agreement must be included with each copy of
    +    the Program.
    +
    +  3.3 Contributors may not remove or alter any copyright, patent,
    +  trademark, attribution notices, disclaimers of warranty, or limitations
    +  of liability ("notices") contained within the Program from any copy of
    +  the Program which they Distribute, provided that Contributors may add
    +  their own appropriate notices.
    +
    +  4. COMMERCIAL DISTRIBUTION
    +
    +  Commercial distributors of software may accept certain responsibilities
    +  with respect to end users, business partners and the like. While this
    +  license is intended to facilitate the commercial use of the Program,
    +  the Contributor who includes the Program in a commercial product
    +  offering should do so in a manner which does not create potential
    +  liability for other Contributors. Therefore, if a Contributor includes
    +  the Program in a commercial product offering, such Contributor
    +  ("Commercial Contributor") hereby agrees to defend and indemnify every
    +  other Contributor ("Indemnified Contributor") against any losses,
    +  damages and costs (collectively "Losses") arising from claims, lawsuits
    +  and other legal actions brought by a third party against the Indemnified
    +  Contributor to the extent caused by the acts or omissions of such
    +  Commercial Contributor in connection with its distribution of the Program
    +  in a commercial product offering. The obligations in this section do not
    +  apply to any claims or Losses relating to any actual or alleged
    +  intellectual property infringement. In order to qualify, an Indemnified
    +  Contributor must: a) promptly notify the Commercial Contributor in
    +  writing of such claim, and b) allow the Commercial Contributor to control,
    +  and cooperate with the Commercial Contributor in, the defense and any
    +  related settlement negotiations. The Indemnified Contributor may
    +  participate in any such claim at its own expense.
    +
    +  For example, a Contributor might include the Program in a commercial
    +  product offering, Product X. That Contributor is then a Commercial
    +  Contributor. If that Commercial Contributor then makes performance
    +  claims, or offers warranties related to Product X, those performance
    +  claims and warranties are such Commercial Contributor's responsibility
    +  alone. Under this section, the Commercial Contributor would have to
    +  defend claims against the other Contributors related to those performance
    +  claims and warranties, and if a court requires any other Contributor to
    +  pay any damages as a result, the Commercial Contributor must pay
    +  those damages.
    +
    +  5. NO WARRANTY
    +
    +  EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
    +  PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS"
    +  BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
    +  IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF
    +  TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
    +  PURPOSE. Each Recipient is solely responsible for determining the
    +  appropriateness of using and distributing the Program and assumes all
    +  risks associated with its exercise of rights under this Agreement,
    +  including but not limited to the risks and costs of program errors,
    +  compliance with applicable laws, damage to or loss of data, programs
    +  or equipment, and unavailability or interruption of operations.
    +
    +  6. DISCLAIMER OF LIABILITY
    +
    +  EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
    +  PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS
    +  SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    +  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
    +  PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    +  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    +  ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
    +  EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
    +  POSSIBILITY OF SUCH DAMAGES.
    +
    +  7. GENERAL
    +
    +  If any provision of this Agreement is invalid or unenforceable under
    +  applicable law, it shall not affect the validity or enforceability of
    +  the remainder of the terms of this Agreement, and without further
    +  action by the parties hereto, such provision shall be reformed to the
    +  minimum extent necessary to make such provision valid and enforceable.
    +
    +  If Recipient institutes patent litigation against any entity
    +  (including a cross-claim or counterclaim in a lawsuit) alleging that the
    +  Program itself (excluding combinations of the Program with other software
    +  or hardware) infringes such Recipient's patent(s), then such Recipient's
    +  rights granted under Section 2(b) shall terminate as of the date such
    +  litigation is filed.
    +
    +  All Recipient's rights under this Agreement shall terminate if it
    +  fails to comply with any of the material terms or conditions of this
    +  Agreement and does not cure such failure in a reasonable period of
    +  time after becoming aware of such noncompliance. If all Recipient's
    +  rights under this Agreement terminate, Recipient agrees to cease use
    +  and distribution of the Program as soon as reasonably practicable.
    +  However, Recipient's obligations under this Agreement and any licenses
    +  granted by Recipient relating to the Program shall continue and survive.
    +
    +  Everyone is permitted to copy and distribute copies of this Agreement,
    +  but in order to avoid inconsistency the Agreement is copyrighted and
    +  may only be modified in the following manner. The Agreement Steward
    +  reserves the right to publish new versions (including revisions) of
    +  this Agreement from time to time. No one other than the Agreement
    +  Steward has the right to modify this Agreement. The Eclipse Foundation
    +  is the initial Agreement Steward. The Eclipse Foundation may assign the
    +  responsibility to serve as the Agreement Steward to a suitable separate
    +  entity. Each new version of the Agreement will be given a distinguishing
    +  version number. The Program (including Contributions) may always be
    +  Distributed subject to the version of the Agreement under which it was
    +  received. In addition, after a new version of the Agreement is published,
    +  Contributor may elect to Distribute the Program (including its
    +  Contributions) under the new version.
    +
    +  Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
    +  receives no rights or licenses to the intellectual property of any
    +  Contributor under this Agreement, whether expressly, by implication,
    +  estoppel or otherwise. All rights in the Program not expressly granted
    +  under this Agreement are reserved. Nothing in this Agreement is intended
    +  to be enforceable by any entity that is not a Contributor or Recipient.
    +  No third-party beneficiary rights are created under this Agreement.
    +
    +  Exhibit A - Form of Secondary Licenses Notice
    +
    +  "This Source Code may also be made available under the following
    +  Secondary Licenses when the conditions for such availability set forth
    +  in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
    +  version(s), and exceptions or additional permissions here}."
    +
    +    Simply including a copy of this Agreement, including this Exhibit A
    +    is not sufficient to license the Source Code under Secondary Licenses.
    +
    +    If it is not possible or desirable to put the notice in a particular
    +    file, then You may include the notice in a location (such as a LICENSE
    +    file in a relevant directory) where a recipient would be likely to
    +    look for such a notice.
    +
    +    You may add additional accurate notices of copyright ownership.
    +
    +The complete text of the GNU General Public License v2 is as follows:
    +
    +          GNU GENERAL PUBLIC LICENSE
    +             Version 2, June 1991
    +
    +   Copyright (C) 1989, 1991 Free Software Foundation, Inc.
    +                         59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    +   Everyone is permitted to copy and distribute verbatim copies
    +   of this license document, but changing it is not allowed.
    +
    +            Preamble
    +
    +    The licenses for most software are designed to take away your
    +  freedom to share and change it.  By contrast, the GNU General Public
    +  License is intended to guarantee your freedom to share and change free
    +  software--to make sure the software is free for all its users.  This
    +  General Public License applies to most of the Free Software
    +  Foundation's software and to any other program whose authors commit to
    +  using it.  (Some other Free Software Foundation software is covered by
    +  the GNU Library General Public License instead.)  You can apply it to
    +  your programs, too.
    +
    +    When we speak of free software, we are referring to freedom, not
    +  price.  Our General Public Licenses are designed to make sure that you
    +  have the freedom to distribute copies of free software (and charge for
    +  this service if you wish), that you receive source code or can get it
    +  if you want it, that you can change the software or use pieces of it
    +  in new free programs; and that you know you can do these things.
    +
    +    To protect your rights, we need to make restrictions that forbid
    +  anyone to deny you these rights or to ask you to surrender the rights.
    +  These restrictions translate to certain responsibilities for you if you
    +  distribute copies of the software, or if you modify it.
    +
    +    For example, if you distribute copies of such a program, whether
    +  gratis or for a fee, you must give the recipients all the rights that
    +  you have.  You must make sure that they, too, receive or can get the
    +  source code.  And you must show them these terms so they know their
    +  rights.
    +
    +    We protect your rights with two steps: (1) copyright the software, and
    +  (2) offer you this license which gives you legal permission to copy,
    +  distribute and/or modify the software.
    +
    +    Also, for each author's protection and ours, we want to make certain
    +  that everyone understands that there is no warranty for this free
    +  software.  If the software is modified by someone else and passed on, we
    +  want its recipients to know that what they have is not the original, so
    +  that any problems introduced by others will not reflect on the original
    +  authors' reputations.
    +
    +    Finally, any free program is threatened constantly by software
    +  patents.  We wish to avoid the danger that redistributors of a free
    +  program will individually obtain patent licenses, in effect making the
    +  program proprietary.  To prevent this, we have made it clear that any
    +  patent must be licensed for everyone's free use or not licensed at all.
    +
    +    The precise terms and conditions for copying, distribution and
    +  modification follow.
    +
    +          GNU GENERAL PUBLIC LICENSE
    +     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    +
    +    0. This License applies to any program or other work which contains
    +  a notice placed by the copyright holder saying it may be distributed
    +  under the terms of this General Public License.  The "Program", below,
    +  refers to any such program or work, and a "work based on the Program"
    +  means either the Program or any derivative work under copyright law:
    +  that is to say, a work containing the Program or a portion of it,
    +  either verbatim or with modifications and/or translated into another
    +  language.  (Hereinafter, translation is included without limitation in
    +  the term "modification".)  Each licensee is addressed as "you".
    +
    +  Activities other than copying, distribution and modification are not
    +  covered by this License; they are outside its scope.  The act of
    +  running the Program is not restricted, and the output from the Program
    +  is covered only if its contents constitute a work based on the
    +  Program (independent of having been made by running the Program).
    +  Whether that is true depends on what the Program does.
    +
    +    1. You may copy and distribute verbatim copies of the Program's
    +  source code as you receive it, in any medium, provided that you
    +  conspicuously and appropriately publish on each copy an appropriate
    +  copyright notice and disclaimer of warranty; keep intact all the
    +  notices that refer to this License and to the absence of any warranty;
    +  and give any other recipients of the Program a copy of this License
    +  along with the Program.
    +
    +  You may charge a fee for the physical act of transferring a copy, and
    +  you may at your option offer warranty protection in exchange for a fee.
    +
    +    2. You may modify your copy or copies of the Program or any portion
    +  of it, thus forming a work based on the Program, and copy and
    +  distribute such modifications or work under the terms of Section 1
    +  above, provided that you also meet all of these conditions:
    +
    +      a) You must cause the modified files to carry prominent notices
    +      stating that you changed the files and the date of any change.
    +
    +      b) You must cause any work that you distribute or publish, that in
    +      whole or in part contains or is derived from the Program or any
    +      part thereof, to be licensed as a whole at no charge to all third
    +      parties under the terms of this License.
    +
    +      c) If the modified program normally reads commands interactively
    +      when run, you must cause it, when started running for such
    +      interactive use in the most ordinary way, to print or display an
    +      announcement including an appropriate copyright notice and a
    +      notice that there is no warranty (or else, saying that you provide
    +      a warranty) and that users may redistribute the program under
    +      these conditions, and telling the user how to view a copy of this
    +      License.  (Exception: if the Program itself is interactive but
    +      does not normally print such an announcement, your work based on
    +      the Program is not required to print an announcement.)
    +
    +  These requirements apply to the modified work as a whole.  If
    +  identifiable sections of that work are not derived from the Program,
    +  and can be reasonably considered independent and separate works in
    +  themselves, then this License, and its terms, do not apply to those
    +  sections when you distribute them as separate works.  But when you
    +  distribute the same sections as part of a whole which is a work based
    +  on the Program, the distribution of the whole must be on the terms of
    +  this License, whose permissions for other licensees extend to the
    +  entire whole, and thus to each and every part regardless of who wrote it.
    +
    +  Thus, it is not the intent of this section to claim rights or contest
    +  your rights to work written entirely by you; rather, the intent is to
    +  exercise the right to control the distribution of derivative or
    +  collective works based on the Program.
    +
    +  In addition, mere aggregation of another work not based on the Program
    +  with the Program (or with a work based on the Program) on a volume of
    +  a storage or distribution medium does not bring the other work under
    +  the scope of this License.
    +
    +    3. You may copy and distribute the Program (or a work based on it,
    +  under Section 2) in object code or executable form under the terms of
    +  Sections 1 and 2 above provided that you also do one of the following:
    +
    +      a) Accompany it with the complete corresponding machine-readable
    +      source code, which must be distributed under the terms of Sections
    +      1 and 2 above on a medium customarily used for software interchange; or,
    +
    +      b) Accompany it with a written offer, valid for at least three
    +      years, to give any third party, for a charge no more than your
    +      cost of physically performing source distribution, a complete
    +      machine-readable copy of the corresponding source code, to be
    +      distributed under the terms of Sections 1 and 2 above on a medium
    +      customarily used for software interchange; or,
    +
    +      c) Accompany it with the information you received as to the offer
    +      to distribute corresponding source code.  (This alternative is
    +      allowed only for noncommercial distribution and only if you
    +      received the program in object code or executable form with such
    +      an offer, in accord with Subsection b above.)
    +
    +  The source code for a work means the preferred form of the work for
    +  making modifications to it.  For an executable work, complete source
    +  code means all the source code for all modules it contains, plus any
    +  associated interface definition files, plus the scripts used to
    +  control compilation and installation of the executable.  However, as a
    +  special exception, the source code distributed need not include
    +  anything that is normally distributed (in either source or binary
    +  form) with the major components (compiler, kernel, and so on) of the
    +  operating system on which the executable runs, unless that component
    +  itself accompanies the executable.
    +
    +  If distribution of executable or object code is made by offering
    +  access to copy from a designated place, then offering equivalent
    +  access to copy the source code from the same place counts as
    +  distribution of the source code, even though third parties are not
    +  compelled to copy the source along with the object code.
    +
    +    4. You may not copy, modify, sublicense, or distribute the Program
    +  except as expressly provided under this License.  Any attempt
    +  otherwise to copy, modify, sublicense or distribute the Program is
    +  void, and will automatically terminate your rights under this License.
    +  However, parties who have received copies, or rights, from you under
    +  this License will not have their licenses terminated so long as such
    +  parties remain in full compliance.
    +
    +    5. You are not required to accept this License, since you have not
    +  signed it.  However, nothing else grants you permission to modify or
    +  distribute the Program or its derivative works.  These actions are
    +  prohibited by law if you do not accept this License.  Therefore, by
    +  modifying or distributing the Program (or any work based on the
    +  Program), you indicate your acceptance of this License to do so, and
    +  all its terms and conditions for copying, distributing or modifying
    +  the Program or works based on it.
    +
    +    6. Each time you redistribute the Program (or any work based on the
    +  Program), the recipient automatically receives a license from the
    +  original licensor to copy, distribute or modify the Program subject to
    +  these terms and conditions.  You may not impose any further
    +  restrictions on the recipients' exercise of the rights granted herein.
    +  You are not responsible for enforcing compliance by third parties to
    +  this License.
    +
    +    7. If, as a consequence of a court judgment or allegation of patent
    +  infringement or for any other reason (not limited to patent issues),
    +  conditions are imposed on you (whether by court order, agreement or
    +  otherwise) that contradict the conditions of this License, they do not
    +  excuse you from the conditions of this License.  If you cannot
    +  distribute so as to satisfy simultaneously your obligations under this
    +  License and any other pertinent obligations, then as a consequence you
    +  may not distribute the Program at all.  For example, if a patent
    +  license would not permit royalty-free redistribution of the Program by
    +  all those who receive copies directly or indirectly through you, then
    +  the only way you could satisfy both it and this License would be to
    +  refrain entirely from distribution of the Program.
    +
    +  If any portion of this section is held invalid or unenforceable under
    +  any particular circumstance, the balance of the section is intended to
    +  apply and the section as a whole is intended to apply in other
    +  circumstances.
    +
    +  It is not the purpose of this section to induce you to infringe any
    +  patents or other property right claims or to contest validity of any
    +  such claims; this section has the sole purpose of protecting the
    +  integrity of the free software distribution system, which is
    +  implemented by public license practices.  Many people have made
    +  generous contributions to the wide range of software distributed
    +  through that system in reliance on consistent application of that
    +  system; it is up to the author/donor to decide if he or she is willing
    +  to distribute software through any other system and a licensee cannot
    +  impose that choice.
    +
    +  This section is intended to make thoroughly clear what is believed to
    +  be a consequence of the rest of this License.
    +
    +    8. If the distribution and/or use of the Program is restricted in
    +  certain countries either by patents or by copyrighted interfaces, the
    +  original copyright holder who places the Program under this License
    +  may add an explicit geographical distribution limitation excluding
    +  those countries, so that distribution is permitted only in or among
    +  countries not thus excluded.  In such case, this License incorporates
    +  the limitation as if written in the body of this License.
    +
    +    9. The Free Software Foundation may publish revised and/or new versions
    +  of the General Public License from time to time.  Such new versions will
    +  be similar in spirit to the present version, but may differ in detail to
    +  address new problems or concerns.
    +
    +  Each version is given a distinguishing version number.  If the Program
    +  specifies a version number of this License which applies to it and "any
    +  later version", you have the option of following the terms and conditions
    +  either of that version or of any later version published by the Free
    +  Software Foundation.  If the Program does not specify a version number of
    +  this License, you may choose any version ever published by the Free Software
    +  Foundation.
    +
    +    10. If you wish to incorporate parts of the Program into other free
    +  programs whose distribution conditions are different, write to the author
    +  to ask for permission.  For software which is copyrighted by the Free
    +  Software Foundation, write to the Free Software Foundation; we sometimes
    +  make exceptions for this.  Our decision will be guided by the two goals
    +  of preserving the free status of all derivatives of our free software and
    +  of promoting the sharing and reuse of software generally.
    +
    +            NO WARRANTY
    +
    +    11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
    +  FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
    +  OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
    +  PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
    +  OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    +  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
    +  TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
    +  PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
    +  REPAIR OR CORRECTION.
    +
    +    12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
    +  WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
    +  REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
    +  INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
    +  OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
    +  TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
    +  YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
    +  PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
    +  POSSIBILITY OF SUCH DAMAGES.
    +
    +           END OF TERMS AND CONDITIONS
    +
    +The complete text of the GNU Lesser General Public License 2.1 is as follows:
    +
    +        GNU LESSER GENERAL PUBLIC LICENSE
    +             Version 2.1, February 1999
    +
    +   Copyright (C) 1991, 1999 Free Software Foundation, Inc.
    +       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    +   Everyone is permitted to copy and distribute verbatim copies
    +   of this license document, but changing it is not allowed.
    +
    +  [This is the first released version of the Lesser GPL.  It also counts
    +   as the successor of the GNU Library Public License, version 2, hence
    +   the version number 2.1.]
    +
    +            Preamble
    +
    +    The licenses for most software are designed to take away your
    +  freedom to share and change it.  By contrast, the GNU General Public
    +  Licenses are intended to guarantee your freedom to share and change
    +  free software--to make sure the software is free for all its users.
    +
    +    This license, the Lesser General Public License, applies to some
    +  specially designated software packages--typically libraries--of the
    +  Free Software Foundation and other authors who decide to use it.  You
    +  can use it too, but we suggest you first think carefully about whether
    +  this license or the ordinary General Public License is the better
    +  strategy to use in any particular case, based on the explanations below.
    +
    +    When we speak of free software, we are referring to freedom of use,
    +  not price.  Our General Public Licenses are designed to make sure that
    +  you have the freedom to distribute copies of free software (and charge
    +  for this service if you wish); that you receive source code or can get
    +  it if you want it; that you can change the software and use pieces of
    +  it in new free programs; and that you are informed that you can do
    +  these things.
    +
    +    To protect your rights, we need to make restrictions that forbid
    +  distributors to deny you these rights or to ask you to surrender these
    +  rights.  These restrictions translate to certain responsibilities for
    +  you if you distribute copies of the library or if you modify it.
    +
    +    For example, if you distribute copies of the library, whether gratis
    +  or for a fee, you must give the recipients all the rights that we gave
    +  you.  You must make sure that they, too, receive or can get the source
    +  code.  If you link other code with the library, you must provide
    +  complete object files to the recipients, so that they can relink them
    +  with the library after making changes to the library and recompiling
    +  it.  And you must show them these terms so they know their rights.
    +
    +    We protect your rights with a two-step method: (1) we copyright the
    +  library, and (2) we offer you this license, which gives you legal
    +  permission to copy, distribute and/or modify the library.
    +
    +    To protect each distributor, we want to make it very clear that
    +  there is no warranty for the free library.  Also, if the library is
    +  modified by someone else and passed on, the recipients should know
    +  that what they have is not the original version, so that the original
    +  author's reputation will not be affected by problems that might be
    +  introduced by others.
    +
    +    Finally, software patents pose a constant threat to the existence of
    +  any free program.  We wish to make sure that a company cannot
    +  effectively restrict the users of a free program by obtaining a
    +  restrictive license from a patent holder.  Therefore, we insist that
    +  any patent license obtained for a version of the library must be
    +  consistent with the full freedom of use specified in this license.
    +
    +    Most GNU software, including some libraries, is covered by the
    +  ordinary GNU General Public License.  This license, the GNU Lesser
    +  General Public License, applies to certain designated libraries, and
    +  is quite different from the ordinary General Public License.  We use
    +  this license for certain libraries in order to permit linking those
    +  libraries into non-free programs.
    +
    +    When a program is linked with a library, whether statically or using
    +  a shared library, the combination of the two is legally speaking a
    +  combined work, a derivative of the original library.  The ordinary
    +  General Public License therefore permits such linking only if the
    +  entire combination fits its criteria of freedom.  The Lesser General
    +  Public License permits more lax criteria for linking other code with
    +  the library.
    +
    +    We call this license the "Lesser" General Public License because it
    +  does Less to protect the user's freedom than the ordinary General
    +  Public License.  It also provides other free software developers Less
    +  of an advantage over competing non-free programs.  These disadvantages
    +  are the reason we use the ordinary General Public License for many
    +  libraries.  However, the Lesser license provides advantages in certain
    +  special circumstances.
    +
    +    For example, on rare occasions, there may be a special need to
    +  encourage the widest possible use of a certain library, so that it becomes
    +  a de-facto standard.  To achieve this, non-free programs must be
    +  allowed to use the library.  A more frequent case is that a free
    +  library does the same job as widely used non-free libraries.  In this
    +  case, there is little to gain by limiting the free library to free
    +  software only, so we use the Lesser General Public License.
    +
    +    In other cases, permission to use a particular library in non-free
    +  programs enables a greater number of people to use a large body of
    +  free software.  For example, permission to use the GNU C Library in
    +  non-free programs enables many more people to use the whole GNU
    +  operating system, as well as its variant, the GNU/Linux operating
    +  system.
    +
    +    Although the Lesser General Public License is Less protective of the
    +  users' freedom, it does ensure that the user of a program that is
    +  linked with the Library has the freedom and the wherewithal to run
    +  that program using a modified version of the Library.
    +
    +    The precise terms and conditions for copying, distribution and
    +  modification follow.  Pay close attention to the difference between a
    +  "work based on the library" and a "work that uses the library".  The
    +  former contains code derived from the library, whereas the latter must
    +  be combined with the library in order to run.
    +
    +        GNU LESSER GENERAL PUBLIC LICENSE
    +     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    +
    +    0. This License Agreement applies to any software library or other
    +  program which contains a notice placed by the copyright holder or
    +  other authorized party saying it may be distributed under the terms of
    +  this Lesser General Public License (also called "this License").
    +  Each licensee is addressed as "you".
    +
    +    A "library" means a collection of software functions and/or data
    +  prepared so as to be conveniently linked with application programs
    +  (which use some of those functions and data) to form executables.
    +
    +    The "Library", below, refers to any such software library or work
    +  which has been distributed under these terms.  A "work based on the
    +  Library" means either the Library or any derivative work under
    +  copyright law: that is to say, a work containing the Library or a
    +  portion of it, either verbatim or with modifications and/or translated
    +  straightforwardly into another language.  (Hereinafter, translation is
    +  included without limitation in the term "modification".)
    +
    +    "Source code" for a work means the preferred form of the work for
    +  making modifications to it.  For a library, complete source code means
    +  all the source code for all modules it contains, plus any associated
    +  interface definition files, plus the scripts used to control compilation
    +  and installation of the library.
    +
    +    Activities other than copying, distribution and modification are not
    +  covered by this License; they are outside its scope.  The act of
    +  running a program using the Library is not restricted, and output from
    +  such a program is covered only if its contents constitute a work based
    +  on the Library (independent of the use of the Library in a tool for
    +  writing it).  Whether that is true depends on what the Library does
    +  and what the program that uses the Library does.
    +
    +    1. You may copy and distribute verbatim copies of the Library's
    +  complete source code as you receive it, in any medium, provided that
    +  you conspicuously and appropriately publish on each copy an
    +  appropriate copyright notice and disclaimer of warranty; keep intact
    +  all the notices that refer to this License and to the absence of any
    +  warranty; and distribute a copy of this License along with the
    +  Library.
    +
    +    You may charge a fee for the physical act of transferring a copy,
    +  and you may at your option offer warranty protection in exchange for a
    +  fee.
    +
    +    2. You may modify your copy or copies of the Library or any portion
    +  of it, thus forming a work based on the Library, and copy and
    +  distribute such modifications or work under the terms of Section 1
    +  above, provided that you also meet all of these conditions:
    +
    +      a) The modified work must itself be a software library.
    +
    +      b) You must cause the files modified to carry prominent notices
    +      stating that you changed the files and the date of any change.
    +
    +      c) You must cause the whole of the work to be licensed at no
    +      charge to all third parties under the terms of this License.
    +
    +      d) If a facility in the modified Library refers to a function or a
    +      table of data to be supplied by an application program that uses
    +      the facility, other than as an argument passed when the facility
    +      is invoked, then you must make a good faith effort to ensure that,
    +      in the event an application does not supply such function or
    +      table, the facility still operates, and performs whatever part of
    +      its purpose remains meaningful.
    +
    +      (For example, a function in a library to compute square roots has
    +      a purpose that is entirely well-defined independent of the
    +      application.  Therefore, Subsection 2d requires that any
    +      application-supplied function or table used by this function must
    +      be optional: if the application does not supply it, the square
    +      root function must still compute square roots.)
    +
    +  These requirements apply to the modified work as a whole.  If
    +  identifiable sections of that work are not derived from the Library,
    +  and can be reasonably considered independent and separate works in
    +  themselves, then this License, and its terms, do not apply to those
    +  sections when you distribute them as separate works.  But when you
    +  distribute the same sections as part of a whole which is a work based
    +  on the Library, the distribution of the whole must be on the terms of
    +  this License, whose permissions for other licensees extend to the
    +  entire whole, and thus to each and every part regardless of who wrote
    +  it.
    +
    +  Thus, it is not the intent of this section to claim rights or contest
    +  your rights to work written entirely by you; rather, the intent is to
    +  exercise the right to control the distribution of derivative or
    +  collective works based on the Library.
    +
    +  In addition, mere aggregation of another work not based on the Library
    +  with the Library (or with a work based on the Library) on a volume of
    +  a storage or distribution medium does not bring the other work under
    +  the scope of this License.
    +
    +    3. You may opt to apply the terms of the ordinary GNU General Public
    +  License instead of this License to a given copy of the Library.  To do
    +  this, you must alter all the notices that refer to this License, so
    +  that they refer to the ordinary GNU General Public License, version 2,
    +  instead of to this License.  (If a newer version than version 2 of the
    +  ordinary GNU General Public License has appeared, then you can specify
    +  that version instead if you wish.)  Do not make any other change in
    +  these notices.
    +
    +    Once this change is made in a given copy, it is irreversible for
    +  that copy, so the ordinary GNU General Public License applies to all
    +  subsequent copies and derivative works made from that copy.
    +
    +    This option is useful when you wish to copy part of the code of
    +  the Library into a program that is not a library.
    +
    +    4. You may copy and distribute the Library (or a portion or
    +  derivative of it, under Section 2) in object code or executable form
    +  under the terms of Sections 1 and 2 above provided that you accompany
    +  it with the complete corresponding machine-readable source code, which
    +  must be distributed under the terms of Sections 1 and 2 above on a
    +  medium customarily used for software interchange.
    +
    +    If distribution of object code is made by offering access to copy
    +  from a designated place, then offering equivalent access to copy the
    +  source code from the same place satisfies the requirement to
    +  distribute the source code, even though third parties are not
    +  compelled to copy the source along with the object code.
    +
    +    5. A program that contains no derivative of any portion of the
    +  Library, but is designed to work with the Library by being compiled or
    +  linked with it, is called a "work that uses the Library".  Such a
    +  work, in isolation, is not a derivative work of the Library, and
    +  therefore falls outside the scope of this License.
    +
    +    However, linking a "work that uses the Library" with the Library
    +  creates an executable that is a derivative of the Library (because it
    +  contains portions of the Library), rather than a "work that uses the
    +  library".  The executable is therefore covered by this License.
    +  Section 6 states terms for distribution of such executables.
    +
    +    When a "work that uses the Library" uses material from a header file
    +  that is part of the Library, the object code for the work may be a
    +  derivative work of the Library even though the source code is not.
    +  Whether this is true is especially significant if the work can be
    +  linked without the Library, or if the work is itself a library.  The
    +  threshold for this to be true is not precisely defined by law.
    +
    +    If such an object file uses only numerical parameters, data
    +  structure layouts and accessors, and small macros and small inline
    +  functions (ten lines or less in length), then the use of the object
    +  file is unrestricted, regardless of whether it is legally a derivative
    +  work.  (Executables containing this object code plus portions of the
    +  Library will still fall under Section 6.)
    +
    +    Otherwise, if the work is a derivative of the Library, you may
    +  distribute the object code for the work under the terms of Section 6.
    +  Any executables containing that work also fall under Section 6,
    +  whether or not they are linked directly with the Library itself.
    +
    +    6. As an exception to the Sections above, you may also combine or
    +  link a "work that uses the Library" with the Library to produce a
    +  work containing portions of the Library, and distribute that work
    +  under terms of your choice, provided that the terms permit
    +  modification of the work for the customer's own use and reverse
    +  engineering for debugging such modifications.
    +
    +    You must give prominent notice with each copy of the work that the
    +  Library is used in it and that the Library and its use are covered by
    +  this License.  You must supply a copy of this License.  If the work
    +  during execution displays copyright notices, you must include the
    +  copyright notice for the Library among them, as well as a reference
    +  directing the user to the copy of this License.  Also, you must do one
    +  of these things:
    +
    +      a) Accompany the work with the complete corresponding
    +      machine-readable source code for the Library including whatever
    +      changes were used in the work (which must be distributed under
    +      Sections 1 and 2 above); and, if the work is an executable linked
    +      with the Library, with the complete machine-readable "work that
    +      uses the Library", as object code and/or source code, so that the
    +      user can modify the Library and then relink to produce a modified
    +      executable containing the modified Library.  (It is understood
    +      that the user who changes the contents of definitions files in the
    +      Library will not necessarily be able to recompile the application
    +      to use the modified definitions.)
    +
    +      b) Use a suitable shared library mechanism for linking with the
    +      Library.  A suitable mechanism is one that (1) uses at run time a
    +      copy of the library already present on the user's computer system,
    +      rather than copying library functions into the executable, and (2)
    +      will operate properly with a modified version of the library, if
    +      the user installs one, as long as the modified version is
    +      interface-compatible with the version that the work was made with.
    +
    +      c) Accompany the work with a written offer, valid for at
    +      least three years, to give the same user the materials
    +      specified in Subsection 6a, above, for a charge no more
    +      than the cost of performing this distribution.
    +
    +      d) If distribution of the work is made by offering access to copy
    +      from a designated place, offer equivalent access to copy the above
    +      specified materials from the same place.
    +
    +      e) Verify that the user has already received a copy of these
    +      materials or that you have already sent this user a copy.
    +
    +    For an executable, the required form of the "work that uses the
    +  Library" must include any data and utility programs needed for
    +  reproducing the executable from it.  However, as a special exception,
    +  the materials to be distributed need not include anything that is
    +  normally distributed (in either source or binary form) with the major
    +  components (compiler, kernel, and so on) of the operating system on
    +  which the executable runs, unless that component itself accompanies
    +  the executable.
    +
    +    It may happen that this requirement contradicts the license
    +  restrictions of other proprietary libraries that do not normally
    +  accompany the operating system.  Such a contradiction means you cannot
    +  use both them and the Library together in an executable that you
    +  distribute.
    +
    +    7. You may place library facilities that are a work based on the
    +  Library side-by-side in a single library together with other library
    +  facilities not covered by this License, and distribute such a combined
    +  library, provided that the separate distribution of the work based on
    +  the Library and of the other library facilities is otherwise
    +  permitted, and provided that you do these two things:
    +
    +      a) Accompany the combined library with a copy of the same work
    +      based on the Library, uncombined with any other library
    +      facilities.  This must be distributed under the terms of the
    +      Sections above.
    +
    +      b) Give prominent notice with the combined library of the fact
    +      that part of it is a work based on the Library, and explaining
    +      where to find the accompanying uncombined form of the same work.
    +
    +    8. You may not copy, modify, sublicense, link with, or distribute
    +  the Library except as expressly provided under this License.  Any
    +  attempt otherwise to copy, modify, sublicense, link with, or
    +  distribute the Library is void, and will automatically terminate your
    +  rights under this License.  However, parties who have received copies,
    +  or rights, from you under this License will not have their licenses
    +  terminated so long as such parties remain in full compliance.
    +
    +    9. You are not required to accept this License, since you have not
    +  signed it.  However, nothing else grants you permission to modify or
    +  distribute the Library or its derivative works.  These actions are
    +  prohibited by law if you do not accept this License.  Therefore, by
    +  modifying or distributing the Library (or any work based on the
    +  Library), you indicate your acceptance of this License to do so, and
    +  all its terms and conditions for copying, distributing or modifying
    +  the Library or works based on it.
    +
    +    10. Each time you redistribute the Library (or any work based on the
    +  Library), the recipient automatically receives a license from the
    +  original licensor to copy, distribute, link with or modify the Library
    +  subject to these terms and conditions.  You may not impose any further
    +  restrictions on the recipients' exercise of the rights granted herein.
    +  You are not responsible for enforcing compliance by third parties with
    +  this License.
    +
    +    11. If, as a consequence of a court judgment or allegation of patent
    +  infringement or for any other reason (not limited to patent issues),
    +  conditions are imposed on you (whether by court order, agreement or
    +  otherwise) that contradict the conditions of this License, they do not
    +  excuse you from the conditions of this License.  If you cannot
    +  distribute so as to satisfy simultaneously your obligations under this
    +  License and any other pertinent obligations, then as a consequence you
    +  may not distribute the Library at all.  For example, if a patent
    +  license would not permit royalty-free redistribution of the Library by
    +  all those who receive copies directly or indirectly through you, then
    +  the only way you could satisfy both it and this License would be to
    +  refrain entirely from distribution of the Library.
    +
    +  If any portion of this section is held invalid or unenforceable under any
    +  particular circumstance, the balance of the section is intended to apply,
    +  and the section as a whole is intended to apply in other circumstances.
    +
    +  It is not the purpose of this section to induce you to infringe any
    +  patents or other property right claims or to contest validity of any
    +  such claims; this section has the sole purpose of protecting the
    +  integrity of the free software distribution system which is
    +  implemented by public license practices.  Many people have made
    +  generous contributions to the wide range of software distributed
    +  through that system in reliance on consistent application of that
    +  system; it is up to the author/donor to decide if he or she is willing
    +  to distribute software through any other system and a licensee cannot
    +  impose that choice.
    +
    +  This section is intended to make thoroughly clear what is believed to
    +  be a consequence of the rest of this License.
    +
    +    12. If the distribution and/or use of the Library is restricted in
    +  certain countries either by patents or by copyrighted interfaces, the
    +  original copyright holder who places the Library under this License may add
    +  an explicit geographical distribution limitation excluding those countries,
    +  so that distribution is permitted only in or among countries not thus
    +  excluded.  In such case, this License incorporates the limitation as if
    +  written in the body of this License.
    +
    +    13. The Free Software Foundation may publish revised and/or new
    +  versions of the Lesser General Public License from time to time.
    +  Such new versions will be similar in spirit to the present version,
    +  but may differ in detail to address new problems or concerns.
    +
    +  Each version is given a distinguishing version number.  If the Library
    +  specifies a version number of this License which applies to it and
    +  "any later version", you have the option of following the terms and
    +  conditions either of that version or of any later version published by
    +  the Free Software Foundation.  If the Library does not specify a
    +  license version number, you may choose any version ever published by
    +  the Free Software Foundation.
    +
    +    14. If you wish to incorporate parts of the Library into other free
    +  programs whose distribution conditions are incompatible with these,
    +  write to the author to ask for permission.  For software which is
    +  copyrighted by the Free Software Foundation, write to the Free
    +  Software Foundation; we sometimes make exceptions for this.  Our
    +  decision will be guided by the two goals of preserving the free status
    +  of all derivatives of our free software and of promoting the sharing
    +  and reuse of software generally.
    +
    +            NO WARRANTY
    +
    +    15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
    +  WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
    +  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
    +  OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
    +  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
    +  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    +  PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
    +  LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
    +  THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
    +
    +    16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
    +  WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
    +  AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
    +  FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
    +  CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
    +  LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
    +  RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
    +  FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
    +  SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
    +  DAMAGES.
    +
    +           END OF TERMS AND CONDITIONS
    +
    +             How to Apply These Terms to Your New Libraries
    +
    +    If you develop a new library, and you want it to be of the greatest
    +  possible use to the public, we recommend making it free software that
    +  everyone can redistribute and change.  You can do so by permitting
    +  redistribution under these terms (or, alternatively, under the terms of the
    +  ordinary General Public License).
    +
    +    To apply these terms, attach the following notices to the library.  It is
    +  safest to attach them to the start of each source file to most effectively
    +  convey the exclusion of warranty; and each file should have at least the
    +  "copyright" line and a pointer to where the full notice is found.
    +
    +      
    +      Copyright (C)   
    +
    +      This library is free software; you can redistribute it and/or
    +      modify it under the terms of the GNU Lesser General Public
    +      License as published by the Free Software Foundation; either
    +      version 2.1 of the License, or (at your option) any later version.
    +
    +      This library is distributed in the hope that it will be useful,
    +      but WITHOUT ANY WARRANTY; without even the implied warranty of
    +      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    +      Lesser General Public License for more details.
    +
    +      You should have received a copy of the GNU Lesser General Public
    +      License along with this library; if not, write to the Free Software
    +      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    +
    +  Also add information on how to contact you by electronic and paper mail.
    +
    +  You should also get your employer (if you work as a programmer) or your
    +  school, if any, to sign a "copyright disclaimer" for the library, if
    +  necessary.  Here is a sample; alter the names:
    +
    +    Yoyodyne, Inc., hereby disclaims all copyright interest in the
    +    library `Frob' (a library for tweaking knobs) written by James Random Hacker.
    +
    +    , 1 April 1990
    +    Ty Coon, President of Vice
    +
    +  That's all there is to it!
    diff --git a/licenses/jnr-x86asm.txt b/licenses/jnr-x86asm.txt
    new file mode 100644
    index 00000000000..c9583db05fd
    --- /dev/null
    +++ b/licenses/jnr-x86asm.txt
    @@ -0,0 +1,24 @@
    +
    + Copyright (C) 2010 Wayne Meissner
    + Copyright (c) 2008-2009, Petr Kobalicek 
    +
    + Permission is hereby granted, free of charge, to any person
    + obtaining a copy of this software and associated documentation
    + files (the "Software"), to deal in the Software without
    + restriction, including without limitation the rights to use,
    + copy, modify, merge, publish, distribute, sublicense, and/or sell
    + copies of the Software, and to permit persons to whom the
    + Software is furnished to do so, subject to the following
    + conditions:
    +
    + The above copyright notice and this permission notice shall be
    + included in all copies or substantial portions of the Software.
    +
    + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
    + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
    + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
    + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    + OTHER DEALINGS IN THE SOFTWARE.
    diff --git a/licenses/slf4j-api.txt b/licenses/slf4j-api.txt
    new file mode 100644
    index 00000000000..bb09a9ad4ec
    --- /dev/null
    +++ b/licenses/slf4j-api.txt
    @@ -0,0 +1,21 @@
    +Copyright (c) 2004-2023 QOS.ch
    +All rights reserved.
    +
    +Permission is hereby granted, free  of charge, to any person obtaining
    +a  copy  of this  software  and  associated  documentation files  (the
    +"Software"), to  deal in  the Software without  restriction, including
    +without limitation  the rights to  use, copy, modify,  merge, publish,
    +distribute,  sublicense, and/or sell  copies of  the Software,  and to
    +permit persons to whom the Software  is furnished to do so, subject to
    +the following conditions:
    +
    +The  above  copyright  notice  and  this permission  notice  shall  be
    +included in all copies or substantial portions of the Software.
    +
    +THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
    +EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
    +MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
    +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
    +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    +OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
    +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    diff --git a/manual/README.md b/manual/README.md
    index 99d3f292e75..e2498c402a2 100644
    --- a/manual/README.md
    +++ b/manual/README.md
    @@ -307,7 +307,7 @@ Besides explicit work with queries and rows, you can also use
     If you're reading this from the [generated HTML documentation on
     github.io](http://datastax.github.io/java-driver/), use the "Contents"
     menu on the left hand side to navigate sub-sections. If you're [browsing the source files on
    -github.com](https://github.com/datastax/java-driver/tree/3.x/manual),
    +github.com](https://github.com/apache/cassandra-java-driver/tree/3.x/manual),
     simply navigate to each sub-directory.
     
     [Cluster]: https://docs.datastax.com/en/drivers/java/3.11/com/datastax/driver/core/Cluster.html
    diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md
    index 5c934ec2720..45fd0f7c64f 100644
    --- a/manual/custom_codecs/extras/README.md
    +++ b/manual/custom_codecs/extras/README.md
    @@ -27,7 +27,7 @@ The module is published as a separate Maven artifact:
     
     ```xml
     
    -  com.datastax.cassandra
    +  org.apache.cassandra
       cassandra-driver-extras
       3.11.5
     
    diff --git a/manual/metrics/README.md b/manual/metrics/README.md
    index 9c563d3fd9a..7d60bec3c78 100644
    --- a/manual/metrics/README.md
    +++ b/manual/metrics/README.md
    @@ -55,7 +55,7 @@ To do this in a maven project:
     
     ```xml
     
    -  com.datastax.cassandra
    +  org.apache.cassandra
       cassandra-driver-core
       3.11.5
       
    diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md
    index 93433622fca..308e3195ac6 100644
    --- a/manual/object_mapper/README.md
    +++ b/manual/object_mapper/README.md
    @@ -28,7 +28,7 @@ The mapper is published as a separate Maven artifact:
     
     ```xml
     
    -  com.datastax.cassandra
    +  org.apache.cassandra
       cassandra-driver-mapping
       3.11.5
     
    diff --git a/manual/osgi/README.md b/manual/osgi/README.md
    index b37507fee73..eb0c83e70da 100644
    --- a/manual/osgi/README.md
    +++ b/manual/osgi/README.md
    @@ -31,7 +31,7 @@ the following Maven artifacts are actually valid OSGi bundles:
     We have complete examples demonstrating usage of the driver in an OSGi
     environment; please refer to our [OSGi examples repository].
     
    -[OSGi examples repository]:https://github.com/datastax/java-driver-examples-osgi
    +[OSGi examples repository]:https://github.com/apache/cassandra-java-driver-examples-osgi
     
     ## Troubleshooting OSGi applications
     
    diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md
    index 26f3ec6a637..0e21639ea7d 100644
    --- a/manual/shaded_jar/README.md
    +++ b/manual/shaded_jar/README.md
    @@ -29,7 +29,7 @@ package name:
     
     ```xml
     
    -  com.datastax.cassandra
    +  org.apache.cassandra
       cassandra-driver-core
       3.11.5
       shaded
    @@ -53,7 +53,7 @@ non-shaded JAR:
     
     ```xml
     
    -  com.datastax.cassandra
    +  org.apache.cassandra
       cassandra-driver-core
       3.11.5
       shaded
    @@ -69,12 +69,12 @@ non-shaded JAR:
       
     
     
    -  com.datastax.cassandra
    +  org.apache.cassandra
       cassandra-driver-mapping
       3.11.5
       
         
    -      com.datastax.cassandra
    +      org.apache.cassandra
           cassandra-driver-core
         
       
    diff --git a/pom.xml b/pom.xml
    index c967b64af36..e3ed58ddc32 100644
    --- a/pom.xml
    +++ b/pom.xml
    @@ -25,7 +25,7 @@
             apache
             23
         
    -    com.datastax.cassandra
    +    org.apache.cassandra
         cassandra-driver-parent
         3.11.6-SNAPSHOT
         pom
    @@ -35,7 +35,7 @@
             (CQL3) and Cassandra's binary protocol.
         
     
    -    https://github.com/datastax/java-driver
    +    https://github.com/apache/cassandra-java-driver
     
         2012
     
    @@ -45,6 +45,7 @@
             driver-extras
             driver-examples
             driver-tests
    +        driver-dist-source
             driver-dist
         
     
    @@ -101,33 +102,33 @@
             
     
                 
    -                com.datastax.cassandra
    +                org.apache.cassandra
                     cassandra-driver-core
                     ${project.parent.version}
                 
     
                 
    -                com.datastax.cassandra
    +                org.apache.cassandra
                     cassandra-driver-core
                     ${project.parent.version}
                     shaded
                 
     
                 
    -                com.datastax.cassandra
    +                org.apache.cassandra
                     cassandra-driver-core
                     ${project.parent.version}
                     test-jar
                 
     
                 
    -                com.datastax.cassandra
    +                org.apache.cassandra
                     cassandra-driver-mapping
                     ${project.parent.version}
                 
     
                 
    -                com.datastax.cassandra
    +                org.apache.cassandra
                     cassandra-driver-extras
                     ${project.parent.version}
                 
    @@ -514,77 +515,6 @@
                         
                     
     
    -                
    -                    maven-javadoc-plugin
    -                    2.10.4
    -                    true
    -                    
    -                        true
    -                        false
    -                        ${javadoc.opts}
    -                        
    -                            https://docs.oracle.com/javase/8/docs/api/
    -                            https://google.github.io/guava/releases/19.0/api/docs/
    -                            http://netty.io/4.0/api/
    -                            http://www.joda.org/joda-time/apidocs/
    -                            http://fasterxml.github.io/jackson-core/javadoc/2.8/
    -                            http://fasterxml.github.io/jackson-databind/javadoc/2.7/
    -                            https://javaee-spec.java.net/nonav/javadocs/
    -                        
    -                        
    -                        
    -                            
    -                                org.xerial.snappy
    -                                snappy-java
    -                                ${snappy.version}
    -                            
    -                            
    -                                org.lz4
    -                                lz4-java
    -                                ${lz4.version}
    -                            
    -                            
    -                                org.hdrhistogram
    -                                HdrHistogram
    -                                ${hdr.version}
    -                            
    -                            
    -                                com.fasterxml.jackson.core
    -                                jackson-core
    -                                ${jackson.version}
    -                            
    -                            
    -                                com.fasterxml.jackson.core
    -                                jackson-annotations
    -                                ${jackson.version}
    -                            
    -                            
    -                                com.fasterxml.jackson.core
    -                                jackson-databind
    -                                ${jackson-databind.version}
    -                            
    -                            
    -                                joda-time
    -                                joda-time
    -                                ${joda.version}
    -                            
    -                            
    -                                javax.json
    -                                javax.json-api
    -                                ${jsr353-api.version}
    -                            
    -                        
    -                    
    -                    
    -                        
    -                            attach-javadocs
    -                            
    -                                jar
    -                            
    -                        
    -                    
    -                
    -
                     
                         maven-jar-plugin
                         3.0.2
    @@ -1053,17 +983,6 @@ limitations under the License.
                                 
                             
                         
    -                    
    -                        maven-javadoc-plugin
    -                        
    -                            
    -                                attach-javadocs
    -                                
    -                                    jar
    -                                
    -                            
    -                        
    -                    
                         
                             maven-gpg-plugin
                             
    @@ -1176,13 +1095,6 @@ limitations under the License.
             
         
     
    -    
    -        
    -            ossrh
    -            https://oss.sonatype.org/service/local/staging/deploy/maven2/
    -        
    -    
    -
         
             
                 Apache 2
    @@ -1195,7 +1107,7 @@ limitations under the License.
         
             scm:git:git@github.com:datastax/java-driver.git
             scm:git:git@github.com:datastax/java-driver.git
    -        https://github.com/datastax/java-driver
    +        https://github.com/apache/cassandra-java-driver
             HEAD
         
     
    diff --git a/upgrade_guide/README.md b/upgrade_guide/README.md
    index 3fdcfbf4ca8..acec88fefdd 100644
    --- a/upgrade_guide/README.md
    +++ b/upgrade_guide/README.md
    @@ -71,7 +71,7 @@ versions of the Java Driver.
         
     [JAVA-1752]:https://datastax-oss.atlassian.net/browse/JAVA-1752
     [JAVA-1376]:https://datastax-oss.atlassian.net/browse/JAVA-1376
    -[online example]:https://github.com/datastax/java-driver/blob/3.x/driver-examples/src/main/java/com/datastax/driver/examples/retry/DowngradingRetry.java
    +[online example]:https://github.com/apache/cassandra-java-driver/blob/3.x/driver-examples/src/main/java/com/datastax/driver/examples/retry/DowngradingRetry.java
     
     2.  The `TokenAwarePolicy` now has a new constructor that takes a `ReplicaOrdering` 
         argument, see [JAVA-1448]. 
    
    From 794b39d68e59a3eecad1f3e1555a97960ecc24e5 Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Thu, 21 Nov 2024 15:30:15 -0600
    Subject: [PATCH 188/211] Update DRIVER_NAME string to match what's used in 4.x
    
    patch by Bret McGuire; reviewed by Bret McGuire, Andy Tolbert for CASSJAVA-58
    ---
     .../src/main/java/com/datastax/driver/core/Requests.java        | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/driver-core/src/main/java/com/datastax/driver/core/Requests.java b/driver-core/src/main/java/com/datastax/driver/core/Requests.java
    index cf28068d534..04833ce159c 100644
    --- a/driver-core/src/main/java/com/datastax/driver/core/Requests.java
    +++ b/driver-core/src/main/java/com/datastax/driver/core/Requests.java
    @@ -38,7 +38,7 @@ static class Startup extends Message.Request {
         private static final String CQL_VERSION = "3.0.0";
         private static final String DRIVER_VERSION_OPTION = "DRIVER_VERSION";
         private static final String DRIVER_NAME_OPTION = "DRIVER_NAME";
    -    private static final String DRIVER_NAME = "Java Driver";
    +    private static final String DRIVER_NAME = "Apache Cassandra Java Driver";
     
         static final String COMPRESSION_OPTION = "COMPRESSION";
         static final String NO_COMPACT_OPTION = "NO_COMPACT";
    
    From 657e470b2f22c22c140d1a5c26b3af34b3a74f59 Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Wed, 18 Dec 2024 10:36:51 -0600
    Subject: [PATCH 189/211] Update changelog and docs for 3.12.0 release
    
    patch by Bret McGuire; reviewed by Bret McGuire, Andy Tolbert
    reference: https://github.com/apache/cassandra-java-driver/pull/1995
    ---
     README.md                             | 10 +++++-----
     changelog/README.md                   |  4 ++++
     faq/README.md                         |  2 +-
     manual/compression/README.md          |  2 +-
     manual/custom_codecs/extras/README.md |  2 +-
     manual/metrics/README.md              |  2 +-
     manual/object_mapper/README.md        |  2 +-
     manual/shaded_jar/README.md           |  6 +++---
     8 files changed, 17 insertions(+), 13 deletions(-)
    
    diff --git a/README.md b/README.md
    index 207c646e3fb..624b4c9eaae 100644
    --- a/README.md
    +++ b/README.md
    @@ -7,7 +7,7 @@ for the development version and that some features described here might
     not yet have been released. You can find the documentation for the latest
     version through the [Java Driver
     docs](http://docs.datastax.com/en/developer/java-driver/3.11/index.html) or via the release tags,
    -[e.g. 3.11.5](https://github.com/apache/cassandra-java-driver/tree/3.11.5).*
    +[e.g. 3.12.0](https://github.com/apache/cassandra-java-driver/tree/3.12.0).*
     
     A modern, [feature-rich](manual/) and highly tunable Java client
     library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol 
    @@ -62,7 +62,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java Driver][dse-dri
     
       org.apache.cassandra
       cassandra-driver-core
    -  3.11.5
    +  3.12.0
     
     ```
     
    @@ -72,7 +72,7 @@ Note that the object mapper is published as a separate artifact:
     
       org.apache.cassandra
       cassandra-driver-mapping
    -  3.11.5
    +  3.12.0
     
     ```
     
    @@ -82,7 +82,7 @@ The 'extras' module is also published as a separate artifact:
     
       org.apache.cassandra
       cassandra-driver-extras
    -  3.11.5/version>
    +  3.12.0/version>
     
     ```
     
    @@ -96,7 +96,7 @@ is available for download.
     
     ## Compatibility
     
    -The Java client driver 3.11.5 ([branch 3.x](https://github.com/apache/cassandra-java-driver/tree/3.x)) is compatible with Apache
    +The Java client driver 3.12.0 ([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).
     
    diff --git a/changelog/README.md b/changelog/README.md
    index 1b8feae01bd..c85e4e31d4c 100644
    --- a/changelog/README.md
    +++ b/changelog/README.md
    @@ -24,6 +24,10 @@ under the License.
       3.x versions get published.
     -->
     
    +## 3.12.0
    +- [improvement] CASSANDRA-18971: Switch all archs to netty-tcnative-boringssl-static
    +- [improvement] CASSJAVA-58: Update 3.x DRIVER_NAME to match 4.x Java driver
    +
     ## 3.11.5
     - [improvement] JAVA-3114: Shade io.dropwizard.metrics:metrics-core in shaded driver
     - [improvement] JAVA-3115: SchemaChangeListener#onKeyspaceChanged can fire when keyspace has not changed if using SimpleStrategy replication
    diff --git a/faq/README.md b/faq/README.md
    index a6a60c1ed9c..567d73d2354 100644
    --- a/faq/README.md
    +++ b/faq/README.md
    @@ -308,7 +308,7 @@ version is available, you may want to reach out to the maintainer of that tool t
     an update with compatibility to this driver version.
     
     
    -[Blobs.java]: https://github.com/apache/cassandra-java-driver/tree/3.11.5/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java
    +[Blobs.java]: https://github.com/apache/cassandra-java-driver/tree/3.12.0/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java
     [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304
     [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding
     [Mapper options]: ../manual/object_mapper/using/#mapper-options
    diff --git a/manual/compression/README.md b/manual/compression/README.md
    index fb4b49bffd8..190cbb1e8d5 100644
    --- a/manual/compression/README.md
    +++ b/manual/compression/README.md
    @@ -107,4 +107,4 @@ cluster = Cluster.builder()
         .build();
     ```
     
    -[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.11.5/cassandra-driver-parent-3.11.5.pom
    +[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.12.0/cassandra-driver-parent-3.12.0.pom
    diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md
    index 45fd0f7c64f..aaabb1a1ba7 100644
    --- a/manual/custom_codecs/extras/README.md
    +++ b/manual/custom_codecs/extras/README.md
    @@ -29,7 +29,7 @@ The module is published as a separate Maven artifact:
     
       org.apache.cassandra
       cassandra-driver-extras
    -  3.11.5
    +  3.12.0
     
     ```
     
    diff --git a/manual/metrics/README.md b/manual/metrics/README.md
    index 7d60bec3c78..50993ba6478 100644
    --- a/manual/metrics/README.md
    +++ b/manual/metrics/README.md
    @@ -57,7 +57,7 @@ To do this in a maven project:
     
       org.apache.cassandra
       cassandra-driver-core
    -  3.11.5
    +  3.12.0
       
         
           io.dropwizard.metrics
    diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md
    index 308e3195ac6..31f04b29aab 100644
    --- a/manual/object_mapper/README.md
    +++ b/manual/object_mapper/README.md
    @@ -30,7 +30,7 @@ The mapper is published as a separate Maven artifact:
     
       org.apache.cassandra
       cassandra-driver-mapping
    -  3.11.5
    +  3.12.0
     
     ```
     
    diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md
    index 0e21639ea7d..1b531e520af 100644
    --- a/manual/shaded_jar/README.md
    +++ b/manual/shaded_jar/README.md
    @@ -31,7 +31,7 @@ package name:
     
       org.apache.cassandra
       cassandra-driver-core
    -  3.11.5
    +  3.12.0
       shaded
       
    @@ -55,7 +55,7 @@ non-shaded JAR:
     
       org.apache.cassandra
       cassandra-driver-core
    -  3.11.5
    +  3.12.0
       shaded
       
         
    @@ -71,7 +71,7 @@ non-shaded JAR:
     
       org.apache.cassandra
       cassandra-driver-mapping
    -  3.11.5
    +  3.12.0
       
         
           org.apache.cassandra
    
    From 4914cf785b2724c595724bd6796265976f348307 Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Tue, 12 Nov 2024 00:18:37 -0600
    Subject: [PATCH 190/211] CASSJAVA-57 Filter comment lines out when reading in
     comparison files
    
    patch by Bret McGuire; reviewed by Bret McGuire for CASSJAVA-57
    ---
     .../driver/core/ExportAsStringTest.java       | 23 +++++++++++++------
     1 file changed, 16 insertions(+), 7 deletions(-)
    
    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 40ae98d003c..934bfba791f 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
    @@ -23,12 +23,12 @@
     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.ByteStreams;
     import com.google.common.io.Closer;
    -import java.io.ByteArrayOutputStream;
    +import java.io.BufferedReader;
     import java.io.IOException;
     import java.io.InputStream;
    -import java.io.PrintStream;
    +import java.io.InputStreamReader;
    +import java.io.StringWriter;
     import java.util.Map;
     import org.slf4j.Logger;
     import org.slf4j.LoggerFactory;
    @@ -248,10 +248,19 @@ private String getExpectedCqlString() {
                       + ")")
               .isNotNull();
           closer.register(is);
    -      ByteArrayOutputStream baos = new ByteArrayOutputStream();
    -      PrintStream ps = new PrintStream(baos);
    -      ByteStreams.copy(is, ps);
    -      return baos.toString().trim();
    +
    +      BufferedReader in = new BufferedReader(new InputStreamReader(is));
    +      StringWriter out = new StringWriter();
    +
    +      String line;
    +      while ((line = in.readLine()) != null) {
    +
    +        String trimmedLine = line.trim();
    +        if (trimmedLine.startsWith("/*") || trimmedLine.startsWith("*")) continue;
    +        out.write(line);
    +        out.write(System.getProperty("line.separator"));
    +      }
    +      return out.toString().trim();
         } catch (IOException e) {
           logger.warn("Failure to read {}", resourceName, e);
           fail("Unable to read " + resourceName + " is it defined?");
    
    From a81a7889bc26a2e0bdf5b6f25cd62ea3238ad25a Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Thu, 19 Dec 2024 11:25:17 -0600
    Subject: [PATCH 191/211] ninja-fix Test fix for changes in CASSJAVA-58
    
    ---
     .../test/java/com/datastax/driver/core/StartupOptionTest.java   | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/driver-core/src/test/java/com/datastax/driver/core/StartupOptionTest.java b/driver-core/src/test/java/com/datastax/driver/core/StartupOptionTest.java
    index 0fc8b97eb12..b4a294d36de 100644
    --- a/driver-core/src/test/java/com/datastax/driver/core/StartupOptionTest.java
    +++ b/driver-core/src/test/java/com/datastax/driver/core/StartupOptionTest.java
    @@ -40,7 +40,7 @@ public void should_send_driver_name_and_version() {
     
         for (Row row : result) {
           assertThat(row.getString("driver_version")).isEqualTo(Cluster.getDriverVersion());
    -      assertThat(row.getString("driver_name")).isEqualTo("Java Driver");
    +      assertThat(row.getString("driver_name")).isEqualTo("Apache Cassandra Java Driver");
         }
       }
     }
    
    From 5f72a124181e4802c106d920068ea30f5c6b8c52 Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Thu, 19 Dec 2024 16:19:24 -0600
    Subject: [PATCH 192/211] CASSJAVA-66 Update POM to use new doclint param added
     in Maven 3.0
    
    patch by Bret McGuire; reviewed by Bret McGuire for CASSJAVA-66
    ---
     pom.xml | 10 +++++++---
     1 file changed, 7 insertions(+), 3 deletions(-)
    
    diff --git a/pom.xml b/pom.xml
    index e3ed58ddc32..56a9511c3d3 100644
    --- a/pom.xml
    +++ b/pom.xml
    @@ -1015,9 +1015,6 @@ limitations under the License.
                 
                     [1.8,)
                 
    -            
    -                -Xdoclint:none
    -            
                 
                     
                         
    @@ -1034,6 +1031,13 @@ limitations under the License.
                                 
                             
                         
    +		    
    +		      org.apache.maven.plugins
    +		      maven-javadoc-plugin
    +		      
    +			none
    +		      
    +		    
                     
                 
             
    
    From 330bef1a25427df030823789616fb5d8e190d308 Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Thu, 2 Jan 2025 15:21:51 -0600
    Subject: [PATCH 193/211] CASSJAVA-67 Issues with Maven "release:prepare" after
     ASF donation
    
    patch by Alexandre Dutra; reviewed by Bret McGuire for CASSJAVA-67
    ---
     driver-dist/pom.xml  | 26 ++++++++++++--------------
     driver-tests/pom.xml | 20 +++++++++++---------
     2 files changed, 23 insertions(+), 23 deletions(-)
    
    diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml
    index 8a87430ea9f..38ae94ff4ce 100644
    --- a/driver-dist/pom.xml
    +++ b/driver-dist/pom.xml
    @@ -34,30 +34,23 @@
     
         
         
    -
             
                 org.apache.cassandra
                 cassandra-driver-core
             
    -
             
                 org.apache.cassandra
                 cassandra-driver-mapping
             
    -
             
                 org.apache.cassandra
                 cassandra-driver-extras
             
    -
         
     
         
    -
             apache-cassandra-java-driver-${project.version}
    -
             
    -
                 
                     maven-jar-plugin
                     
    @@ -68,34 +61,34 @@
                         
                     
                 
    -
                 
                     maven-source-plugin
                     
                         true
                     
                 
    -
                 
                     maven-install-plugin
                     
                         true
                     
                 
    -
                 
                     maven-deploy-plugin
                     
                         true
                     
                 
    -
    +            
    +                maven-gpg-plugin
    +                
    +                    true
    +                
    +            
             
    -
         
     
         
    -
             
                 release
                 
    @@ -145,10 +138,15 @@
                             
                           
                         
    +                    
    +                        maven-gpg-plugin
    +                        
    +                            false
    +                        
    +                    
                     
                 
             
    -
         
     
     
    diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml
    index 87dead1decc..2da94ab91f2 100644
    --- a/driver-tests/pom.xml
    +++ b/driver-tests/pom.xml
    @@ -39,9 +39,7 @@
         
     
         
    -
             
    -
                 
                     org.codehaus.mojo
                     clirr-maven-plugin
    @@ -49,21 +47,18 @@
                         true
                     
                 
    -
                 
                     maven-source-plugin
                     
                         true
                     
                 
    -
                 
                     maven-gpg-plugin
                     
                         true
                     
                 
    -
                 
                     maven-install-plugin
                     
    @@ -77,13 +72,21 @@
                         true
                     
                 
    -
    +            
    +                net.nicoulaj.maven.plugins
    +                checksum-maven-plugin
    +                1.7
    +                
    +                    
    +                        source-release-checksum
    +                        none
    +                    
    +                
    +            
             
    -
         
     
         
    -
             
                 release
                 
    @@ -98,7 +101,6 @@
                     
                 
             
    -
         
     
     
    
    From 4d0a6d24583335ec1b0165d4056bb998deba84aa Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Thu, 2 Jan 2025 15:57:40 -0600
    Subject: [PATCH 194/211] [maven-release-plugin] prepare release 3.12.0
    
    ---
     driver-core/pom.xml                   | 2 +-
     driver-dist-source/pom.xml            | 2 +-
     driver-dist/pom.xml                   | 2 +-
     driver-examples/pom.xml               | 2 +-
     driver-extras/pom.xml                 | 2 +-
     driver-mapping/pom.xml                | 2 +-
     driver-tests/osgi/common/pom.xml      | 2 +-
     driver-tests/osgi/pom.xml             | 2 +-
     driver-tests/osgi/shaded/pom.xml      | 2 +-
     driver-tests/osgi/unshaded/pom.xml    | 2 +-
     driver-tests/pom.xml                  | 2 +-
     driver-tests/shading/pom.xml          | 2 +-
     driver-tests/shading/shaded/pom.xml   | 2 +-
     driver-tests/shading/unshaded/pom.xml | 2 +-
     driver-tests/stress/pom.xml           | 2 +-
     pom.xml                               | 4 ++--
     16 files changed, 17 insertions(+), 17 deletions(-)
    
    diff --git a/driver-core/pom.xml b/driver-core/pom.xml
    index 56a0f7458ce..3a613e09a3c 100644
    --- a/driver-core/pom.xml
    +++ b/driver-core/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-core
    diff --git a/driver-dist-source/pom.xml b/driver-dist-source/pom.xml
    index 0e77ca6530a..72010c520bf 100644
    --- a/driver-dist-source/pom.xml
    +++ b/driver-dist-source/pom.xml
    @@ -23,7 +23,7 @@
       
         org.apache.cassandra
         cassandra-driver-parent
    -    3.11.6-SNAPSHOT
    +    3.12.0
       
       java-driver-distribution-source
       pom
    diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml
    index 38ae94ff4ce..81cda0e1d9a 100644
    --- a/driver-dist/pom.xml
    +++ b/driver-dist/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-dist
    diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml
    index 9d58e408f0a..9220d6eaaee 100644
    --- a/driver-examples/pom.xml
    +++ b/driver-examples/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-examples
    diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml
    index 3800e34dcf1..ec240a99aab 100644
    --- a/driver-extras/pom.xml
    +++ b/driver-extras/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-extras
    diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml
    index 4585544a03c..330ee331aa5 100644
    --- a/driver-mapping/pom.xml
    +++ b/driver-mapping/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-mapping
    diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml
    index e82cf4c5117..493a2b772d8 100644
    --- a/driver-tests/osgi/common/pom.xml
    +++ b/driver-tests/osgi/common/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         jar
    diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml
    index fb597bb890f..c7b7229871c 100644
    --- a/driver-tests/osgi/pom.xml
    +++ b/driver-tests/osgi/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         pom
    diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml
    index 99f8120cbe3..b4e26459475 100644
    --- a/driver-tests/osgi/shaded/pom.xml
    +++ b/driver-tests/osgi/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-osgi-shaded
    diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml
    index 9653b51f9a1..3d7ccac4197 100644
    --- a/driver-tests/osgi/unshaded/pom.xml
    +++ b/driver-tests/osgi/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-osgi-unshaded
    diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml
    index 2da94ab91f2..2c29d9729c4 100644
    --- a/driver-tests/pom.xml
    +++ b/driver-tests/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-parent
    diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml
    index 1c4ebe74037..88d4ba15c3c 100644
    --- a/driver-tests/shading/pom.xml
    +++ b/driver-tests/shading/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         pom
    diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml
    index 7661694569e..702916d13bb 100644
    --- a/driver-tests/shading/shaded/pom.xml
    +++ b/driver-tests/shading/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-shading-shaded
    diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml
    index 0043f941d17..b629bb04984 100644
    --- a/driver-tests/shading/unshaded/pom.xml
    +++ b/driver-tests/shading/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-shading-unshaded
    diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml
    index 87119fc92f4..fb1da6f31f5 100644
    --- a/driver-tests/stress/pom.xml
    +++ b/driver-tests/stress/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-stress
    diff --git a/pom.xml b/pom.xml
    index 56a9511c3d3..3ba5b787fa5 100644
    --- a/pom.xml
    +++ b/pom.xml
    @@ -27,7 +27,7 @@
         
         org.apache.cassandra
         cassandra-driver-parent
    -    3.11.6-SNAPSHOT
    +    3.12.0
         pom
         Java Driver for Apache Cassandra
         
    @@ -1112,7 +1112,7 @@ limitations under the License.
             scm:git:git@github.com:datastax/java-driver.git
             scm:git:git@github.com:datastax/java-driver.git
             https://github.com/apache/cassandra-java-driver
    -        HEAD
    +        3.12.0
         
     
         
    
    From dd437b2a973dbccb415a612c4c997659edffd638 Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Thu, 2 Jan 2025 15:57:43 -0600
    Subject: [PATCH 195/211] [maven-release-plugin] prepare for next development
     iteration
    
    ---
     driver-core/pom.xml                   | 2 +-
     driver-dist-source/pom.xml            | 2 +-
     driver-dist/pom.xml                   | 2 +-
     driver-examples/pom.xml               | 2 +-
     driver-extras/pom.xml                 | 2 +-
     driver-mapping/pom.xml                | 2 +-
     driver-tests/osgi/common/pom.xml      | 2 +-
     driver-tests/osgi/pom.xml             | 2 +-
     driver-tests/osgi/shaded/pom.xml      | 2 +-
     driver-tests/osgi/unshaded/pom.xml    | 2 +-
     driver-tests/pom.xml                  | 2 +-
     driver-tests/shading/pom.xml          | 2 +-
     driver-tests/shading/shaded/pom.xml   | 2 +-
     driver-tests/shading/unshaded/pom.xml | 2 +-
     driver-tests/stress/pom.xml           | 2 +-
     pom.xml                               | 4 ++--
     16 files changed, 17 insertions(+), 17 deletions(-)
    
    diff --git a/driver-core/pom.xml b/driver-core/pom.xml
    index 3a613e09a3c..879b86d5793 100644
    --- a/driver-core/pom.xml
    +++ b/driver-core/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-core
    diff --git a/driver-dist-source/pom.xml b/driver-dist-source/pom.xml
    index 72010c520bf..feac0c98631 100644
    --- a/driver-dist-source/pom.xml
    +++ b/driver-dist-source/pom.xml
    @@ -23,7 +23,7 @@
       
         org.apache.cassandra
         cassandra-driver-parent
    -    3.12.0
    +    3.12.1-SNAPSHOT
       
       java-driver-distribution-source
       pom
    diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml
    index 81cda0e1d9a..31fd02732a5 100644
    --- a/driver-dist/pom.xml
    +++ b/driver-dist/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-dist
    diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml
    index 9220d6eaaee..f9858b7c68f 100644
    --- a/driver-examples/pom.xml
    +++ b/driver-examples/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-examples
    diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml
    index ec240a99aab..b8502771c7b 100644
    --- a/driver-extras/pom.xml
    +++ b/driver-extras/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-extras
    diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml
    index 330ee331aa5..cfdb6459ee5 100644
    --- a/driver-mapping/pom.xml
    +++ b/driver-mapping/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-mapping
    diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml
    index 493a2b772d8..372e20c2204 100644
    --- a/driver-tests/osgi/common/pom.xml
    +++ b/driver-tests/osgi/common/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         jar
    diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml
    index c7b7229871c..a30d770167b 100644
    --- a/driver-tests/osgi/pom.xml
    +++ b/driver-tests/osgi/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         pom
    diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml
    index b4e26459475..bececdd68f0 100644
    --- a/driver-tests/osgi/shaded/pom.xml
    +++ b/driver-tests/osgi/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-tests-osgi-shaded
    diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml
    index 3d7ccac4197..d4383b4676a 100644
    --- a/driver-tests/osgi/unshaded/pom.xml
    +++ b/driver-tests/osgi/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-tests-osgi-unshaded
    diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml
    index 2c29d9729c4..6cfa6b85204 100644
    --- a/driver-tests/pom.xml
    +++ b/driver-tests/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-tests-parent
    diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml
    index 88d4ba15c3c..b3960e41d26 100644
    --- a/driver-tests/shading/pom.xml
    +++ b/driver-tests/shading/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         pom
    diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml
    index 702916d13bb..25dbdc4a0d3 100644
    --- a/driver-tests/shading/shaded/pom.xml
    +++ b/driver-tests/shading/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-tests-shading-shaded
    diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml
    index b629bb04984..512318e8875 100644
    --- a/driver-tests/shading/unshaded/pom.xml
    +++ b/driver-tests/shading/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-tests-shading-unshaded
    diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml
    index fb1da6f31f5..1c80f7b23a8 100644
    --- a/driver-tests/stress/pom.xml
    +++ b/driver-tests/stress/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-tests-stress
    diff --git a/pom.xml b/pom.xml
    index 3ba5b787fa5..767b32ff779 100644
    --- a/pom.xml
    +++ b/pom.xml
    @@ -27,7 +27,7 @@
         
         org.apache.cassandra
         cassandra-driver-parent
    -    3.12.0
    +    3.12.1-SNAPSHOT
         pom
         Java Driver for Apache Cassandra
         
    @@ -1112,7 +1112,7 @@ limitations under the License.
             scm:git:git@github.com:datastax/java-driver.git
             scm:git:git@github.com:datastax/java-driver.git
             https://github.com/apache/cassandra-java-driver
    -        3.12.0
    +        HEAD
         
     
         
    
    From 41dafd90a40a30b17a55e894122f30b5ab99ddd9 Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Wed, 8 Jan 2025 15:09:11 -0600
    Subject: [PATCH 196/211] Revert "[maven-release-plugin] prepare for next
     development iteration"
    
    This reverts commit dd437b2a973dbccb415a612c4c997659edffd638.
    ---
     driver-core/pom.xml                   | 2 +-
     driver-dist-source/pom.xml            | 2 +-
     driver-dist/pom.xml                   | 2 +-
     driver-examples/pom.xml               | 2 +-
     driver-extras/pom.xml                 | 2 +-
     driver-mapping/pom.xml                | 2 +-
     driver-tests/osgi/common/pom.xml      | 2 +-
     driver-tests/osgi/pom.xml             | 2 +-
     driver-tests/osgi/shaded/pom.xml      | 2 +-
     driver-tests/osgi/unshaded/pom.xml    | 2 +-
     driver-tests/pom.xml                  | 2 +-
     driver-tests/shading/pom.xml          | 2 +-
     driver-tests/shading/shaded/pom.xml   | 2 +-
     driver-tests/shading/unshaded/pom.xml | 2 +-
     driver-tests/stress/pom.xml           | 2 +-
     pom.xml                               | 4 ++--
     16 files changed, 17 insertions(+), 17 deletions(-)
    
    diff --git a/driver-core/pom.xml b/driver-core/pom.xml
    index 879b86d5793..3a613e09a3c 100644
    --- a/driver-core/pom.xml
    +++ b/driver-core/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-core
    diff --git a/driver-dist-source/pom.xml b/driver-dist-source/pom.xml
    index feac0c98631..72010c520bf 100644
    --- a/driver-dist-source/pom.xml
    +++ b/driver-dist-source/pom.xml
    @@ -23,7 +23,7 @@
       
         org.apache.cassandra
         cassandra-driver-parent
    -    3.12.1-SNAPSHOT
    +    3.12.0
       
       java-driver-distribution-source
       pom
    diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml
    index 31fd02732a5..81cda0e1d9a 100644
    --- a/driver-dist/pom.xml
    +++ b/driver-dist/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-dist
    diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml
    index f9858b7c68f..9220d6eaaee 100644
    --- a/driver-examples/pom.xml
    +++ b/driver-examples/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-examples
    diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml
    index b8502771c7b..ec240a99aab 100644
    --- a/driver-extras/pom.xml
    +++ b/driver-extras/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-extras
    diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml
    index cfdb6459ee5..330ee331aa5 100644
    --- a/driver-mapping/pom.xml
    +++ b/driver-mapping/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-mapping
    diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml
    index 372e20c2204..493a2b772d8 100644
    --- a/driver-tests/osgi/common/pom.xml
    +++ b/driver-tests/osgi/common/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.1-SNAPSHOT
    +        3.12.0
         
     
         jar
    diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml
    index a30d770167b..c7b7229871c 100644
    --- a/driver-tests/osgi/pom.xml
    +++ b/driver-tests/osgi/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.1-SNAPSHOT
    +        3.12.0
         
     
         pom
    diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml
    index bececdd68f0..b4e26459475 100644
    --- a/driver-tests/osgi/shaded/pom.xml
    +++ b/driver-tests/osgi/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.1-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-osgi-shaded
    diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml
    index d4383b4676a..3d7ccac4197 100644
    --- a/driver-tests/osgi/unshaded/pom.xml
    +++ b/driver-tests/osgi/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.1-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-osgi-unshaded
    diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml
    index 6cfa6b85204..2c29d9729c4 100644
    --- a/driver-tests/pom.xml
    +++ b/driver-tests/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-parent
    diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml
    index b3960e41d26..88d4ba15c3c 100644
    --- a/driver-tests/shading/pom.xml
    +++ b/driver-tests/shading/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.1-SNAPSHOT
    +        3.12.0
         
     
         pom
    diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml
    index 25dbdc4a0d3..702916d13bb 100644
    --- a/driver-tests/shading/shaded/pom.xml
    +++ b/driver-tests/shading/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.12.1-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-shading-shaded
    diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml
    index 512318e8875..b629bb04984 100644
    --- a/driver-tests/shading/unshaded/pom.xml
    +++ b/driver-tests/shading/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.12.1-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-shading-unshaded
    diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml
    index 1c80f7b23a8..fb1da6f31f5 100644
    --- a/driver-tests/stress/pom.xml
    +++ b/driver-tests/stress/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.1-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-stress
    diff --git a/pom.xml b/pom.xml
    index 767b32ff779..3ba5b787fa5 100644
    --- a/pom.xml
    +++ b/pom.xml
    @@ -27,7 +27,7 @@
         
         org.apache.cassandra
         cassandra-driver-parent
    -    3.12.1-SNAPSHOT
    +    3.12.0
         pom
         Java Driver for Apache Cassandra
         
    @@ -1112,7 +1112,7 @@ limitations under the License.
             scm:git:git@github.com:datastax/java-driver.git
             scm:git:git@github.com:datastax/java-driver.git
             https://github.com/apache/cassandra-java-driver
    -        HEAD
    +        3.12.0
         
     
         
    
    From 1c796b4d5d78f11de8e60b8a985c4eea6789e2ef Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Wed, 8 Jan 2025 15:09:27 -0600
    Subject: [PATCH 197/211] Revert "[maven-release-plugin] prepare release
     3.12.0"
    
    This reverts commit 4d0a6d24583335ec1b0165d4056bb998deba84aa.
    ---
     driver-core/pom.xml                   | 2 +-
     driver-dist-source/pom.xml            | 2 +-
     driver-dist/pom.xml                   | 2 +-
     driver-examples/pom.xml               | 2 +-
     driver-extras/pom.xml                 | 2 +-
     driver-mapping/pom.xml                | 2 +-
     driver-tests/osgi/common/pom.xml      | 2 +-
     driver-tests/osgi/pom.xml             | 2 +-
     driver-tests/osgi/shaded/pom.xml      | 2 +-
     driver-tests/osgi/unshaded/pom.xml    | 2 +-
     driver-tests/pom.xml                  | 2 +-
     driver-tests/shading/pom.xml          | 2 +-
     driver-tests/shading/shaded/pom.xml   | 2 +-
     driver-tests/shading/unshaded/pom.xml | 2 +-
     driver-tests/stress/pom.xml           | 2 +-
     pom.xml                               | 4 ++--
     16 files changed, 17 insertions(+), 17 deletions(-)
    
    diff --git a/driver-core/pom.xml b/driver-core/pom.xml
    index 3a613e09a3c..56a0f7458ce 100644
    --- a/driver-core/pom.xml
    +++ b/driver-core/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.11.6-SNAPSHOT
         
     
         cassandra-driver-core
    diff --git a/driver-dist-source/pom.xml b/driver-dist-source/pom.xml
    index 72010c520bf..0e77ca6530a 100644
    --- a/driver-dist-source/pom.xml
    +++ b/driver-dist-source/pom.xml
    @@ -23,7 +23,7 @@
       
         org.apache.cassandra
         cassandra-driver-parent
    -    3.12.0
    +    3.11.6-SNAPSHOT
       
       java-driver-distribution-source
       pom
    diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml
    index 81cda0e1d9a..38ae94ff4ce 100644
    --- a/driver-dist/pom.xml
    +++ b/driver-dist/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.11.6-SNAPSHOT
         
     
         cassandra-driver-dist
    diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml
    index 9220d6eaaee..9d58e408f0a 100644
    --- a/driver-examples/pom.xml
    +++ b/driver-examples/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.11.6-SNAPSHOT
         
     
         cassandra-driver-examples
    diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml
    index ec240a99aab..3800e34dcf1 100644
    --- a/driver-extras/pom.xml
    +++ b/driver-extras/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.11.6-SNAPSHOT
         
     
         cassandra-driver-extras
    diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml
    index 330ee331aa5..4585544a03c 100644
    --- a/driver-mapping/pom.xml
    +++ b/driver-mapping/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.11.6-SNAPSHOT
         
     
         cassandra-driver-mapping
    diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml
    index 493a2b772d8..e82cf4c5117 100644
    --- a/driver-tests/osgi/common/pom.xml
    +++ b/driver-tests/osgi/common/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.0
    +        3.11.6-SNAPSHOT
         
     
         jar
    diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml
    index c7b7229871c..fb597bb890f 100644
    --- a/driver-tests/osgi/pom.xml
    +++ b/driver-tests/osgi/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.0
    +        3.11.6-SNAPSHOT
         
     
         pom
    diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml
    index b4e26459475..99f8120cbe3 100644
    --- a/driver-tests/osgi/shaded/pom.xml
    +++ b/driver-tests/osgi/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.0
    +        3.11.6-SNAPSHOT
         
     
         cassandra-driver-tests-osgi-shaded
    diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml
    index 3d7ccac4197..9653b51f9a1 100644
    --- a/driver-tests/osgi/unshaded/pom.xml
    +++ b/driver-tests/osgi/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.0
    +        3.11.6-SNAPSHOT
         
     
         cassandra-driver-tests-osgi-unshaded
    diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml
    index 2c29d9729c4..2da94ab91f2 100644
    --- a/driver-tests/pom.xml
    +++ b/driver-tests/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.11.6-SNAPSHOT
         
     
         cassandra-driver-tests-parent
    diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml
    index 88d4ba15c3c..1c4ebe74037 100644
    --- a/driver-tests/shading/pom.xml
    +++ b/driver-tests/shading/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.0
    +        3.11.6-SNAPSHOT
         
     
         pom
    diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml
    index 702916d13bb..7661694569e 100644
    --- a/driver-tests/shading/shaded/pom.xml
    +++ b/driver-tests/shading/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.12.0
    +        3.11.6-SNAPSHOT
         
     
         cassandra-driver-tests-shading-shaded
    diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml
    index b629bb04984..0043f941d17 100644
    --- a/driver-tests/shading/unshaded/pom.xml
    +++ b/driver-tests/shading/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.12.0
    +        3.11.6-SNAPSHOT
         
     
         cassandra-driver-tests-shading-unshaded
    diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml
    index fb1da6f31f5..87119fc92f4 100644
    --- a/driver-tests/stress/pom.xml
    +++ b/driver-tests/stress/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.0
    +        3.11.6-SNAPSHOT
         
     
         cassandra-driver-tests-stress
    diff --git a/pom.xml b/pom.xml
    index 3ba5b787fa5..56a9511c3d3 100644
    --- a/pom.xml
    +++ b/pom.xml
    @@ -27,7 +27,7 @@
         
         org.apache.cassandra
         cassandra-driver-parent
    -    3.12.0
    +    3.11.6-SNAPSHOT
         pom
         Java Driver for Apache Cassandra
         
    @@ -1112,7 +1112,7 @@ limitations under the License.
             scm:git:git@github.com:datastax/java-driver.git
             scm:git:git@github.com:datastax/java-driver.git
             https://github.com/apache/cassandra-java-driver
    -        3.12.0
    +        HEAD
         
     
         
    
    From 1a96d27130ea43ed5762c4f7b7cc182eb24f8952 Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Wed, 8 Jan 2025 15:20:31 -0600
    Subject: [PATCH 198/211] [maven-release-plugin] prepare release 3.12.0
    
    ---
     driver-core/pom.xml                   | 2 +-
     driver-dist-source/pom.xml            | 2 +-
     driver-dist/pom.xml                   | 2 +-
     driver-examples/pom.xml               | 2 +-
     driver-extras/pom.xml                 | 2 +-
     driver-mapping/pom.xml                | 2 +-
     driver-tests/osgi/common/pom.xml      | 2 +-
     driver-tests/osgi/pom.xml             | 2 +-
     driver-tests/osgi/shaded/pom.xml      | 2 +-
     driver-tests/osgi/unshaded/pom.xml    | 2 +-
     driver-tests/pom.xml                  | 2 +-
     driver-tests/shading/pom.xml          | 2 +-
     driver-tests/shading/shaded/pom.xml   | 2 +-
     driver-tests/shading/unshaded/pom.xml | 2 +-
     driver-tests/stress/pom.xml           | 2 +-
     pom.xml                               | 4 ++--
     16 files changed, 17 insertions(+), 17 deletions(-)
    
    diff --git a/driver-core/pom.xml b/driver-core/pom.xml
    index 56a0f7458ce..3a613e09a3c 100644
    --- a/driver-core/pom.xml
    +++ b/driver-core/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-core
    diff --git a/driver-dist-source/pom.xml b/driver-dist-source/pom.xml
    index 0e77ca6530a..72010c520bf 100644
    --- a/driver-dist-source/pom.xml
    +++ b/driver-dist-source/pom.xml
    @@ -23,7 +23,7 @@
       
         org.apache.cassandra
         cassandra-driver-parent
    -    3.11.6-SNAPSHOT
    +    3.12.0
       
       java-driver-distribution-source
       pom
    diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml
    index 38ae94ff4ce..81cda0e1d9a 100644
    --- a/driver-dist/pom.xml
    +++ b/driver-dist/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-dist
    diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml
    index 9d58e408f0a..9220d6eaaee 100644
    --- a/driver-examples/pom.xml
    +++ b/driver-examples/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-examples
    diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml
    index 3800e34dcf1..ec240a99aab 100644
    --- a/driver-extras/pom.xml
    +++ b/driver-extras/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-extras
    diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml
    index 4585544a03c..330ee331aa5 100644
    --- a/driver-mapping/pom.xml
    +++ b/driver-mapping/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-mapping
    diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml
    index e82cf4c5117..493a2b772d8 100644
    --- a/driver-tests/osgi/common/pom.xml
    +++ b/driver-tests/osgi/common/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         jar
    diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml
    index fb597bb890f..c7b7229871c 100644
    --- a/driver-tests/osgi/pom.xml
    +++ b/driver-tests/osgi/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         pom
    diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml
    index 99f8120cbe3..b4e26459475 100644
    --- a/driver-tests/osgi/shaded/pom.xml
    +++ b/driver-tests/osgi/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-osgi-shaded
    diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml
    index 9653b51f9a1..3d7ccac4197 100644
    --- a/driver-tests/osgi/unshaded/pom.xml
    +++ b/driver-tests/osgi/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-osgi-unshaded
    diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml
    index 2da94ab91f2..2c29d9729c4 100644
    --- a/driver-tests/pom.xml
    +++ b/driver-tests/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-parent
    diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml
    index 1c4ebe74037..88d4ba15c3c 100644
    --- a/driver-tests/shading/pom.xml
    +++ b/driver-tests/shading/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         pom
    diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml
    index 7661694569e..702916d13bb 100644
    --- a/driver-tests/shading/shaded/pom.xml
    +++ b/driver-tests/shading/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-shading-shaded
    diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml
    index 0043f941d17..b629bb04984 100644
    --- a/driver-tests/shading/unshaded/pom.xml
    +++ b/driver-tests/shading/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-shading-unshaded
    diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml
    index 87119fc92f4..fb1da6f31f5 100644
    --- a/driver-tests/stress/pom.xml
    +++ b/driver-tests/stress/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.11.6-SNAPSHOT
    +        3.12.0
         
     
         cassandra-driver-tests-stress
    diff --git a/pom.xml b/pom.xml
    index 56a9511c3d3..3ba5b787fa5 100644
    --- a/pom.xml
    +++ b/pom.xml
    @@ -27,7 +27,7 @@
         
         org.apache.cassandra
         cassandra-driver-parent
    -    3.11.6-SNAPSHOT
    +    3.12.0
         pom
         Java Driver for Apache Cassandra
         
    @@ -1112,7 +1112,7 @@ limitations under the License.
             scm:git:git@github.com:datastax/java-driver.git
             scm:git:git@github.com:datastax/java-driver.git
             https://github.com/apache/cassandra-java-driver
    -        HEAD
    +        3.12.0
         
     
         
    
    From 392820fc2ff458be129d7da0fd928f308b09b15b Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Wed, 8 Jan 2025 15:20:33 -0600
    Subject: [PATCH 199/211] [maven-release-plugin] prepare for next development
     iteration
    
    ---
     driver-core/pom.xml                   | 2 +-
     driver-dist-source/pom.xml            | 2 +-
     driver-dist/pom.xml                   | 2 +-
     driver-examples/pom.xml               | 2 +-
     driver-extras/pom.xml                 | 2 +-
     driver-mapping/pom.xml                | 2 +-
     driver-tests/osgi/common/pom.xml      | 2 +-
     driver-tests/osgi/pom.xml             | 2 +-
     driver-tests/osgi/shaded/pom.xml      | 2 +-
     driver-tests/osgi/unshaded/pom.xml    | 2 +-
     driver-tests/pom.xml                  | 2 +-
     driver-tests/shading/pom.xml          | 2 +-
     driver-tests/shading/shaded/pom.xml   | 2 +-
     driver-tests/shading/unshaded/pom.xml | 2 +-
     driver-tests/stress/pom.xml           | 2 +-
     pom.xml                               | 4 ++--
     16 files changed, 17 insertions(+), 17 deletions(-)
    
    diff --git a/driver-core/pom.xml b/driver-core/pom.xml
    index 3a613e09a3c..879b86d5793 100644
    --- a/driver-core/pom.xml
    +++ b/driver-core/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-core
    diff --git a/driver-dist-source/pom.xml b/driver-dist-source/pom.xml
    index 72010c520bf..feac0c98631 100644
    --- a/driver-dist-source/pom.xml
    +++ b/driver-dist-source/pom.xml
    @@ -23,7 +23,7 @@
       
         org.apache.cassandra
         cassandra-driver-parent
    -    3.12.0
    +    3.12.1-SNAPSHOT
       
       java-driver-distribution-source
       pom
    diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml
    index 81cda0e1d9a..31fd02732a5 100644
    --- a/driver-dist/pom.xml
    +++ b/driver-dist/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-dist
    diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml
    index 9220d6eaaee..f9858b7c68f 100644
    --- a/driver-examples/pom.xml
    +++ b/driver-examples/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-examples
    diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml
    index ec240a99aab..b8502771c7b 100644
    --- a/driver-extras/pom.xml
    +++ b/driver-extras/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-extras
    diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml
    index 330ee331aa5..cfdb6459ee5 100644
    --- a/driver-mapping/pom.xml
    +++ b/driver-mapping/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-mapping
    diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml
    index 493a2b772d8..372e20c2204 100644
    --- a/driver-tests/osgi/common/pom.xml
    +++ b/driver-tests/osgi/common/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         jar
    diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml
    index c7b7229871c..a30d770167b 100644
    --- a/driver-tests/osgi/pom.xml
    +++ b/driver-tests/osgi/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         pom
    diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml
    index b4e26459475..bececdd68f0 100644
    --- a/driver-tests/osgi/shaded/pom.xml
    +++ b/driver-tests/osgi/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-tests-osgi-shaded
    diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml
    index 3d7ccac4197..d4383b4676a 100644
    --- a/driver-tests/osgi/unshaded/pom.xml
    +++ b/driver-tests/osgi/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-tests-osgi-unshaded
    diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml
    index 2c29d9729c4..6cfa6b85204 100644
    --- a/driver-tests/pom.xml
    +++ b/driver-tests/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-tests-parent
    diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml
    index 88d4ba15c3c..b3960e41d26 100644
    --- a/driver-tests/shading/pom.xml
    +++ b/driver-tests/shading/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         pom
    diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml
    index 702916d13bb..25dbdc4a0d3 100644
    --- a/driver-tests/shading/shaded/pom.xml
    +++ b/driver-tests/shading/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-tests-shading-shaded
    diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml
    index b629bb04984..512318e8875 100644
    --- a/driver-tests/shading/unshaded/pom.xml
    +++ b/driver-tests/shading/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-tests-shading-unshaded
    diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml
    index fb1da6f31f5..1c80f7b23a8 100644
    --- a/driver-tests/stress/pom.xml
    +++ b/driver-tests/stress/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.0
    +        3.12.1-SNAPSHOT
         
     
         cassandra-driver-tests-stress
    diff --git a/pom.xml b/pom.xml
    index 3ba5b787fa5..767b32ff779 100644
    --- a/pom.xml
    +++ b/pom.xml
    @@ -27,7 +27,7 @@
         
         org.apache.cassandra
         cassandra-driver-parent
    -    3.12.0
    +    3.12.1-SNAPSHOT
         pom
         Java Driver for Apache Cassandra
         
    @@ -1112,7 +1112,7 @@ limitations under the License.
             scm:git:git@github.com:datastax/java-driver.git
             scm:git:git@github.com:datastax/java-driver.git
             https://github.com/apache/cassandra-java-driver
    -        3.12.0
    +        HEAD
         
     
         
    
    From a221439142557ddc7956081bd2e2a131cd3be3d4 Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Wed, 15 Jan 2025 10:27:53 -0600
    Subject: [PATCH 200/211] CASSJAVA-55 Remove setting "Host" header for metadata
     requests.
    
    With some sysprops enabled this will actually be respected which completely borks Astra routing.
    
    patch by Bret McGuire; reviewed by Alexandre Dutra and Bret McGuire for CASSJAVA-55
    ---
     .../main/java/com/datastax/driver/core/CloudConfigFactory.java   | 1 -
     1 file changed, 1 deletion(-)
    
    diff --git a/driver-core/src/main/java/com/datastax/driver/core/CloudConfigFactory.java b/driver-core/src/main/java/com/datastax/driver/core/CloudConfigFactory.java
    index cee81267c56..d2181cc3e77 100644
    --- a/driver-core/src/main/java/com/datastax/driver/core/CloudConfigFactory.java
    +++ b/driver-core/src/main/java/com/datastax/driver/core/CloudConfigFactory.java
    @@ -208,7 +208,6 @@ protected BufferedReader fetchProxyMetadata(URL metadataServiceUrl, SSLContext s
         HttpsURLConnection connection = (HttpsURLConnection) metadataServiceUrl.openConnection();
         connection.setSSLSocketFactory(sslContext.getSocketFactory());
         connection.setRequestMethod("GET");
    -    connection.setRequestProperty("host", "localhost");
         return new BufferedReader(new InputStreamReader(connection.getInputStream(), UTF_8));
       }
     
    
    From 1876645dab79c9e08607683fe119086fa2400ece Mon Sep 17 00:00:00 2001
    From: Lukasz Antoniak 
    Date: Wed, 30 Oct 2024 09:28:14 +0100
    Subject: [PATCH 201/211] JAVA-3125: Match broadcast RPC for control connection
     and Astra events
    
    patch by Lukasz Antoniak; reviewed by Bret McGuire and Andrew Tolbert for JAVA-3125
    reference: https://github.com/apache/cassandra-java-driver/pull/1981
    
    Fix to address Scassandra test issues
    ---
     .../driver/core/ControlConnection.java        | 13 ++++--
     .../driver/core/ControlConnectionTest.java    | 45 +++++++++++++++++++
     .../driver/core/ScassandraCluster.java        | 35 ++++++++++++---
     3 files changed, 83 insertions(+), 10 deletions(-)
    
    diff --git a/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java b/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java
    index 5ad1ee9d9c5..b5fd7689d67 100644
    --- a/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java
    +++ b/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java
    @@ -626,7 +626,11 @@ private static void updateInfo(
           broadcastRpcAddress = new InetSocketAddress(nativeAddress, nativePort);
         } else if (row.getColumnDefinitions().contains("rpc_address")) {
           InetAddress rpcAddress = row.getInet("rpc_address");
    -      broadcastRpcAddress = new InetSocketAddress(rpcAddress, cluster.connectionFactory.getPort());
    +      int nativePort = cluster.connectionFactory.getPort();
    +      if (row.getColumnDefinitions().contains("rpc_port")) {
    +        nativePort = row.getInt("rpc_port");
    +      }
    +      broadcastRpcAddress = new InetSocketAddress(rpcAddress, nativePort);
         }
         // Before CASSANDRA-9436, system.local doesn't have rpc_address, so this might be null. It's not
         // a big deal because we only use this for server events, and the control node doesn't receive
    @@ -854,8 +858,11 @@ private void refreshNodeListAndTokenMap(
             broadcastRpcAddress = new InetSocketAddress(nativeAddress, nativePort);
           } else {
             InetAddress rpcAddress = row.getInet("rpc_address");
    -        broadcastRpcAddress =
    -            new InetSocketAddress(rpcAddress, cluster.connectionFactory.getPort());
    +        int nativePort = cluster.connectionFactory.getPort();
    +        if (row.getColumnDefinitions().contains("rpc_port")) {
    +          nativePort = row.getInt("rpc_port");
    +        }
    +        broadcastRpcAddress = new InetSocketAddress(rpcAddress, nativePort);
           }
           broadcastRpcAddresses.add(broadcastRpcAddress);
     
    diff --git a/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java b/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java
    index abe4982e354..90edb28b1d0 100644
    --- a/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java
    +++ b/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java
    @@ -20,6 +20,7 @@
     import static com.datastax.driver.core.Assertions.assertThat;
     import static com.datastax.driver.core.CreateCCM.TestMode.PER_METHOD;
     import static com.datastax.driver.core.ScassandraCluster.SELECT_LOCAL;
    +import static com.datastax.driver.core.ScassandraCluster.SELECT_LOCAL_RPC_ADDRESS_AND_PORT;
     import static com.datastax.driver.core.ScassandraCluster.SELECT_PEERS;
     import static com.datastax.driver.core.ScassandraCluster.SELECT_PEERS_DSE68;
     import static com.datastax.driver.core.ScassandraCluster.SELECT_PEERS_V2;
    @@ -659,6 +660,50 @@ public void should_extract_hosts_using_rpc_address_from_peers() throws UnknownHo
         runPeerTest(state);
       }
     
    +  @Test(groups = "short")
    +  @CCMConfig(createCcm = false)
    +  public void should_extract_hosts_port_using_rpc_port_from_local() throws UnknownHostException {
    +    InetAddress expectedAddress = InetAddress.getByName("1.2.3.4");
    +    int expectedPort = 29042;
    +    PeerRowState state =
    +        PeerRowState.builder()
    +            .local("rpc_address", expectedAddress)
    +            .local("rpc_port", expectedPort)
    +            .build();
    +
    +    ScassandraCluster scassandras =
    +        ScassandraCluster.builder().withNodes(2).withPeersV2(state.usePeersV2()).build();
    +    scassandras.init();
    +
    +    Cluster cluster = null;
    +    try {
    +      scassandras.node(1).primingClient().clearAllPrimes();
    +      PrimingClient primingClient = scassandras.node(1).primingClient();
    +      primingClient.prime(
    +          PrimingRequest.queryBuilder()
    +              .withQuery("SELECT * FROM system.local WHERE key='local'")
    +              .withThen(
    +                  then()
    +                      .withColumnTypes(SELECT_LOCAL_RPC_ADDRESS_AND_PORT)
    +                      .withRows(state.getLocalRow())
    +                      .build())
    +              .build());
    +      cluster =
    +          Cluster.builder()
    +              .addContactPoints(scassandras.address(1).getAddress())
    +              .withPort(scassandras.getBinaryPort())
    +              .withNettyOptions(nonQuietClusterCloseOptions)
    +              .build();
    +      cluster.connect();
    +
    +      assertThat(cluster.manager.getControlConnection().connectedHost().getBroadcastRpcAddress())
    +          .isEqualTo(new InetSocketAddress(expectedAddress, expectedPort));
    +    } finally {
    +      if (cluster != null) cluster.close();
    +      scassandras.stop();
    +    }
    +  }
    +
       private void runPeerTest(PeerRowState state) {
     
         ScassandraCluster scassandras =
    diff --git a/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java b/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java
    index b07a01b9765..aa3a46b1455 100644
    --- a/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java
    +++ b/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java
    @@ -658,14 +658,14 @@ private Object getPeerInfo(int dc, int node, String property, Object defaultValu
         column("cluster_name", TEXT),
         column("cql_version", TEXT),
         column("data_center", TEXT),
    +    column("graph", BOOLEAN),
    +    column("host_id", UUID),
         column("listen_address", INET),
         column("partitioner", TEXT),
         column("rack", TEXT),
         column("release_version", TEXT),
    -    column("tokens", set(TEXT)),
    -    column("graph", BOOLEAN),
    -    column("host_id", UUID),
    -    column("schema_version", UUID)
    +    column("schema_version", UUID),
    +    column("tokens", set(TEXT))
       };
     
       public static final org.scassandra.http.client.types.ColumnMetadata[] SELECT_LOCAL_V2 = {
    @@ -676,15 +676,36 @@ private Object getPeerInfo(int dc, int node, String property, Object defaultValu
         column("cluster_name", TEXT),
         column("cql_version", TEXT),
         column("data_center", TEXT),
    +    column("graph", BOOLEAN),
    +    column("host_id", UUID),
         column("listen_address", INET),
         column("listen_port", INT),
         column("partitioner", TEXT),
         column("rack", TEXT),
         column("release_version", TEXT),
    -    column("tokens", set(TEXT)),
    -    column("graph", BOOLEAN),
    +    column("schema_version", UUID),
    +    column("tokens", set(TEXT))
    +  };
    +
    +  public static final org.scassandra.http.client.types.ColumnMetadata[]
    +      SELECT_LOCAL_RPC_ADDRESS_AND_PORT = {
    +    column("key", TEXT),
    +    column("bootstrapped", TEXT),
    +    column("broadcast_address", INET),
    +    column("broadcast_port", INT),
    +    column("cluster_name", TEXT),
    +    column("cql_version", TEXT),
    +    column("data_center", TEXT),
         column("host_id", UUID),
    -    column("schema_version", UUID)
    +    column("listen_address", INET),
    +    column("listen_port", INT),
    +    column("partitioner", TEXT),
    +    column("rack", TEXT),
    +    column("release_version", TEXT),
    +    column("rpc_address", INET),
    +    column("rpc_port", INT),
    +    column("schema_version", UUID),
    +    column("tokens", set(TEXT))
       };
     
       static final org.scassandra.http.client.types.ColumnMetadata[] SELECT_CLUSTER_NAME = {
    
    From 5753685335030dc417dbd8f26e02a1c6824c37ba Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Fri, 17 Jan 2025 17:32:12 -0600
    Subject: [PATCH 202/211] Update changelog and docs for 3.12.1 release
    
    patch by Bret McGuire; reviewed by Bret McGuire and Erik Merkle
    reference: https://github.com/apache/cassandra-java-driver/pull/2006
    ---
     README.md                             | 10 +++++-----
     changelog/README.md                   |  4 ++++
     faq/README.md                         |  2 +-
     manual/compression/README.md          |  2 +-
     manual/custom_codecs/extras/README.md |  2 +-
     manual/metrics/README.md              |  2 +-
     manual/object_mapper/README.md        |  2 +-
     manual/shaded_jar/README.md           |  6 +++---
     8 files changed, 17 insertions(+), 13 deletions(-)
    
    diff --git a/README.md b/README.md
    index 624b4c9eaae..34f8364c4f6 100644
    --- a/README.md
    +++ b/README.md
    @@ -7,7 +7,7 @@ for the development version and that some features described here might
     not yet have been released. You can find the documentation for the latest
     version through the [Java Driver
     docs](http://docs.datastax.com/en/developer/java-driver/3.11/index.html) or via the release tags,
    -[e.g. 3.12.0](https://github.com/apache/cassandra-java-driver/tree/3.12.0).*
    +[e.g. 3.12.1](https://github.com/apache/cassandra-java-driver/tree/3.12.1).*
     
     A modern, [feature-rich](manual/) and highly tunable Java client
     library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol 
    @@ -62,7 +62,7 @@ using DataStax Enterprise, install the [DataStax Enterprise Java Driver][dse-dri
     
       org.apache.cassandra
       cassandra-driver-core
    -  3.12.0
    +  3.12.1
     
     ```
     
    @@ -72,7 +72,7 @@ Note that the object mapper is published as a separate artifact:
     
       org.apache.cassandra
       cassandra-driver-mapping
    -  3.12.0
    +  3.12.1
     
     ```
     
    @@ -82,7 +82,7 @@ The 'extras' module is also published as a separate artifact:
     
       org.apache.cassandra
       cassandra-driver-extras
    -  3.12.0/version>
    +  3.12.1/version>
     
     ```
     
    @@ -96,7 +96,7 @@ is available for download.
     
     ## Compatibility
     
    -The Java client driver 3.12.0 ([branch 3.x](https://github.com/apache/cassandra-java-driver/tree/3.x)) is compatible with Apache
    +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).
     
    diff --git a/changelog/README.md b/changelog/README.md
    index c85e4e31d4c..c8c12cffdbf 100644
    --- a/changelog/README.md
    +++ b/changelog/README.md
    @@ -24,6 +24,10 @@ under the License.
       3.x versions get published.
     -->
     
    +## 3.12.1
    +- [improvement] CASSJAVA-55: Remove setting "Host" header for metadata requests.
    +- [bug] JAVA-3125: Match broadcast RPC for control connection and Astra events
    +
     ## 3.12.0
     - [improvement] CASSANDRA-18971: Switch all archs to netty-tcnative-boringssl-static
     - [improvement] CASSJAVA-58: Update 3.x DRIVER_NAME to match 4.x Java driver
    diff --git a/faq/README.md b/faq/README.md
    index 567d73d2354..35e92d6e03c 100644
    --- a/faq/README.md
    +++ b/faq/README.md
    @@ -308,7 +308,7 @@ version is available, you may want to reach out to the maintainer of that tool t
     an update with compatibility to this driver version.
     
     
    -[Blobs.java]: https://github.com/apache/cassandra-java-driver/tree/3.12.0/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java
    +[Blobs.java]: https://github.com/apache/cassandra-java-driver/tree/3.12.1/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java
     [CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304
     [Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding
     [Mapper options]: ../manual/object_mapper/using/#mapper-options
    diff --git a/manual/compression/README.md b/manual/compression/README.md
    index 190cbb1e8d5..6b25b5e5c69 100644
    --- a/manual/compression/README.md
    +++ b/manual/compression/README.md
    @@ -107,4 +107,4 @@ cluster = Cluster.builder()
         .build();
     ```
     
    -[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.12.0/cassandra-driver-parent-3.12.0.pom
    +[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.12.1/cassandra-driver-parent-3.12.1.pom
    diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md
    index aaabb1a1ba7..3198135878a 100644
    --- a/manual/custom_codecs/extras/README.md
    +++ b/manual/custom_codecs/extras/README.md
    @@ -29,7 +29,7 @@ The module is published as a separate Maven artifact:
     
       org.apache.cassandra
       cassandra-driver-extras
    -  3.12.0
    +  3.12.1
     
     ```
     
    diff --git a/manual/metrics/README.md b/manual/metrics/README.md
    index 50993ba6478..7af7a050232 100644
    --- a/manual/metrics/README.md
    +++ b/manual/metrics/README.md
    @@ -57,7 +57,7 @@ To do this in a maven project:
     
       org.apache.cassandra
       cassandra-driver-core
    -  3.12.0
    +  3.12.1
       
         
           io.dropwizard.metrics
    diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md
    index 31f04b29aab..3c3cc021822 100644
    --- a/manual/object_mapper/README.md
    +++ b/manual/object_mapper/README.md
    @@ -30,7 +30,7 @@ The mapper is published as a separate Maven artifact:
     
       org.apache.cassandra
       cassandra-driver-mapping
    -  3.12.0
    +  3.12.1
     
     ```
     
    diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md
    index 1b531e520af..9bfe8e59564 100644
    --- a/manual/shaded_jar/README.md
    +++ b/manual/shaded_jar/README.md
    @@ -31,7 +31,7 @@ package name:
     
       org.apache.cassandra
       cassandra-driver-core
    -  3.12.0
    +  3.12.1
       shaded
       
    @@ -55,7 +55,7 @@ non-shaded JAR:
     
       org.apache.cassandra
       cassandra-driver-core
    -  3.12.0
    +  3.12.1
       shaded
       
         
    @@ -71,7 +71,7 @@ non-shaded JAR:
     
       org.apache.cassandra
       cassandra-driver-mapping
    -  3.12.0
    +  3.12.1
       
         
           org.apache.cassandra
    
    From 873e6f764a499bd9c5a42cafa53dc77184711eea Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Sat, 18 Jan 2025 15:16:01 -0600
    Subject: [PATCH 203/211] [maven-release-plugin] prepare release 3.12.1
    
    ---
     driver-core/pom.xml                   | 2 +-
     driver-dist-source/pom.xml            | 2 +-
     driver-dist/pom.xml                   | 2 +-
     driver-examples/pom.xml               | 2 +-
     driver-extras/pom.xml                 | 2 +-
     driver-mapping/pom.xml                | 2 +-
     driver-tests/osgi/common/pom.xml      | 2 +-
     driver-tests/osgi/pom.xml             | 2 +-
     driver-tests/osgi/shaded/pom.xml      | 2 +-
     driver-tests/osgi/unshaded/pom.xml    | 2 +-
     driver-tests/pom.xml                  | 2 +-
     driver-tests/shading/pom.xml          | 2 +-
     driver-tests/shading/shaded/pom.xml   | 2 +-
     driver-tests/shading/unshaded/pom.xml | 2 +-
     driver-tests/stress/pom.xml           | 2 +-
     pom.xml                               | 4 ++--
     16 files changed, 17 insertions(+), 17 deletions(-)
    
    diff --git a/driver-core/pom.xml b/driver-core/pom.xml
    index 879b86d5793..024735ac1cd 100644
    --- a/driver-core/pom.xml
    +++ b/driver-core/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1-SNAPSHOT
    +        3.12.1
         
     
         cassandra-driver-core
    diff --git a/driver-dist-source/pom.xml b/driver-dist-source/pom.xml
    index feac0c98631..58a7d62be06 100644
    --- a/driver-dist-source/pom.xml
    +++ b/driver-dist-source/pom.xml
    @@ -23,7 +23,7 @@
       
         org.apache.cassandra
         cassandra-driver-parent
    -    3.12.1-SNAPSHOT
    +    3.12.1
       
       java-driver-distribution-source
       pom
    diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml
    index 31fd02732a5..46ab5b66f1a 100644
    --- a/driver-dist/pom.xml
    +++ b/driver-dist/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1-SNAPSHOT
    +        3.12.1
         
     
         cassandra-driver-dist
    diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml
    index f9858b7c68f..6589bcf7d30 100644
    --- a/driver-examples/pom.xml
    +++ b/driver-examples/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1-SNAPSHOT
    +        3.12.1
         
     
         cassandra-driver-examples
    diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml
    index b8502771c7b..348851b68ab 100644
    --- a/driver-extras/pom.xml
    +++ b/driver-extras/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1-SNAPSHOT
    +        3.12.1
         
     
         cassandra-driver-extras
    diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml
    index cfdb6459ee5..a03c7a29a71 100644
    --- a/driver-mapping/pom.xml
    +++ b/driver-mapping/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1-SNAPSHOT
    +        3.12.1
         
     
         cassandra-driver-mapping
    diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml
    index 372e20c2204..c973d2b5d60 100644
    --- a/driver-tests/osgi/common/pom.xml
    +++ b/driver-tests/osgi/common/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.1-SNAPSHOT
    +        3.12.1
         
     
         jar
    diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml
    index a30d770167b..be678f7f6d9 100644
    --- a/driver-tests/osgi/pom.xml
    +++ b/driver-tests/osgi/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.1-SNAPSHOT
    +        3.12.1
         
     
         pom
    diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml
    index bececdd68f0..383fa75b7e4 100644
    --- a/driver-tests/osgi/shaded/pom.xml
    +++ b/driver-tests/osgi/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.1-SNAPSHOT
    +        3.12.1
         
     
         cassandra-driver-tests-osgi-shaded
    diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml
    index d4383b4676a..e5ba633fb84 100644
    --- a/driver-tests/osgi/unshaded/pom.xml
    +++ b/driver-tests/osgi/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.1-SNAPSHOT
    +        3.12.1
         
     
         cassandra-driver-tests-osgi-unshaded
    diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml
    index 6cfa6b85204..6e013d2e891 100644
    --- a/driver-tests/pom.xml
    +++ b/driver-tests/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1-SNAPSHOT
    +        3.12.1
         
     
         cassandra-driver-tests-parent
    diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml
    index b3960e41d26..8a37bda89a7 100644
    --- a/driver-tests/shading/pom.xml
    +++ b/driver-tests/shading/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.1-SNAPSHOT
    +        3.12.1
         
     
         pom
    diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml
    index 25dbdc4a0d3..635ce904911 100644
    --- a/driver-tests/shading/shaded/pom.xml
    +++ b/driver-tests/shading/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.12.1-SNAPSHOT
    +        3.12.1
         
     
         cassandra-driver-tests-shading-shaded
    diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml
    index 512318e8875..ca7ba2dcab5 100644
    --- a/driver-tests/shading/unshaded/pom.xml
    +++ b/driver-tests/shading/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.12.1-SNAPSHOT
    +        3.12.1
         
     
         cassandra-driver-tests-shading-unshaded
    diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml
    index 1c80f7b23a8..2349ecbe423 100644
    --- a/driver-tests/stress/pom.xml
    +++ b/driver-tests/stress/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.1-SNAPSHOT
    +        3.12.1
         
     
         cassandra-driver-tests-stress
    diff --git a/pom.xml b/pom.xml
    index 767b32ff779..551d1e25962 100644
    --- a/pom.xml
    +++ b/pom.xml
    @@ -27,7 +27,7 @@
         
         org.apache.cassandra
         cassandra-driver-parent
    -    3.12.1-SNAPSHOT
    +    3.12.1
         pom
         Java Driver for Apache Cassandra
         
    @@ -1112,7 +1112,7 @@ limitations under the License.
             scm:git:git@github.com:datastax/java-driver.git
             scm:git:git@github.com:datastax/java-driver.git
             https://github.com/apache/cassandra-java-driver
    -        HEAD
    +        3.12.1
         
     
         
    
    From fcfb9c2d0bac4571b2f01ba6308798825425e071 Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Sat, 18 Jan 2025 15:16:04 -0600
    Subject: [PATCH 204/211] [maven-release-plugin] prepare for next development
     iteration
    
    ---
     driver-core/pom.xml                   | 2 +-
     driver-dist-source/pom.xml            | 2 +-
     driver-dist/pom.xml                   | 2 +-
     driver-examples/pom.xml               | 2 +-
     driver-extras/pom.xml                 | 2 +-
     driver-mapping/pom.xml                | 2 +-
     driver-tests/osgi/common/pom.xml      | 2 +-
     driver-tests/osgi/pom.xml             | 2 +-
     driver-tests/osgi/shaded/pom.xml      | 2 +-
     driver-tests/osgi/unshaded/pom.xml    | 2 +-
     driver-tests/pom.xml                  | 2 +-
     driver-tests/shading/pom.xml          | 2 +-
     driver-tests/shading/shaded/pom.xml   | 2 +-
     driver-tests/shading/unshaded/pom.xml | 2 +-
     driver-tests/stress/pom.xml           | 2 +-
     pom.xml                               | 4 ++--
     16 files changed, 17 insertions(+), 17 deletions(-)
    
    diff --git a/driver-core/pom.xml b/driver-core/pom.xml
    index 024735ac1cd..45aff62c17d 100644
    --- a/driver-core/pom.xml
    +++ b/driver-core/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1
    +        3.12.2-SNAPSHOT
         
     
         cassandra-driver-core
    diff --git a/driver-dist-source/pom.xml b/driver-dist-source/pom.xml
    index 58a7d62be06..27297c8bb66 100644
    --- a/driver-dist-source/pom.xml
    +++ b/driver-dist-source/pom.xml
    @@ -23,7 +23,7 @@
       
         org.apache.cassandra
         cassandra-driver-parent
    -    3.12.1
    +    3.12.2-SNAPSHOT
       
       java-driver-distribution-source
       pom
    diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml
    index 46ab5b66f1a..098e8be1a66 100644
    --- a/driver-dist/pom.xml
    +++ b/driver-dist/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1
    +        3.12.2-SNAPSHOT
         
     
         cassandra-driver-dist
    diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml
    index 6589bcf7d30..a5508fa9d9b 100644
    --- a/driver-examples/pom.xml
    +++ b/driver-examples/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1
    +        3.12.2-SNAPSHOT
         
     
         cassandra-driver-examples
    diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml
    index 348851b68ab..b83942f2d44 100644
    --- a/driver-extras/pom.xml
    +++ b/driver-extras/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1
    +        3.12.2-SNAPSHOT
         
     
         cassandra-driver-extras
    diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml
    index a03c7a29a71..eaf17481ddb 100644
    --- a/driver-mapping/pom.xml
    +++ b/driver-mapping/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1
    +        3.12.2-SNAPSHOT
         
     
         cassandra-driver-mapping
    diff --git a/driver-tests/osgi/common/pom.xml b/driver-tests/osgi/common/pom.xml
    index c973d2b5d60..71e616ad2a5 100644
    --- a/driver-tests/osgi/common/pom.xml
    +++ b/driver-tests/osgi/common/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.1
    +        3.12.2-SNAPSHOT
         
     
         jar
    diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml
    index be678f7f6d9..8609753a8c9 100644
    --- a/driver-tests/osgi/pom.xml
    +++ b/driver-tests/osgi/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.1
    +        3.12.2-SNAPSHOT
         
     
         pom
    diff --git a/driver-tests/osgi/shaded/pom.xml b/driver-tests/osgi/shaded/pom.xml
    index 383fa75b7e4..26d30bc88bd 100644
    --- a/driver-tests/osgi/shaded/pom.xml
    +++ b/driver-tests/osgi/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.1
    +        3.12.2-SNAPSHOT
         
     
         cassandra-driver-tests-osgi-shaded
    diff --git a/driver-tests/osgi/unshaded/pom.xml b/driver-tests/osgi/unshaded/pom.xml
    index e5ba633fb84..eda19e9b6a1 100644
    --- a/driver-tests/osgi/unshaded/pom.xml
    +++ b/driver-tests/osgi/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-osgi
    -        3.12.1
    +        3.12.2-SNAPSHOT
         
     
         cassandra-driver-tests-osgi-unshaded
    diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml
    index 6e013d2e891..fee1fba96c1 100644
    --- a/driver-tests/pom.xml
    +++ b/driver-tests/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-parent
    -        3.12.1
    +        3.12.2-SNAPSHOT
         
     
         cassandra-driver-tests-parent
    diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml
    index 8a37bda89a7..a9fefd15636 100644
    --- a/driver-tests/shading/pom.xml
    +++ b/driver-tests/shading/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.1
    +        3.12.2-SNAPSHOT
         
     
         pom
    diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml
    index 635ce904911..46465fcb09c 100644
    --- a/driver-tests/shading/shaded/pom.xml
    +++ b/driver-tests/shading/shaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.12.1
    +        3.12.2-SNAPSHOT
         
     
         cassandra-driver-tests-shading-shaded
    diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml
    index ca7ba2dcab5..577c414453d 100644
    --- a/driver-tests/shading/unshaded/pom.xml
    +++ b/driver-tests/shading/unshaded/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-shading
    -        3.12.1
    +        3.12.2-SNAPSHOT
         
     
         cassandra-driver-tests-shading-unshaded
    diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml
    index 2349ecbe423..669a03344c4 100644
    --- a/driver-tests/stress/pom.xml
    +++ b/driver-tests/stress/pom.xml
    @@ -24,7 +24,7 @@
         
             org.apache.cassandra
             cassandra-driver-tests-parent
    -        3.12.1
    +        3.12.2-SNAPSHOT
         
     
         cassandra-driver-tests-stress
    diff --git a/pom.xml b/pom.xml
    index 551d1e25962..f62040ae5bd 100644
    --- a/pom.xml
    +++ b/pom.xml
    @@ -27,7 +27,7 @@
         
         org.apache.cassandra
         cassandra-driver-parent
    -    3.12.1
    +    3.12.2-SNAPSHOT
         pom
         Java Driver for Apache Cassandra
         
    @@ -1112,7 +1112,7 @@ limitations under the License.
             scm:git:git@github.com:datastax/java-driver.git
             scm:git:git@github.com:datastax/java-driver.git
             https://github.com/apache/cassandra-java-driver
    -        3.12.1
    +        HEAD
         
     
         
    
    From b01446bb461e826a5cba7a60435883223744c0ae Mon Sep 17 00:00:00 2001
    From: Brad Schoening 
    Date: Wed, 12 Feb 2025 18:18:23 -0500
    Subject: [PATCH 205/211] CASSJAVA-81 Added license and Maven Central badges,
     fix typo
    
    patch by Brad Schoening; reviewed by Andrew Tolbert for CASSJAVA-81
    ---
     README.md | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/README.md b/README.md
    index 34f8364c4f6..a56816e0767 100644
    --- a/README.md
    +++ b/README.md
    @@ -2,6 +2,9 @@
     
     :warning: The java-driver has recently been donated by Datastax to The Apache Software Foundation and the Apache Cassandra project.  Bear with us as we move assets and coordinates.
     
    +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
    +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.cassandra/cassandra-driver-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.cassandra/cassandra-driver-core)
    +
     *If you're reading this on github.com, please note that this is the readme
     for the development version and that some features described here might
     not yet have been released. You can find the documentation for the latest
    @@ -82,7 +85,7 @@ The 'extras' module is also published as a separate artifact:
     
       org.apache.cassandra
       cassandra-driver-extras
    -  3.12.1/version>
    +  3.12.1
     
     ```
     
    
    From e957cd2be4e771f499df23334197d5ee4577fad6 Mon Sep 17 00:00:00 2001
    From: Andy Tolbert <6889771+tolbertam@users.noreply.github.com>
    Date: Thu, 13 Feb 2025 15:50:07 -0600
    Subject: [PATCH 206/211] Remove fossa dependency analysis github action
    
    Removing this from 3.x branch like was done on 4.x in 8352d4c.
    
    ASF does not have a subscription for fossa
    
    Patch by Andy Tolbert; Reviewed by Bret McGuire for CASSJAVA-82
    ---
     .github/workflows/dep-lic-scan.yaml | 23 -----------------------
     1 file changed, 23 deletions(-)
     delete mode 100644 .github/workflows/dep-lic-scan.yaml
    
    diff --git a/.github/workflows/dep-lic-scan.yaml b/.github/workflows/dep-lic-scan.yaml
    deleted file mode 100644
    index afb197bf137..00000000000
    --- a/.github/workflows/dep-lic-scan.yaml
    +++ /dev/null
    @@ -1,23 +0,0 @@
    -name: Dependency and License Scan
    -on:
    -  push:
    -    branches:
    -      - '4.x'
    -      - '3.x'
    -    paths-ignore:
    -      - 'manual/**'
    -      - 'faq/**'
    -      - 'upgrade_guide/**'
    -      - 'changelog/**'
    -jobs:
    -  scan-repo:
    -    runs-on: ubuntu-latest
    -    steps:
    -      - name: Check out code
    -        uses: actions/checkout@v2
    -      - name: Install Fossa CLI
    -        run: |
    -          curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash -s -- -b .
    -      - name: Scan for dependencies and licenses
    -        run: |
    -          FOSSA_API_KEY=${{ secrets.FOSSA_PUSH_ONLY_API_KEY }} ./fossa analyze
    
    From 2b8b221b5f40bec2c2a85fa9f55341feaa1f5531 Mon Sep 17 00:00:00 2001
    From: tommy stendahl 
    Date: Fri, 28 Feb 2025 11:16:26 +0100
    Subject: [PATCH 207/211] CASSJAVA-85: decode custom payload and warnings in
     correct order
    
    patch by Tommy Stendahl; reviewed by Alexandre Dutra and Andy Tolbert for CASSJAVA-85
    ---
     .../src/main/java/com/datastax/driver/core/Message.java  | 9 +++++----
     1 file changed, 5 insertions(+), 4 deletions(-)
    
    diff --git a/driver-core/src/main/java/com/datastax/driver/core/Message.java b/driver-core/src/main/java/com/datastax/driver/core/Message.java
    index 617a8a0fd74..05e9ef3500c 100644
    --- a/driver-core/src/main/java/com/datastax/driver/core/Message.java
    +++ b/driver-core/src/main/java/com/datastax/driver/core/Message.java
    @@ -274,8 +274,13 @@ static class ProtocolDecoder extends MessageToMessageDecoder {
         protected void decode(ChannelHandlerContext ctx, Frame frame, List out)
             throws Exception {
           boolean isTracing = frame.header.flags.contains(Frame.Header.Flag.TRACING);
    +      boolean hasWarnings = frame.header.flags.contains(Frame.Header.Flag.WARNING);
           boolean isCustomPayload = frame.header.flags.contains(Frame.Header.Flag.CUSTOM_PAYLOAD);
           UUID tracingId = isTracing ? CBUtil.readUUID(frame.body) : null;
    +
    +      List warnings =
    +          hasWarnings ? CBUtil.readStringList(frame.body) : Collections.emptyList();
    +
           Map customPayload =
               isCustomPayload ? CBUtil.readBytesMap(frame.body) : null;
     
    @@ -286,10 +291,6 @@ protected void decode(ChannelHandlerContext ctx, Frame frame, List out)
                 CBUtil.sizeOfBytesMap(customPayload));
           }
     
    -      boolean hasWarnings = frame.header.flags.contains(Frame.Header.Flag.WARNING);
    -      List warnings =
    -          hasWarnings ? CBUtil.readStringList(frame.body) : Collections.emptyList();
    -
           try {
             CodecRegistry codecRegistry = ctx.channel().attr(CODEC_REGISTRY_ATTRIBUTE_KEY).get();
             assert codecRegistry != null;
    
    From ca73827c6c3add68ca6a9c1ed8faaf17eb8098c0 Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Fri, 4 Apr 2025 21:31:49 -0500
    Subject: [PATCH 208/211] ninja-fix Port of CASSJAVA-20 changes to 3.x
    
    ---
     Jenkinsfile-datastax | 20 +++++++++++---------
     1 file changed, 11 insertions(+), 9 deletions(-)
    
    diff --git a/Jenkinsfile-datastax b/Jenkinsfile-datastax
    index e8e6a1ecf3d..21bd9721f7f 100644
    --- a/Jenkinsfile-datastax
    +++ b/Jenkinsfile-datastax
    @@ -65,14 +65,16 @@ def initializeEnvironment() {
     }
     
     def buildDriver(jabbaVersion) {
    -  withEnv(["BUILD_JABBA_VERSION=${jabbaVersion}"]) {
    -    sh label: 'Build driver', script: '''#!/bin/bash -le
    -      . ${JABBA_SHELL}
    -      jabba use ${BUILD_JABBA_VERSION}
    +  def buildDriverScript = '''#!/bin/bash -le
     
    -      mvn -B -V install -DskipTests
    -    '''
    -  }
    +    . ${JABBA_SHELL}
    +    jabba use '''+jabbaVersion+'''
    +
    +    echo "Building with Java version '''+jabbaVersion+'''"
    +
    +    mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true
    +  '''
    +  sh label: 'Build driver', script: buildDriverScript
     }
     
     def executeTests() {
    @@ -397,7 +399,7 @@ pipeline {
               }
               stage('Build-Driver') {
                 steps {
    -              buildDriver(env.JABBA_VERSION)
    +              buildDriver('1.8')
                 }
               }
               stage('Execute-Tests') {
    @@ -511,7 +513,7 @@ pipeline {
               stage('Build-Driver') {
                 steps {
                   // Jabba default should be a JDK8 for now
    -              buildDriver('default')
    +              buildDriver('1.8')
                 }
               }
               stage('Execute-Tests') {
    
    From 4aee8648430dd7dcfccd8b6fe599cad32a1201e3 Mon Sep 17 00:00:00 2001
    From: Abe Ratnofsky 
    Date: Mon, 10 Feb 2025 13:20:38 -0500
    Subject: [PATCH 209/211] Upgrade Netty to 4.1.119
    
    patch by Abe Ratnofsky; reviewed by Bret McGuire and Francisco Guerrero for CASSJAVA-78
    ---
     pom.xml | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/pom.xml b/pom.xml
    index f62040ae5bd..d179f45d04f 100644
    --- a/pom.xml
    +++ b/pom.xml
    @@ -58,8 +58,8 @@
             1.7.25
             1.7.25
             19.0
    -        4.1.94.Final
    -        2.0.61.Final
    +        4.1.119.Final
    +        2.0.70.Final
             3.2.2
             1.1.2.6
             1.4.1
    
    From e863144e888a57e10503e5942c9b385133a5c850 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Jo=C3=A3o=20Reis?= 
    Date: Tue, 27 Jan 2026 13:22:29 +0000
    Subject: [PATCH 210/211] ninja-fix Fix agent label on jenkinsfile-datastax
    
    reference: #2074
    ---
     Jenkinsfile-datastax | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/Jenkinsfile-datastax b/Jenkinsfile-datastax
    index 21bd9721f7f..282e8a532ec 100644
    --- a/Jenkinsfile-datastax
    +++ b/Jenkinsfile-datastax
    @@ -341,7 +341,7 @@ pipeline {
       }
     
       environment {
    -    OS_VERSION = 'ubuntu/bionic64/java-driver'
    +    OS_VERSION = 'ubuntu/focal64/java-driver'
         JABBA_SHELL = '/usr/lib/jabba/jabba.sh'
         CCM_ENVIRONMENT_SHELL = '/usr/local/bin/ccm_environment.sh'
       }
    
    From 209150c1d53dfc8fe197a93c9fb0fb1933c6377f Mon Sep 17 00:00:00 2001
    From: absurdfarce 
    Date: Mon, 2 Mar 2026 11:21:44 -0600
    Subject: [PATCH 211/211] ninja-fix Update Jenkins label to Jammy
    
    ---
     Jenkinsfile-datastax | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/Jenkinsfile-datastax b/Jenkinsfile-datastax
    index 282e8a532ec..9e7b92bed4f 100644
    --- a/Jenkinsfile-datastax
    +++ b/Jenkinsfile-datastax
    @@ -341,7 +341,7 @@ pipeline {
       }
     
       environment {
    -    OS_VERSION = 'ubuntu/focal64/java-driver'
    +    OS_VERSION = 'ubuntu/jammy64/java-driver'
         JABBA_SHELL = '/usr/lib/jabba/jabba.sh'
         CCM_ENVIRONMENT_SHELL = '/usr/local/bin/ccm_environment.sh'
       }