kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 503af700a0780ef0a39c15beae22c98ebad051203daa28b43cba2bba34c1c0b5 |
|---|---|
| Author | Alexandre Dutra <adutra@users.noreply.github.com> · 2017-03-02 10:58 +01:00 |
| Committer | GitHub <noreply@github.com> · 2017-03-02 10:58 +01:00 |
| Parents | b7d84d56c31c, 139d88f37c84 |
20 files changed
modified driver-core/src/main/java/com/datastax/driver/core/Connection.java +2 −1
| @@ -1211,6 +1211,7 @@ | ||
| 1211 | 1211 | |
| 1212 | 1212 | ChannelFuture future = channel.close(); |
| 1213 | 1213 | future.addListener(new ChannelFutureListener() { |
| 1214 | + @Override | |
| 1214 | 1215 | public void operationComplete(ChannelFuture future) { |
| 1215 | 1216 | factory.allChannels.remove(channel); |
| 1216 | 1217 | if (future.cause() != null) { |
| @@ -1421,7 +1422,7 @@ | ||
| 1421 | 1422 | pipeline.addLast("ssl", sslOptions.newSSLHandler(channel)); |
| 1422 | 1423 | } |
| 1423 | 1424 | |
| 1424 | - // pipeline.addLast("debug", new LoggingHandler(LogLevel.INFO)); | |
| 1425 | + // pipeline.addLast("debug", new LoggingHandler(LogLevel.INFO)); | |
| 1425 | 1426 | |
| 1426 | 1427 | pipeline.addLast("frameDecoder", new Frame.Decoder()); |
| 1427 | 1428 | pipeline.addLast("frameEncoder", frameEncoder); |
modified driver-core/src/main/java/com/datastax/driver/core/DataType.java +1 −1
| @@ -709,7 +709,7 @@ | ||
| 709 | 709 | * The driver provides a minimal support for such types through |
| 710 | 710 | * instances of this class. |
| 711 | 711 | * <p/> |
| 712 | - * A codec for custom types can be obtained via {@link TypeCodec#custom(CustomType)}. | |
| 712 | + * A codec for custom types can be obtained via {@link TypeCodec#custom(DataType.CustomType)}. | |
| 713 | 713 | */ |
| 714 | 714 | public static class CustomType extends DataType { |
| 715 | 715 |
modified driver-core/src/main/java/com/datastax/driver/core/TypeCodec.java +4 −2
| @@ -90,8 +90,10 @@ | ||
| 90 | 90 | * the wrapper Java class instead, and implement the appropriate interface |
| 91 | 91 | * (e.g. {@link com.datastax.driver.core.TypeCodec.PrimitiveBooleanCodec} for primitive {@code boolean} types; |
| 92 | 92 | * there is one such interface for each Java primitive type).</li> |
| 93 | - * <li>TypeCodec implementations should not consume {@link ByteBuffer} instances by performing read operations | |
| 94 | - * that modify their current position; if necessary, codecs should {@link ByteBuffer#duplicate()} duplicate} them.</li> | |
| 93 | + * <li>When deserializing, TypeCodec implementations should not consume {@link ByteBuffer} instances | |
| 94 | + * by performing relative read operations that modify their current position; | |
| 95 | + * codecs should instead prefer absolute read methods, or, if necessary, they should | |
| 96 | + * {@link ByteBuffer#duplicate() duplicate} their byte buffers prior to reading them.</li> | |
| 95 | 97 | * </ol> |
| 96 | 98 | * |
| 97 | 99 | * @param <T> The codec's Java type |
modified driver-core/src/main/java/com/datastax/driver/core/policies/FallthroughRetryPolicy.java +1 −1
| @@ -24,7 +24,7 @@ | ||
| 24 | 24 | /** |
| 25 | 25 | * A retry policy that never retries (nor ignores). |
| 26 | 26 | * <p/> |
| 27 | - * All of the methods of this retry policy unconditionally return {@link RetryDecision#rethrow()}. | |
| 27 | + * All of the methods of this retry policy unconditionally return {@link RetryPolicy.RetryDecision#rethrow()}. | |
| 28 | 28 | * If this policy is used, retry logic will have to be implemented in business code. |
| 29 | 29 | */ |
| 30 | 30 | public class FallthroughRetryPolicy implements RetryPolicy { |
modified driver-core/src/main/java/com/datastax/driver/core/utils/UUIDs.java +0 −2
| @@ -35,8 +35,6 @@ | ||
| 35 | 35 | private UUIDs() { |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - ; | |
| 39 | - | |
| 40 | 38 | // http://www.ietf.org/rfc/rfc4122.txt |
| 41 | 39 | private static final long START_EPOCH = makeEpoch(); |
| 42 | 40 | private static final long CLOCK_SEQ_AND_NODE = makeClockSeqAndNode(); |
modified driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java +2 −2
| @@ -44,6 +44,7 @@ | ||
| 44 | 44 | import static com.datastax.driver.core.TestUtils.ipOfNode; |
| 45 | 45 | import static com.datastax.driver.core.TestUtils.nonQuietClusterCloseOptions; |
| 46 | 46 | import static org.mockito.Mockito.*; |
| 47 | +import static org.scassandra.http.client.PrimingRequest.then; | |
| 47 | 48 | |
| 48 | 49 | public class ClusterInitTest { |
| 49 | 50 | private static final Logger logger = LoggerFactory.getLogger(ClusterInitTest.class); |
| @@ -278,8 +279,7 @@ | ||
| 278 | 279 | primingClient.prime( |
| 279 | 280 | PrimingRequest.queryBuilder() |
| 280 | 281 | .withQuery("SELECT * FROM system.peers") |
| 281 | - .withColumnTypes(ScassandraCluster.SELECT_PEERS) | |
| 282 | - .withRows(rows) | |
| 282 | + .withThen(then().withRows(rows).withColumnTypes(ScassandraCluster.SELECT_PEERS)) | |
| 283 | 283 | .build()); |
| 284 | 284 | } |
| 285 | 285 | } |
modified driver-core/src/test/java/com/datastax/driver/core/ConnectionReleaseTest.java +5 −4
| @@ -28,6 +28,7 @@ | ||
| 28 | 28 | import java.util.concurrent.TimeoutException; |
| 29 | 29 | |
| 30 | 30 | import static org.assertj.core.api.Assertions.assertThat; |
| 31 | +import static org.scassandra.http.client.PrimingRequest.then; | |
| 31 | 32 | import static org.testng.Assert.fail; |
| 32 | 33 | |
| 33 | 34 | public class ConnectionReleaseTest extends ScassandraTestBase { |
| @@ -66,20 +67,20 @@ | ||
| 66 | 67 | primingClient.prime( |
| 67 | 68 | PrimingRequest.queryBuilder() |
| 68 | 69 | .withQuery("mock query") |
| 69 | - .withRows(ImmutableMap.of("key", 1)) | |
| 70 | - .withFixedDelay(10000) | |
| 70 | + .withThen(then().withRows(ImmutableMap.of("key", 1)) | |
| 71 | + .withFixedDelay(10000L)) | |
| 71 | 72 | .build() |
| 72 | 73 | ); |
| 73 | 74 | primingClient.prime( |
| 74 | 75 | PrimingRequest.queryBuilder() |
| 75 | 76 | .withQuery("select c from test1 where k=1") |
| 76 | - .withRows(ImmutableMap.of("c", "hello")) | |
| 77 | + .withThen(then().withRows(ImmutableMap.of("c", "hello"))) | |
| 77 | 78 | .build() |
| 78 | 79 | ); |
| 79 | 80 | primingClient.prime( |
| 80 | 81 | PrimingRequest.queryBuilder() |
| 81 | 82 | .withQuery("select n from test2 where c='hello'") |
| 82 | - .withRows(ImmutableMap.of("n", "world")) | |
| 83 | + .withThen(then().withRows(ImmutableMap.of("n", "world"))) | |
| 83 | 84 | .build() |
| 84 | 85 | ); |
| 85 | 86 |
modified driver-core/src/test/java/com/datastax/driver/core/HostAssert.java +7 −0
| @@ -123,6 +123,7 @@ | ||
| 123 | 123 | public HostAssert goesDownWithin(long duration, TimeUnit unit) { |
| 124 | 124 | final CountDownLatch downSignal = new CountDownLatch(1); |
| 125 | 125 | StateListener upListener = new StateListenerBase() { |
| 126 | + @Override | |
| 126 | 127 | public void onDown(Host host) { |
| 127 | 128 | downSignal.countDown(); |
| 128 | 129 | } |
| @@ -141,31 +142,37 @@ | ||
| 141 | 142 | return this; |
| 142 | 143 | } |
| 143 | 144 | |
| 145 | + @SuppressWarnings("deprecation") | |
| 144 | 146 | public HostAssert hasWorkload(String workload) { |
| 145 | 147 | assertThat(actual.getDseWorkload()).isNotNull().isEqualTo(workload); |
| 146 | 148 | return this; |
| 147 | 149 | } |
| 148 | 150 | |
| 151 | + @SuppressWarnings("deprecation") | |
| 149 | 152 | public HostAssert hasNoWorkload() { |
| 150 | 153 | assertThat(actual.getDseWorkload()).isNull(); |
| 151 | 154 | return this; |
| 152 | 155 | } |
| 153 | 156 | |
| 157 | + @SuppressWarnings("deprecation") | |
| 154 | 158 | public HostAssert hasDseVersion(VersionNumber versionNumber) { |
| 155 | 159 | assertThat(actual.getDseVersion()).isNotNull().isEqualTo(versionNumber); |
| 156 | 160 | return this; |
| 157 | 161 | } |
| 158 | 162 | |
| 163 | + @SuppressWarnings("deprecation") | |
| 159 | 164 | public HostAssert hasNoDseVersion() { |
| 160 | 165 | assertThat(actual.getDseVersion()).isNull(); |
| 161 | 166 | return this; |
| 162 | 167 | } |
| 163 | 168 | |
| 169 | + @SuppressWarnings("deprecation") | |
| 164 | 170 | public HostAssert hasDseGraph() { |
| 165 | 171 | assertThat(actual.isDseGraphEnabled()).isTrue(); |
| 166 | 172 | return this; |
| 167 | 173 | } |
| 168 | 174 | |
| 175 | + @SuppressWarnings("deprecation") | |
| 169 | 176 | public HostAssert hasNoDseGraph() { |
| 170 | 177 | assertThat(actual.isDseGraphEnabled()).isFalse(); |
| 171 | 178 | return this; |
modified driver-core/src/test/java/com/datastax/driver/core/RequestHandlerTest.java +6 −2
| @@ -20,10 +20,14 @@ | ||
| 20 | 20 | import org.scassandra.http.client.PrimingRequest; |
| 21 | 21 | import org.testng.annotations.Test; |
| 22 | 22 | |
| 23 | +import java.util.Collections; | |
| 24 | +import java.util.List; | |
| 25 | +import java.util.Map; | |
| 23 | 26 | import java.util.concurrent.TimeUnit; |
| 24 | 27 | import java.util.concurrent.TimeoutException; |
| 25 | 28 | |
| 26 | 29 | import static org.assertj.core.api.Assertions.assertThat; |
| 30 | +import static org.scassandra.http.client.PrimingRequest.then; | |
| 27 | 31 | |
| 28 | 32 | public class RequestHandlerTest { |
| 29 | 33 | |
| @@ -35,11 +39,11 @@ | ||
| 35 | 39 | try { |
| 36 | 40 | // Use a mock server that takes a constant time to reply |
| 37 | 41 | scassandra.start(); |
| 42 | + List<Map<String, ?>> rows = Collections.<Map<String, ?>>singletonList(ImmutableMap.of("key", 1)); | |
| 38 | 43 | scassandra.primingClient().prime( |
| 39 | 44 | PrimingRequest.queryBuilder() |
| 40 | 45 | .withQuery("mock query") |
| 41 | - .withRows(ImmutableMap.of("key", 1)) | |
| 42 | - .withFixedDelay(10) | |
| 46 | + .withThen(then().withRows(rows).withFixedDelay(10L)) | |
| 43 | 47 | .build() |
| 44 | 48 | ); |
| 45 | 49 |
modified driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java +3 −2
| @@ -27,6 +27,7 @@ | ||
| 27 | 27 | |
| 28 | 28 | import java.net.InetAddress; |
| 29 | 29 | import java.net.InetSocketAddress; |
| 30 | +import java.util.Collections; | |
| 30 | 31 | import java.util.List; |
| 31 | 32 | import java.util.Map; |
| 32 | 33 | import java.util.TreeSet; |
| @@ -364,7 +365,7 @@ | ||
| 364 | 365 | .withQuery(query) |
| 365 | 366 | .withThen(then() |
| 366 | 367 | .withColumnTypes(metadata) |
| 367 | - .withRows(row) | |
| 368 | + .withRows(Collections.<Map<String, ?>>singletonList(row)) | |
| 368 | 369 | .build()) |
| 369 | 370 | .build()); |
| 370 | 371 | } |
| @@ -386,7 +387,7 @@ | ||
| 386 | 387 | .withQuery("select cluster_name from system.local") |
| 387 | 388 | .withThen(then() |
| 388 | 389 | .withColumnTypes(SELECT_CLUSTER_NAME) |
| 389 | - .withRows(clusterNameRow) | |
| 390 | + .withRows(Collections.<Map<String, ?>>singletonList(clusterNameRow)) | |
| 390 | 391 | .build()) |
| 391 | 392 | .build()); |
| 392 | 393 |
modified driver-core/src/test/java/com/datastax/driver/core/SpeculativeExecutionTest.java +10 −14
| @@ -35,6 +35,7 @@ | ||
| 35 | 35 | import static com.datastax.driver.core.Assertions.assertThat; |
| 36 | 36 | import static com.datastax.driver.core.TestUtils.nonQuietClusterCloseOptions; |
| 37 | 37 | import static org.mockito.Mockito.*; |
| 38 | +import static org.scassandra.http.client.PrimingRequest.then; | |
| 38 | 39 | |
| 39 | 40 | public class SpeculativeExecutionTest { |
| 40 | 41 | ScassandraCluster scassandras; |
| @@ -84,7 +85,7 @@ | ||
| 84 | 85 | public void should_not_start_speculative_execution_if_first_execution_completes_successfully() { |
| 85 | 86 | scassandras.node(1).primingClient().prime(PrimingRequest.queryBuilder() |
| 86 | 87 | .withQuery("mock query") |
| 87 | - .withRows(row("result", "result1")) | |
| 88 | + .withThen(then().withRows(row("result", "result1"))) | |
| 88 | 89 | .build() |
| 89 | 90 | ); |
| 90 | 91 | |
| @@ -104,14 +105,14 @@ | ||
| 104 | 105 | scassandras.node(1).primingClient().prime(PrimingRequest.queryBuilder() |
| 105 | 106 | .withQuery("mock query") |
| 106 | 107 | .withConsistency(Consistency.TWO) |
| 107 | - .withResult(Result.read_request_timeout) | |
| 108 | + .withThen(then().withResult(Result.read_request_timeout)) | |
| 108 | 109 | .build() |
| 109 | 110 | ); |
| 110 | 111 | |
| 111 | 112 | scassandras.node(1).primingClient().prime(PrimingRequest.queryBuilder() |
| 112 | 113 | .withQuery("mock query") |
| 113 | 114 | .withConsistency(Consistency.ONE) |
| 114 | - .withRows(row("result", "result1")) | |
| 115 | + .withThen(then().withRows(row("result", "result1"))) | |
| 115 | 116 | .build() |
| 116 | 117 | ); |
| 117 | 118 | |
| @@ -134,14 +135,13 @@ | ||
| 134 | 135 | public void should_start_speculative_execution_if_first_execution_takes_too_long() { |
| 135 | 136 | scassandras.node(1).primingClient().prime(PrimingRequest.queryBuilder() |
| 136 | 137 | .withQuery("mock query") |
| 137 | - .withFixedDelay(400) | |
| 138 | - .withRows(row("result", "result1")) | |
| 138 | + .withThen(then().withRows(row("result", "result1")).withFixedDelay(400L)) | |
| 139 | 139 | .build() |
| 140 | 140 | ); |
| 141 | 141 | |
| 142 | 142 | scassandras.node(2).primingClient().prime(PrimingRequest.queryBuilder() |
| 143 | 143 | .withQuery("mock query") |
| 144 | - .withRows(row("result", "result2")) | |
| 144 | + .withThen(then().withRows(row("result", "result2"))) | |
| 145 | 145 | .build() |
| 146 | 146 | ); |
| 147 | 147 | long execStartCount = errors.getSpeculativeExecutions().getCount(); |
| @@ -163,15 +163,13 @@ | ||
| 163 | 163 | // execution1 starts with host1, which will time out at t=1000 |
| 164 | 164 | .prime(PrimingRequest.queryBuilder() |
| 165 | 165 | .withQuery("mock query") |
| 166 | - .withFixedDelay(2000) | |
| 167 | - .withRows(row("result", "result1")) | |
| 166 | + .withThen(then().withRows(row("result", "result1")).withFixedDelay(2000L)) | |
| 168 | 167 | .build()); |
| 169 | 168 | // at t=1000, execution1 moves to host3, which eventually succeeds at t=1500 |
| 170 | 169 | scassandras.node(3).primingClient() |
| 171 | 170 | .prime(PrimingRequest.queryBuilder() |
| 172 | 171 | .withQuery("mock query") |
| 173 | - .withFixedDelay(500) | |
| 174 | - .withRows(row("result", "result3")) | |
| 172 | + .withThen(then().withRows(row("result", "result3")).withFixedDelay(500L)) | |
| 175 | 173 | .build()); |
| 176 | 174 | // meanwhile, execution2 starts at t=200, using host2 which times out at t=1200 |
| 177 | 175 | // at that time, the query plan is empty so execution2 fails |
| @@ -179,8 +177,7 @@ | ||
| 179 | 177 | scassandras.node(2).primingClient() |
| 180 | 178 | .prime(PrimingRequest.queryBuilder() |
| 181 | 179 | .withQuery("mock query") |
| 182 | - .withFixedDelay(2000) | |
| 183 | - .withRows(row("result", "result2")) | |
| 180 | + .withThen(then().withRows(row("result", "result2")).withFixedDelay(2000L)) | |
| 184 | 181 | .build()); |
| 185 | 182 | long execStartCount = errors.getSpeculativeExecutions().getCount(); |
| 186 | 183 | |
| @@ -247,8 +244,7 @@ | ||
| 247 | 244 | // execution1 starts with host1, which will time out at t=1000 |
| 248 | 245 | .prime(PrimingRequest.queryBuilder() |
| 249 | 246 | .withQuery("mock query") |
| 250 | - .withFixedDelay(2000) | |
| 251 | - .withRows(row("result", "result1")) | |
| 247 | + .withThen(then().withRows(row("result", "result1")).withFixedDelay(2000L)) | |
| 252 | 248 | .build()); |
| 253 | 249 | |
| 254 | 250 | Session session = cluster.connect(); |
modified driver-core/src/test/java/com/datastax/driver/core/TestUtils.java +3 −3
| @@ -129,13 +129,13 @@ | ||
| 129 | 129 | data.setUUID(i, (UUID) value); |
| 130 | 130 | break; |
| 131 | 131 | case LIST: |
| 132 | - data.setList(i, (List) value); | |
| 132 | + data.setList(i, (List<?>) value); | |
| 133 | 133 | break; |
| 134 | 134 | case SET: |
| 135 | - data.setSet(i, (Set) value); | |
| 135 | + data.setSet(i, (Set<?>) value); | |
| 136 | 136 | break; |
| 137 | 137 | case MAP: |
| 138 | - data.setMap(i, (Map) value); | |
| 138 | + data.setMap(i, (Map<?, ?>) value); | |
| 139 | 139 | break; |
| 140 | 140 | default: |
| 141 | 141 | throw new RuntimeException("Missing handling of " + type); |
modified driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsScassandraTest.java +2 −1
| @@ -30,6 +30,7 @@ | ||
| 30 | 30 | import static com.datastax.driver.core.ConsistencyLevel.LOCAL_ONE; |
| 31 | 31 | import static org.assertj.core.api.Assertions.assertThat; |
| 32 | 32 | import static org.assertj.core.api.Assertions.fail; |
| 33 | +import static org.scassandra.http.client.PrimingRequest.then; | |
| 33 | 34 | import static org.scassandra.http.client.Result.*; |
| 34 | 35 | |
| 35 | 36 | public class ExceptionsScassandraTest { |
| @@ -115,7 +116,7 @@ | ||
| 115 | 116 | protected void simulateError(int hostNumber, Result result) { |
| 116 | 117 | scassandras.node(hostNumber).primingClient().prime(PrimingRequest.queryBuilder() |
| 117 | 118 | .withQuery("mock query") |
| 118 | - .withResult(result) | |
| 119 | + .withThen(then().withResult(result)) | |
| 119 | 120 | .build()); |
| 120 | 121 | } |
| 121 | 122 |
modified driver-core/src/test/java/com/datastax/driver/core/policies/AbstractRetryPolicyIntegrationTest.java +7 −5
| @@ -39,6 +39,7 @@ | ||
| 39 | 39 | import static org.assertj.core.api.Assertions.assertThat; |
| 40 | 40 | import static org.mockito.Matchers.*; |
| 41 | 41 | import static org.mockito.Mockito.times; |
| 42 | +import static org.scassandra.http.client.PrimingRequest.then; | |
| 42 | 43 | import static org.scassandra.http.client.Result.overloaded; |
| 43 | 44 | import static org.scassandra.http.client.Result.server_error; |
| 44 | 45 | |
| @@ -109,12 +110,13 @@ | ||
| 109 | 110 | } |
| 110 | 111 | |
| 111 | 112 | protected void simulateError(int hostNumber, Result result, Config config) { |
| 112 | - PrimingRequestBuilder builder = PrimingRequest.queryBuilder() | |
| 113 | - .withQuery("mock query") | |
| 114 | - .withResult(result); | |
| 113 | + PrimingRequest.Then.ThenBuilder then = then().withResult(result); | |
| 114 | + PrimingRequestBuilder builder = PrimingRequest.queryBuilder().withQuery("mock query"); | |
| 115 | 115 | |
| 116 | 116 | if (config != null) |
| 117 | - builder = builder.withConfig(config); | |
| 117 | + then = then.withConfig(config); | |
| 118 | + | |
| 119 | + builder = builder.withThen(then); | |
| 118 | 120 | |
| 119 | 121 | scassandras.node(hostNumber).primingClient().prime(builder.build()); |
| 120 | 122 | } |
| @@ -122,7 +124,7 @@ | ||
| 122 | 124 | protected void simulateNormalResponse(int hostNumber) { |
| 123 | 125 | scassandras.node(hostNumber).primingClient().prime(PrimingRequest.queryBuilder() |
| 124 | 126 | .withQuery("mock query") |
| 125 | - .withRows(row("result", "result1")) | |
| 127 | + .withThen(then().withRows(row("result", "result1"))) | |
| 126 | 128 | .build()); |
| 127 | 129 | } |
| 128 | 130 |
modified driver-core/src/test/java/com/datastax/driver/core/policies/LatencyAwarePolicyTest.java +3 −2
| @@ -27,6 +27,7 @@ | ||
| 27 | 27 | import static org.assertj.core.api.Assertions.assertThat; |
| 28 | 28 | import static org.assertj.core.api.Assertions.fail; |
| 29 | 29 | import static org.scassandra.http.client.PrimingRequest.queryBuilder; |
| 30 | +import static org.scassandra.http.client.PrimingRequest.then; | |
| 30 | 31 | import static org.scassandra.http.client.Result.read_request_timeout; |
| 31 | 32 | import static org.scassandra.http.client.Result.unavailable; |
| 32 | 33 | |
| @@ -106,7 +107,7 @@ | ||
| 106 | 107 | primingClient.prime( |
| 107 | 108 | queryBuilder() |
| 108 | 109 | .withQuery(query) |
| 109 | - .withResult(unavailable) | |
| 110 | + .withThen(then().withResult(unavailable)) | |
| 110 | 111 | .build() |
| 111 | 112 | ); |
| 112 | 113 | LatencyAwarePolicy latencyAwarePolicy = LatencyAwarePolicy.builder(new RoundRobinPolicy()) |
| @@ -150,7 +151,7 @@ | ||
| 150 | 151 | primingClient.prime( |
| 151 | 152 | queryBuilder() |
| 152 | 153 | .withQuery(query) |
| 153 | - .withResult(read_request_timeout) | |
| 154 | + .withThen(then().withResult(read_request_timeout)) | |
| 154 | 155 | .build() |
| 155 | 156 | ); |
| 156 | 157 |
modified driver-dist/pom.xml +0 −38
| @@ -70,44 +70,6 @@ | ||
| 70 | 70 | </goals> |
| 71 | 71 | <configuration> |
| 72 | 72 | <includeDependencySources>true</includeDependencySources> |
| 73 | - <!-- optional dependencies from other modules (must be explicitly declared here in order to be correctly resolved) --> | |
| 74 | - <additionalDependencies> | |
| 75 | - <additionalDependency> | |
| 76 | - <groupId>org.xerial.snappy</groupId> | |
| 77 | - <artifactId>snappy-java</artifactId> | |
| 78 | - <version>${snappy.version}</version> | |
| 79 | - </additionalDependency> | |
| 80 | - <additionalDependency> | |
| 81 | - <groupId>net.jpountz.lz4</groupId> | |
| 82 | - <artifactId>lz4</artifactId> | |
| 83 | - <version>${lz4.version}</version> | |
| 84 | - </additionalDependency> | |
| 85 | - <additionalDependency> | |
| 86 | - <groupId>org.hdrhistogram</groupId> | |
| 87 | - <artifactId>HdrHistogram</artifactId> | |
| 88 | - <version>${hdr.version}</version> | |
| 89 | - </additionalDependency> | |
| 90 | - <additionalDependency> | |
| 91 | - <groupId>com.fasterxml.jackson.core</groupId> | |
| 92 | - <artifactId>jackson-core</artifactId> | |
| 93 | - <version>${jackson.version}</version> | |
| 94 | - </additionalDependency> | |
| 95 | - <additionalDependency> | |
| 96 | - <groupId>com.fasterxml.jackson.core</groupId> | |
| 97 | - <artifactId>jackson-databind</artifactId> | |
| 98 | - <version>${jackson.version}</version> | |
| 99 | - </additionalDependency> | |
| 100 | - <additionalDependency> | |
| 101 | - <groupId>joda-time</groupId> | |
| 102 | - <artifactId>joda-time</artifactId> | |
| 103 | - <version>${joda.version}</version> | |
| 104 | - </additionalDependency> | |
| 105 | - <additionalDependency> | |
| 106 | - <groupId>javax.json</groupId> | |
| 107 | - <artifactId>javax.json-api</artifactId> | |
| 108 | - <version>${jsr353-api.version}</version> | |
| 109 | - </additionalDependency> | |
| 110 | - </additionalDependencies> | |
| 111 | 73 | </configuration> |
| 112 | 74 | </execution> |
| 113 | 75 | </executions> |
modified driver-examples/pom.xml +9 −0
| @@ -53,6 +53,15 @@ | ||
| 53 | 53 | |
| 54 | 54 | <plugins> |
| 55 | 55 | |
| 56 | + <plugin> | |
| 57 | + <groupId>org.codehaus.mojo</groupId> | |
| 58 | + <artifactId>clirr-maven-plugin</artifactId> | |
| 59 | + <version>2.7</version> | |
| 60 | + <configuration> | |
| 61 | + <skip>true</skip> | |
| 62 | + </configuration> | |
| 63 | + </plugin> | |
| 64 | + | |
| 56 | 65 | <plugin> |
| 57 | 66 | <groupId>org.apache.maven.plugins</groupId> |
| 58 | 67 | <artifactId>maven-install-plugin</artifactId> |
modified driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationChecks.java +3 −3
| @@ -57,7 +57,7 @@ | ||
| 57 | 57 | /** |
| 58 | 58 | * Checks that a field is only annotated with the given mapping annotations, and that its "frozen" annotations are valid. |
| 59 | 59 | */ |
| 60 | - static void validateAnnotations(Field field, String classDescription, Class<? extends Annotation>... allowed) { | |
| 60 | + static void validateAnnotations(Field field, String classDescription, Class<?>... allowed) { | |
| 61 | 61 | Class<? extends Annotation> invalid = validateAnnotations(field.getAnnotations(), allowed); |
| 62 | 62 | if (invalid != null) |
| 63 | 63 | throw new IllegalArgumentException(String.format("Annotation @%s is not allowed on field %s of %s %s", |
| @@ -69,7 +69,7 @@ | ||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | // Returns the offending annotation if there is one |
| 72 | - private static Class<? extends Annotation> validateAnnotations(Annotation[] annotations, Class<? extends Annotation>... allowed) { | |
| 72 | + private static Class<? extends Annotation> validateAnnotations(Annotation[] annotations, Class<?>... allowed) { | |
| 73 | 73 | for (Annotation annotation : annotations) { |
| 74 | 74 | Class<? extends Annotation> actual = annotation.annotationType(); |
| 75 | 75 | if (actual.getPackage().equals(MAPPING_PACKAGE) && !contains(allowed, actual)) |
| @@ -85,7 +85,7 @@ | ||
| 85 | 85 | return false; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - static void checkValidComputed(Field field) { | |
| 88 | + private static void checkValidComputed(Field field) { | |
| 89 | 89 | Computed computed = field.getAnnotation(Computed.class); |
| 90 | 90 | if (computed != null && computed.value().isEmpty()) { |
| 91 | 91 | throw new IllegalArgumentException(String.format("Field %s: attribute 'value' of annotation @Computed is mandatory for computed fields", field.getName())); |
modified driver-tests/pom.xml +15 −0
| @@ -61,7 +61,18 @@ | ||
| 61 | 61 | </developers> |
| 62 | 62 | |
| 63 | 63 | <build> |
| 64 | + | |
| 64 | 65 | <plugins> |
| 66 | + | |
| 67 | + <plugin> | |
| 68 | + <groupId>org.codehaus.mojo</groupId> | |
| 69 | + <artifactId>clirr-maven-plugin</artifactId> | |
| 70 | + <version>2.7</version> | |
| 71 | + <configuration> | |
| 72 | + <skip>true</skip> | |
| 73 | + </configuration> | |
| 74 | + </plugin> | |
| 75 | + | |
| 65 | 76 | <plugin> |
| 66 | 77 | <groupId>org.apache.maven.plugins</groupId> |
| 67 | 78 | <artifactId>maven-install-plugin</artifactId> |
| @@ -70,6 +81,7 @@ | ||
| 70 | 81 | <skip>true</skip> |
| 71 | 82 | </configuration> |
| 72 | 83 | </plugin> |
| 84 | + | |
| 73 | 85 | <plugin> |
| 74 | 86 | <groupId>org.apache.maven.plugins</groupId> |
| 75 | 87 | <artifactId>maven-deploy-plugin</artifactId> |
| @@ -78,6 +90,9 @@ | ||
| 78 | 90 | <skip>true</skip> |
| 79 | 91 | </configuration> |
| 80 | 92 | </plugin> |
| 93 | + | |
| 81 | 94 | </plugins> |
| 95 | + | |
| 82 | 96 | </build> |
| 97 | + | |
| 83 | 98 | </project> |
modified pom.xml +44 −0
| @@ -226,6 +226,7 @@ | ||
| 226 | 226 | <version>2.9.1</version> |
| 227 | 227 | <inherited>true</inherited> |
| 228 | 228 | <configuration> |
| 229 | + <quiet>true</quiet> | |
| 229 | 230 | <verbose>false</verbose> |
| 230 | 231 | <additionalparam>${javadoc.opts}</additionalparam> |
| 231 | 232 | <links> |
| @@ -238,6 +239,49 @@ | ||
| 238 | 239 | <link>http://fasterxml.github.io/jackson-databind/javadoc/2.6/</link> |
| 239 | 240 | <link>https://javaee-spec.java.net/nonav/javadocs/</link> |
| 240 | 241 | </links> |
| 242 | + <!-- optional dependencies from other modules (must be explicitly declared here in order to be correctly resolved) --> | |
| 243 | + <additionalDependencies> | |
| 244 | + <additionalDependency> | |
| 245 | + <groupId>org.xerial.snappy</groupId> | |
| 246 | + <artifactId>snappy-java</artifactId> | |
| 247 | + <version>${snappy.version}</version> | |
| 248 | + </additionalDependency> | |
| 249 | + <additionalDependency> | |
| 250 | + <groupId>net.jpountz.lz4</groupId> | |
| 251 | + <artifactId>lz4</artifactId> | |
| 252 | + <version>${lz4.version}</version> | |
| 253 | + </additionalDependency> | |
| 254 | + <additionalDependency> | |
| 255 | + <groupId>org.hdrhistogram</groupId> | |
| 256 | + <artifactId>HdrHistogram</artifactId> | |
| 257 | + <version>${hdr.version}</version> | |
| 258 | + </additionalDependency> | |
| 259 | + <additionalDependency> | |
| 260 | + <groupId>com.fasterxml.jackson.core</groupId> | |
| 261 | + <artifactId>jackson-core</artifactId> | |
| 262 | + <version>${jackson.version}</version> | |
| 263 | + </additionalDependency> | |
| 264 | + <additionalDependency> | |
| 265 | + <groupId>com.fasterxml.jackson.core</groupId> | |
| 266 | + <artifactId>jackson-annotations</artifactId> | |
| 267 | + <version>${jackson.version}</version> | |
| 268 | + </additionalDependency> | |
| 269 | + <additionalDependency> | |
| 270 | + <groupId>com.fasterxml.jackson.core</groupId> | |
| 271 | + <artifactId>jackson-databind</artifactId> | |
| 272 | + <version>${jackson.version}</version> | |
| 273 | + </additionalDependency> | |
| 274 | + <additionalDependency> | |
| 275 | + <groupId>joda-time</groupId> | |
| 276 | + <artifactId>joda-time</artifactId> | |
| 277 | + <version>${joda.version}</version> | |
| 278 | + </additionalDependency> | |
| 279 | + <additionalDependency> | |
| 280 | + <groupId>javax.json</groupId> | |
| 281 | + <artifactId>javax.json-api</artifactId> | |
| 282 | + <version>${jsr353-api.version}</version> | |
| 283 | + </additionalDependency> | |
| 284 | + </additionalDependencies> | |
| 241 | 285 | </configuration> |
| 242 | 286 | <executions> |
| 243 | 287 | <execution> |