Skip to content

Commit 3912041

Browse files
authored
JAVA-1871: Change LOCAL_SERIAL.isDCLocal() to return true (apache#1070)
1 parent 8be7570 commit 3912041

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

changelog/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- [bug] JAVA-1924: StatementWrapper setters should return the wrapping statement.
1212
- [new feature] JAVA-1532: Add Codec support for Java 8's LocalDateTime and ZoneId.
1313
- [improvement] JAVA-1786: Use Google code formatter.
14+
- [bug] JAVA-1871: Change LOCAL\_SERIAL.isDCLocal() to return true.
1415

1516
Merged from 3.5.x:
1617

driver-core/src/main/java/com/datastax/driver/core/ConsistencyLevel.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ static ConsistencyLevel fromCode(int code) {
5757
/**
5858
* Whether or not this consistency level applies to the local data-center only.
5959
*
60-
* @return whether this consistency level is {@code LOCAL_ONE} or {@code LOCAL_QUORUM}.
60+
* @return whether this consistency level is {@code LOCAL_ONE}, {@code LOCAL_QUORUM}, or {@code
61+
* LOCAL_SERIAL}.
6162
*/
6263
public boolean isDCLocal() {
63-
return this == LOCAL_ONE || this == LOCAL_QUORUM;
64+
return this == LOCAL_ONE || this == LOCAL_QUORUM || this == LOCAL_SERIAL;
6465
}
6566

6667
/**

upgrade_guide/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
The purpose of this guide is to detail changes made by successive
44
versions of the Java driver.
55

6+
### 3.6.0
7+
8+
1. `ConsistencyLevel.LOCAL_SERIAL.isDCLocal()` now returns true. In driver
9+
code, `isDCLocal()` is only used when evaluating a Statement's
10+
ConsistencyLevel (which does not include Serial CLs), but as a matter of
11+
correctness this was updated.
12+
613
### 3.5.0
714

815
1. The `DowngradingConsistencyRetryPolicy` is now deprecated, see [JAVA-1752].

0 commit comments

Comments
 (0)