Skip to content

Commit 2ec061f

Browse files
committed
Merge branch '4.x' of github.com:apache/cassandra-java-driver into vector-arbitrary-support
2 parents 61f9470 + 8c10099 commit 2ec061f

File tree

23 files changed

+453
-45
lines changed

23 files changed

+453
-45
lines changed

.asf.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ github:
3434
projects: false
3535
autolink_jira:
3636
- CASSANDRA
37+
- CASSJAVA

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ See the [Cassandra error handling done right blog](https://www.datastax.com/blog
7575

7676
* [Manual](manual/)
7777
* [API docs]
78-
* Bug tracking: [JIRA]. Make sure to select the "Client/java-driver" component when filing new tickets!
78+
* Bug tracking: [JIRA]
7979
* [Mailing list]
8080
* [Changelog]
8181
* [FAQ]
8282

8383
[API docs]: https://docs.datastax.com/en/drivers/java/4.17
84-
[JIRA]: https://issues.apache.org/jira/issues/?jql=project%20%3D%20CASSANDRA%20AND%20component%20%3D%20%22Client%2Fjava-driver%22%20ORDER%20BY%20key%20DESC
84+
[JIRA]: https://issues.apache.org/jira/issues/?jql=project%20%3D%20CASSJAVA%20ORDER%20BY%20key%20DESC
8585
[Mailing list]: https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user
8686
[Changelog]: changelog/
8787
[FAQ]: faq/
@@ -108,4 +108,4 @@ Apache Cassandra, Apache, Tomcat, Lucene, Solr, Hadoop, Spark, TinkerPop, and Ca
108108
trademarks of the [Apache Software Foundation](http://www.apache.org/) or its subsidiaries in
109109
Canada, the United States and/or other countries.
110110

111-
Binary artifacts of this product bundle Java Native Runtime libraries, which is available under the Eclipse Public License version 2.0.
111+
Binary artifacts of this product bundle Java Native Runtime libraries, which is available under the Eclipse Public License version 2.0.

bom/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@
5555
<artifactId>java-driver-query-builder</artifactId>
5656
<version>4.18.2-SNAPSHOT</version>
5757
</dependency>
58+
<dependency>
59+
<groupId>org.apache.cassandra</groupId>
60+
<artifactId>java-driver-guava-shaded</artifactId>
61+
<version>4.18.2-SNAPSHOT</version>
62+
</dependency>
5863
<dependency>
5964
<groupId>org.apache.cassandra</groupId>
6065
<artifactId>java-driver-test-infra</artifactId>
@@ -75,11 +80,6 @@
7580
<artifactId>native-protocol</artifactId>
7681
<version>1.5.1</version>
7782
</dependency>
78-
<dependency>
79-
<groupId>com.datastax.oss</groupId>
80-
<artifactId>java-driver-shaded-guava</artifactId>
81-
<version>25.1-jre-graal-sub-1</version>
82-
</dependency>
8383
</dependencies>
8484
</dependencyManagement>
8585
<build>

core-shaded/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
<artifactId>native-protocol</artifactId>
5858
</dependency>
5959
<dependency>
60-
<groupId>com.datastax.oss</groupId>
61-
<artifactId>java-driver-shaded-guava</artifactId>
60+
<groupId>org.apache.cassandra</groupId>
61+
<artifactId>java-driver-guava-shaded</artifactId>
6262
</dependency>
6363
<dependency>
6464
<groupId>com.typesafe</groupId>

core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
<artifactId>netty-handler</artifactId>
5050
</dependency>
5151
<dependency>
52-
<groupId>com.datastax.oss</groupId>
53-
<artifactId>java-driver-shaded-guava</artifactId>
52+
<groupId>org.apache.cassandra</groupId>
53+
<artifactId>java-driver-guava-shaded</artifactId>
5454
</dependency>
5555
<dependency>
5656
<groupId>com.typesafe</groupId>

core/src/main/java/com/datastax/oss/driver/internal/core/config/cloud/CloudConfigFactory.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ protected BufferedReader fetchProxyMetadata(
229229
HttpsURLConnection connection = (HttpsURLConnection) metadataServiceUrl.openConnection();
230230
connection.setSSLSocketFactory(sslContext.getSocketFactory());
231231
connection.setRequestMethod("GET");
232-
connection.setRequestProperty("host", "localhost");
233232
return new BufferedReader(
234233
new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8));
235234
} catch (ConnectException e) {

core/src/main/java/com/datastax/oss/driver/internal/core/type/codec/UdtCodec.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@
3030
import java.nio.BufferUnderflowException;
3131
import java.nio.ByteBuffer;
3232
import net.jcip.annotations.ThreadSafe;
33+
import org.slf4j.Logger;
34+
import org.slf4j.LoggerFactory;
3335

3436
@ThreadSafe
3537
public class UdtCodec implements TypeCodec<UdtValue> {
3638

39+
private static final Logger LOG = LoggerFactory.getLogger(UdtCodec.class);
40+
3741
private final UserDefinedType cqlType;
3842

3943
public UdtCodec(@NonNull UserDefinedType cqlType) {
@@ -107,10 +111,8 @@ public UdtValue decode(@Nullable ByteBuffer bytes, @NonNull ProtocolVersion prot
107111
int i = 0;
108112
while (input.hasRemaining()) {
109113
if (i == cqlType.getFieldTypes().size()) {
110-
throw new IllegalArgumentException(
111-
String.format(
112-
"Too many fields in encoded UDT value, expected %d",
113-
cqlType.getFieldTypes().size()));
114+
LOG.debug("Encountered unexpected fields when parsing codec {}", cqlType);
115+
break;
114116
}
115117
int elementSize = input.getInt();
116118
ByteBuffer element;

core/src/test/java/com/datastax/dse/driver/internal/core/cql/reactive/TestSubscriber.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public List<T> getElements() {
8181
}
8282

8383
public void awaitTermination() {
84-
Uninterruptibles.awaitUninterruptibly(latch, 1, TimeUnit.MINUTES);
85-
if (latch.getCount() > 0) fail("subscriber not terminated");
84+
if (!Uninterruptibles.awaitUninterruptibly(latch, 1, TimeUnit.MINUTES)) {
85+
fail("subscriber not terminated");
86+
}
8687
}
8788
}

core/src/test/java/com/datastax/oss/driver/internal/core/type/codec/UdtCodecTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,18 @@ public void should_decode_udt() {
136136
}
137137

138138
@Test
139-
public void should_fail_to_decode_udt_when_too_many_fields() {
140-
assertThatThrownBy(
141-
() ->
142-
decode(
143-
"0x"
144-
+ ("00000004" + "00000001")
145-
+ "ffffffff"
146-
+ ("00000001" + "61")
147-
// extra contents
148-
+ "ffffffff"))
149-
.isInstanceOf(IllegalArgumentException.class)
150-
.hasMessage("Too many fields in encoded UDT value, expected 3");
139+
public void should_decode_udt_when_too_many_fields() {
140+
UdtValue udt =
141+
decode(
142+
"0x"
143+
+ ("00000004" + "00000001")
144+
+ "ffffffff"
145+
+ ("00000001" + "61")
146+
// extra contents
147+
+ "ffffffff");
148+
assertThat(udt.getInt(0)).isEqualTo(1);
149+
assertThat(udt.isNull(1)).isTrue();
150+
assertThat(udt.getString(2)).isEqualTo("a");
151151
}
152152

153153
/** Test for JAVA-2557. Ensures that the codec can decode null fields with any negative length. */

distribution/src/assembly/binary-tarball.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
<exclude>org.apache.cassandra:java-driver-core</exclude>
6767
<exclude>org.apache.cassandra:java-driver-mapper-runtime</exclude>
6868
<exclude>org.apache.cassandra:java-driver-mapper-processor</exclude>
69+
<exclude>org.apache.cassandra:java-driver-guava-shaded</exclude>
6970
<!-- Don't reinclude dependencies that core also has -->
70-
<exclude>com.datastax.oss:java-driver-shaded-guava</exclude>
7171
<exclude>com.github.stephenc.jcip:jcip-annotations</exclude>
7272
<exclude>com.github.spotbugs:spotbugs-annotations</exclude>
7373
</excludes>
@@ -91,8 +91,8 @@
9191
<exclude>org.apache.cassandra:java-driver-core</exclude>
9292
<exclude>org.apache.cassandra:java-driver-query-builder</exclude>
9393
<exclude>org.apache.cassandra:java-driver-mapper-processor</exclude>
94+
<exclude>org.apache.cassandra:java-driver-guava-shaded</exclude>
9495
<!-- Don't reinclude dependencies that core also has -->
95-
<exclude>com.datastax.oss:java-driver-shaded-guava</exclude>
9696
<exclude>com.github.stephenc.jcip:jcip-annotations</exclude>
9797
<exclude>com.github.spotbugs:spotbugs-annotations</exclude>
9898
</excludes>
@@ -116,8 +116,8 @@
116116
<exclude>org.apache.cassandra:java-driver-core</exclude>
117117
<exclude>org.apache.cassandra:java-driver-query-builder</exclude>
118118
<exclude>org.apache.cassandra:java-driver-mapper-runtime</exclude>
119+
<exclude>org.apache.cassandra:java-driver-guava-shaded</exclude>
119120
<!-- Don't reinclude dependencies that core also has -->
120-
<exclude>com.datastax.oss:java-driver-shaded-guava</exclude>
121121
<exclude>com.github.stephenc.jcip:jcip-annotations</exclude>
122122
<exclude>com.github.spotbugs:spotbugs-annotations</exclude>
123123
</excludes>

0 commit comments

Comments
 (0)