kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | e1b0741e5c51c7b3f2df807c1f67bc6f7759e87d4896f5fcac9a52fd6fc21696 |
|---|---|
| Author | Alexandre Dutra <alexandre.dutra@datastax.com> · 2015-11-26 12:19 +01:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2015-12-03 18:13 +01:00 |
| Parents | e75c6c2093c0 |
4 files changed
modified changelog/README.md +1 −0
| @@ -7,6 +7,7 @@ | ||
| 7 | 7 | - [bug] JAVA-998: SchemaChangeListener not invoked for Functions or Aggregates having UDT arguments. |
| 8 | 8 | - [bug] JAVA-1009: use CL ONE to compute query plan when reconnecting |
| 9 | 9 | control connection. |
| 10 | +- [improvement] JAVA-1003: Change default consistency level to LOCAL_ONE (amends JAVA-926). | |
| 10 | 11 | |
| 11 | 12 | Merged from 2.1 branch: |
| 12 | 13 |
modified driver-core/src/main/java/com/datastax/driver/core/QueryOptions.java +2 −2
| @@ -23,9 +23,9 @@ | ||
| 23 | 23 | public class QueryOptions { |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | - * The default consistency level for queries: {@link ConsistencyLevel#LOCAL_QUORUM}. | |
| 26 | + * The default consistency level for queries: {@link ConsistencyLevel#LOCAL_ONE}. | |
| 27 | 27 | */ |
| 28 | - public static final ConsistencyLevel DEFAULT_CONSISTENCY_LEVEL = ConsistencyLevel.LOCAL_QUORUM; | |
| 28 | + public static final ConsistencyLevel DEFAULT_CONSISTENCY_LEVEL = ConsistencyLevel.LOCAL_ONE; | |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * 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 @@ | ||
| 33 | 33 | import com.datastax.driver.core.*; |
| 34 | 34 | import com.datastax.driver.core.policies.FallthroughRetryPolicy; |
| 35 | 35 | |
| 36 | -import static com.datastax.driver.core.ConsistencyLevel.LOCAL_QUORUM; | |
| 36 | +import static com.datastax.driver.core.ConsistencyLevel.LOCAL_ONE; | |
| 37 | 37 | |
| 38 | 38 | public class ExceptionsScassandraTest { |
| 39 | 39 | |
| @@ -72,8 +72,8 @@ | ||
| 72 | 72 | query(); |
| 73 | 73 | fail("expected an UnavailableException"); |
| 74 | 74 | } 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); | |
| 77 | 77 | assertThat(e.getAliveReplicas()).isEqualTo(0); |
| 78 | 78 | assertThat(e.getRequiredReplicas()).isEqualTo(1); |
| 79 | 79 | assertThat(e.getAddress()).isEqualTo(host1.getSocketAddress()); |
| @@ -88,8 +88,8 @@ | ||
| 88 | 88 | query(); |
| 89 | 89 | fail("expected a ReadTimeoutException"); |
| 90 | 90 | } 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); | |
| 93 | 93 | assertThat(e.getReceivedAcknowledgements()).isEqualTo(0); |
| 94 | 94 | assertThat(e.getRequiredAcknowledgements()).isEqualTo(1); |
| 95 | 95 | assertThat(e.getAddress()).isEqualTo(host1.getSocketAddress()); |
| @@ -104,8 +104,8 @@ | ||
| 104 | 104 | query(); |
| 105 | 105 | fail("expected a WriteTimeoutException"); |
| 106 | 106 | } 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); | |
| 109 | 109 | assertThat(e.getReceivedAcknowledgements()).isEqualTo(0); |
| 110 | 110 | assertThat(e.getRequiredAcknowledgements()).isEqualTo(1); |
| 111 | 111 | assertThat(e.getWriteType()).isEqualTo(WriteType.SIMPLE); |
modified upgrade_guide/README.md +1 −1
| @@ -11,7 +11,7 @@ | ||
| 11 | 11 | The main changes were introduced by the custom codecs feature (see below). |
| 12 | 12 | We've also seized the opportunity to remove code that was deprecated in 2.1. |
| 13 | 13 | |
| 14 | -1. The default consistency level in `QueryOptions` is now `LOCAL_QUORUM`. | |
| 14 | +1. The default consistency level in `QueryOptions` is now `LOCAL_ONE`. | |
| 15 | 15 | 2. [Custom codecs](../features/custom_codecs/) |
| 16 | 16 | ([JAVA-721](https://datastax-oss.atlassian.net/browse/JAVA-721)) |
| 17 | 17 | introduce several breaking changes and also modify a few runtime behaviors. |