Elffuss BraidHub

kikocis/java-driver public

cd8368797258 · 2.1 KiBRawPermalink
1Upgrade Guide to 2.1.0
2======================
3
4The purpose of this guide is to detail the changes made by version 2.1 of
5the Java Driver that are relevant to an upgrade from version 2.0. This guide
6only describes breaking changes of the API, added features are not covered.
7
8
9User API Changes
10----------------
11
121. The ``getCaching`` method of ``TableMetadata#Options`` now returns a
13 ``Map`` to account for changes to Cassandra 2.1. Also, the
14 ``getIndexInterval`` method now returns an ``Integer`` instead of an ``int``
15 which will be ``null`` when connected to Cassandra 2.1 nodes.
16
172. ``BoundStatement`` variables that have not been set explicitly will no
18 longer default to ``null``. Instead, all variables must be bound explicitly,
19 otherwise the execution of the statement will fail (this also applies to
20 statements inside of a ``BatchStatement``). For variables that map to a
21 primitive Java type, a new ``setToNull`` method has been added.
22 We made this change because the driver might soon distinguish between unset
23 and null variables, so we don't want clients relying on the "leave unset to
24 set to ``null``" behavior.
25
26
27Internal API Changes
28--------------------
29
30The changes listed in this section should normally not impact end users of the
31driver, but rather third-party frameworks and tools.
32
333. The ``serialize`` and ``deserialize`` methods in ``DataType`` now take an
34 additional parameter: the protocol version. As explained in the javadoc,
35 if unsure, the proper value to use for this parameter is the protocol version
36 in use by the driver, i.e. the value returned by
37 ``cluster.getConfiguration().getProtocolOptions().getProtocolVersion()``.
38
394. The ``parse`` method in ``DataType`` now returns a Java object, not a
40 ``ByteBuffer``. The previous behavior can be obtained by calling the
41 ``serialize`` method on the returned object.
42
435. The ``getValues`` method of ``RegularStatement`` now takes the protocol
44 version as a parameter. As above, the proper value if unsure is almost surely
45 the protocol version in use
46 (``cluster.getConfiguration().getProtocolOptions().getProtocolVersion()``).