Elffuss BraidHub

kikocis/java-driver public

JAVA-1003: Change default consistency level to LOCAL_ONE (amends JAVA-926).
Changesete1b0741e5c51c7b3f2df807c1f67bc6f7759e87d4896f5fcac9a52fd6fc21696
AuthorAlexandre Dutra <alexandre.dutra@datastax.com> · 2015-11-26 12:19 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2015-12-03 18:13 +01:00
Parentse75c6c2093c0

Browse the files at this changeset

4 files changed

modified changelog/README.md +1 −0
@@ -7,6 +7,7 @@
77 - [bug] JAVA-998: SchemaChangeListener not invoked for Functions or Aggregates having UDT arguments.
88 - [bug] JAVA-1009: use CL ONE to compute query plan when reconnecting
99 control connection.
10+- [improvement] JAVA-1003: Change default consistency level to LOCAL_ONE (amends JAVA-926).
1011
1112 Merged from 2.1 branch:
1213
modified driver-core/src/main/java/com/datastax/driver/core/QueryOptions.java +2 −2
@@ -23,9 +23,9 @@
2323 public class QueryOptions {
2424
2525 /**
26- * The default consistency level for queries: {@link ConsistencyLevel#LOCAL_QUORUM}.
26+ * The default consistency level for queries: {@link ConsistencyLevel#LOCAL_ONE}.
2727 */
28- public static final ConsistencyLevel DEFAULT_CONSISTENCY_LEVEL = ConsistencyLevel.LOCAL_QUORUM;
28+ public static final ConsistencyLevel DEFAULT_CONSISTENCY_LEVEL = ConsistencyLevel.LOCAL_ONE;
2929
3030 /**
3131 * The default serial consistency level for conditional updates: {@link ConsistencyLevel#SERIAL}.
modified driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsScassandraTest.java +7 −7
@@ -33,7 +33,7 @@
3333 import com.datastax.driver.core.*;
3434 import com.datastax.driver.core.policies.FallthroughRetryPolicy;
3535
36-import static com.datastax.driver.core.ConsistencyLevel.LOCAL_QUORUM;
36+import static com.datastax.driver.core.ConsistencyLevel.LOCAL_ONE;
3737
3838 public class ExceptionsScassandraTest {
3939
@@ -72,8 +72,8 @@
7272 query();
7373 fail("expected an UnavailableException");
7474 } catch (UnavailableException e) {
75- assertThat(e.getMessage()).isEqualTo("Not enough replicas available for query at consistency LOCAL_QUORUM (1 required but only 0 alive)");
76- assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_QUORUM);
75+ assertThat(e.getMessage()).isEqualTo("Not enough replicas available for query at consistency LOCAL_ONE (1 required but only 0 alive)");
76+ assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_ONE);
7777 assertThat(e.getAliveReplicas()).isEqualTo(0);
7878 assertThat(e.getRequiredReplicas()).isEqualTo(1);
7979 assertThat(e.getAddress()).isEqualTo(host1.getSocketAddress());
@@ -88,8 +88,8 @@
8888 query();
8989 fail("expected a ReadTimeoutException");
9090 } catch (ReadTimeoutException e) {
91- assertThat(e.getMessage()).isEqualTo("Cassandra timeout during read query at consistency LOCAL_QUORUM (1 responses were required but only 0 replica responded)");
92- assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_QUORUM);
91+ assertThat(e.getMessage()).isEqualTo("Cassandra timeout during read query at consistency LOCAL_ONE (1 responses were required but only 0 replica responded)");
92+ assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_ONE);
9393 assertThat(e.getReceivedAcknowledgements()).isEqualTo(0);
9494 assertThat(e.getRequiredAcknowledgements()).isEqualTo(1);
9595 assertThat(e.getAddress()).isEqualTo(host1.getSocketAddress());
@@ -104,8 +104,8 @@
104104 query();
105105 fail("expected a WriteTimeoutException");
106106 } catch (WriteTimeoutException e) {
107- assertThat(e.getMessage()).isEqualTo("Cassandra timeout during write query at consistency LOCAL_QUORUM (1 replica were required but only 0 acknowledged the write)");
108- assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_QUORUM);
107+ assertThat(e.getMessage()).isEqualTo("Cassandra timeout during write query at consistency LOCAL_ONE (1 replica were required but only 0 acknowledged the write)");
108+ assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_ONE);
109109 assertThat(e.getReceivedAcknowledgements()).isEqualTo(0);
110110 assertThat(e.getRequiredAcknowledgements()).isEqualTo(1);
111111 assertThat(e.getWriteType()).isEqualTo(WriteType.SIMPLE);
modified upgrade_guide/README.md +1 −1
@@ -11,7 +11,7 @@
1111 The main changes were introduced by the custom codecs feature (see below).
1212 We've also seized the opportunity to remove code that was deprecated in 2.1.
1313
14-1. The default consistency level in `QueryOptions` is now `LOCAL_QUORUM`.
14+1. The default consistency level in `QueryOptions` is now `LOCAL_ONE`.
1515 2. [Custom codecs](../features/custom_codecs/)
1616 ([JAVA-721](https://datastax-oss.atlassian.net/browse/JAVA-721))
1717 introduce several breaking changes and also modify a few runtime behaviors.