CompanyMarch 29, 2017

DataStax Java Driver: 3.2.0 released!

Alexandre Dutra
Alexandre Dutra
DataStax Java Driver: 3.2.0 released!

The Java driver team is pleased to announce that version 3.2.0 of the DataStax Java driver for Apache Cassandra® has just been released.

We would like to stress that this release has been made possible thanks to a strong and vibrant community involvement. Our team and our company are thankful to all of you that contributed, directly or indirectly, to make our driver even better, with a special shout-out to 3 Github users: @avivcarmis@wimtie and @gnoremac.

In this post, we will focus on the most significant changes brought by this new release; you can also consult the full changelog and our upgrade guide for details about how to migrate existing applications.

 

Performance and Usability Enhancements

This release is the first one to provide full compatibility with recent Guava versions up to 21.0 inclusive. By default, the driver now uses version 19.0, but any version from 16.0.1 to 21.0 can be used.

According to our internal benchmarks, this version is also noticeably faster than any previous version in the 3.x series thanks to a few performance improvements, among which the performance boost in a core component of the driver. Users are strongly encouraged to migrate to 3.2.0 as soon as possible to benefit from these.

Enhanced SSL options

The current SSLOptions interface does not allow implementors to perform hostname verification. Thanks to JAVA-1364, this is now possible, using the newly-introduced RemoteEndpointAwareSSLOptions sub-interface, that exposes a new method giving implementors access to the remote endpoint address.

This new sub-interface comes with two new concrete implementations: RemoteEndpointAwareJdkSSLOptions and RemoteEndpointAwareNettySSLOptions. Note that the old SSLOptions interface and its direct implementations are now deprecated. Read more about SSL configuration in our online documentation.

Mapper Configuration

This release brings substantial enhancements to the driver's object mapper; thanks to JAVA-1310 and JAVA-1316, users can now customize certain aspects of the mapping process itself by defining strategies.

For example, by default the mapper tries to map all the properties found in your Java data model. You might want to take an "opt-in" approach instead and only map the ones that are explicitly annotated with @Column or @Field; this is now possible thanks to a dedicated strategy. Similarly, you might want to tell the mapper to ignore certain parent classes in your class hierarchy; this is also made possible by another strategy.

Another common need is to customize the way Cassandra column names are inferred. Out of the box, Java property names are simply lowercased: a userName Java property is mapped to the username column. It is now possible to map it to something else instead, e.g. user_name or USERNAME, by simply configuring the relevant strategy.

Strategies can be supplied through a new class, MappingConfiguration. Read more about the object mapper configuration in our online documentation.

Support for the duration type

This release also brings full support for the new CQL duration type. This type has been introduced in Apache Cassandra® 3.10, and although its primary purpose is to be used in CQL statements to specify either restrictions – e.g. WHERE time < now() + 2h – or aggregations – e.g. GROUP BY floor(time, 2h) –, it can also be used as a regular CQL type. The driver now supports such a usage through the new Duration class (however, there are no dedicated methods for it in the Row interface nor in the BoundStatement class; users are expected to set and retrieve Duration instances through the generic get() and set() methods).

Getting the driver

As always, the driver is available from Maven and from our downloads server.

We're also running a platform and runtime survey to improve our testing infrastructure. Your feedback would be most appreciated.

Discover more
JavaDrivers
Share

One-stop Data API for Production GenAI

Astra DB gives JavaScript developers a complete data API and out-of-the-box integrations that make it easier to build production RAG apps with high relevancy and low latency.