We've just released the GA version of our next generation drivers.
There were a few breaking changes to the API since RC1, in order to address issues reported by early adopters:
- statement builder methods were renamed to setXxx, e.g. withPageSize => setPageSize (JAVA-2164). This makes it easier to convert code that creates statements to builders, since the method names do not change.
- we annotated statement setters with
@CheckReturnValue (JAVA-2161), to stress the fact that ignoring their results is a programming error (they operate on immutable objects and return new instances every time). Note that you can configure
ErrorProne in your build to automatically check for this.
- Statement.setTimestamp() was renamed to setQueryTimestamp() (JAVA-2143). This method sets the write time for mutations (like USING TIMESTAMP in CQL), not to be confused with BoundStatement.setInstant(), which sets a bound value corresponding to CQL type TIMESTAMP.
- our public API doesn't use wildcards in futures and optional return types anymore (JAVA-2192). The previous approach (e.g. CompletionStage<? extends AsyncResultSet>) caused typing issues in client code. Thanks to Scott Carey for reporting this.
The manual will be published to
docs.datastax.com shortly. In the meantime, you can read it directly on GitHub
here. In particular, we encourage you to take a look at the
upgrade guide.
Here is the changelog for OSS 4.0.0:
- [improvement] JAVA-2192: Don't return generic types with wildcards
- [improvement] JAVA-2148: Add examples
- [bug] JAVA-2189: Exclude virtual keyspaces from token map computation
- [improvement] JAVA-2183: Enable materialized views when testing against Cassandra 4
- [improvement] JAVA-2182: Add insertInto().json() variant that takes an object in QueryBuilder
- [improvement] JAVA-2161: Annotate mutating methods with `@CheckReturnValue`
- [bug] JAVA-2177: Don't exclude down nodes when initializing LBPs
- [improvement] JAVA-2143: Rename Statement.setTimestamp() to setQueryTimestamp()
- [improvement] JAVA-2165: Abstract node connection information
- [improvement] JAVA-2090: Add support for additional_write_policy and read_repair table options
- [improvement] JAVA-2164: Rename statement builder methods to setXxx
- [bug] JAVA-2178: QueryBuilder: Alias after function column is not included in a query
- [improvement] JAVA-2158: Allow BuildableQuery to build statement with values
- [improvement] JAVA-2150: Improve query builder error message on unsupported literal type
- [documentation] JAVA-2149: Improve Term javadocs in the query builder
And DSE 2.0.0:
- [documentation] JAVA-2188: Document DSE load balancing policy
- [improvement] JAVA-2192: Don't return generic types with wildcards
- [bug] JAVA-2166: Use programmatic local datacenter in DSE LBP
- [improvement] JAVA-2018: Check backward compatibility with Revapi
- [improvement] JAVA-2190: Use `@CheckReturnValue` in DSE-specific types
- [bug] JAVA-2185: Handle DOWN nodes in DseLoadBalancingPolicy.init
- [documentation] JAVA-2068: Add documentation for the reactive request processor
- [improvement] JAVA-2156: Don't have ContinuousReactiveSession extend ReactiveSession
As usual, the driver is available from Maven:
<dependency>
<groupId>com.datastax.oss</groupId>
<artifactId>java-driver-core</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.datastax.oss</groupId>
<artifactId>java-driver-query-builder</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.datastax.dse</groupId>
<artifactId>dse-java-driver-core</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.datastax.dse</groupId>
<artifactId>dse-java-driver-query-builder</artifactId>
<version>2.0.0</version>
</dependency>
And from our download servers:
--
The Java driver dev team