Elffuss BraidHub

kikocis/java-driver public

Update timestamp codecs documentation to mention that such codecs are incompatible with Cassandra < 2.0.9.
Changeseta3f1b7a590489863a882955b62b9daef4d58c262bd4e070811ecccc1b62949dd
AuthorAlexandre Dutra <alexandre.dutra@datastax.com> · 2015-12-22 12:29 +01:00
CommitterAlexandre Dutra <alexandre.dutra@datastax.com> · 2015-12-22 12:29 +01:00
Parents732cde7e1c80

Browse the files at this changeset

7 files changed

modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/InstantCodec.java +4 −4
@@ -33,16 +33,16 @@
3333 import static java.time.temporal.ChronoField.*;
3434
3535 /**
36- * <p>
3736 * {@link TypeCodec} that maps {@link Instant} to CQL {@code timestamp}
3837 * allowing the setting and retrieval of {@code timestamp}
3938 * columns as {@link Instant} instances.
40- * </p>
4139 * <p/>
42- * <p>
4340 * Since C* <code>timestamp</code> columns do not preserve timezones
4441 * any attached timezone information will be lost.
45- * </p>
42+ * <p/>
43+ * <strong>IMPORTANT</strong>: this codec's {@link #format(Instant) format} method formats
44+ * timestamps using an ISO-8601 format that includes milliseconds.
45+ * <strong>This format is incompatible with Cassandra versions < 2.0.9.</strong>
4646 *
4747 * @see ZonedDateTimeCodec
4848 * @see <a href="https://cassandra.apache.org/doc/cql3/CQL-2.2.html#usingtimestamps">Working with timestamps</a>
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.java +4 −2
@@ -34,13 +34,11 @@
3434 import static java.time.temporal.ChronoField.*;
3535
3636 /**
37- * <p/>
3837 * {@link TypeCodec} that maps
3938 * {@link ZonedDateTime} to CQL {@code tuple<timestamp,varchar>},
4039 * providing a pattern for maintaining timezone information in
4140 * Cassandra.
4241 * <p/>
43- * <p/>
4442 * Since Cassandra's <code>timestamp</code> type preserves only
4543 * milliseconds since epoch, any timezone information
4644 * would normally be lost. By using a
@@ -48,6 +46,10 @@
4846 * persisted in the <code>varchar</code> field such that when the
4947 * value is deserialized the timezone is
5048 * preserved.
49+ * <p/>
50+ * <strong>IMPORTANT</strong>: this codec's {@link #format(Object) format} method formats
51+ * timestamps using an ISO-8601 format that includes milliseconds.
52+ * <strong>This format is incompatible with Cassandra versions < 2.0.9.</strong>
5153 *
5254 * @see <a href="https://cassandra.apache.org/doc/cql3/CQL-2.2.html#usingtimestamps">Working with timestamps</a>
5355 * section of CQL specification.
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/DateTimeCodec.java +4 −2
@@ -33,13 +33,11 @@
3333 import static org.joda.time.DateTimeZone.UTC;
3434
3535 /**
36- * <p/>
3736 * {@link TypeCodec} that maps
3837 * {@link DateTime} to CQL {@code tuple<timestamp,varchar>},
3938 * providing a pattern for maintaining timezone information in
4039 * Cassandra.
4140 * <p/>
42- * <p/>
4341 * Since Cassandra's <code>timestamp</code> type preserves only
4442 * milliseconds since epoch, any timezone information
4543 * would normally be lost. By using a
@@ -47,6 +45,10 @@
4745 * persisted in the <code>varchar</code> field such that when the
4846 * value is deserialized the timezone is
4947 * preserved.
48+ * <p/>
49+ * <strong>IMPORTANT</strong>: this codec's {@link #format(Object) format} method formats
50+ * timestamps using an ISO-8601 format that includes nanoseconds.
51+ * <strong>This format is incompatible with Cassandra versions < 2.0.9.</strong>
5052 *
5153 * @see <a href="https://cassandra.apache.org/doc/cql3/CQL-2.2.html#usingtimestamps">Working with timestamps</a>
5254 * section of CQL specification.
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/InstantCodec.java +10 −1
@@ -31,7 +31,16 @@
3131 import static java.lang.Long.parseLong;
3232
3333 /**
34- * {@link TypeCodec} that maps {@link Instant} to CQL {@code timestamp}.
34+ * {@link TypeCodec} that maps {@link Instant} to CQL {@code timestamp}
35+ * allowing the setting and retrieval of {@code timestamp}
36+ * columns as {@link Instant} instances.
37+ * <p/>
38+ * Since C* <code>timestamp</code> columns do not preserve timezones
39+ * any attached timezone information will be lost.
40+ * <p/>
41+ * <strong>IMPORTANT</strong>: this codec's {@link #format(Instant) format} method formats
42+ * timestamps using an ISO-8601 format that includes milliseconds.
43+ * <strong>This format is incompatible with Cassandra versions < 2.0.9.</strong>
3544 *
3645 * @see DateTimeCodec
3746 * @see <a href="https://cassandra.apache.org/doc/cql3/CQL-2.2.html#usingtimestamps">Working with timestamps</a>
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.java +1 −2
@@ -33,8 +33,7 @@
3333 /**
3434 * {@link TypeCodec} that maps {@link LocalTime} to CQL {@code time} (long representing nanoseconds since midnight).
3535 * <p/>
36- * <p/>
37- * IMPORTANT: {@link LocalTime} has millisecond precision; nanoseconds below one millisecond will be lost
36+ * <strong>IMPORTANT</strong>: {@link LocalTime} has millisecond precision; nanoseconds below one millisecond will be lost
3837 * during deserialization.
3938 */
4039 public class LocalTimeCodec extends TypeCodec<LocalTime> {
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.java +0 −2
@@ -33,12 +33,10 @@
3333 * A JSON codec that uses the <a href="http://wiki.fasterxml.com/JacksonHome">Jackson</a>
3434 * library to perform serialization and deserialization of JSON objects.
3535 * <p/>
36- * <p/>
3736 * This codec maps a single Java object to a single JSON structure at a time;
3837 * mapping of arrays or collections to root-level JSON arrays is not supported,
3938 * but such a codec can be easily crafted after this one.
4039 * <p/>
41- * <p/>
4240 * Note that this codec requires the presence of Jackson library at runtime.
4341 * If you use Maven, this can be done by declaring the following dependency in your project:
4442 * <p/>
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.java +1 −5
@@ -40,13 +40,12 @@
4040 * users should manually downcast to either {@link JsonObject} or {@link JsonArray},
4141 * as in the example below:
4242 * <pre>{@code
43- * <p/>
4443 * // setting values
4544 * JsonObject myObject = ...
4645 * PreparedStatement ps = ...
4746 * // set values using JsonStructure as target Java type
4847 * BoundStatement bs = ps.bind().set(1, myObject, JsonStructure.class);
49- * <p/>
48+ *
5049 * // retrieving values
5150 * Row row = session.execute(bs).one();
5251 * // use JsonStructure as target Java type to retrieve values
@@ -56,13 +55,10 @@
5655 * ...
5756 * }
5857 * }</pre>
59- * <p/>
60- * <p/>
6158 * Note that at runtime, this codec requires the presence of both JSR-353 API
6259 * and a JSR-353-compatible runtime library, such as
6360 * <a href="https://jsonp.java.net/download.html">JSR-353's reference implementation</a>.
6461 * If you use Maven, this can be done by declaring the following dependencies in your project:
65- * <p/>
6662 * <pre>{@code
6763 * <dependency>
6864 * <groupId>javax.json</groupId>