From 48e8cc58240b9f8cbfd343ad0bc6fd619c7cf3d1 Mon Sep 17 00:00:00 2001 From: Andrew Tolbert Date: Tue, 7 Aug 2018 09:02:48 -0500 Subject: [PATCH] JAVA-1871: Change LOCAL_SERIAL.isDCLocal() to return true --- changelog/README.md | 1 + .../java/com/datastax/driver/core/ConsistencyLevel.java | 5 +++-- upgrade_guide/README.md | 7 +++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/changelog/README.md b/changelog/README.md index 790d2a00f8a..56bec6d410c 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -11,6 +11,7 @@ - [bug] JAVA-1924: StatementWrapper setters should return the wrapping statement. - [new feature] JAVA-1532: Add Codec support for Java 8's LocalDateTime and ZoneId. - [improvement] JAVA-1786: Use Google code formatter. +- [bug] JAVA-1871: Change LOCAL\_SERIAL.isDCLocal() to return true. Merged from 3.5.x: diff --git a/driver-core/src/main/java/com/datastax/driver/core/ConsistencyLevel.java b/driver-core/src/main/java/com/datastax/driver/core/ConsistencyLevel.java index 68b5c868468..fbe378fc263 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ConsistencyLevel.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ConsistencyLevel.java @@ -57,10 +57,11 @@ static ConsistencyLevel fromCode(int code) { /** * Whether or not this consistency level applies to the local data-center only. * - * @return whether this consistency level is {@code LOCAL_ONE} or {@code LOCAL_QUORUM}. + * @return whether this consistency level is {@code LOCAL_ONE}, {@code LOCAL_QUORUM}, or {@code + * LOCAL_SERIAL}. */ public boolean isDCLocal() { - return this == LOCAL_ONE || this == LOCAL_QUORUM; + return this == LOCAL_ONE || this == LOCAL_QUORUM || this == LOCAL_SERIAL; } /** diff --git a/upgrade_guide/README.md b/upgrade_guide/README.md index f9dd6eea6db..6eb085ba450 100644 --- a/upgrade_guide/README.md +++ b/upgrade_guide/README.md @@ -3,6 +3,13 @@ The purpose of this guide is to detail changes made by successive versions of the Java driver. +### 3.6.0 + +1. `ConsistencyLevel.LOCAL_SERIAL.isDCLocal()` now returns true. In driver + code, `isDCLocal()` is only used when evaluating a Statement's + ConsistencyLevel (which does not include Serial CLs), but as a matter of + correctness this was updated. + ### 3.5.0 1. The `DowngradingConsistencyRetryPolicy` is now deprecated, see [JAVA-1752].