Elffuss BraidHub

kikocis/java-driver public

Merge branch 'java926' into 3.0
Changesetb32f1acac85e3c61c42c773a2402edfe5ce7c89dc289afeba2f245d8f9a63757
Authorolim7t <omichallat+github@gmail.com> · 2015-10-12 11:47 +02:00
Committerolim7t <omichallat+github@gmail.com> · 2015-10-12 11:47 +02:00
Parentseeaba16c0f88, 0e8fa2afd953

Browse the files at this changeset

4 files changed

modified changelog/README.md +5 −0
@@ -1,5 +1,10 @@
11 ## Changelog
22
3+### 3.0.0-beta1
4+
5+- [improvement] Change default consistency level to LOCAL_QUORUM (JAVA-926)
6+
7+
38 ### 3.0.0-alpha3
49
510 - [new feature] Support new system tables in C* 3.0 (JAVA-571)
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#ONE}.
26+ * The default consistency level for queries: {@link ConsistencyLevel#LOCAL_QUORUM}.
2727 */
28- public static final ConsistencyLevel DEFAULT_CONSISTENCY_LEVEL = ConsistencyLevel.ONE;
28+ public static final ConsistencyLevel DEFAULT_CONSISTENCY_LEVEL = ConsistencyLevel.LOCAL_QUORUM;
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
@@ -32,7 +32,7 @@
3232 import com.datastax.driver.core.*;
3333 import com.datastax.driver.core.policies.FallthroughRetryPolicy;
3434
35-import static com.datastax.driver.core.ConsistencyLevel.ONE;
35+import static com.datastax.driver.core.ConsistencyLevel.LOCAL_QUORUM;
3636
3737 public class ExceptionsScassandraTest {
3838
@@ -67,8 +67,8 @@
6767 query();
6868 fail("expected an UnavailableException");
6969 } catch (UnavailableException e) {
70- assertThat(e.getMessage()).isEqualTo("Not enough replicas available for query at consistency ONE (1 required but only 0 alive)");
71- assertThat(e.getConsistencyLevel()).isEqualTo(ONE);
70+ assertThat(e.getMessage()).isEqualTo("Not enough replicas available for query at consistency LOCAL_QUORUM (1 required but only 0 alive)");
71+ assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_QUORUM);
7272 assertThat(e.getAliveReplicas()).isEqualTo(0);
7373 assertThat(e.getRequiredReplicas()).isEqualTo(1);
7474 assertThat(e.getAddress()).isEqualTo(host1.getSocketAddress());
@@ -83,8 +83,8 @@
8383 query();
8484 fail("expected a ReadTimeoutException");
8585 } catch (ReadTimeoutException e) {
86- assertThat(e.getMessage()).isEqualTo("Cassandra timeout during read query at consistency ONE (1 responses were required but only 0 replica responded)");
87- assertThat(e.getConsistencyLevel()).isEqualTo(ONE);
86+ assertThat(e.getMessage()).isEqualTo("Cassandra timeout during read query at consistency LOCAL_QUORUM (1 responses were required but only 0 replica responded)");
87+ assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_QUORUM);
8888 assertThat(e.getReceivedAcknowledgements()).isEqualTo(0);
8989 assertThat(e.getRequiredAcknowledgements()).isEqualTo(1);
9090 assertThat(e.getAddress()).isEqualTo(host1.getSocketAddress());
@@ -99,8 +99,8 @@
9999 query();
100100 fail("expected a WriteTimeoutException");
101101 } catch (WriteTimeoutException e) {
102- assertThat(e.getMessage()).isEqualTo("Cassandra timeout during write query at consistency ONE (1 replica were required but only 0 acknowledged the write)");
103- assertThat(e.getConsistencyLevel()).isEqualTo(ONE);
102+ assertThat(e.getMessage()).isEqualTo("Cassandra timeout during write query at consistency LOCAL_QUORUM (1 replica were required but only 0 acknowledged the write)");
103+ assertThat(e.getConsistencyLevel()).isEqualTo(LOCAL_QUORUM);
104104 assertThat(e.getReceivedAcknowledgements()).isEqualTo(0);
105105 assertThat(e.getRequiredAcknowledgements()).isEqualTo(1);
106106 assertThat(e.getWriteType()).isEqualTo(WriteType.SIMPLE);
modified upgrade_guide/README.md +21 −20
@@ -3,15 +3,16 @@
33 The purpose of this guide is to detail changes made by successive
44 versions of the Java driver.
55
6-### 2.2.0
6+### 3.0
77
8-This version brings parity with Cassandra 2.2.
8+This version brings parity with Cassandra 2.2 and 3.0.
99
1010 It is **not binary compatible** with the driver's 2.1 branch.
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. [Custom codecs](../features/custom_codecs/)
14+1. The default consistency level in `QueryOptions` is now `LOCAL_QUORUM`.
15+2. [Custom codecs](../features/custom_codecs/)
1516 ([JAVA-721](https://datastax-oss.atlassian.net/browse/JAVA-721))
1617 introduce several breaking changes and also modify a few runtime behaviors.
1718
@@ -66,18 +67,18 @@
6667 * `TypeCodec.format(Object)` now returns the CQL keyword `"NULL"` instead of a `null` reference
6768 for `null` inputs.
6869
69-2. The driver now depends on Guava 16.0.1 (instead of 14.0.1).
70+3. The driver now depends on Guava 16.0.1 (instead of 14.0.1).
7071 This update has been mainly motivated by Guava's [Issue #1635](https://code.google.com/p/guava-libraries/issues/detail?id=1635),
7172 which affects `TypeToken`, and hence all `TypeCodec` implementations handling parameterized types.
7273
73-3. `UDTMapper` (the type previously used to convert `@UDT`-annotated
74+4. `UDTMapper` (the type previously used to convert `@UDT`-annotated
7475 classes to their CQL counterpart) was removed, as well as the
7576 corresponding method `MappingManager#udtMapper`.
7677
7778 The mapper now uses custom codecs to convert UDTs. See more
7879 explanations [here](../features/object_mapper/custom_codecs/#implicit-udt-codecs).
7980
80-4. All methods that took the protocol version as an `int` or assumed a
81+5. All methods that took the protocol version as an `int` or assumed a
8182 default version have been removed (they were already deprecated in
8283 2.1):
8384 * `AbstractGettableData(int)`
@@ -91,19 +92,19 @@
9192 enum. In addition, `ProtocolOptions#getProtocolVersionEnum` has been
9293 renamed to `ProtocolOptions#getProtocolVersion`.
9394
94-5. All methods related to the "suspected" host state have been removed
95+6. All methods related to the "suspected" host state have been removed
9596 (they had been deprecated in 2.1.6 when the suspicion mechanism was
9697 removed):
9798 * `Host.StateListener#onSuspected()` (was inherited by
9899 `LoadBalancingPolicy`)
99100 * `Host#getInitialReconnectionAttemptFuture()`
100101
101-6. `PoolingOptions#setMinSimultaneousRequestsPerConnectionThreshold(HostDistance,
102+7. `PoolingOptions#setMinSimultaneousRequestsPerConnectionThreshold(HostDistance,
102103 int)` has been removed. The new connection pool resizing algorithm introduced by
103104 [JAVA-419](https://datastax-oss.atlassian.net/browse/JAVA-419) does not need this
104105 threshold anymore.
105106
106-7. `AddressTranslater` has been renamed to `AddressTranslator`. All
107+8. `AddressTranslater` has been renamed to `AddressTranslator`. All
107108 related methods and classes have also been renamed.
108109
109110 In addition, the `close()` method has been pulled up into
@@ -111,12 +112,12 @@
111112 Existing third-party `AddressTranslator` implementations only need
112113 to add an empty `close()` method.
113114
114-8. The `close()` method has been pulled up into `LoadBalancingPolicy`,
115+9. The `close()` method has been pulled up into `LoadBalancingPolicy`,
115116 and `CloseableLoadBalancingPolicy` has been removed. Existing third-party
116117 `LoadBalancingPolicy` implementations only need to add an empty
117118 `close()` method.
118119
119-9. All pluggable components now have callbacks to detect when they get
120+10. All pluggable components now have callbacks to detect when they get
120121 associated with a `Cluster` instance:
121122 * `ReconnectionPolicy`, `RetryPolicy`, `AddressTranslator`,
122123 and `TimestampGenerator`:
@@ -130,22 +131,22 @@
130131 initialization / cleanup tasks. Existing third-party implementations
131132 only need to add empty methods.
132133
133-10. `LoadBalancingPolicy` does not extend `Host.StateListener` anymore:
134+11. `LoadBalancingPolicy` does not extend `Host.StateListener` anymore:
134135 callback methods (`onUp`, `onDown`, etc.) have been duplicated. This
135136 is unlikely to affect clients.
136137
137-11. [Client-side timestamp generation](../features/query_timestamps/) is
138+12. [Client-side timestamp generation](../features/query_timestamps/) is
138139 now the default (provided that [native
139140 protocol](../features/native_protocol) v3 or higher is in use). The
140141 generator used is `AtomicMonotonicTimestampGenerator`.
141142
142-12. If a DNS name resolves to multiple A-records,
143+13. If a DNS name resolves to multiple A-records,
143144 `Cluster.Builder#addContactPoint(String)` will now use all of these
144145 addresses as contact points. This gives you the possibility of
145146 maintaining contact points in DNS configuration, and having a single,
146147 static contact point in your Java code.
147148
148-13. The following methods were added for [Custom payloads](../features/custom_payloads):
149+14. The following methods were added for [Custom payloads](../features/custom_payloads):
149150 * in `PreparedStatement`: `getIncomingPayload()`,
150151 `getOutgoingPayload()` and
151152 `setOutgoingPayload(Map<String,ByteBuffer>)`
@@ -158,7 +159,7 @@
158159 This breaks binary compatibility for these two classes; if you have
159160 custom implementations, you will have to adapt them accordingly.
160161
161-14. Getters and setters have been added to "data-container" classes for
162+15. Getters and setters have been added to "data-container" classes for
162163 new CQL types:
163164 * `getByte`/`setByte` for the `TINYINT` type
164165 * `getShort`/`setShort` for the `SMALLINT` type
@@ -170,7 +171,7 @@
170171
171172 This affects `Row`, `BoundStatement`, `TupleValue` and `UDTValue`.
172173
173-15. New exception types have been added to handle additional server-side
174+16. New exception types have been added to handle additional server-side
174175 errors introduced in Cassandra 2.2:
175176 * `ReadFailureException`
176177 * `WriteFailureException`
@@ -185,19 +186,19 @@
185186 exception hierarchy, it now has new child classes that are not
186187 related to timeouts).
187188
188-16. `ResultSet#fetchMoreResults()` now returns a `ListenableFuture<ResultSet>`.
189+17. `ResultSet#fetchMoreResults()` now returns a `ListenableFuture<ResultSet>`.
189190 This makes the API more friendly if you chain transformations on an async
190191 query to process all pages (see `AsyncResultSetTest` in the sources for an
191192 example).
192193
193-17. `Frozen` annotations in the mapper are no longer checked at runtime (see
194+18. `Frozen` annotations in the mapper are no longer checked at runtime (see
194195 [JAVA-843](https://datastax-oss.atlassian.net/browse/JAVA-843) for more
195196 explanations). So they become purely informational at this stage.
196197 However it is a good idea to keep using these annotations and make sure
197198 they match the schema, in anticipation for the schema generation features
198199 that will be added in a future version.
199200
200-18. `AsyncInitSession` has been removed, `initAsync()` is now part of the
201+19. `AsyncInitSession` has been removed, `initAsync()` is now part of the
201202 `Session` interface (the only purpose of the extra interface was to preserve
202203 binary compatibility on the 2.1 branch).
203204