kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | b32f1acac85e3c61c42c773a2402edfe5ce7c89dc289afeba2f245d8f9a63757 |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2015-10-12 11:47 +02:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2015-10-12 11:47 +02:00 |
| Parents | eeaba16c0f88, 0e8fa2afd953 |
4 files changed
modified changelog/README.md +5 −0
| @@ -1,5 +1,10 @@ | ||
| 1 | 1 | ## Changelog |
| 2 | 2 | |
| 3 | +### 3.0.0-beta1 | |
| 4 | + | |
| 5 | +- [improvement] Change default consistency level to LOCAL_QUORUM (JAVA-926) | |
| 6 | + | |
| 7 | + | |
| 3 | 8 | ### 3.0.0-alpha3 |
| 4 | 9 | |
| 5 | 10 | - [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 @@ | ||
| 23 | 23 | public class QueryOptions { |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | - * The default consistency level for queries: {@link ConsistencyLevel#ONE}. | |
| 26 | + * The default consistency level for queries: {@link ConsistencyLevel#LOCAL_QUORUM}. | |
| 27 | 27 | */ |
| 28 | - public static final ConsistencyLevel DEFAULT_CONSISTENCY_LEVEL = ConsistencyLevel.ONE; | |
| 28 | + public static final ConsistencyLevel DEFAULT_CONSISTENCY_LEVEL = ConsistencyLevel.LOCAL_QUORUM; | |
| 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
| @@ -32,7 +32,7 @@ | ||
| 32 | 32 | import com.datastax.driver.core.*; |
| 33 | 33 | import com.datastax.driver.core.policies.FallthroughRetryPolicy; |
| 34 | 34 | |
| 35 | -import static com.datastax.driver.core.ConsistencyLevel.ONE; | |
| 35 | +import static com.datastax.driver.core.ConsistencyLevel.LOCAL_QUORUM; | |
| 36 | 36 | |
| 37 | 37 | public class ExceptionsScassandraTest { |
| 38 | 38 | |
| @@ -67,8 +67,8 @@ | ||
| 67 | 67 | query(); |
| 68 | 68 | fail("expected an UnavailableException"); |
| 69 | 69 | } 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); | |
| 72 | 72 | assertThat(e.getAliveReplicas()).isEqualTo(0); |
| 73 | 73 | assertThat(e.getRequiredReplicas()).isEqualTo(1); |
| 74 | 74 | assertThat(e.getAddress()).isEqualTo(host1.getSocketAddress()); |
| @@ -83,8 +83,8 @@ | ||
| 83 | 83 | query(); |
| 84 | 84 | fail("expected a ReadTimeoutException"); |
| 85 | 85 | } 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); | |
| 88 | 88 | assertThat(e.getReceivedAcknowledgements()).isEqualTo(0); |
| 89 | 89 | assertThat(e.getRequiredAcknowledgements()).isEqualTo(1); |
| 90 | 90 | assertThat(e.getAddress()).isEqualTo(host1.getSocketAddress()); |
| @@ -99,8 +99,8 @@ | ||
| 99 | 99 | query(); |
| 100 | 100 | fail("expected a WriteTimeoutException"); |
| 101 | 101 | } 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); | |
| 104 | 104 | assertThat(e.getReceivedAcknowledgements()).isEqualTo(0); |
| 105 | 105 | assertThat(e.getRequiredAcknowledgements()).isEqualTo(1); |
| 106 | 106 | assertThat(e.getWriteType()).isEqualTo(WriteType.SIMPLE); |
modified upgrade_guide/README.md +21 −20
| @@ -3,15 +3,16 @@ | ||
| 3 | 3 | The purpose of this guide is to detail changes made by successive |
| 4 | 4 | versions of the Java driver. |
| 5 | 5 | |
| 6 | -### 2.2.0 | |
| 6 | +### 3.0 | |
| 7 | 7 | |
| 8 | -This version brings parity with Cassandra 2.2. | |
| 8 | +This version brings parity with Cassandra 2.2 and 3.0. | |
| 9 | 9 | |
| 10 | 10 | It is **not binary compatible** with the driver's 2.1 branch. |
| 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. [Custom codecs](../features/custom_codecs/) | |
| 14 | +1. The default consistency level in `QueryOptions` is now `LOCAL_QUORUM`. | |
| 15 | +2. [Custom codecs](../features/custom_codecs/) | |
| 15 | 16 | ([JAVA-721](https://datastax-oss.atlassian.net/browse/JAVA-721)) |
| 16 | 17 | introduce several breaking changes and also modify a few runtime behaviors. |
| 17 | 18 | |
| @@ -66,18 +67,18 @@ | ||
| 66 | 67 | * `TypeCodec.format(Object)` now returns the CQL keyword `"NULL"` instead of a `null` reference |
| 67 | 68 | for `null` inputs. |
| 68 | 69 | |
| 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). | |
| 70 | 71 | This update has been mainly motivated by Guava's [Issue #1635](https://code.google.com/p/guava-libraries/issues/detail?id=1635), |
| 71 | 72 | which affects `TypeToken`, and hence all `TypeCodec` implementations handling parameterized types. |
| 72 | 73 | |
| 73 | -3. `UDTMapper` (the type previously used to convert `@UDT`-annotated | |
| 74 | +4. `UDTMapper` (the type previously used to convert `@UDT`-annotated | |
| 74 | 75 | classes to their CQL counterpart) was removed, as well as the |
| 75 | 76 | corresponding method `MappingManager#udtMapper`. |
| 76 | 77 | |
| 77 | 78 | The mapper now uses custom codecs to convert UDTs. See more |
| 78 | 79 | explanations [here](../features/object_mapper/custom_codecs/#implicit-udt-codecs). |
| 79 | 80 | |
| 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 | |
| 81 | 82 | default version have been removed (they were already deprecated in |
| 82 | 83 | 2.1): |
| 83 | 84 | * `AbstractGettableData(int)` |
| @@ -91,19 +92,19 @@ | ||
| 91 | 92 | enum. In addition, `ProtocolOptions#getProtocolVersionEnum` has been |
| 92 | 93 | renamed to `ProtocolOptions#getProtocolVersion`. |
| 93 | 94 | |
| 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 | |
| 95 | 96 | (they had been deprecated in 2.1.6 when the suspicion mechanism was |
| 96 | 97 | removed): |
| 97 | 98 | * `Host.StateListener#onSuspected()` (was inherited by |
| 98 | 99 | `LoadBalancingPolicy`) |
| 99 | 100 | * `Host#getInitialReconnectionAttemptFuture()` |
| 100 | 101 | |
| 101 | -6. `PoolingOptions#setMinSimultaneousRequestsPerConnectionThreshold(HostDistance, | |
| 102 | +7. `PoolingOptions#setMinSimultaneousRequestsPerConnectionThreshold(HostDistance, | |
| 102 | 103 | int)` has been removed. The new connection pool resizing algorithm introduced by |
| 103 | 104 | [JAVA-419](https://datastax-oss.atlassian.net/browse/JAVA-419) does not need this |
| 104 | 105 | threshold anymore. |
| 105 | 106 | |
| 106 | -7. `AddressTranslater` has been renamed to `AddressTranslator`. All | |
| 107 | +8. `AddressTranslater` has been renamed to `AddressTranslator`. All | |
| 107 | 108 | related methods and classes have also been renamed. |
| 108 | 109 | |
| 109 | 110 | In addition, the `close()` method has been pulled up into |
| @@ -111,12 +112,12 @@ | ||
| 111 | 112 | Existing third-party `AddressTranslator` implementations only need |
| 112 | 113 | to add an empty `close()` method. |
| 113 | 114 | |
| 114 | -8. The `close()` method has been pulled up into `LoadBalancingPolicy`, | |
| 115 | +9. The `close()` method has been pulled up into `LoadBalancingPolicy`, | |
| 115 | 116 | and `CloseableLoadBalancingPolicy` has been removed. Existing third-party |
| 116 | 117 | `LoadBalancingPolicy` implementations only need to add an empty |
| 117 | 118 | `close()` method. |
| 118 | 119 | |
| 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 | |
| 120 | 121 | associated with a `Cluster` instance: |
| 121 | 122 | * `ReconnectionPolicy`, `RetryPolicy`, `AddressTranslator`, |
| 122 | 123 | and `TimestampGenerator`: |
| @@ -130,22 +131,22 @@ | ||
| 130 | 131 | initialization / cleanup tasks. Existing third-party implementations |
| 131 | 132 | only need to add empty methods. |
| 132 | 133 | |
| 133 | -10. `LoadBalancingPolicy` does not extend `Host.StateListener` anymore: | |
| 134 | +11. `LoadBalancingPolicy` does not extend `Host.StateListener` anymore: | |
| 134 | 135 | callback methods (`onUp`, `onDown`, etc.) have been duplicated. This |
| 135 | 136 | is unlikely to affect clients. |
| 136 | 137 | |
| 137 | -11. [Client-side timestamp generation](../features/query_timestamps/) is | |
| 138 | +12. [Client-side timestamp generation](../features/query_timestamps/) is | |
| 138 | 139 | now the default (provided that [native |
| 139 | 140 | protocol](../features/native_protocol) v3 or higher is in use). The |
| 140 | 141 | generator used is `AtomicMonotonicTimestampGenerator`. |
| 141 | 142 | |
| 142 | -12. If a DNS name resolves to multiple A-records, | |
| 143 | +13. If a DNS name resolves to multiple A-records, | |
| 143 | 144 | `Cluster.Builder#addContactPoint(String)` will now use all of these |
| 144 | 145 | addresses as contact points. This gives you the possibility of |
| 145 | 146 | maintaining contact points in DNS configuration, and having a single, |
| 146 | 147 | static contact point in your Java code. |
| 147 | 148 | |
| 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): | |
| 149 | 150 | * in `PreparedStatement`: `getIncomingPayload()`, |
| 150 | 151 | `getOutgoingPayload()` and |
| 151 | 152 | `setOutgoingPayload(Map<String,ByteBuffer>)` |
| @@ -158,7 +159,7 @@ | ||
| 158 | 159 | This breaks binary compatibility for these two classes; if you have |
| 159 | 160 | custom implementations, you will have to adapt them accordingly. |
| 160 | 161 | |
| 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 | |
| 162 | 163 | new CQL types: |
| 163 | 164 | * `getByte`/`setByte` for the `TINYINT` type |
| 164 | 165 | * `getShort`/`setShort` for the `SMALLINT` type |
| @@ -170,7 +171,7 @@ | ||
| 170 | 171 | |
| 171 | 172 | This affects `Row`, `BoundStatement`, `TupleValue` and `UDTValue`. |
| 172 | 173 | |
| 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 | |
| 174 | 175 | errors introduced in Cassandra 2.2: |
| 175 | 176 | * `ReadFailureException` |
| 176 | 177 | * `WriteFailureException` |
| @@ -185,19 +186,19 @@ | ||
| 185 | 186 | exception hierarchy, it now has new child classes that are not |
| 186 | 187 | related to timeouts). |
| 187 | 188 | |
| 188 | -16. `ResultSet#fetchMoreResults()` now returns a `ListenableFuture<ResultSet>`. | |
| 189 | +17. `ResultSet#fetchMoreResults()` now returns a `ListenableFuture<ResultSet>`. | |
| 189 | 190 | This makes the API more friendly if you chain transformations on an async |
| 190 | 191 | query to process all pages (see `AsyncResultSetTest` in the sources for an |
| 191 | 192 | example). |
| 192 | 193 | |
| 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 | |
| 194 | 195 | [JAVA-843](https://datastax-oss.atlassian.net/browse/JAVA-843) for more |
| 195 | 196 | explanations). So they become purely informational at this stage. |
| 196 | 197 | However it is a good idea to keep using these annotations and make sure |
| 197 | 198 | they match the schema, in anticipation for the schema generation features |
| 198 | 199 | that will be added in a future version. |
| 199 | 200 | |
| 200 | -18. `AsyncInitSession` has been removed, `initAsync()` is now part of the | |
| 201 | +19. `AsyncInitSession` has been removed, `initAsync()` is now part of the | |
| 201 | 202 | `Session` interface (the only purpose of the extra interface was to preserve |
| 202 | 203 | binary compatibility on the 2.1 branch). |
| 203 | 204 |