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
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:
RemoteEndpointAwareNettySSLOptions. Note that the old
SSLOptions interface and its direct implementations are now deprecated. Read more about SSL configuration in our online documentation.
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
@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.
USERNAME, by simply configuring the relevant strategy.
Support for the
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
Getting the driver
We're also running a platform and runtime survey to improve our testing infrastructure. Your feedback would be most appreciated.