Merge branch '3.2.x' into 3.3.x
diff --git a/.travis.yml b/.travis.yml
index 489a813..0292d38 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,6 @@
language: java
jdk:
-- openjdk6
-- oraclejdk7
+- openjdk7
- oraclejdk8
sudo: false
before_install:
diff --git a/README.md b/README.md
index 787d944..69ad033 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
version through [Java driver
docs](http://datastax.github.io/java-driver/) or via the release tags,
[e.g.
-3.2.0](https://github.com/datastax/java-driver/tree/3.2.0).*
+3.3.2](https://github.com/datastax/java-driver/tree/3.3.2).*
A modern, [feature-rich](manual/) and highly tunable Java client
library for Apache Cassandra (1.2+) and DataStax Enterprise (3.1+) using
@@ -51,11 +51,11 @@
driver releases and important announcements (low frequency).
[@DataStaxEng](https://twitter.com/datastaxeng) has more news including
other drivers, Cassandra, and DSE.
-- DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.2/manual/) has quick
+- DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.3/manual/) has quick
start material and technical details about the driver and its features.
-- API: http://www.datastax.com/drivers/java/3.2
+- API: http://www.datastax.com/drivers/java/3.3
- [changelog](changelog/)
-- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.2.0.tar.gz)
+- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.3.2.tar.gz)
**Feeback requested:** help us focus our efforts, provide your input on the [Platform and Runtime Survey](http://goo.gl/forms/qwUE6qnL7U) (we kept it short).
@@ -68,7 +68,7 @@
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
- <version>3.2.0</version>
+ <version>3.3.2</version>
</dependency>
```
@@ -78,7 +78,7 @@
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-mapping</artifactId>
- <version>3.2.0</version>
+ <version>3.3.2</version>
</dependency>
```
@@ -88,7 +88,7 @@
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-extras</artifactId>
- <version>3.2.0</version>
+ <version>3.3.2</version>
</dependency>
```
@@ -97,12 +97,12 @@
to avoid the explicit dependency to Netty.
If you can't use a dependency management tool, a
-[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.2.0.tar.gz)
+[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.3.2.tar.gz)
is available for download.
## Compatibility
-The Java client driver 3.2.0 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache
+The Java client driver 3.3.2 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache
Cassandra 1.2, 2.0, 2.1, 2.2 and 3.0 (see [this page](http://datastax.github.io/java-driver/manual/native_protocol) for
the most up-to-date compatibility information).
@@ -115,6 +115,7 @@
Trying to use these with a cluster running Cassandra 1.2 will result in
an [UnsupportedFeatureException](https://github.com/datastax/java-driver/blob/3.x/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedFeatureException.java) being thrown.
+__Note__: DataStax products do not support big-endian systems.
## Upgrading from previous versions
diff --git a/build.yaml b/build.yaml
index ae3992c..9c9e786 100644
--- a/build.yaml
+++ b/build.yaml
@@ -11,6 +11,7 @@
cassandra: ['1.2', '2.0', '2.1', '2.2', '3.0']
env_vars: |
TEST_GROUP="short"
+ disable_commit_status: true
nightly:
# Run full suite nightly on change for all primary branches if they have changes.
schedule: nightly
@@ -19,6 +20,7 @@
include: ["/\\d+(\\.[\\dx]+)+/"]
env_vars: |
TEST_GROUP="long"
+ disable_commit_status: true
adhoc:
# Adhoc job for non-primary braches that doesn't have a schedule but may be used to run all configs.
schedule: adhoc
@@ -27,19 +29,20 @@
exclude: ["/\\d+(\\.[\\dx]+)+/"]
env_vars: |
TEST_GROUP="long"
+ disable_commit_status: true
java:
- openjdk6
- oraclejdk7
- oraclejdk8
os:
- - ubuntu/trusty64
+ - ubuntu/trusty64/m3.large
cassandra:
- '1.2'
- '2.0'
- '2.1'
- '2.2'
- '3.0'
- - '3.10'
+ - '3.11'
build:
- script: |
. /usr/local/bin/jdk_switcher.sh
diff --git a/changelog/README.md b/changelog/README.md
index cd9dd59..a97d6d0 100644
--- a/changelog/README.md
+++ b/changelog/README.md
@@ -1,5 +1,54 @@
## Changelog
+### 3.3.2
+
+- [bug] JAVA-1666: Fix keyspace export when a UDT has case-sensitive field names.
+- [improvement] JAVA-1196: Include hash of result set metadata in prepared statement id.
+- [improvement] JAVA-1670: Support user-provided JMX ports for CCMBridge.
+- [improvement] JAVA-1661: Avoid String.toLowerCase if possible in Metadata.
+- [improvement] JAVA-1659: Expose low-level flusher tuning options.
+- [improvement] JAVA-1660: Support netty-transport-native-epoll in OSGi container.
+
+
+### 3.3.1
+
+- [bug] JAVA-1555: Include VIEW and CDC in WriteType.
+- [bug] JAVA-1599: exportAsString improvements (sort, format, clustering order)
+- [improvement] JAVA-1587: Deterministic ordering of columns used in Mapper#saveQuery
+- [improvement] JAVA-1500: Add a metric to report number of in-flight requests.
+- [bug] JAVA-1438: QueryBuilder check for empty orderings.
+- [improvement] JAVA-1490: Allow zero delay for speculative executions.
+- [documentation] JAVA-1607: Add FAQ entry for netty-transport-native-epoll.
+- [bug] JAVA-1630: Fix Metadata.addIfAbsent.
+- [improvement] JAVA-1619: Update QueryBuilder methods to support Iterable input.
+- [improvement] JAVA-1527: Expose host_id and schema_version on Host metadata.
+- [new feature] JAVA-1377: Add support for TWCS in SchemaBuilder.
+- [improvement] JAVA-1631: Publish a sources jar for driver-core-tests.
+- [improvement] JAVA-1632: Add a withIpPrefix(String) method to CCMBridge.Builder.
+- [bug] JAVA-1639: VersionNumber does not fullfill equals/hashcode contract.
+- [bug] JAVA-1613: Fix broken shaded Netty detection in NettyUtil.
+
+
+### 3.3.0
+
+- [bug] JAVA-1469: Update LoggingRetryPolicy to deal with SLF4J-353.
+- [improvement] JAVA-1203: Upgrade Metrics to allow usage in OSGi.
+- [bug] JAVA-1407: KeyspaceMetadata exportAsString should export user types in topological sort order.
+- [bug] JAVA-1455: Mapper support using unset for null values.
+- [bug] JAVA-1464: Allow custom codecs with non public constructors in @Param.
+- [bug] JAVA-1470: Querying multiple pages overrides WrappedStatement.
+- [improvement] JAVA-1428: Upgrade logback and jackson dependencies.
+- [documentation] JAVA-1463: Revisit speculative execution docs.
+- [documentation] JAVA-1466: Revisit timestamp docs.
+- [documentation] JAVA-1445: Clarify how nodes are penalized in LatencyAwarePolicy docs.
+- [improvement] JAVA-1446: Support 'DEFAULT UNSET' in Query Builder JSON Insert.
+- [improvement] JAVA-1443: Add groupBy method to Select statement.
+- [improvement] JAVA-1458: Check thread in mapper sync methods.
+- [improvement] JAVA-1488: Upgrade Netty to 4.0.47.Final.
+- [improvement] JAVA-1460: Add speculative execution number to ExecutionInfo
+- [improvement] JAVA-1431: Improve error handling during pool initialization.
+
+
### 3.2.0
- [new feature] JAVA-1347: Add support for duration type.
diff --git a/ci/appveyor.yml b/ci/appveyor.yml
index fc69692..81dd5b0 100644
--- a/ci/appveyor.yml
+++ b/ci/appveyor.yml
@@ -9,9 +9,9 @@
install:
- ps: .\ci\appveyor.ps1
build_script:
- - "set \"JAVA_HOME=%JAVA_8_HOME%\" && mvn install -DskipTests=true -D\"maven.javadoc.skip\"=true -B -V"
+ - "set \"JAVA_HOME=%JAVA_8_HOME%\" && mvn install -DskipTests=true -B -V"
test_script:
- - "set \"JAVA_HOME=%JAVA_PLATFORM_HOME%\" && mvn -B -D\"ccm.java.home\"=\"%JAVA_8_HOME%\" -D\"ccm.maxNumberOfNodes\"=1 -D\"cassandra.version\"=%cassandra_version% test -P %test_profile%"
+ - "set \"JAVA_HOME=%JAVA_PLATFORM_HOME%\" && mvn -B -D\"ccm.java.home\"=\"%JAVA_8_HOME%\" -D\"ccm.maxNumberOfNodes\"=1 -D\"cassandra.version\"=%cassandra_version% verify -P %test_profile%"
on_finish:
- ps: .\ci\uploadtests.ps1
cache:
diff --git a/clirr-ignores.xml b/clirr-ignores.xml
index 5b59573..e7c34ac 100644
--- a/clirr-ignores.xml
+++ b/clirr-ignores.xml
@@ -147,4 +147,16 @@
<justification>False positive, the enclosing class is package-private so this was never exposed</justification>
</difference>
+ <difference>
+ <differenceType>7005</differenceType>
+ <className>com/datastax/driver/core/querybuilder/QueryBuilder</className>
+ <!--
+ A Clirr bug prevents us from excluding the methods individually (errors re-appear as soon as there are more
+ than one method). Excluding every method is too coarse, but it's the only solution.
+ -->
+ <method>*</method>
+ <to>*</to>
+ <justification>Relaxed parameters from List to Iterable for in, lt, lte, eq, gt, and gte</justification>
+ </difference>
+
</differences>
diff --git a/docs.yaml b/docs.yaml
index 3524a9e..b38b863 100644
--- a/docs.yaml
+++ b/docs.yaml
@@ -35,28 +35,32 @@
- title: Code
href: https://github.com/datastax/java-driver/
- title: Docs
- href: http://datastax.github.io/java-driver/
+ href: http://docs.datastax.com/en/developer/java-driver/
- title: Issues
href: https://datastax-oss.atlassian.net/browse/JAVA/
- title: Mailing List
href: https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user
- - title: IRC Channel
- href: irc://irc.freenode.net/datastax-drivers
- title: Releases
- href: https://github.com/datastax/java-driver/releases
+ href: http://downloads.datastax.com/java-driver/
api_docs:
+ 3.3: http://docs.datastax.com/en/drivers/java/3.3
+ 4.0-alpha: http://docs.datastax.com/en/drivers/java/4.0
3.2: http://docs.datastax.com/en/drivers/java/3.2
3.1: http://docs.datastax.com/en/drivers/java/3.1
3.0: http://docs.datastax.com/en/drivers/java/3.0
2.1: http://docs.datastax.com/en/drivers/java/2.1
2.0: http://docs.datastax.com/en/drivers/java/2.0
versions:
+ - name: '3.3'
+ ref: '3.3.0'
+ - name: '4.0-alpha'
+ ref: '9f0edeb'
- name: '3.2'
- ref: '3.2.0'
+ ref: '3.2_docfixes'
- name: '3.1'
- ref: '3.1.4'
+ ref: '3.1_docfixes'
- name: '3.0'
- ref: '3.0.7'
+ ref: '3.0_docfixes'
- name: '2.1'
ref: '2.1.10.3'
- name: '2.0'
diff --git a/driver-core/pom.xml b/driver-core/pom.xml
index 8553c70..3c48ee2 100644
--- a/driver-core/pom.xml
+++ b/driver-core/pom.xml
@@ -1,68 +1,67 @@
<!--
- Copyright (C) 2012-2015 DataStax Inc.
+ Copyright (C) 2012-2017 DataStax Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-parent</artifactId>
- <version>3.2.1-SNAPSHOT</version>
+ <version>3.3.3-SNAPSHOT</version>
</parent>
+
<artifactId>cassandra-driver-core</artifactId>
- <packaging>bundle</packaging>
<name>DataStax Java Driver for Apache Cassandra - Core</name>
- <description>A driver for Apache Cassandra 1.2+ that works exclusively with the Cassandra Query Language version 3
+ <description>
+ A driver for Apache Cassandra 1.2+ that works exclusively with the Cassandra Query Language version 3
(CQL3) and Cassandra's binary protocol.
</description>
- <url>https://github.com/datastax/java-driver</url>
-
- <properties>
- <main.basedir>${project.parent.basedir}</main.basedir>
- </properties>
<dependencies>
+
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
- <version>${netty.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <version>${guava.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
- <version>${metrics.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-ffi</artifactId>
- <version>${jnr-ffi.version}</version>
</dependency>
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-posix</artifactId>
- <version>${jnr-posix.version}</version>
</dependency>
<!-- Compression libraries for the protocol. -->
@@ -71,14 +70,12 @@
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
- <version>${snappy.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.jpountz.lz4</groupId>
<artifactId>lz4</artifactId>
- <version>${lz4.version}</version>
<optional>true</optional>
</dependency>
@@ -87,62 +84,48 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
- <version>${netty.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hdrhistogram</groupId>
<artifactId>HdrHistogram</artifactId>
- <version>${hdr.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>${testng.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
- <version>${assertj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
- <version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scassandra</groupId>
<artifactId>java-client</artifactId>
- <version>${scassandra.version}</version>
<scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
- <version>${commons-exec.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative</artifactId>
- <version>1.1.33.Fork26</version>
<classifier>${os.detected.classifier}</classifier>
<scope>test</scope>
</dependency>
@@ -150,191 +133,191 @@
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
- <version>${log4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
- <version>${slf4j-log4j12.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.byteman</groupId>
+ <artifactId>byteman-bmunit</artifactId>
+ <scope>test</scope>
+ <version>${byteman.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
</dependencies>
<build>
+
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
+
<plugins>
+
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
<executions>
<execution>
+ <id>test-jar</id>
<goals>
<goal>test-jar</goal>
</goals>
- <phase>test-compile</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!--
+ We avoid packaging bundle because it does not play nicely with the shade plugin, see
+ https://stackoverflow.com/questions/31262032/maven-shade-plugin-and-custom-packaging-type
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-test-sources</id>
+ <goals>
+ <goal>test-jar-no-fork</goal>
+ </goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <version>2.4.0</version>
- <!--
- Default configuration, used by the `bundle` goal that is implicitly bound to the `package` phase
- (because the project uses the `bundle` packaging)
- -->
<configuration>
<instructions>
<Bundle-SymbolicName>com.datastax.driver.core</Bundle-SymbolicName>
- <Bundle-Version>${project.version}</Bundle-Version>
- <_include>-osgi.bnd</_include>
- <Import-Package>
- <!-- JNR does not provide OSGi bundles, so exclude it; the driver can live without it -->
- <![CDATA[com.google.common.*;version="[16.0.1,22)",!jnr.*,*]]></Import-Package>
</instructions>
- <supportedProjectTypes>
- <supportedProjectType>jar</supportedProjectType>
- <supportedProjectType>bundle</supportedProjectType>
- <supportedProjectType>pom</supportedProjectType>
- </supportedProjectTypes>
+ <!--
+ Prevent customized manifest entries from the project's maven-jar-plugin configuration from being read, see
+ http://apache-felix.18485.x6.nabble.com/how-lt-manifestLocation-gt-is-used-in-maven-bundle-plugin-td4835566.html
+ -->
+ <archive>
+ <forced>true</forced>
+ </archive>
</configuration>
<executions>
+ <!-- Default execution -->
+ <execution>
+ <id>bundle-manifest</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>manifest</goal>
+ </goals>
+ <configuration>
+ <manifestLocation>${project.build.outputDirectory}/META-INF</manifestLocation>
+ <instructions>
+ <!-- JNR does not provide OSGi bundles, so exclude it; the driver can live without it -->
+ <Import-Package><![CDATA[com.google.common.*;version="[16.0.1,22)",!jnr.*,io.netty.channel.epoll,*]]></Import-Package>
+ </instructions>
+ </configuration>
+ </execution>
<!-- Alternate execution to generate the shaded JAR's manifest -->
<execution>
<id>bundle-manifest-shaded</id>
- <phase>prepare-package</phase>
+ <phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<manifestLocation>${project.build.directory}/META-INF-shaded</manifestLocation>
<instructions>
- <Import-Package>
- <!--
- JNR does not provide OSGi bundles, so exclude it; the driver can live without it
- Explicitly import javax.security.cert because it's required by Netty, but Netty has been explicitly excluded
- -->
- <![CDATA[com.google.common.*;version="[16.0.1,22)",!jnr.*,!io.netty.*,javax.security.cert,*]]></Import-Package>
+ <!--
+ JNR does not provide OSGi bundles, so exclude it; the driver can live without it
+ Explicitly import javax.security.cert because it's required by Netty, but Netty has been explicitly excluded
+ -->
+ <Import-Package><![CDATA[com.google.common.*;version="[16.0.1,22)",!jnr.*,!io.netty.*,javax.security.cert,*]]></Import-Package>
<Private-Package>com.datastax.shaded.*</Private-Package>
</instructions>
</configuration>
</execution>
</executions>
</plugin>
+
<plugin>
<artifactId>maven-shade-plugin</artifactId>
- <version>2.3</version>
+ <configuration>
+ <shadedArtifactAttached>true</shadedArtifactAttached>
+ <artifactSet>
+ <includes>
+ <include>io.netty:*</include>
+ </includes>
+ <excludes>
+ <exclude>io.netty:netty-transport-native-epoll</exclude>
+ </excludes>
+ </artifactSet>
+ <relocations>
+ <relocation>
+ <pattern>io.netty</pattern>
+ <shadedPattern>com.datastax.shaded.netty</shadedPattern>
+ </relocation>
+ </relocations>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
+ <resources>
+ <resource>META-INF/MANIFEST.MF</resource>
+ <resource>META-INF/io.netty.versions.properties</resource>
+ <resource>META-INF/maven/io.netty/netty-buffer/pom.properties</resource>
+ <resource>META-INF/maven/io.netty/netty-buffer/pom.xml</resource>
+ <resource>META-INF/maven/io.netty/netty-codec/pom.properties</resource>
+ <resource>META-INF/maven/io.netty/netty-codec/pom.xml</resource>
+ <resource>META-INF/maven/io.netty/netty-common/pom.properties</resource>
+ <resource>META-INF/maven/io.netty/netty-common/pom.xml</resource>
+ <resource>META-INF/maven/io.netty/netty-handler/pom.properties</resource>
+ <resource>META-INF/maven/io.netty/netty-handler/pom.xml</resource>
+ <resource>META-INF/maven/io.netty/netty-transport/pom.properties</resource>
+ <resource>META-INF/maven/io.netty/netty-transport/pom.xml</resource>
+ </resources>
+ </transformer>
+ <!-- Pick up the alternate manifest that was generated by the alternate execution of the bundle plugin -->
+ <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
+ <resource>META-INF/MANIFEST.MF</resource>
+ <file>${project.build.directory}/META-INF-shaded/MANIFEST.MF</file>
+ </transformer>
+ </transformers>
+ </configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
- <configuration>
- <shadedArtifactAttached>true</shadedArtifactAttached>
- <artifactSet>
- <includes>
- <include>io.netty:*</include>
- </includes>
- <excludes>
- <exclude>io.netty:netty-transport-native-epoll</exclude>
- </excludes>
- </artifactSet>
- <relocations>
- <relocation>
- <pattern>io.netty</pattern>
- <shadedPattern>com.datastax.shaded.netty</shadedPattern>
- </relocation>
- </relocations>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
- <resources>
- <resource>META-INF/MANIFEST.MF</resource>
- <resource>META-INF/io.netty.versions.properties</resource>
- <resource>META-INF/maven/io.netty/netty-buffer/pom.properties</resource>
- <resource>META-INF/maven/io.netty/netty-buffer/pom.xml</resource>
- <resource>META-INF/maven/io.netty/netty-codec/pom.properties</resource>
- <resource>META-INF/maven/io.netty/netty-codec/pom.xml</resource>
- <resource>META-INF/maven/io.netty/netty-common/pom.properties</resource>
- <resource>META-INF/maven/io.netty/netty-common/pom.xml</resource>
- <resource>META-INF/maven/io.netty/netty-handler/pom.properties</resource>
- <resource>META-INF/maven/io.netty/netty-handler/pom.xml</resource>
- <resource>META-INF/maven/io.netty/netty-transport/pom.properties</resource>
- <resource>META-INF/maven/io.netty/netty-transport/pom.xml</resource>
- </resources>
- </transformer>
- <!-- Pick up the alternate manifest that was generated by the alternate execution of the bundle plugin -->
- <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
- <resource>META-INF/MANIFEST.MF</resource>
- <file>${project.build.directory}/META-INF-shaded/MANIFEST.MF</file>
- </transformer>
- </transformers>
- </configuration>
</execution>
</executions>
</plugin>
+
</plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <versionRange>[2.2,)</versionRange>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore />
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <extensions>
- <extension>
- <groupId>kr.motd.maven</groupId>
- <artifactId>os-maven-plugin</artifactId>
- <version>1.4.1.Final</version>
- </extension>
- </extensions>
</build>
<profiles>
+
<profile>
<id>isolated</id>
- <properties>
- <env>default</env>
- </properties>
<build>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
<configuration>
<skip>false</skip>
<includes>
@@ -350,30 +333,8 @@
</plugins>
</build>
</profile>
+
</profiles>
- <licenses>
- <license>
- <name>Apache 2</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- <comments>Apache License Version 2.0</comments>
- </license>
- </licenses>
-
- <scm>
- <connection>scm:git:git@github.com:datastax/java-driver.git</connection>
- <developerConnection>scm:git:git@github.com:datastax/java-driver.git</developerConnection>
- <url>https://github.com/datastax/java-driver</url>
- <tag>HEAD</tag>
- </scm>
-
- <developers>
- <developer>
- <name>Various</name>
- <organization>DataStax</organization>
- </developer>
- </developers>
-
</project>
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractAddressableByIndexData.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractAddressableByIndexData.java
index fc795b2..3cc9fb7 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractAddressableByIndexData.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractAddressableByIndexData.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractData.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractData.java
index 80eaed6..bbb349c 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractData.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractData.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableByIndexData.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableByIndexData.java
index 287de62..d1b1974 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableByIndexData.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableByIndexData.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableData.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableData.java
index a7cbe78..1cd4898 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableData.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableData.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractMonotonicTimestampGenerator.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractMonotonicTimestampGenerator.java
index 4b4688c..18ed00a 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractMonotonicTimestampGenerator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractMonotonicTimestampGenerator.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractReconnectionHandler.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractReconnectionHandler.java
index 64cea33..ad7234c 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractReconnectionHandler.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractReconnectionHandler.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractSession.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractSession.java
index 599f4e9..c743205 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractSession.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractSession.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractTableMetadata.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractTableMetadata.java
index 1c38a9a..e79ec65 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractTableMetadata.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractTableMetadata.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -33,6 +33,14 @@
}
};
+ // comparator for ordering tables and views by name.
+ static final Comparator<AbstractTableMetadata> byNameComparator = new Comparator<AbstractTableMetadata>() {
+ @Override
+ public int compare(AbstractTableMetadata o1, AbstractTableMetadata o2) {
+ return o1.getName().compareTo(o2.getName());
+ }
+ };
+
static final Predicate<ClusteringOrder> isAscending = new Predicate<ClusteringOrder>() {
@Override
public boolean apply(ClusteringOrder o) {
@@ -237,10 +245,10 @@
protected StringBuilder appendOptions(StringBuilder sb, boolean formatted) {
// Options
- sb.append(" WITH ");
+ sb.append("WITH ");
if (options.isCompactStorage())
and(sb.append("COMPACT STORAGE"), formatted);
- if (!Iterables.all(clusteringOrder, isAscending))
+ if (!clusteringOrder.isEmpty())
and(appendClusteringOrder(sb), formatted);
sb.append("read_repair_chance = ").append(options.getReadRepairChance());
and(sb, formatted).append("dclocal_read_repair_chance = ").append(options.getLocalReadRepairChance());
@@ -285,7 +293,7 @@
sb.append("CLUSTERING ORDER BY (");
for (int i = 0; i < clusteringColumns.size(); i++) {
if (i > 0) sb.append(", ");
- sb.append(clusteringColumns.get(i).getName()).append(' ').append(clusteringOrder.get(i));
+ sb.append(Metadata.quoteIfNecessary(clusteringColumns.get(i).getName())).append(' ').append(clusteringOrder.get(i));
}
return sb.append(')');
}
@@ -310,18 +318,7 @@
}
private StringBuilder and(StringBuilder sb, boolean formatted) {
- return newLine(sb, formatted).append(spaces(2, formatted)).append(" AND ");
- }
-
- static String spaces(int n, boolean formatted) {
- if (!formatted)
- return "";
-
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < n; i++)
- sb.append(' ');
-
- return sb.toString();
+ return spaceOrNewLine(sb, formatted).append("AND ");
}
static StringBuilder newLine(StringBuilder sb, boolean formatted) {
@@ -331,7 +328,7 @@
}
static StringBuilder spaceOrNewLine(StringBuilder sb, boolean formatted) {
- sb.append(formatted ? '\n' : ' ');
+ sb.append(formatted ? "\n " : ' ');
return sb;
}
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AggregateMetadata.java b/driver-core/src/main/java/com/datastax/driver/core/AggregateMetadata.java
index 39699e6..a08f624 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AggregateMetadata.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AggregateMetadata.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -202,8 +202,9 @@
TableMetadata.spaceOrNewLine(sb, formatted)
.append("SFUNC ")
- .append(Metadata.quoteIfNecessary(stateFuncSimpleName))
- .append(" STYPE ")
+ .append(Metadata.quoteIfNecessary(stateFuncSimpleName));
+ TableMetadata.spaceOrNewLine(sb, formatted)
+ .append("STYPE ")
.append(stateType.asFunctionParameterString());
if (finalFuncSimpleName != null)
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedResultSet.java b/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedResultSet.java
index 1a217a4..81e348a 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedResultSet.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedResultSet.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -39,7 +39,7 @@
private static final Queue<List<ByteBuffer>> EMPTY_QUEUE = new ArrayDeque<List<ByteBuffer>>(0);
- protected final ColumnDefinitions metadata;
+ protected volatile ColumnDefinitions metadata;
protected final Token.Factory tokenFactory;
private final boolean wasApplied;
@@ -60,18 +60,43 @@
case ROWS:
Responses.Result.Rows r = (Responses.Result.Rows) msg;
- ColumnDefinitions columnDefs;
- if (r.metadata.columns == null) {
- if (statement instanceof StatementWrapper) {
- statement = ((StatementWrapper) statement).getWrappedStatement();
- }
- assert statement instanceof BoundStatement;
- columnDefs = ((BoundStatement) statement).statement.getPreparedId().resultSetMetadata;
- assert columnDefs != null;
- } else {
- columnDefs = r.metadata.columns;
+ Statement actualStatement = statement;
+ if (statement instanceof StatementWrapper) {
+ actualStatement = ((StatementWrapper) statement).getWrappedStatement();
}
+ ColumnDefinitions columnDefs = r.metadata.columns;
+ if (columnDefs == null) {
+ // If result set metadata is not present, it means the request had SKIP_METADATA set, the driver
+ // only ever does that for bound statements.
+ BoundStatement bs = (BoundStatement) actualStatement;
+ columnDefs = bs.preparedStatement().getPreparedId().resultSetMetadata.variables;
+ } else {
+ // Otherwise, always use the response's metadata.
+ // In addition, if a new id is present it means we're executing a bound statement with protocol v5,
+ // the schema changed server-side, and we need to update the prepared statement (see
+ // CASSANDRA-10786).
+ MD5Digest newMetadataId = r.metadata.metadataId;
+ assert !(actualStatement instanceof BoundStatement) ||
+ ProtocolFeature.PREPARED_METADATA_CHANGES.isSupportedBy(protocolVersion) ||
+ newMetadataId == null;
+ if (newMetadataId != null) {
+ BoundStatement bs = ((BoundStatement) actualStatement);
+ PreparedId preparedId = bs.preparedStatement().getPreparedId();
+ // Extra test for CASSANDRA-13992: conditional updates yield a different result set depending on
+ // whether the update was applied or not, so the prepared statement must never have result
+ // metadata, and we should always execute with skip_metadata = false.
+ // However the server sends a new_metadata_id in the response, so make sure we ignore it if the
+ // prepared statement did not have metadata in the first place.
+ // TODO remove the "if" (i.e. always assign resultSetMetadata) if CASSANDRA-13992 gets fixed before 4.0.0 GA
+ if (preparedId.resultSetMetadata.variables != null) {
+ preparedId.resultSetMetadata =
+ new PreparedId.PreparedMetadata(newMetadataId, columnDefs);
+ }
+ }
+ }
+ assert columnDefs != null;
+
Token.Factory tokenFactory = (session == null) ? null
: session.getCluster().manager.metadata.tokenFactory();
@@ -223,7 +248,7 @@
private static class MultiPage extends ArrayBackedResultSet {
private Queue<List<ByteBuffer>> currentPage;
- private final Queue<Queue<List<ByteBuffer>>> nextPages = new ConcurrentLinkedQueue<Queue<List<ByteBuffer>>>();
+ private final Queue<NextPage> nextPages = new ConcurrentLinkedQueue<NextPage>();
private final Deque<ExecutionInfo> infos = new LinkedBlockingDeque<ExecutionInfo>();
@@ -279,8 +304,8 @@
@Override
public int getAvailableWithoutFetching() {
int available = currentPage.size();
- for (Queue<List<ByteBuffer>> page : nextPages)
- available += page.size();
+ for (NextPage page : nextPages)
+ available += page.data.size();
return available;
}
@@ -296,9 +321,12 @@
// Grab the current state now to get a consistent view in this iteration.
FetchingState fetchingState = this.fetchState;
- Queue<List<ByteBuffer>> nextPage = nextPages.poll();
+ NextPage nextPage = nextPages.poll();
if (nextPage != null) {
- currentPage = nextPage;
+ if (nextPage.metadata != null) {
+ this.metadata = nextPage.metadata;
+ }
+ currentPage = nextPage.data;
continue;
}
if (fetchingState == null)
@@ -362,7 +390,16 @@
if (rm.kind == Responses.Result.Kind.ROWS) {
Responses.Result.Rows rows = (Responses.Result.Rows) rm;
info = update(info, rm, MultiPage.this.session, rows.metadata.pagingState, protocolVersion, codecRegistry, statement);
- MultiPage.this.nextPages.offer(rows.data);
+ // If the query is a prepared 'SELECT *', the metadata can change between pages
+ ColumnDefinitions newMetadata = null;
+ if (rows.metadata.metadataId != null) {
+ newMetadata = rows.metadata.columns;
+ assert statement instanceof BoundStatement;
+ BoundStatement bs = (BoundStatement) statement;
+ bs.preparedStatement().getPreparedId().resultSetMetadata =
+ new PreparedId.PreparedMetadata(rows.metadata.metadataId, rows.metadata.columns);
+ }
+ MultiPage.this.nextPages.offer(new NextPage(newMetadata, rows.data));
MultiPage.this.fetchState = rows.metadata.pagingState == null ? null : new FetchingState(rows.metadata.pagingState, null);
} else if (rm.kind == Responses.Result.Kind.VOID) {
// We shouldn't really get a VOID message here but well, no harm in handling it I suppose
@@ -442,6 +479,16 @@
this.inProgress = inProgress;
}
}
+
+ private static class NextPage {
+ final ColumnDefinitions metadata;
+ final Queue<List<ByteBuffer>> data;
+
+ NextPage(ColumnDefinitions metadata, Queue<List<ByteBuffer>> data) {
+ this.metadata = metadata;
+ this.data = data;
+ }
+ }
}
// This method checks the value of the "[applied]" column manually, to avoid instantiating an ArrayBackedRow
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedRow.java b/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedRow.java
index e3bea24..ca78e52 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedRow.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedRow.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.java b/driver-core/src/main/java/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.java
index 57ba547..b5d1ce8 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AuthProvider.java b/driver-core/src/main/java/com/datastax/driver/core/AuthProvider.java
index ef735ec..cef94ab 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AuthProvider.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AuthProvider.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Authenticator.java b/driver-core/src/main/java/com/datastax/driver/core/Authenticator.java
index 19f1593..0936c28 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Authenticator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Authenticator.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java b/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java
index d7dd037..e820311 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -61,8 +61,6 @@
COUNTER
}
- ;
-
final Type batchType;
private final List<Statement> statements = new ArrayList<Statement>();
@@ -97,7 +95,7 @@
// We handle BatchStatement in add() so ...
assert statement instanceof BoundStatement;
BoundStatement st = (BoundStatement) statement;
- idAndVals.ids.add(st.statement.getPreparedId().id);
+ idAndVals.ids.add(st.statement.getPreparedId().boundValuesMetadata.id);
idAndVals.values.add(Arrays.asList(st.wrapper.values));
}
}
diff --git a/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java b/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java
index ad27aed..8855fa9 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -293,7 +293,10 @@
*/
@Override
public String getKeyspace() {
- return statement.getPreparedId().metadata.size() == 0 ? null : statement.getPreparedId().metadata.getKeyspace(0);
+ ColumnDefinitions defs = statement.getPreparedId().boundValuesMetadata.variables;
+ return defs.size() == 0
+ ? null
+ : defs.getKeyspace(0);
}
/**
diff --git a/driver-core/src/main/java/com/datastax/driver/core/CBUtil.java b/driver-core/src/main/java/com/datastax/driver/core/CBUtil.java
index 620258d..0db5802 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/CBUtil.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/CBUtil.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ChainedResultSetFuture.java b/driver-core/src/main/java/com/datastax/driver/core/ChainedResultSetFuture.java
index 0dfd0d1..8726043 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ChainedResultSetFuture.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ChainedResultSetFuture.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Clock.java b/driver-core/src/main/java/com/datastax/driver/core/Clock.java
index 47cb22f..a2d31b5 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Clock.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Clock.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/CloseFuture.java b/driver-core/src/main/java/com/datastax/driver/core/CloseFuture.java
index 51effb2..a1fbb4c 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/CloseFuture.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/CloseFuture.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -51,7 +51,7 @@
* Try to force the completion of the shutdown this is a future of.
* <p/>
* This method will do its best to expedite the shutdown process. In
- * particular, all connections will be closed right away, even if there is
+ * particular, all connections will be closed right away, even if there are
* ongoing queries at the time this method is called.
* <p/>
* Note that this method does not block. The completion of this method does
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java
index 4fd297d..145100f 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Cluster.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Cluster.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -1505,7 +1505,7 @@
// We don't want to signal -- call onAdd() -- because nothing is ready
// yet (loadbalancing policy, control connection, ...). All we want is
// create the Host object so we can initialize the control connection.
- metadata.add(address);
+ metadata.addIfAbsent(metadata.newHost(address));
}
Collection<Host> allHosts = metadata.allHosts();
@@ -2218,13 +2218,15 @@
}
public PreparedStatement addPrepared(PreparedStatement stmt) {
- PreparedStatement previous = preparedQueries.putIfAbsent(stmt.getPreparedId().id, stmt);
+ PreparedStatement previous = preparedQueries.putIfAbsent(stmt.getPreparedId().boundValuesMetadata.id, stmt);
if (previous != null) {
logger.warn("Re-preparing already prepared query is generally an anti-pattern and will likely affect performance. "
+ "Consider preparing the statement only once. Query='{}'", stmt.getQueryString());
// The one object in the cache will get GCed once it's not referenced by the client anymore since we use a weak reference.
// So we need to make sure that the instance we do return to the user is the one that is in the cache.
+ // However if the result metadata changed since the last PREPARE call, this also needs to be updated.
+ previous.getPreparedId().resultSetMetadata = stmt.getPreparedId().resultSetMetadata;
return previous;
}
return stmt;
@@ -2714,27 +2716,25 @@
case UP:
Host upHost = metadata.getHost(address);
if (upHost == null) {
- upHost = metadata.add(address);
- // If upHost is still null, it means we didn't know about it the line before but
- // got beaten at adding it to the metadata by another thread. In that case, it's
- // fine to let the other thread win and ignore the notification here
- if (upHost == null)
+ upHost = metadata.newHost(address);
+ Host previous = metadata.addIfAbsent(upHost);
+ if (previous != null) {
+ // We got beat by another thread at adding the host. Let it win and ignore the
+ // notification here.
continue;
+ }
futures.add(schedule(hostAdded(upHost)));
} else {
futures.add(schedule(hostUp(upHost)));
}
break;
case ADDED:
- Host newHost = metadata.add(address);
- if (newHost != null) {
+ Host newHost = metadata.newHost(address);
+ Host previous = metadata.addIfAbsent(newHost);
+ if (previous == null) {
futures.add(schedule(hostAdded(newHost)));
- } else {
- // If host already existed, retrieve it and check its state, if it's not up schedule a
- // hostUp event.
- Host existingHost = metadata.getHost(address);
- if (!existingHost.isUp())
- futures.add(schedule(hostUp(existingHost)));
+ } else if (!previous.isUp()) {
+ futures.add(schedule(hostUp(previous)));
}
break;
case DOWN:
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ClusterNameMismatchException.java b/driver-core/src/main/java/com/datastax/driver/core/ClusterNameMismatchException.java
index 946d06f..d467d34 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ClusterNameMismatchException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ClusterNameMismatchException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ClusterWidePercentileTracker.java b/driver-core/src/main/java/com/datastax/driver/core/ClusterWidePercentileTracker.java
index b77acd2..8766106 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ClusterWidePercentileTracker.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ClusterWidePercentileTracker.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ClusteringOrder.java b/driver-core/src/main/java/com/datastax/driver/core/ClusteringOrder.java
index 3b639c6..50cd74b 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ClusteringOrder.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ClusteringOrder.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/CodecRegistry.java b/driver-core/src/main/java/com/datastax/driver/core/CodecRegistry.java
index 2e8ef03..c32f0ab 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/CodecRegistry.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/CodecRegistry.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/CodecUtils.java b/driver-core/src/main/java/com/datastax/driver/core/CodecUtils.java
index b59cef2..2499b22 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/CodecUtils.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/CodecUtils.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ColumnDefinitions.java b/driver-core/src/main/java/com/datastax/driver/core/ColumnDefinitions.java
index a3721f7..7b71ed7 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ColumnDefinitions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ColumnDefinitions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ColumnMetadata.java b/driver-core/src/main/java/com/datastax/driver/core/ColumnMetadata.java
index 851f7fa..ad1c503 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ColumnMetadata.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ColumnMetadata.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Configuration.java b/driver-core/src/main/java/com/datastax/driver/core/Configuration.java
index 25e88d7..fc0e77a 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Configuration.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Configuration.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Connection.java b/driver-core/src/main/java/com/datastax/driver/core/Connection.java
index 6c7d89b..c468328 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Connection.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Connection.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -66,6 +66,8 @@
private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
private static final boolean DISABLE_COALESCING = SystemProperties.getBoolean("com.datastax.driver.DISABLE_COALESCING", false);
+ private static final int FLUSHER_SCHEDULE_PERIOD_NS = SystemProperties.getInt("com.datastax.driver.FLUSHER_SCHEDULE_PERIOD_NS", 10000);
+ private static final int FLUSHER_RUN_WITHOUT_WORK_TIMES = SystemProperties.getInt("com.datastax.driver.FLUSHER_RUN_WITHOUT_WORK_TIMES", 5);
enum State {OPEN, TRASHED, RESURRECTING, GONE}
@@ -193,8 +195,8 @@
future.setException(t);
} else {
// Defunct to ensure that the error will be signaled (marking the host down)
- Exception e = (t instanceof ConnectionException || t instanceof DriverException || t instanceof InterruptedException)
- ? (Exception) t
+ Throwable e = (t instanceof ConnectionException || t instanceof DriverException || t instanceof InterruptedException || t instanceof Error)
+ ? t
: new ConnectionException(Connection.this.address,
String.format("Unexpected error during transport initialization (%s)", t),
t);
@@ -422,7 +424,7 @@
return dispatcher.streamIdHandler.maxAvailableStreams();
}
- <E extends Exception> E defunct(E e) {
+ <E extends Throwable> E defunct(E e) {
if (isDefunct.compareAndSet(false, true)) {
if (Host.statesLogger.isTraceEnabled())
@@ -846,6 +848,8 @@
throw (ClusterNameMismatchException) t;
if (t instanceof DriverException)
throw (DriverException) t;
+ if (t instanceof Error)
+ throw (Error) t;
return new RuntimeException("Unexpected exception during connection initialization", t);
}
@@ -951,7 +955,7 @@
runsWithNoWork = 0;
} else {
// either reschedule or cancel
- if (++runsWithNoWork > 5) {
+ if (++runsWithNoWork > FLUSHER_RUN_WITHOUT_WORK_TIMES) {
running.set(false);
if (queued.isEmpty() || !running.compareAndSet(false, true))
return;
@@ -960,7 +964,11 @@
EventLoop eventLoop = eventLoopRef.get();
if (eventLoop != null && !eventLoop.isShuttingDown()) {
- eventLoop.schedule(this, 10000, TimeUnit.NANOSECONDS);
+ if (FLUSHER_SCHEDULE_PERIOD_NS > 0) {
+ eventLoop.schedule(this, FLUSHER_SCHEDULE_PERIOD_NS, TimeUnit.NANOSECONDS);
+ } else {
+ eventLoop.execute(this);
+ }
}
}
}
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ConsistencyLevel.java b/driver-core/src/main/java/com/datastax/driver/core/ConsistencyLevel.java
index d6352bf..2439780 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ConsistencyLevel.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ConsistencyLevel.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java b/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java
index 1483190..1699d8d 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -516,6 +516,8 @@
String dseVersion = row.getString("dse_version");
host.setDseVersion(dseVersion);
}
+ host.setHostId(row.getUUID("host_id"));
+ host.setSchemaVersion(row.getUUID("schema_version"));
}
private static void updateLocationInfo(Host host, String datacenter, String rack, boolean isInitialConnection, Cluster.Manager cluster) {
@@ -588,6 +590,8 @@
List<String> dseVersions = new ArrayList<String>();
List<Boolean> dseGraphEnabled = new ArrayList<Boolean>();
List<String> dseWorkloads = new ArrayList<String>();
+ List<UUID> hostIds = new ArrayList<UUID>();
+ List<UUID> schemaVersions = new ArrayList<UUID>();
for (Row row : peersFuture.get()) {
if (!isValidPeer(row, logInvalidPeers))
@@ -617,6 +621,8 @@
dseGraphEnabled.add(isDseGraph);
String dseVersion = row.getColumnDefinitions().contains("dse_version") ? row.getString("dse_version") : null;
dseVersions.add(dseVersion);
+ hostIds.add(row.getUUID("host_id"));
+ schemaVersions.add(row.getUUID("schema_version"));
}
for (int i = 0; i < foundHosts.size(); i++) {
@@ -626,12 +632,12 @@
// We don't know that node, create the Host object but wait until we've set the known
// info before signaling the addition.
Host newHost = cluster.metadata.newHost(foundHosts.get(i));
- Host existing = cluster.metadata.addIfAbsent(newHost);
- if (existing == null) {
+ Host previous = cluster.metadata.addIfAbsent(newHost);
+ if (previous == null) {
host = newHost;
isNew = true;
} else {
- host = existing;
+ host = previous;
isNew = false;
}
}
@@ -650,6 +656,12 @@
host.setDseWorkload(dseWorkloads.get(i));
if (dseGraphEnabled.get(i) != null)
host.setDseGraphEnabled(dseGraphEnabled.get(i));
+ if (hostIds.get(i) != null) {
+ host.setHostId(hostIds.get(i));
+ }
+ if (schemaVersions.get(i) != null) {
+ host.setSchemaVersion(schemaVersions.get(i));
+ }
if (metadataEnabled && factory != null && allTokens.get(i) != null)
tokenMap.put(host, allTokens.get(i));
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ConvictionPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/ConvictionPolicy.java
index f1bd00e..0fce5d1 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ConvictionPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ConvictionPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/DataType.java b/driver-core/src/main/java/com/datastax/driver/core/DataType.java
index 1f29a9c..b7e7653 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/DataType.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/DataType.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/DataTypeClassNameParser.java b/driver-core/src/main/java/com/datastax/driver/core/DataTypeClassNameParser.java
index f774170..2e7f4c1 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/DataTypeClassNameParser.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/DataTypeClassNameParser.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/DataTypeCqlNameParser.java b/driver-core/src/main/java/com/datastax/driver/core/DataTypeCqlNameParser.java
index 4a0bd6e..4b36b07 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/DataTypeCqlNameParser.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/DataTypeCqlNameParser.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/DefaultPreparedStatement.java b/driver-core/src/main/java/com/datastax/driver/core/DefaultPreparedStatement.java
index 725347a..2a4ca95 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/DefaultPreparedStatement.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/DefaultPreparedStatement.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -56,18 +56,18 @@
ColumnDefinitions defs = msg.metadata.columns;
ProtocolVersion protocolVersion = cluster.getConfiguration().getProtocolOptions().getProtocolVersion();
+ PreparedId.PreparedMetadata boundValuesMetadata = new PreparedId.PreparedMetadata(msg.statementId, defs);
+ PreparedId.PreparedMetadata resultSetMetadata = new PreparedId.PreparedMetadata(msg.resultMetadataId, msg.resultMetadata.columns);
- if (defs.size() == 0) {
- return new DefaultPreparedStatement(new PreparedId(msg.statementId, defs, msg.resultMetadata.columns, null, protocolVersion), query, queryKeyspace, msg.getCustomPayload(), cluster);
+ int[] pkIndices = null;
+ if (defs.size() > 0) {
+ pkIndices = (protocolVersion.compareTo(V4) >= 0)
+ ? msg.metadata.pkIndices
+ : computePkIndices(cluster.getMetadata(), defs);
}
- int[] pkIndices = (protocolVersion.compareTo(V4) >= 0)
- ? msg.metadata.pkIndices
- : computePkIndices(cluster.getMetadata(), defs);
-
- PreparedId prepId = new PreparedId(msg.statementId, defs, msg.resultMetadata.columns, pkIndices, protocolVersion);
-
- return new DefaultPreparedStatement(prepId, query, queryKeyspace, msg.getCustomPayload(), cluster);
+ PreparedId preparedId = new PreparedId(boundValuesMetadata, resultSetMetadata, pkIndices, protocolVersion);
+ return new DefaultPreparedStatement(preparedId, query, queryKeyspace, msg.getCustomPayload(), cluster);
}
private static int[] computePkIndices(Metadata clusterMetadata, ColumnDefinitions boundColumns) {
@@ -117,7 +117,7 @@
@Override
public ColumnDefinitions getVariables() {
- return preparedId.metadata;
+ return preparedId.boundValuesMetadata.variables;
}
@Override
diff --git a/driver-core/src/main/java/com/datastax/driver/core/DefaultResultSetFuture.java b/driver-core/src/main/java/com/datastax/driver/core/DefaultResultSetFuture.java
index 1ad214e..ba22393 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/DefaultResultSetFuture.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/DefaultResultSetFuture.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/DelegatingCluster.java b/driver-core/src/main/java/com/datastax/driver/core/DelegatingCluster.java
index a693308..bf8c06f 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/DelegatingCluster.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/DelegatingCluster.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/DirectedGraph.java b/driver-core/src/main/java/com/datastax/driver/core/DirectedGraph.java
index dc76262..a0aa7cd 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/DirectedGraph.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/DirectedGraph.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -33,8 +33,10 @@
final Map<V, Integer> vertices;
final Multimap<V, V> adjacencyList;
boolean wasSorted;
+ final Comparator<V> comparator;
- DirectedGraph(List<V> vertices) {
+ DirectedGraph(Comparator<V> comparator, List<V> vertices) {
+ this.comparator = comparator;
this.vertices = Maps.newHashMapWithExpectedSize(vertices.size());
this.adjacencyList = HashMultimap.create();
@@ -43,8 +45,8 @@
}
}
- DirectedGraph(V... vertices) {
- this(Arrays.asList(vertices));
+ DirectedGraph(Comparator<V> comparator, V... vertices) {
+ this(comparator, Arrays.asList(vertices));
}
/**
@@ -65,16 +67,21 @@
Queue<V> queue = new LinkedList<V>();
- for (Map.Entry<V, Integer> entry : vertices.entrySet()) {
- if (entry.getValue() == 0)
- queue.add(entry.getKey());
+ // Sort vertices so order of evaluation is always the same (instead of depending on undefined map order behavior)
+ List<V> orderedVertices = new ArrayList<V>(vertices.keySet());
+ Collections.sort(orderedVertices, comparator);
+ for (V v : orderedVertices) {
+ if (vertices.get(v) == 0)
+ queue.add(v);
}
List<V> result = Lists.newArrayList();
while (!queue.isEmpty()) {
V vertex = queue.remove();
result.add(vertex);
- for (V successor : adjacencyList.get(vertex)) {
+ List<V> adjacentVertices = new ArrayList<V>(adjacencyList.get(vertex));
+ Collections.sort(adjacentVertices, comparator);
+ for (V successor : adjacentVertices) {
if (decrementAndGetCount(successor) == 0)
queue.add(successor);
}
diff --git a/driver-core/src/main/java/com/datastax/driver/core/DriverThrowables.java b/driver-core/src/main/java/com/datastax/driver/core/DriverThrowables.java
index ec4fb96..9e692a2 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/DriverThrowables.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/DriverThrowables.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Duration.java b/driver-core/src/main/java/com/datastax/driver/core/Duration.java
index d28e891..729b0c9 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Duration.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Duration.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/EventDebouncer.java b/driver-core/src/main/java/com/datastax/driver/core/EventDebouncer.java
index ef48c0d..a1acb26 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/EventDebouncer.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/EventDebouncer.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ExceptionCatchingRunnable.java b/driver-core/src/main/java/com/datastax/driver/core/ExceptionCatchingRunnable.java
index bc87885..e14dc3a 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ExceptionCatchingRunnable.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ExceptionCatchingRunnable.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ExceptionCode.java b/driver-core/src/main/java/com/datastax/driver/core/ExceptionCode.java
index e162ff0..48a6c58 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ExceptionCode.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ExceptionCode.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ExecutionInfo.java b/driver-core/src/main/java/com/datastax/driver/core/ExecutionInfo.java
index a4bf946..9c1ad7e 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ExecutionInfo.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ExecutionInfo.java
@@ -1,21 +1,22 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
import com.datastax.driver.core.utils.Bytes;
+import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
@@ -28,6 +29,8 @@
* Basic information on the execution of a query.
*/
public class ExecutionInfo {
+ private final int speculativeExecutions;
+ private final int successfulExecutionIndex;
private final List<Host> triedHosts;
private final ConsistencyLevel achievedConsistency;
private final QueryTrace trace;
@@ -39,7 +42,9 @@
private final List<String> warnings;
private final Map<String, ByteBuffer> incomingPayload;
- private ExecutionInfo(List<Host> triedHosts, ConsistencyLevel achievedConsistency, QueryTrace trace, ByteBuffer pagingState, ProtocolVersion protocolVersion, CodecRegistry codecRegistry, Statement statement, boolean schemaAgreement, List<String> warnings, Map<String, ByteBuffer> incomingPayload) {
+ private ExecutionInfo(int speculativeExecutions, int successfulExecutionIndex, List<Host> triedHosts, ConsistencyLevel achievedConsistency, QueryTrace trace, ByteBuffer pagingState, ProtocolVersion protocolVersion, CodecRegistry codecRegistry, Statement statement, boolean schemaAgreement, List<String> warnings, Map<String, ByteBuffer> incomingPayload) {
+ this.speculativeExecutions = speculativeExecutions;
+ this.successfulExecutionIndex = successfulExecutionIndex;
this.triedHosts = triedHosts;
this.achievedConsistency = achievedConsistency;
this.trace = trace;
@@ -52,16 +57,16 @@
this.incomingPayload = incomingPayload;
}
- ExecutionInfo(List<Host> triedHosts) {
- this(triedHosts, null, null, null, null, null, null, true, Collections.<String>emptyList(), null);
+ ExecutionInfo(Host singleHost) {
+ this(0, 0, ImmutableList.of(singleHost), null, null, null, null, null, null, true, Collections.<String>emptyList(), null);
}
- ExecutionInfo withAchievedConsistency(ConsistencyLevel newConsistency) {
- return new ExecutionInfo(triedHosts, newConsistency, trace, pagingState, protocolVersion, codecRegistry, statement, schemaInAgreement, warnings, incomingPayload);
+ public ExecutionInfo(int speculativeExecutions, int successfulExecutionIndex, List<Host> triedHosts, ConsistencyLevel achievedConsistency, Map<String, ByteBuffer> customPayload) {
+ this(speculativeExecutions, successfulExecutionIndex, triedHosts, achievedConsistency, null, null, null, null, null, false, null, customPayload);
}
ExecutionInfo with(QueryTrace newTrace, List<String> newWarnings, ByteBuffer newPagingState, Statement newStatement, ProtocolVersion protocolVersion, CodecRegistry codecRegistry) {
- return new ExecutionInfo(this.triedHosts, this.achievedConsistency,
+ return new ExecutionInfo(speculativeExecutions, successfulExecutionIndex, triedHosts, achievedConsistency,
newTrace,
newPagingState, protocolVersion, codecRegistry,
newStatement,
@@ -71,10 +76,6 @@
);
}
- ExecutionInfo withIncomingPayload(Map<String, ByteBuffer> incomingPayload) {
- return new ExecutionInfo(triedHosts, achievedConsistency, trace, pagingState, protocolVersion, codecRegistry, statement, schemaInAgreement, warnings, incomingPayload);
- }
-
/**
* The list of tried hosts for this query.
* <p/>
@@ -87,7 +88,10 @@
* {@link com.datastax.driver.core.policies.RetryPolicy} may retry the
* query on the same host, so the same host might appear twice.</li>
* <li>if {@link com.datastax.driver.core.policies.SpeculativeExecutionPolicy speculative executions}
- * are enabled, other hosts might have been tried speculatively as well.</li>
+ * are enabled, this will also contain hosts that were tried by other executions (however, note that
+ * this only contains hosts which timed out, or for which a response was received; if an execution is
+ * waiting for a response from a host and another execution completes the request in the meantime, then
+ * the host of the first execution will not be in that list).</li>
* </ul>
* <p/>
* If you are only interested in fetching the final (and often only) node
@@ -103,7 +107,7 @@
/**
* Return the Cassandra host that coordinated this query.
* <p/>
- * This is a shortcut for {@code getTriedHosts().get(getTriedHosts().size())}.
+ * This is a shortcut for {@code getTriedHosts().get(getTriedHosts().size() - 1)}.
*
* @return return the Cassandra host that coordinated this query.
*/
@@ -112,6 +116,33 @@
}
/**
+ * The number of speculative executions that were started for this query.
+ * <p>
+ * This does not include the initial, normal execution of the query. Therefore, if speculative
+ * executions are disabled, this will always be 0. If they are enabled and one speculative
+ * execution was triggered in addition to the initial execution, this will be 1, etc.
+ *
+ * @see #getSuccessfulExecutionIndex()
+ * @see Cluster.Builder#withSpeculativeExecutionPolicy(com.datastax.driver.core.policies.SpeculativeExecutionPolicy)
+ */
+ public int getSpeculativeExecutions() {
+ return speculativeExecutions;
+ }
+
+ /**
+ * The index of the execution that completed this query.
+ * <p>
+ * 0 represents the initial, normal execution of the query, 1 represents the first speculative
+ * execution, etc.
+ *
+ * @see #getSpeculativeExecutions()
+ * @see Cluster.Builder#withSpeculativeExecutionPolicy(com.datastax.driver.core.policies.SpeculativeExecutionPolicy)
+ */
+ public int getSuccessfulExecutionIndex() {
+ return successfulExecutionIndex;
+ }
+
+ /**
* If the query returned without achieving the requested consistency level
* due to the {@link com.datastax.driver.core.policies.RetryPolicy}, this
* return the biggest consistency level that has been actually achieved by
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Frame.java b/driver-core/src/main/java/com/datastax/driver/core/Frame.java
index 4b8abfe..36cd16f 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Frame.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Frame.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/FrameCompressor.java b/driver-core/src/main/java/com/datastax/driver/core/FrameCompressor.java
index b2eda8d..58e91f0 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/FrameCompressor.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/FrameCompressor.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/FunctionMetadata.java b/driver-core/src/main/java/com/datastax/driver/core/FunctionMetadata.java
index 397932a..f229ee1 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/FunctionMetadata.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/FunctionMetadata.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -174,11 +174,9 @@
first = false;
else
sb.append(',');
- TableMetadata.newLine(sb, formatted);
String name = entry.getKey();
DataType type = entry.getValue();
sb
- .append(TableMetadata.spaces(4, formatted))
.append(Metadata.quoteIfNecessary(name))
.append(' ')
.append(type.asFunctionParameterString());
@@ -190,7 +188,7 @@
TableMetadata.spaceOrNewLine(sb, formatted)
.append("RETURNS ")
- .append(returnType);
+ .append(returnType.asFunctionParameterString());
TableMetadata.spaceOrNewLine(sb, formatted)
.append("LANGUAGE ")
diff --git a/driver-core/src/main/java/com/datastax/driver/core/GettableByIndexData.java b/driver-core/src/main/java/com/datastax/driver/core/GettableByIndexData.java
index c3ff076..a0a4c63 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/GettableByIndexData.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/GettableByIndexData.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/GettableByNameData.java b/driver-core/src/main/java/com/datastax/driver/core/GettableByNameData.java
index e30df85..e13c522 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/GettableByNameData.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/GettableByNameData.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/GettableData.java b/driver-core/src/main/java/com/datastax/driver/core/GettableData.java
index 7a97472..a2f62a6 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/GettableData.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/GettableData.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java b/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java
index d7b1453..6f8c400 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Host.java b/driver-core/src/main/java/com/datastax/driver/core/Host.java
index af36f89..4c4009c 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Host.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Host.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -24,6 +24,7 @@
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.Set;
+import java.util.UUID;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.ReentrantLock;
@@ -52,6 +53,10 @@
// specified otherwise in cassandra.yaml file.
private volatile InetAddress listenAddress;
+ private volatile UUID hostId;
+
+ private volatile UUID schemaVersion;
+
enum State {ADDED, DOWN, UP}
volatile State state;
@@ -88,7 +93,7 @@
this.address = address;
this.convictionPolicy = convictionPolicyFactory.create(this, manager.reconnectionPolicy());
this.manager = manager;
- this.defaultExecutionInfo = new ExecutionInfo(ImmutableList.of(this));
+ this.defaultExecutionInfo = new ExecutionInfo(this);
this.state = State.ADDED;
}
@@ -137,6 +142,14 @@
this.dseGraphEnabled = dseGraphEnabled;
}
+ void setHostId(UUID hostId) {
+ this.hostId = hostId;
+ }
+
+ void setSchemaVersion(UUID schemaVersion) {
+ this.schemaVersion = schemaVersion;
+ }
+
boolean supports(ProtocolVersion version) {
return getCassandraVersion() == null
|| version.minCassandraVersion().compareTo(getCassandraVersion().nextStable()) <= 0;
@@ -304,6 +317,31 @@
}
/**
+ * Return the host id value for the host.
+ * <p/>
+ * The host id is the main identifier used by Cassandra on the server for internal
+ * communication (gossip). It is referenced as the column {@code host_id} in the
+ * {@code system.local} or {@code system.peers} table.
+ *
+ * @return the node's host id value.
+ */
+ public UUID getHostId() {
+ return hostId;
+ }
+
+ /**
+ * Return the current schema version for the host.
+ * <p/>
+ * Schema versions in Cassandra are used to ensure all the nodes agree on the current
+ * Cassandra schema when it is modified. For more information see {@link ExecutionInfo#isSchemaInAgreement()}
+ *
+ * @return the node's current schema version value.
+ */
+ public UUID getSchemaVersion() {
+ return schemaVersion;
+ }
+
+ /**
* Returns the tokens that this host owns.
*
* @return the (immutable) set of tokens.
diff --git a/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java b/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java
index 1dcfb33..662305b 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -174,11 +174,14 @@
// accordingly in SessionManager#maybeAddPool.
Throwables.propagateIfInstanceOf(t, ClusterNameMismatchException.class);
Throwables.propagateIfInstanceOf(t, UnsupportedProtocolVersionException.class);
+ Throwables.propagateIfInstanceOf(t, AuthenticationException.class);
// We don't want to swallow Errors either as they probably indicate a more serious issue (OOME...)
Throwables.propagateIfInstanceOf(t, Error.class);
- // Otherwise, return success. The pool will simply ignore this connection when it sees that it's been closed.
+ // Otherwise, log the exception but return success.
+ // The pool will simply ignore this connection when it sees that it's been closed.
+ logger.warn("Error creating connection to " + host, t);
return MoreFutures.VOID_SUCCESS;
}
}, executor);
diff --git a/driver-core/src/main/java/com/datastax/driver/core/HostDistance.java b/driver-core/src/main/java/com/datastax/driver/core/HostDistance.java
index 11ac2d1..d1913d3 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/HostDistance.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/HostDistance.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/IndexMetadata.java b/driver-core/src/main/java/com/datastax/driver/core/IndexMetadata.java
index f77e70f..d4a4bbd 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/IndexMetadata.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/IndexMetadata.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/JdkSSLOptions.java b/driver-core/src/main/java/com/datastax/driver/core/JdkSSLOptions.java
index b616d22..ee65aa0 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/JdkSSLOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/JdkSSLOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/KeyspaceMetadata.java b/driver-core/src/main/java/com/datastax/driver/core/KeyspaceMetadata.java
index 9381502..849bb49 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/KeyspaceMetadata.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/KeyspaceMetadata.java
@@ -1,27 +1,25 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
import com.google.common.annotations.VisibleForTesting;
+import com.google.common.collect.ImmutableSortedSet;
import com.google.common.collect.Lists;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
/**
@@ -43,7 +41,7 @@
final Map<String, TableMetadata> tables = new ConcurrentHashMap<String, TableMetadata>();
final Map<String, MaterializedViewMetadata> views = new ConcurrentHashMap<String, MaterializedViewMetadata>();
- final Map<String, UserType> userTypes = new ConcurrentHashMap<String, UserType>();
+ final Map<String, UserType> userTypes = Collections.synchronizedMap(new LinkedHashMap<String, UserType>());
final Map<String, FunctionMetadata> functions = new ConcurrentHashMap<String, FunctionMetadata>();
final Map<String, AggregateMetadata> aggregates = new ConcurrentHashMap<String, AggregateMetadata>();
@@ -246,6 +244,29 @@
return aggregates.remove(fullName);
}
+ // comparators for ordering types in cqlsh output.
+
+ private static final Comparator<UserType> typeByName = new Comparator<UserType>() {
+ @Override
+ public int compare(UserType o1, UserType o2) {
+ return o1.getTypeName().compareTo(o2.getTypeName());
+ }
+ };
+
+ private static final Comparator<FunctionMetadata> functionByName = new Comparator<FunctionMetadata>() {
+ @Override
+ public int compare(FunctionMetadata o1, FunctionMetadata o2) {
+ return o1.getSimpleName().compareTo(o2.getSimpleName());
+ }
+ };
+
+ private static final Comparator<AggregateMetadata> aggregateByName = new Comparator<AggregateMetadata>() {
+ @Override
+ public int compare(AggregateMetadata o1, AggregateMetadata o2) {
+ return o1.getSimpleName().compareTo(o2.getSimpleName());
+ }
+ };
+
/**
* Returns a {@code String} containing CQL queries representing this
* keyspace and the user types and tables it contains.
@@ -265,21 +286,61 @@
sb.append(asCQLQuery()).append('\n');
- for (UserType udt : userTypes.values())
+ // include types, tables, views, functions and aggregates, each ordered by name, with one small exception
+ // being that user types are ordered topologically and then by name within same level.
+ for (UserType udt : getSortedUserTypes())
sb.append('\n').append(udt.exportAsString()).append('\n');
- for (TableMetadata tm : tables.values())
+ for (AbstractTableMetadata tm : ImmutableSortedSet.orderedBy(AbstractTableMetadata.byNameComparator).addAll(tables.values()).build())
sb.append('\n').append(tm.exportAsString()).append('\n');
- for (FunctionMetadata fm : functions.values())
+ for (FunctionMetadata fm : ImmutableSortedSet.orderedBy(functionByName).addAll(functions.values()).build())
sb.append('\n').append(fm.exportAsString()).append('\n');
- for (AggregateMetadata am : aggregates.values())
+ for (AggregateMetadata am : ImmutableSortedSet.orderedBy(aggregateByName).addAll(aggregates.values()).build())
sb.append('\n').append(am.exportAsString()).append('\n');
return sb.toString();
}
+ private List<UserType> getSortedUserTypes() {
+ // rebuilds dependency tree of user types so they may be sorted within each dependency level.
+ List<UserType> unsortedTypes = new ArrayList<UserType>(userTypes.values());
+ DirectedGraph<UserType> graph = new DirectedGraph<UserType>(typeByName, unsortedTypes);
+ for (UserType from : unsortedTypes) {
+ for (UserType to : unsortedTypes) {
+ if (from != to && dependsOn(to, from))
+ graph.addEdge(from, to);
+ }
+ }
+ return graph.topologicalSort();
+ }
+
+ private boolean dependsOn(UserType udt1, UserType udt2) {
+ for (UserType.Field field : udt1) {
+ if (references(field.getType(), udt2)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean references(DataType dataType, DataType udtType) {
+ if (dataType.equals(udtType))
+ return true;
+ for (DataType arg : dataType.getTypeArguments()) {
+ if (references(arg, udtType))
+ return true;
+ }
+ if (dataType instanceof TupleType) {
+ for (DataType arg : ((TupleType) dataType).getComponentTypes()) {
+ if (references(arg, udtType))
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* Returns a CQL query representing this keyspace.
* <p/>
diff --git a/driver-core/src/main/java/com/datastax/driver/core/LZ4Compressor.java b/driver-core/src/main/java/com/datastax/driver/core/LZ4Compressor.java
index 595adac..19633c1 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/LZ4Compressor.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/LZ4Compressor.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/LatencyTracker.java b/driver-core/src/main/java/com/datastax/driver/core/LatencyTracker.java
index fb29c1a..b8b7667 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/LatencyTracker.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/LatencyTracker.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/LocalDate.java b/driver-core/src/main/java/com/datastax/driver/core/LocalDate.java
index b47f738..424c87c 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/LocalDate.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/LocalDate.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/LoggingMonotonicTimestampGenerator.java b/driver-core/src/main/java/com/datastax/driver/core/LoggingMonotonicTimestampGenerator.java
index 5bb44e8..cae8163 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/LoggingMonotonicTimestampGenerator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/LoggingMonotonicTimestampGenerator.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/MD5Digest.java b/driver-core/src/main/java/com/datastax/driver/core/MD5Digest.java
index 2ff526e..12f50bc 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/MD5Digest.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/MD5Digest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/MaterializedViewMetadata.java b/driver-core/src/main/java/com/datastax/driver/core/MaterializedViewMetadata.java
index 9ce1e89..f5d102d 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/MaterializedViewMetadata.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/MaterializedViewMetadata.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -162,34 +162,32 @@
StringBuilder sb = new StringBuilder();
sb.append("CREATE MATERIALIZED VIEW ")
.append(keyspaceName).append('.').append(viewName)
- .append(" AS ");
- newLine(sb, formatted);
+ .append(" AS");
// SELECT
- sb.append("SELECT ");
+ spaceOrNewLine(sb, formatted).append("SELECT ");
if (includeAllColumns) {
- sb.append(" * ");
+ sb.append("*");
} else {
Iterator<ColumnMetadata> it = columns.values().iterator();
while (it.hasNext()) {
ColumnMetadata column = it.next();
- sb.append(spaces(4, formatted)).append(Metadata.quoteIfNecessary(column.getName()));
- if (it.hasNext()) sb.append(",");
- sb.append(" ");
- newLine(sb, formatted);
+ sb.append(Metadata.quoteIfNecessary(column.getName()));
+ if (it.hasNext()) sb.append(", ");
}
}
// FROM
- newLine(sb.append("FROM ").append(keyspaceName).append('.').append(baseTableName).append(" "), formatted);
+ spaceOrNewLine(sb, formatted).append("FROM ").append(keyspaceName).append('.').append(baseTableName);
// WHERE
// the CQL grammar allows missing WHERE clauses, although C* currently disallows it
- if (whereClause != null && !whereClause.isEmpty())
- newLine(sb.append("WHERE ").append(whereClause).append(' '), formatted);
+ if (whereClause != null && !whereClause.isEmpty()) {
+ spaceOrNewLine(sb, formatted).append("WHERE ").append(whereClause);
+ }
// PK
- sb.append("PRIMARY KEY (");
+ spaceOrNewLine(sb, formatted).append("PRIMARY KEY (");
if (partitionKey.size() == 1) {
sb.append(Metadata.quoteIfNecessary(partitionKey.get(0).getName()));
} else {
@@ -208,6 +206,8 @@
sb.append(", ").append(Metadata.quoteIfNecessary(cm.getName()));
sb.append(')');
+ // append 3 extra spaces if formatted to align WITH.
+ spaceOrNewLine(sb, formatted);
appendOptions(sb, formatted);
return sb.toString();
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Message.java b/driver-core/src/main/java/com/datastax/driver/core/Message.java
index 09c0edd..d2ddba6 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Message.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Message.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Metadata.java b/driver-core/src/main/java/com/datastax/driver/core/Metadata.java
index f31f2c5..bd172d8 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Metadata.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Metadata.java
@@ -1,23 +1,24 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
+import io.netty.util.collection.IntObjectHashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,7 +46,7 @@
final ReentrantLock lock = new ReentrantLock();
// See https://github.com/apache/cassandra/blob/trunk/doc/cql3/CQL.textile#appendixA
- private static final Set<String> RESERVED_KEYWORDS = ImmutableSet.of(
+ private static final IntObjectHashMap<List<char[]>> RESERVED_KEYWORDS = indexByCaseInsensitiveHash(
"add", "allow", "alter", "and", "any", "apply", "asc", "authorize", "batch", "begin", "by",
"columnfamily", "create", "delete", "desc", "drop", "each_quorum", "from", "grant", "in",
"index", "inet", "infinity", "insert", "into", "keyspace", "keyspaces", "limit", "local_one",
@@ -90,13 +91,11 @@
return new Host(address, cluster.convictionPolicyFactory, cluster);
}
+ /**
+ * @return the previous host associated with this socket address, or {@code null} if there was no such host.
+ */
Host addIfAbsent(Host host) {
- Host previous = hosts.putIfAbsent(host.getSocketAddress(), host);
- return previous == null ? host : null;
- }
-
- Host add(InetSocketAddress address) {
- return addIfAbsent(newHost(address));
+ return hosts.putIfAbsent(host.getSocketAddress(), host);
}
boolean remove(Host host) {
@@ -127,27 +126,34 @@
if (id == null)
return null;
- if (isAlphanumeric(id))
+ boolean isAlphanumericLowCase = true;
+ boolean isAlphanumeric = true;
+ for (int i = 0; i < id.length(); i++) {
+ char c = id.charAt(i);
+ if (c >= 65 && c <= 90) { // A-Z
+ isAlphanumericLowCase = false;
+ } else if (!(
+ (c >= 48 && c <= 57) // 0-9
+ || (c == 95) // _ (underscore)
+ || (c >= 97 && c <= 122) // a-z
+ )) {
+ isAlphanumeric = false;
+ isAlphanumericLowCase = false;
+ break;
+ }
+ }
+
+ if (isAlphanumericLowCase) {
+ return id;
+ }
+ if (isAlphanumeric) {
return id.toLowerCase();
+ }
// Check if it's enclosed in quotes. If it is, remove them and unescape internal double quotes
return ParseUtils.unDoubleQuote(id);
}
- private static boolean isAlphanumeric(String s) {
- for (int i = 0; i < s.length(); i++) {
- char c = s.charAt(i);
- if (!(
- (c >= 48 && c <= 57) // 0-9
- || (c >= 65 && c <= 90) // A-Z
- || (c == 95) // _ (underscore)
- || (c >= 97 && c <= 122) // a-z
- ))
- return false;
- }
- return true;
- }
-
/**
* Quotes a CQL identifier if necessary.
* <p/>
@@ -275,8 +281,73 @@
* @return {@code true} if the given identifier is a known reserved
* CQL keyword, {@code false} otherwise.
*/
+
public static boolean isReservedCqlKeyword(String id) {
- return id != null && RESERVED_KEYWORDS.contains(id.toLowerCase());
+ if (id == null) {
+ return false;
+ }
+ int hash = caseInsensitiveHash(id);
+ List<char[]> keywords = RESERVED_KEYWORDS.get(hash);
+ if (keywords == null) {
+ return false;
+ } else {
+ for (char[] keyword : keywords) {
+ if (equalsIgnoreCaseAscii(id, keyword)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ private static int caseInsensitiveHash(String str) {
+ int hashCode = 17;
+ for (int i = 0; i < str.length(); i++) {
+ char c = toLowerCaseAscii(str.charAt(i));
+ hashCode = 31 * hashCode + c;
+ }
+ return hashCode;
+ }
+
+ // keyword is expected as a second argument always in low case
+ private static boolean equalsIgnoreCaseAscii(String str1, char[] str2LowCase) {
+ if (str1.length() != str2LowCase.length) return false;
+
+ for (int i = 0; i < str1.length(); i++) {
+ char c1 = str1.charAt(i);
+ char c2Low = str2LowCase[i];
+ if (c1 == c2Low) {
+ continue;
+ }
+ char low1 = toLowerCaseAscii(c1);
+ if (low1 == c2Low) {
+ continue;
+ }
+ return false;
+ }
+ return true;
+ }
+
+ private static char toLowerCaseAscii(char c) {
+ if (c >= 65 && c <= 90) { // A-Z
+ c ^= 0x20; // convert to low case
+ }
+ return c;
+ }
+
+ private static IntObjectHashMap<List<char[]>> indexByCaseInsensitiveHash(String... words) {
+ IntObjectHashMap<List<char[]>> result = new IntObjectHashMap<List<char[]>>();
+ for (String word : words) {
+ char[] wordAsCharArray = word.toLowerCase().toCharArray();
+ int hash = caseInsensitiveHash(word);
+ List<char[]> list = result.get(hash);
+ if (list == null) {
+ list = new ArrayList<char[]>();
+ result.put(hash, list);
+ }
+ list.add(wordAsCharArray);
+ }
+ return result;
}
/**
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Metrics.java b/driver-core/src/main/java/com/datastax/driver/core/Metrics.java
index c459b47..3087634 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Metrics.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Metrics.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -79,6 +79,16 @@
return value;
}
});
+ private final Gauge<Integer> inFlightRequests = registry.register("inflight-requests", new Gauge<Integer>() {
+ @Override
+ public Integer getValue() {
+ int value = 0;
+ for (SessionManager session : manager.sessions)
+ for (HostConnectionPool pool : session.pools.values())
+ value += pool.totalInFlight.get();
+ return value;
+ }
+ });
private final Gauge<Integer> executorQueueDepth;
private final Gauge<Integer> blockingExecutorQueueDepth;
@@ -219,6 +229,15 @@
}
/**
+ * Returns the total number of in flight requests to Cassandra hosts.
+ *
+ * @return The total number of in flight requests to Cassandra hosts.
+ */
+ public Gauge<Integer> getInFlightRequests() {
+ return inFlightRequests;
+ }
+
+ /**
* Returns the number of queued up tasks in the {@link ThreadingOptions#createExecutor(String) main internal executor}.
* <p/>
* If the executor's task queue is not accessible – which happens when the executor
diff --git a/driver-core/src/main/java/com/datastax/driver/core/MetricsOptions.java b/driver-core/src/main/java/com/datastax/driver/core/MetricsOptions.java
index 4c850ff..4b43027 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/MetricsOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/MetricsOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Native.java b/driver-core/src/main/java/com/datastax/driver/core/Native.java
index 9610130..aba985b 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Native.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Native.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/NettyOptions.java b/driver-core/src/main/java/com/datastax/driver/core/NettyOptions.java
index 0548ced..b4a8c61 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/NettyOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/NettyOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/NettySSLOptions.java b/driver-core/src/main/java/com/datastax/driver/core/NettySSLOptions.java
index b00cf26..8890960 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/NettySSLOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/NettySSLOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/NettyUtil.java b/driver-core/src/main/java/com/datastax/driver/core/NettyUtil.java
index 3776f2f..c35e0d9 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/NettyUtil.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/NettyUtil.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -37,7 +37,6 @@
private static final Logger LOGGER = LoggerFactory.getLogger(NettyUtil.class);
- private static final boolean SHADED;
private static final boolean USE_EPOLL;
@@ -47,21 +46,12 @@
private static final Class[] EVENT_GROUP_ARGUMENTS = {int.class, ThreadFactory.class};
+ private static final String SHADING_DETECTION_STRING = "io.netty.shadingdetection.ShadingDetection";
+
+ private static final boolean SHADED = !SHADING_DETECTION_STRING.equals(String.format("%s.%s.shadingdetection.ShadingDetection", "io", "netty"));
+
static {
- boolean shaded;
- try {
- // prevent this string from being shaded
- Class.forName(String.format("%s.%s.channel.Channel", "io", "netty"));
- shaded = false;
- } catch (ClassNotFoundException e) {
- try {
- Class.forName("com.datastax.shaded.netty.channel.Channel");
- shaded = true;
- } catch (ClassNotFoundException e1) {
- throw new AssertionError("Cannot locate Netty classes in the classpath:" + e1);
- }
- }
- SHADED = shaded;
+
boolean useEpoll = false;
if (!SHADED) {
try {
diff --git a/driver-core/src/main/java/com/datastax/driver/core/PagingIterable.java b/driver-core/src/main/java/com/datastax/driver/core/PagingIterable.java
index 1abd67a..4a7fdb9 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/PagingIterable.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/PagingIterable.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/PagingState.java b/driver-core/src/main/java/com/datastax/driver/core/PagingState.java
index e591f25..708f74c 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/PagingState.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/PagingState.java
@@ -1,19 +1,18 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package com.datastax.driver.core;
import com.datastax.driver.core.exceptions.PagingStateException;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ParseUtils.java b/driver-core/src/main/java/com/datastax/driver/core/ParseUtils.java
index a2d1ad2..f9cefb0 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ParseUtils.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ParseUtils.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/PerHostPercentileTracker.java b/driver-core/src/main/java/com/datastax/driver/core/PerHostPercentileTracker.java
index f86e8e9..081e2c9 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/PerHostPercentileTracker.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/PerHostPercentileTracker.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/PercentileTracker.java b/driver-core/src/main/java/com/datastax/driver/core/PercentileTracker.java
index 9b177ca..6f60df2 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/PercentileTracker.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/PercentileTracker.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/PlainTextAuthProvider.java b/driver-core/src/main/java/com/datastax/driver/core/PlainTextAuthProvider.java
index 60935b7..67ef178 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/PlainTextAuthProvider.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/PlainTextAuthProvider.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/PoolingOptions.java b/driver-core/src/main/java/com/datastax/driver/core/PoolingOptions.java
index ec6544a..7ffd5b0 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/PoolingOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/PoolingOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/PreparedId.java b/driver-core/src/main/java/com/datastax/driver/core/PreparedId.java
index 1755bd4..3e29723 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/PreparedId.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/PreparedId.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -19,21 +19,37 @@
* Identifies a PreparedStatement.
*/
public class PreparedId {
- // This class is mostly here to group PreparedStatement data that are need for
- // execution but that we don't want to expose publicly (see JAVA-195)
- final MD5Digest id;
- final ColumnDefinitions metadata;
- final ColumnDefinitions resultSetMetadata;
+ // This class is mostly here to group PreparedStatement data that are needed for
+ // execution but that we don't want to expose publicly (see JAVA-195)
final int[] routingKeyIndexes;
+
final ProtocolVersion protocolVersion;
- PreparedId(MD5Digest id, ColumnDefinitions metadata, ColumnDefinitions resultSetMetadata, int[] routingKeyIndexes, ProtocolVersion protocolVersion) {
- this.id = id;
- this.metadata = metadata;
+ final PreparedMetadata boundValuesMetadata;
+
+ // can change over time, see JAVA-1196, JAVA-420
+ volatile PreparedMetadata resultSetMetadata;
+
+ PreparedId(PreparedMetadata boundValuesMetadata, PreparedMetadata resultSetMetadata, int[] routingKeyIndexes, ProtocolVersion protocolVersion) {
+ assert boundValuesMetadata != null;
+ assert resultSetMetadata != null;
+ this.boundValuesMetadata = boundValuesMetadata;
this.resultSetMetadata = resultSetMetadata;
this.routingKeyIndexes = routingKeyIndexes;
this.protocolVersion = protocolVersion;
}
+
+
+ static class PreparedMetadata {
+
+ final MD5Digest id;
+ final ColumnDefinitions variables;
+
+ PreparedMetadata(MD5Digest id, ColumnDefinitions variables) {
+ this.id = id;
+ this.variables = variables;
+ }
+ }
}
diff --git a/driver-core/src/main/java/com/datastax/driver/core/PreparedStatement.java b/driver-core/src/main/java/com/datastax/driver/core/PreparedStatement.java
index 5ffeb96..acf0dd3 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/PreparedStatement.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/PreparedStatement.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ProtocolEvent.java b/driver-core/src/main/java/com/datastax/driver/core/ProtocolEvent.java
index 5dc0958..863c056 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ProtocolEvent.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ProtocolEvent.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ProtocolFeature.java b/driver-core/src/main/java/com/datastax/driver/core/ProtocolFeature.java
new file mode 100644
index 0000000..bbedf6e
--- /dev/null
+++ b/driver-core/src/main/java/com/datastax/driver/core/ProtocolFeature.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2012-2017 DataStax Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.datastax.driver.core;
+
+/**
+ * A listing of features that may or not apply to a given {@link ProtocolVersion}.
+ */
+enum ProtocolFeature {
+
+ /**
+ * The capability of updating a prepared statement if the result's metadata changes at runtime (for example, if the
+ * query is a {@code SELECT *} and the table is altered).
+ */
+ PREPARED_METADATA_CHANGES,
+ //
+ ;
+
+ /**
+ * Determines whether or not the input version supports ths feature.
+ *
+ * @param version the version to test against.
+ * @return true if supported, false otherwise.
+ */
+ boolean isSupportedBy(ProtocolVersion version) {
+ switch (this) {
+ case PREPARED_METADATA_CHANGES:
+ return version == ProtocolVersion.V5;
+ default:
+ return false;
+ }
+ }
+
+}
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ProtocolOptions.java b/driver-core/src/main/java/com/datastax/driver/core/ProtocolOptions.java
index 9880c94..77848c0 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ProtocolOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ProtocolOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ProtocolV1Authenticator.java b/driver-core/src/main/java/com/datastax/driver/core/ProtocolV1Authenticator.java
index b0d6f33..007fe14 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ProtocolV1Authenticator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ProtocolV1Authenticator.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ProtocolVersion.java b/driver-core/src/main/java/com/datastax/driver/core/ProtocolVersion.java
index 479ae77..e5836c5 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ProtocolVersion.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ProtocolVersion.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/QueryLogger.java b/driver-core/src/main/java/com/datastax/driver/core/QueryLogger.java
index 9387326..32963fb 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/QueryLogger.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/QueryLogger.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/QueryOptions.java b/driver-core/src/main/java/com/datastax/driver/core/QueryOptions.java
index d71edc4..d7fc041 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/QueryOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/QueryOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/QueryTrace.java b/driver-core/src/main/java/com/datastax/driver/core/QueryTrace.java
index 0bb6624..1d59a4f 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/QueryTrace.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/QueryTrace.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java b/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java
index e157bfa..cc2c9a6 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.java b/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.java
index fa2916b..53364df 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.java b/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.java
index 6047c65..a574068 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.java b/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.java
index 9a698e4..707ee18 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ReplicationStategy.java b/driver-core/src/main/java/com/datastax/driver/core/ReplicationStategy.java
index 1f71302..605d373 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ReplicationStategy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ReplicationStategy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java b/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java
index c68f76a..49f0869 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -20,6 +20,7 @@
import com.datastax.driver.core.policies.RetryPolicy;
import com.datastax.driver.core.policies.RetryPolicy.RetryDecision.Type;
import com.datastax.driver.core.policies.SpeculativeExecutionPolicy.SpeculativeExecutionPlan;
+import com.google.common.collect.ImmutableList;
import com.google.common.collect.Sets;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
@@ -69,7 +70,7 @@
private final long startTime;
private final AtomicBoolean isDone = new AtomicBoolean();
- private final AtomicInteger executionCount = new AtomicInteger();
+ private final AtomicInteger executionIndex = new AtomicInteger();
public RequestHandler(SessionManager manager, Callback callback, Statement statement) {
this.id = Long.toString(System.identityHashCode(this));
@@ -110,7 +111,7 @@
return;
Message.Request request = callback.request();
- int position = executionCount.incrementAndGet();
+ int position = executionIndex.getAndIncrement();
SpeculativeExecution execution = new SpeculativeExecution(request, position);
runningExecutions.add(execution);
@@ -118,30 +119,40 @@
}
private void scheduleExecution(long delayMillis) {
- if (isDone.get() || delayMillis <= 0)
+ if (isDone.get() || delayMillis < 0)
return;
if (logger.isTraceEnabled())
logger.trace("[{}] Schedule next speculative execution in {} ms", id, delayMillis);
- scheduledExecutions.add(scheduler.newTimeout(newExecutionTask, delayMillis, TimeUnit.MILLISECONDS));
+ if(delayMillis == 0) {
+ // kick off request immediately
+ scheduleExecutionImmediately();
+ } else {
+ scheduledExecutions.add(scheduler.newTimeout(newExecutionTask, delayMillis, TimeUnit.MILLISECONDS));
+ }
}
private final TimerTask newExecutionTask = new TimerTask() {
@Override
public void run(final Timeout timeout) throws Exception {
scheduledExecutions.remove(timeout);
- if (!isDone.get())
+ if (!isDone.get()) {
// We're on the timer thread so reschedule to another executor
manager.executor().execute(new Runnable() {
@Override
public void run() {
- if (metricsEnabled())
- metrics().getErrorMetrics().getSpeculativeExecutions().inc();
- startNewExecution();
+ scheduleExecutionImmediately();
}
});
+ }
}
};
+ private void scheduleExecutionImmediately() {
+ if (metricsEnabled())
+ metrics().getErrorMetrics().getSpeculativeExecutions().inc();
+ startNewExecution();
+ }
+
private void cancelPendingExecutions(SpeculativeExecution ignore) {
for (SpeculativeExecution execution : runningExecutions)
if (execution != ignore) // not vital but this produces nicer logs
@@ -166,16 +177,22 @@
if (timerContext != null)
timerContext.stop();
- ExecutionInfo info = execution.current.defaultExecutionInfo;
- if (triedHosts != null) {
- triedHosts.add(execution.current);
- info = new ExecutionInfo(triedHosts);
+ ExecutionInfo info;
+ int speculativeExecutions = executionIndex.get() - 1;
+ // Avoid creating a new instance if we can reuse the host's default one
+ if (execution.position == 0 && speculativeExecutions == 0 && triedHosts == null && execution.retryConsistencyLevel == null
+ && response.getCustomPayload() == null) {
+ info = execution.current.defaultExecutionInfo;
+ } else {
+ List<Host> hosts;
+ if (triedHosts == null) {
+ hosts = ImmutableList.of(execution.current);
+ } else {
+ hosts = triedHosts;
+ hosts.add(execution.current);
+ }
+ info = new ExecutionInfo(speculativeExecutions, execution.position, hosts, execution.retryConsistencyLevel, response.getCustomPayload());
}
- if (execution.retryConsistencyLevel != null)
- info = info.withAchievedConsistency(execution.retryConsistencyLevel);
- if (response.getCustomPayload() != null)
- info = info.withIncomingPayload(response.getCustomPayload());
-
callback.onSet(connection, response, info, statement, System.nanoTime() - startTime);
} catch (Exception e) {
callback.onException(connection,
@@ -246,6 +263,7 @@
class SpeculativeExecution implements Connection.ResponseCallback {
final String id;
private final Message.Request request;
+ private final int position;
private volatile Host current;
private volatile ConsistencyLevel retryConsistencyLevel;
private final AtomicReference<QueryState> queryStateRef;
@@ -262,6 +280,7 @@
SpeculativeExecution(Message.Request request, int position) {
this.id = RequestHandler.this.id + "-" + position;
this.request = request;
+ this.position = position;
this.queryStateRef = new AtomicReference<QueryState>(QueryState.INITIAL);
if (logger.isTraceEnabled())
logger.trace("[{}] Starting", id);
@@ -274,6 +293,11 @@
if (query(host))
return;
}
+ if (current != null) {
+ if (triedHosts == null)
+ triedHosts = new CopyOnWriteArrayList<Host>();
+ triedHosts.add(current);
+ }
reportNoMoreHosts(this);
} catch (Exception e) {
// Shouldn't happen really, but if ever the loadbalancing policy returned iterator throws, we don't want to block.
@@ -299,6 +323,10 @@
Futures.addCallback(connectionFuture, new FutureCallback<Connection>() {
@Override
public void onSuccess(Connection connection) {
+ if (isDone.get()) {
+ connection.release();
+ return;
+ }
if (current != null) {
if (triedHosts == null)
triedHosts = new CopyOnWriteArrayList<Host>();
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Requests.java b/driver-core/src/main/java/com/datastax/driver/core/Requests.java
index f202193..3af73f4 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Requests.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Requests.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -183,38 +183,48 @@
@Override
public void encode(Execute msg, ByteBuf dest, ProtocolVersion version) {
CBUtil.writeBytes(msg.statementId.bytes, dest);
+ if (ProtocolFeature.PREPARED_METADATA_CHANGES.isSupportedBy(version))
+ CBUtil.writeBytes(msg.resultMetadataId.bytes, dest);
msg.options.encode(dest, version);
}
@Override
public int encodedSize(Execute msg, ProtocolVersion version) {
- return CBUtil.sizeOfBytes(msg.statementId.bytes)
- + msg.options.encodedSize(version);
+ int size = CBUtil.sizeOfBytes(msg.statementId.bytes);
+ if (ProtocolFeature.PREPARED_METADATA_CHANGES.isSupportedBy(version))
+ size += CBUtil.sizeOfBytes(msg.resultMetadataId.bytes);
+ size += msg.options.encodedSize(version);
+ return size;
}
};
final MD5Digest statementId;
+ final MD5Digest resultMetadataId;
final QueryProtocolOptions options;
- Execute(MD5Digest statementId, QueryProtocolOptions options, boolean tracingRequested) {
+ Execute(MD5Digest statementId, MD5Digest resultMetadataId, QueryProtocolOptions options, boolean tracingRequested) {
super(Message.Request.Type.EXECUTE, tracingRequested);
this.statementId = statementId;
+ this.resultMetadataId = resultMetadataId;
this.options = options;
}
@Override
protected Request copyInternal() {
- return new Execute(statementId, options, isTracingRequested());
+ return new Execute(statementId, resultMetadataId, options, isTracingRequested());
}
@Override
protected Request copyInternal(ConsistencyLevel newConsistencyLevel) {
- return new Execute(statementId, options.copy(newConsistencyLevel), isTracingRequested());
+ return new Execute(statementId, resultMetadataId, options.copy(newConsistencyLevel), isTracingRequested());
}
@Override
public String toString() {
- return "EXECUTE " + statementId + " (" + options + ')';
+ if (resultMetadataId != null)
+ return "EXECUTE preparedId: " + statementId + " resultMetadataId: " + resultMetadataId + " (" + options + ')';
+ else
+ return "EXECUTE preparedId: " + statementId + " (" + options + ')';
}
}
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Responses.java b/driver-core/src/main/java/com/datastax/driver/core/Responses.java
index 98a120b..847a812 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Responses.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Responses.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -25,7 +25,6 @@
import java.nio.ByteBuffer;
import java.util.*;
-import static com.datastax.driver.core.ProtocolVersion.V4;
import static com.datastax.driver.core.SchemaElement.*;
class Responses {
@@ -347,7 +346,8 @@
// The order of that enum matters!!
GLOBAL_TABLES_SPEC,
HAS_MORE_PAGES,
- NO_METADATA;
+ NO_METADATA,
+ METADATA_CHANGED;
static EnumSet<Flag> deserialize(int flags) {
EnumSet<Flag> set = EnumSet.noneOf(Flag.class);
@@ -367,14 +367,16 @@
}
}
- static final Metadata EMPTY = new Metadata(0, null, null, null);
+ static final Metadata EMPTY = new Metadata(null, 0, null, null, null);
final int columnCount;
final ColumnDefinitions columns; // Can be null if no metadata was asked by the query
final ByteBuffer pagingState;
final int[] pkIndices;
+ final MD5Digest metadataId; // only present if the flag METADATA_CHANGED is set (ROWS response only)
- private Metadata(int columnCount, ColumnDefinitions columns, ByteBuffer pagingState, int[] pkIndices) {
+ private Metadata(MD5Digest metadataId, int columnCount, ColumnDefinitions columns, ByteBuffer pagingState, int[] pkIndices) {
+ this.metadataId = metadataId;
this.columnCount = columnCount;
this.columns = columns;
this.pagingState = pagingState;
@@ -391,6 +393,18 @@
EnumSet<Flag> flags = Flag.deserialize(body.readInt());
int columnCount = body.readInt();
+ ByteBuffer state = null;
+ if (flags.contains(Flag.HAS_MORE_PAGES))
+ state = CBUtil.readValue(body);
+
+ MD5Digest resultMetadataId = null;
+ if (flags.contains(Flag.METADATA_CHANGED)) {
+ assert ProtocolFeature.PREPARED_METADATA_CHANGES.isSupportedBy(protocolVersion)
+ : "METADATA_CHANGED flag is not supported in protocol version " + protocolVersion;
+ assert !flags.contains(Flag.NO_METADATA) : "METADATA_CHANGED and NO_METADATA are mutually exclusive flags";
+ resultMetadataId = MD5Digest.wrap(CBUtil.readBytes(body));
+ }
+
int[] pkIndices = null;
int pkCount;
if (withPkIndices && (pkCount = body.readInt()) > 0) {
@@ -399,12 +413,8 @@
pkIndices[i] = (int) body.readShort();
}
- ByteBuffer state = null;
- if (flags.contains(Flag.HAS_MORE_PAGES))
- state = CBUtil.readValue(body);
-
if (flags.contains(Flag.NO_METADATA))
- return new Metadata(columnCount, null, state, pkIndices);
+ return new Metadata(resultMetadataId, columnCount, null, state, pkIndices);
boolean globalTablesSpec = flags.contains(Flag.GLOBAL_TABLES_SPEC);
@@ -425,7 +435,7 @@
defs[i] = new ColumnDefinitions.Definition(ksName, cfName, name, type);
}
- return new Metadata(columnCount, new ColumnDefinitions(defs, codecRegistry), state, pkIndices);
+ return new Metadata(resultMetadataId, columnCount, new ColumnDefinitions(defs, codecRegistry), state, pkIndices);
}
@Override
@@ -517,10 +527,13 @@
@Override
public Result decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
MD5Digest id = MD5Digest.wrap(CBUtil.readBytes(body));
- boolean withPkIndices = version.compareTo(V4) >= 0;
+ MD5Digest resultMetadataId = null;
+ if (ProtocolFeature.PREPARED_METADATA_CHANGES.isSupportedBy(version))
+ resultMetadataId = MD5Digest.wrap(CBUtil.readBytes(body));
+ boolean withPkIndices = version.compareTo(ProtocolVersion.V4) >= 0;
Rows.Metadata metadata = Rows.Metadata.decode(body, withPkIndices, version, codecRegistry);
Rows.Metadata resultMetadata = decodeResultMetadata(body, version, codecRegistry);
- return new Prepared(id, metadata, resultMetadata);
+ return new Prepared(id, resultMetadataId, metadata, resultMetadata);
}
private Metadata decodeResultMetadata(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
@@ -539,12 +552,14 @@
};
final MD5Digest statementId;
+ final MD5Digest resultMetadataId;
final Rows.Metadata metadata;
final Rows.Metadata resultMetadata;
- private Prepared(MD5Digest statementId, Rows.Metadata metadata, Rows.Metadata resultMetadata) {
+ private Prepared(MD5Digest statementId, MD5Digest resultMetadataId, Rows.Metadata metadata, Rows.Metadata resultMetadata) {
super(Kind.PREPARED);
this.statementId = statementId;
+ this.resultMetadataId = resultMetadataId;
this.metadata = metadata;
this.resultMetadata = resultMetadata;
}
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ResultSet.java b/driver-core/src/main/java/com/datastax/driver/core/ResultSet.java
index 582b517..3d05896 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ResultSet.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ResultSet.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ResultSetFuture.java b/driver-core/src/main/java/com/datastax/driver/core/ResultSetFuture.java
index f91f3a1..6a246f6 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ResultSetFuture.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ResultSetFuture.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Row.java b/driver-core/src/main/java/com/datastax/driver/core/Row.java
index ea79b90..69b935c 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Row.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Row.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/SSLOptions.java b/driver-core/src/main/java/com/datastax/driver/core/SSLOptions.java
index 74b1a8d..e621854 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/SSLOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/SSLOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/SchemaChangeListener.java b/driver-core/src/main/java/com/datastax/driver/core/SchemaChangeListener.java
index 15344b7..47cf82d 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/SchemaChangeListener.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/SchemaChangeListener.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/SchemaChangeListenerBase.java b/driver-core/src/main/java/com/datastax/driver/core/SchemaChangeListenerBase.java
index ffddc4d..a48579b 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/SchemaChangeListenerBase.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/SchemaChangeListenerBase.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/SchemaElement.java b/driver-core/src/main/java/com/datastax/driver/core/SchemaElement.java
index b132ba7..5443e67 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/SchemaElement.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/SchemaElement.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java b/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java
index fcd1859..e43e4dc 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/SchemaParser.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -663,6 +663,24 @@
return whereClause;
}
+ // Used by maybeSortUdts to sort at each dependency group alphabetically.
+ private static final Comparator<Row> sortByTypeName = new Comparator<Row>() {
+ @Override
+ public int compare(Row o1, Row o2) {
+ String type1 = o1.getString(UserType.TYPE_NAME);
+ String type2 = o2.getString(UserType.TYPE_NAME);
+
+ if (type1 == null && type2 == null) {
+ return 0;
+ } else if (type2 == null) {
+ return 1;
+ } else if (type1 == null) {
+ return -1;
+ } else {
+ return type1.compareTo(type2);
+ }
+ }
+ };
@Override
protected List<Row> maybeSortUdts(List<Row> udtRows, Cluster cluster, String keyspace) {
@@ -671,7 +689,7 @@
// For C* 3+, user-defined type resolution must be done in proper order
// to guarantee that nested UDTs get resolved
- DirectedGraph<Row> graph = new DirectedGraph<Row>(udtRows);
+ DirectedGraph<Row> graph = new DirectedGraph<Row>(sortByTypeName, udtRows);
for (Row from : udtRows) {
for (Row to : udtRows) {
if (from != to && dependsOn(to, from, cluster, keyspace))
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ServerSideTimestampGenerator.java b/driver-core/src/main/java/com/datastax/driver/core/ServerSideTimestampGenerator.java
index 5560e29..9ca292d 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ServerSideTimestampGenerator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ServerSideTimestampGenerator.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Session.java b/driver-core/src/main/java/com/datastax/driver/core/Session.java
index 115194d..4a59169 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Session.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Session.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java b/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java
index 8702d24..0dd9aec 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/SessionManager.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -376,8 +376,16 @@
cluster.manager.triggerOnDown(host, false);
} else {
logger.warn("Error creating pool to " + host, t);
+ // do not mark the host down, as there could be other connections to it
+ // (e.g. the control connection, or another session pool).
+ // The conviction policy will mark it down if it has no more active connections.
}
- future.set(false);
+ // propagate errors; for all other exceptions, consider the pool init failed
+ // but allow the session init process to continue normally
+ if (t instanceof Error)
+ future.setException(t);
+ else
+ future.set(false);
}
});
return future;
@@ -431,7 +439,7 @@
}
// Wait pool creation before removing, so we don't lose connectivity
- ListenableFuture<?> allPoolsCreatedFuture = Futures.successfulAsList(poolCreatedFutures);
+ ListenableFuture<?> allPoolsCreatedFuture = Futures.allAsList(poolCreatedFutures);
return GuavaCompatibility.INSTANCE.transformAsync(allPoolsCreatedFuture, new AsyncFunction<Object, List<Void>>() {
@Override
@@ -452,11 +460,7 @@
try {
if (pool == null) {
if (dist != HostDistance.IGNORED && h.state == Host.State.UP)
- try {
- maybeAddPool(h, null).get();
- } catch (ExecutionException e) {
- // Ignore, maybeAddPool has already handled the error
- }
+ maybeAddPool(h, null).get();
} else if (dist != pool.hostDistance) {
if (dist == HostDistance.IGNORED) {
removePool(h).get();
@@ -468,7 +472,10 @@
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} catch (ExecutionException e) {
- logger.error("Unexpected error while refreshing connection pools", e.getCause());
+ Throwable cause = e.getCause();
+ logger.error("Unexpected error while refreshing connection pools", cause);
+ if (cause instanceof Error)
+ throw ((Error) cause);
}
}
@@ -567,16 +574,23 @@
request = new Requests.Query(qString, options, statement.isTracing());
} else if (statement instanceof BoundStatement) {
BoundStatement bs = (BoundStatement) statement;
- if (!cluster.manager.preparedQueries.containsKey(bs.statement.getPreparedId().id)) {
+ if (!cluster.manager.preparedQueries.containsKey(bs.statement.getPreparedId().boundValuesMetadata.id)) {
throw new InvalidQueryException(String.format("Tried to execute unknown prepared query : %s. "
- + "You may have used a PreparedStatement that was created with another Cluster instance.", bs.statement.getPreparedId().id));
+ + "You may have used a PreparedStatement that was created with another Cluster instance.", bs.statement.getPreparedId().boundValuesMetadata.id));
}
if (protocolVersion.compareTo(ProtocolVersion.V4) < 0)
bs.ensureAllSet();
- boolean skipMetadata = protocolVersion != ProtocolVersion.V1 && bs.statement.getPreparedId().resultSetMetadata != null;
- Requests.QueryProtocolOptions options = new Requests.QueryProtocolOptions(Message.Request.Type.EXECUTE, consistency, Arrays.asList(bs.wrapper.values), Collections.<String, ByteBuffer>emptyMap(),
- skipMetadata, fetchSize, usedPagingState, serialConsistency, defaultTimestamp);
- request = new Requests.Execute(bs.statement.getPreparedId().id, options, statement.isTracing());
+
+ // skip resultset metadata if version > 1 (otherwise this feature is not supported)
+ // and if we already have metadata for the prepared statement being executed.
+ boolean skipMetadata = protocolVersion != ProtocolVersion.V1 && bs.statement.getPreparedId().resultSetMetadata.variables != null;
+ Requests.QueryProtocolOptions options = new Requests.QueryProtocolOptions(Message.Request.Type.EXECUTE,
+ consistency, Arrays.asList(bs.wrapper.values), Collections.<String, ByteBuffer>emptyMap(), skipMetadata,
+ fetchSize, usedPagingState, serialConsistency, defaultTimestamp);
+ request = new Requests.Execute(
+ bs.statement.getPreparedId().boundValuesMetadata.id,
+ bs.statement.getPreparedId().resultSetMetadata.id,
+ options, statement.isTracing());
} else {
assert statement instanceof BatchStatement : statement;
assert pagingState == null;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/SettableByIndexData.java b/driver-core/src/main/java/com/datastax/driver/core/SettableByIndexData.java
index 67ee259..220256a 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/SettableByIndexData.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/SettableByIndexData.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/SettableByNameData.java b/driver-core/src/main/java/com/datastax/driver/core/SettableByNameData.java
index 98ee9a1..1aaa229 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/SettableByNameData.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/SettableByNameData.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/SettableData.java b/driver-core/src/main/java/com/datastax/driver/core/SettableData.java
index 438bf44..878c025 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/SettableData.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/SettableData.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/SimpleJSONParser.java b/driver-core/src/main/java/com/datastax/driver/core/SimpleJSONParser.java
index 57aaa67..a59bfff 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/SimpleJSONParser.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/SimpleJSONParser.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/SimpleStatement.java b/driver-core/src/main/java/com/datastax/driver/core/SimpleStatement.java
index cd539ab..6cf37e8 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/SimpleStatement.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/SimpleStatement.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/SnappyCompressor.java b/driver-core/src/main/java/com/datastax/driver/core/SnappyCompressor.java
index 68d3551..d3d4a43 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/SnappyCompressor.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/SnappyCompressor.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/SocketOptions.java b/driver-core/src/main/java/com/datastax/driver/core/SocketOptions.java
index 8cf9f9e..1f860f1 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/SocketOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/SocketOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Statement.java b/driver-core/src/main/java/com/datastax/driver/core/Statement.java
index 5c0329c..6eb3ba6 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Statement.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Statement.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/StatementWrapper.java b/driver-core/src/main/java/com/datastax/driver/core/StatementWrapper.java
index 0c79b64..9443611 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/StatementWrapper.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/StatementWrapper.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/StreamIdGenerator.java b/driver-core/src/main/java/com/datastax/driver/core/StreamIdGenerator.java
index f577191..325cecf 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/StreamIdGenerator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/StreamIdGenerator.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/SystemProperties.java b/driver-core/src/main/java/com/datastax/driver/core/SystemProperties.java
index 5fd48c5..c9ed45a 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/SystemProperties.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/SystemProperties.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/TableMetadata.java b/driver-core/src/main/java/com/datastax/driver/core/TableMetadata.java
index 99cb877..6cde2b5 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/TableMetadata.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/TableMetadata.java
@@ -1,21 +1,22 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
import com.datastax.driver.core.utils.MoreObjects;
+import com.google.common.collect.ImmutableSortedSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -384,12 +385,30 @@
sb.append(super.exportAsString());
- for (IndexMetadata index : indexes.values()) {
- sb.append('\n').append(index.asCQLQuery());
+ if (!indexes.isEmpty()) {
+ sb.append('\n');
+
+ Iterator<IndexMetadata> indexIt = indexes.values().iterator();
+ while (indexIt.hasNext()) {
+ IndexMetadata index = indexIt.next();
+ sb.append('\n').append(index.asCQLQuery());
+ if (indexIt.hasNext()) {
+ sb.append('\n');
+ }
+ }
}
- for (MaterializedViewMetadata view : views.values()) {
- sb.append('\n').append(view.asCQLQuery());
+ if (!views.isEmpty()) {
+ sb.append('\n');
+
+ Iterator<AbstractTableMetadata> viewsIt = ImmutableSortedSet.orderedBy(AbstractTableMetadata.byNameComparator).addAll(views.values()).build().iterator();
+ while (viewsIt.hasNext()) {
+ AbstractTableMetadata view = viewsIt.next();
+ sb.append('\n').append(view.exportAsString());
+ if (viewsIt.hasNext()) {
+ sb.append('\n');
+ }
+ }
}
return sb.toString();
@@ -399,12 +418,16 @@
protected String asCQLQuery(boolean formatted) {
StringBuilder sb = new StringBuilder();
sb.append("CREATE TABLE ").append(Metadata.quoteIfNecessary(keyspace.getName())).append('.').append(Metadata.quoteIfNecessary(name)).append(" (");
- newLine(sb, formatted);
- for (ColumnMetadata cm : columns.values())
- newLine(sb.append(spaces(4, formatted)).append(cm).append(',').append(spaces(1, !formatted)), formatted);
+ if (formatted) {
+ spaceOrNewLine(sb, true);
+ }
+ for (ColumnMetadata cm : columns.values()) {
+ sb.append(cm).append(',');
+ spaceOrNewLine(sb, formatted);
+ }
// PK
- sb.append(spaces(4, formatted)).append("PRIMARY KEY (");
+ sb.append("PRIMARY KEY (");
if (partitionKey.size() == 1) {
sb.append(Metadata.quoteIfNecessary(partitionKey.get(0).getName()));
} else {
@@ -425,7 +448,7 @@
newLine(sb, formatted);
// end PK
- sb.append(")");
+ sb.append(") ");
appendOptions(sb, formatted);
return sb.toString();
}
diff --git a/driver-core/src/main/java/com/datastax/driver/core/TableOptionsMetadata.java b/driver-core/src/main/java/com/datastax/driver/core/TableOptionsMetadata.java
index 49c1dfc..e655395 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/TableOptionsMetadata.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/TableOptionsMetadata.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.java b/driver-core/src/main/java/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.java
index 591c809..cdfbe16 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ThreadingOptions.java b/driver-core/src/main/java/com/datastax/driver/core/ThreadingOptions.java
index 3d75bc5..f3f9703 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ThreadingOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ThreadingOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/TimestampGenerator.java b/driver-core/src/main/java/com/datastax/driver/core/TimestampGenerator.java
index 7cd09c2..361f9ff 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/TimestampGenerator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/TimestampGenerator.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Token.java b/driver-core/src/main/java/com/datastax/driver/core/Token.java
index 4686f51..c7014d5 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Token.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Token.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/TokenRange.java b/driver-core/src/main/java/com/datastax/driver/core/TokenRange.java
index 2ae58a9..777f1fd 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/TokenRange.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/TokenRange.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/TupleType.java b/driver-core/src/main/java/com/datastax/driver/core/TupleType.java
index b7f4959..ca9279e 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/TupleType.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/TupleType.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/TupleValue.java b/driver-core/src/main/java/com/datastax/driver/core/TupleValue.java
index 485f5c0..478b059 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/TupleValue.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/TupleValue.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/TypeCodec.java b/driver-core/src/main/java/com/datastax/driver/core/TypeCodec.java
index 9a10702..b4f0a1b 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/TypeCodec.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/TypeCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/TypeTokens.java b/driver-core/src/main/java/com/datastax/driver/core/TypeTokens.java
index 25df8ec..e9ceedd 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/TypeTokens.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/TypeTokens.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/UDTValue.java b/driver-core/src/main/java/com/datastax/driver/core/UDTValue.java
index 220c363..b6aa875 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/UDTValue.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/UDTValue.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/UserType.java b/driver-core/src/main/java/com/datastax/driver/core/UserType.java
index f590fdd..fc2d845 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/UserType.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/UserType.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -278,12 +278,17 @@
StringBuilder sb = new StringBuilder();
sb.append("CREATE TYPE ").append(Metadata.quoteIfNecessary(keyspace)).append('.').append(Metadata.quoteIfNecessary(typeName)).append(" (");
- TableMetadata.newLine(sb, formatted);
+ if (formatted) {
+ TableMetadata.spaceOrNewLine(sb, true);
+ }
for (int i = 0; i < byIdx.length; i++) {
- sb.append(TableMetadata.spaces(4, formatted)).append(byIdx[i]);
- if (i < byIdx.length - 1)
+ sb.append(byIdx[i]);
+ if (i < byIdx.length - 1) {
sb.append(',');
- TableMetadata.newLine(sb, formatted);
+ TableMetadata.spaceOrNewLine(sb, formatted);
+ } else {
+ TableMetadata.newLine(sb, formatted);
+ }
}
return sb.append(");").toString();
diff --git a/driver-core/src/main/java/com/datastax/driver/core/VIntCoding.java b/driver-core/src/main/java/com/datastax/driver/core/VIntCoding.java
index c90d553..b11829a 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/VIntCoding.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/VIntCoding.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
diff --git a/driver-core/src/main/java/com/datastax/driver/core/VersionNumber.java b/driver-core/src/main/java/com/datastax/driver/core/VersionNumber.java
index 2efa03f..ff3e4aa 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/VersionNumber.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/VersionNumber.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -233,7 +233,7 @@
@Override
public int hashCode() {
- return MoreObjects.hashCode(major, minor, patch, dsePatch, preReleases, build);
+ return MoreObjects.hashCode(major, minor, patch, dsePatch, Arrays.hashCode(preReleases), build);
}
@Override
diff --git a/driver-core/src/main/java/com/datastax/driver/core/WriteType.java b/driver-core/src/main/java/com/datastax/driver/core/WriteType.java
index 06686ac..cf4cca8 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/WriteType.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/WriteType.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -48,5 +48,15 @@
* A conditional write. If a timeout has this {@code WriteType}, the timeout has happened while doing the compare-and-swap for
* an conditional update. In this case, the update may or may not have been applied.
*/
- CAS;
+ CAS,
+ /**
+ * Indicates that the timeout was related to acquiring locks needed for updating materialized
+ * views affected by write operation.
+ */
+ VIEW,
+ /**
+ * Indicates that the timeout was related to acquiring space for change data capture logs for cdc
+ * tracked tables.
+ */
+ CDC;
}
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/AlreadyExistsException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/AlreadyExistsException.java
index 6d1d084..4f70885 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/AlreadyExistsException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/AlreadyExistsException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/AuthenticationException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/AuthenticationException.java
index 8fcb226..599f808 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/AuthenticationException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/AuthenticationException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/BootstrappingException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/BootstrappingException.java
index aa2631d..124cff8 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/BootstrappingException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/BootstrappingException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyConnectionException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyConnectionException.java
index 262c56c..723c8b5 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyConnectionException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyConnectionException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyPoolException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyPoolException.java
index 88d2cc8..8bcd755 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyPoolException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/BusyPoolException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/CodecNotFoundException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/CodecNotFoundException.java
index b548233..1a1f711 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/CodecNotFoundException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/CodecNotFoundException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ConnectionException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ConnectionException.java
index 878d31d..10c379a 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ConnectionException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ConnectionException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/CoordinatorException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/CoordinatorException.java
index 30c610e..23432d7 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/CoordinatorException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/CoordinatorException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/DriverException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/DriverException.java
index 4ed44fe..7c86840 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/DriverException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/DriverException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/DriverInternalError.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/DriverInternalError.java
index 371f18c..dba3985 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/DriverInternalError.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/DriverInternalError.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/FrameTooLongException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/FrameTooLongException.java
index bb1d6b6..7b3aced 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/FrameTooLongException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/FrameTooLongException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/FunctionExecutionException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/FunctionExecutionException.java
index d97002c..d4564dc 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/FunctionExecutionException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/FunctionExecutionException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.java
index 59237f1..8b64291 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidQueryException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidQueryException.java
index a61d6e8..5bb8892 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidQueryException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidQueryException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidTypeException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidTypeException.java
index 1acb518..249e6a3 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidTypeException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/InvalidTypeException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/NoHostAvailableException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/NoHostAvailableException.java
index 7e9a6a3..e3dd6f4 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/NoHostAvailableException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/NoHostAvailableException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/OperationTimedOutException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/OperationTimedOutException.java
index 4fde95a..93f8f77 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/OperationTimedOutException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/OperationTimedOutException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/OverloadedException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/OverloadedException.java
index 57cf274..fdbd658 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/OverloadedException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/OverloadedException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/PagingStateException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/PagingStateException.java
index 1dd2754..8736fcd 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/PagingStateException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/PagingStateException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ProtocolError.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ProtocolError.java
index 2495a84..3f5cc6a 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ProtocolError.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ProtocolError.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryConsistencyException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryConsistencyException.java
index 2a15340..018e41d 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryConsistencyException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryConsistencyException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryExecutionException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryExecutionException.java
index 248a380..4f38e49 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryExecutionException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryExecutionException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryValidationException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryValidationException.java
index 83d7277..8e6572f 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryValidationException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/QueryValidationException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadFailureException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadFailureException.java
index db6ed9b..43db5ef 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadFailureException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadFailureException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadTimeoutException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadTimeoutException.java
index e0068ae..e1da94e 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadTimeoutException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ReadTimeoutException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ServerError.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ServerError.java
index a275e3e..87a503c 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/ServerError.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/ServerError.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/SyntaxError.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/SyntaxError.java
index 595cfde..51593cb 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/SyntaxError.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/SyntaxError.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/TraceRetrievalException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/TraceRetrievalException.java
index 6fc1083..23a4882 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/TraceRetrievalException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/TraceRetrievalException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/TransportException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/TransportException.java
index c811dc8..02ca568 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/TransportException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/TransportException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/TruncateException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/TruncateException.java
index d747e89..db77355 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/TruncateException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/TruncateException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnauthorizedException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnauthorizedException.java
index a6e42fd..846a2f4 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnauthorizedException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnauthorizedException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnavailableException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnavailableException.java
index dd2bb00..edaa8a2 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnavailableException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnavailableException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnpreparedException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnpreparedException.java
index 81cf233..95ecdb3 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnpreparedException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnpreparedException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnresolvedUserTypeException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnresolvedUserTypeException.java
index 3cfce40..752587e 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnresolvedUserTypeException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnresolvedUserTypeException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedFeatureException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedFeatureException.java
index e069a76..ec32cad 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedFeatureException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedFeatureException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedProtocolVersionException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedProtocolVersionException.java
index 409986b..f1c8931 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedProtocolVersionException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedProtocolVersionException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteFailureException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteFailureException.java
index b4ef62d..60d8d9a 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteFailureException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteFailureException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteTimeoutException.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteTimeoutException.java
index 913b914..df0c809 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteTimeoutException.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/WriteTimeoutException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/exceptions/package-info.java b/driver-core/src/main/java/com/datastax/driver/core/exceptions/package-info.java
index 53524d5..c76e4ba 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/exceptions/package-info.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/exceptions/package-info.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
/**
* Exceptions thrown by the DataStax Java driver for Cassandra.
diff --git a/driver-core/src/main/java/com/datastax/driver/core/package-info.java b/driver-core/src/main/java/com/datastax/driver/core/package-info.java
index c720b89..f5003da 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/package-info.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/package-info.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
/**
* The main package for the DataStax Java driver for Cassandra.
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/AddressTranslator.java b/driver-core/src/main/java/com/datastax/driver/core/policies/AddressTranslator.java
index 132eb8b..1555b6c 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/AddressTranslator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/AddressTranslator.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/ChainableLoadBalancingPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/ChainableLoadBalancingPolicy.java
index 96f697c..a9d2f1e 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/ChainableLoadBalancingPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/ChainableLoadBalancingPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/Clock.java b/driver-core/src/main/java/com/datastax/driver/core/policies/Clock.java
index e54049b..a382332 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/Clock.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/Clock.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/ConstantReconnectionPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/ConstantReconnectionPolicy.java
index 59ff4e8..e50d7eb 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/ConstantReconnectionPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/ConstantReconnectionPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/ConstantSpeculativeExecutionPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/ConstantSpeculativeExecutionPolicy.java
index f110ce3..a7d1acf 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/ConstantSpeculativeExecutionPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/ConstantSpeculativeExecutionPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
@@ -32,13 +32,15 @@
/**
* Builds a new instance.
*
- * @param constantDelayMillis the delay between each speculative execution. Must be strictly positive.
+ * @param constantDelayMillis the delay between each speculative execution. Must be >= 0. A zero delay means
+ * it should immediately send `maxSpeculativeExecutions` requests along with the
+ * original request.
* @param maxSpeculativeExecutions the number of speculative executions. Must be strictly positive.
* @throws IllegalArgumentException if one of the arguments does not respect the preconditions above.
*/
public ConstantSpeculativeExecutionPolicy(final long constantDelayMillis, final int maxSpeculativeExecutions) {
- Preconditions.checkArgument(constantDelayMillis > 0,
- "delay must be strictly positive (was %d)", constantDelayMillis);
+ Preconditions.checkArgument(constantDelayMillis >= 0,
+ "delay must be >= 0 (was %d)", constantDelayMillis);
Preconditions.checkArgument(maxSpeculativeExecutions > 0,
"number of speculative executions must be strictly positive (was %d)", maxSpeculativeExecutions);
this.constantDelayMillis = constantDelayMillis;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.java
index 04e3c7d..598e1ba 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/DefaultRetryPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/DefaultRetryPolicy.java
index 8fd28dc..237f359 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/DefaultRetryPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/DefaultRetryPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/DowngradingConsistencyRetryPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/DowngradingConsistencyRetryPolicy.java
index 3848819..413e119 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/DowngradingConsistencyRetryPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/DowngradingConsistencyRetryPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslator.java b/driver-core/src/main/java/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslator.java
index bd84b1a..ce92338 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslator.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/ErrorAwarePolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/ErrorAwarePolicy.java
index f62bf3e..adae2e1 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/ErrorAwarePolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/ErrorAwarePolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.java
index e4fe708..9ae4175 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/ExponentialReconnectionPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/FallthroughRetryPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/FallthroughRetryPolicy.java
index d78e950..a7acb7f 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/FallthroughRetryPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/FallthroughRetryPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/HostFilterPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/HostFilterPolicy.java
index 96a9ba2..cacb460 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/HostFilterPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/HostFilterPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/IdempotenceAwareRetryPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/IdempotenceAwareRetryPolicy.java
index 9db16b8..c9777c7 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/IdempotenceAwareRetryPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/IdempotenceAwareRetryPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/IdentityTranslator.java b/driver-core/src/main/java/com/datastax/driver/core/policies/IdentityTranslator.java
index b523dd4..2cdf935 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/IdentityTranslator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/IdentityTranslator.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/LatencyAwarePolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/LatencyAwarePolicy.java
index b375957..dc9b876 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/LatencyAwarePolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/LatencyAwarePolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
@@ -33,11 +33,11 @@
* A wrapper load balancing policy that adds latency awareness to a child policy.
* <p/>
* When used, this policy will collect the latencies of the queries to each
- * Cassandra node and maintain a per-node latency score (an average). Based
- * on these scores, the policy will penalize (technically, it will ignore them
- * unless no other nodes are up) the nodes that are slower than the best
- * performing node by more than some configurable amount (the exclusion
- * threshold).
+ * Cassandra node and maintain a per-node average latency score. The nodes
+ * that are slower than the best performing node by more than a configurable threshold
+ * will be moved to the end of the query plan (that is, they will only be tried if
+ * all other nodes failed). Note that this policy only penalizes slow nodes, it does
+ * <em>not</em> globally sort the query plan by latency.
* <p/>
* The latency score for a given node is a based on a form of
* <a href="http://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average">exponential moving average</a>.
@@ -193,14 +193,10 @@
* Returns the hosts to use for a new query.
* <p/>
* The returned plan will be the same as the plan generated by the
- * child policy, but with the (initial) exclusion of hosts whose recent
- * (averaged) latency is more than {@code exclusionThreshold * minLatency}
- * (where {@code minLatency} is the (averaged) latency of the fastest
- * host).
- * <p/>
- * The hosts that are initially excluded due to their latency will be returned
- * by this iterator, but only only after all non-excluded hosts of the
- * child policy have been returned.
+ * child policy, except that nodes that are slower than the best performing node by more
+ * than a configurable threshold will be moved to the end (that is, they will only be
+ * tried if all other nodes failed). Note that this policy only penalizes slow nodes, it
+ * does <em>not</em> globally sort the query plan by latency.
*
* @param loggedKeyspace the currently logged keyspace.
* @param statement the statement for which to build the plan.
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/LoadBalancingPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/LoadBalancingPolicy.java
index 2f576a8..c03d59d 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/LoadBalancingPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/LoadBalancingPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/LoggingRetryPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/LoggingRetryPolicy.java
index 711c74c..ba882cc 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/LoggingRetryPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/LoggingRetryPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
@@ -139,10 +139,10 @@
RetryDecision decision = policy.onRequestError(statement, cl, e, nbRetry);
switch (decision.getType()) {
case IGNORE:
- logDecision(IGNORING_REQUEST_ERROR, cl, nbRetry, e);
+ logDecision(IGNORING_REQUEST_ERROR, cl, nbRetry, e.toString());
break;
case RETRY:
- logDecision(RETRYING_ON_REQUEST_ERROR, host(decision), cl(cl, decision), cl, nbRetry, e);
+ logDecision(RETRYING_ON_REQUEST_ERROR, host(decision), cl(cl, decision), cl, nbRetry, e.toString());
break;
}
return decision;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/NoSpeculativeExecutionPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/NoSpeculativeExecutionPolicy.java
index 045bf1e..940839f 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/NoSpeculativeExecutionPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/NoSpeculativeExecutionPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/PercentileSpeculativeExecutionPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/PercentileSpeculativeExecutionPolicy.java
index 4bd75ba..8b8b84e 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/PercentileSpeculativeExecutionPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/PercentileSpeculativeExecutionPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/Policies.java b/driver-core/src/main/java/com/datastax/driver/core/policies/Policies.java
index 20ede45..881b437 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/Policies.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/Policies.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/ReconnectionPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/ReconnectionPolicy.java
index 195f443..acae1ef 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/ReconnectionPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/ReconnectionPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/RetryPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/RetryPolicy.java
index a894aba..78c47f4 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/RetryPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/RetryPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/RollingCount.java b/driver-core/src/main/java/com/datastax/driver/core/policies/RollingCount.java
index 02dca25..7cb53c1 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/RollingCount.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/RollingCount.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/RoundRobinPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/RoundRobinPolicy.java
index b4101c5..6121da4 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/RoundRobinPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/RoundRobinPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.java
index 8246227..35c38fb 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
@@ -64,8 +64,8 @@
* Returns the time before the next speculative query.
*
* @param lastQueried the host that was just queried.
- * @return the time (in milliseconds) before a speculative query is sent to the next host. If zero or negative,
- * no speculative query will be sent.
+ * @return the time (in milliseconds) before a speculative query is sent to the next host. If negative,
+ * no speculative query will be sent. If zero it will immediately send the execution.
*/
long nextExecution(Host lastQueried);
}
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/TokenAwarePolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/TokenAwarePolicy.java
index cef6fc3..d0b912c 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/TokenAwarePolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/TokenAwarePolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/WhiteListPolicy.java b/driver-core/src/main/java/com/datastax/driver/core/policies/WhiteListPolicy.java
index 08c3a4c..83ca102 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/WhiteListPolicy.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/WhiteListPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/policies/package-info.java b/driver-core/src/main/java/com/datastax/driver/core/policies/package-info.java
index 0b506f2..986935a 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/policies/package-info.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/policies/package-info.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
/**
* Policies that allow to control some of the behavior of the DataStax Java driver for Cassandra.
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Assignment.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Assignment.java
index d8156f3..153baf7 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Assignment.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Assignment.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Batch.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Batch.java
index 16007bf..9b92c4e 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Batch.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Batch.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/BindMarker.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/BindMarker.java
index 57c8d07..23e2cdf 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/BindMarker.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/BindMarker.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/BuiltStatement.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/BuiltStatement.java
index 7658f0c..73ef667 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/BuiltStatement.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/BuiltStatement.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
@@ -23,7 +23,6 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import java.util.regex.Pattern;
/**
* Common ancestor to statements generated with the {@link QueryBuilder}.
@@ -76,8 +75,6 @@
*/
public abstract class BuiltStatement extends RegularStatement {
- private static final Pattern lowercaseAlphanumeric = Pattern.compile("[a-z][a-z0-9_]*");
-
private final List<ColumnMetadata> partitionKey;
private final List<Object> routingKeyValues;
final String keyspace;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Clause.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Clause.java
index e90559e..440d65b 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Clause.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Clause.java
@@ -1,22 +1,22 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
import com.datastax.driver.core.CodecRegistry;
-
+import com.google.common.collect.Lists;
import java.util.List;
public abstract class Clause extends Utils.Appendeable {
@@ -70,13 +70,14 @@
private final List<?> values;
- InClause(String name, List<?> values) {
+ InClause(String name, Iterable<?> values) {
super(name);
- this.values = values;
-
if (values == null)
throw new IllegalArgumentException("Missing values for IN clause");
- if (values.size() > 65535)
+
+ this.values = Lists.newArrayList(values);
+
+ if (this.values.size() > 65535)
throw new IllegalArgumentException("Too many values for IN clause, the maximum allowed is 65535");
}
@@ -91,7 +92,7 @@
// ... IN ? ...
// which binds the variable to the full list the IN is on.
if (values.size() == 1 && values.get(0) instanceof BindMarker) {
- Utils.appendName(name, sb).append(" IN ").append(values.get(0));
+ Utils.appendName(name, sb).append(" IN ").append(values.iterator().next());
return;
}
@@ -178,11 +179,12 @@
private final List<String> names;
private final List<?> values;
- CompoundClause(List<String> names, String op, List<?> values) {
- assert names.size() == values.size();
+ CompoundClause(Iterable<String> names, String op, Iterable<?> values) {
this.op = op;
- this.names = names;
- this.values = values;
+ this.names = Lists.newArrayList(names);
+ this.values = Lists.newArrayList(values);
+ if (this.names.size() != this.values.size())
+ throw new IllegalArgumentException(String.format("The number of names (%d) and values (%d) don't match", this.names.size(), this.values.size()));
}
@Override
@@ -227,25 +229,32 @@
static class CompoundInClause extends Clause {
private final List<String> names;
- private final List<?> valueLists;
+ private final List<Object> valueLists;
- public CompoundInClause(List<String> names, List<?> valueLists) {
+ public CompoundInClause(Iterable<String> names, Iterable<?> valueLists) {
if (valueLists == null)
throw new IllegalArgumentException("Missing values for IN clause");
- if (valueLists.size() > 65535)
- throw new IllegalArgumentException("Too many values for IN clause, the maximum allowed is 65535");
+ if (names == null)
+ throw new IllegalArgumentException("Missing names for IN clause");
+
+ this.names = Lists.newArrayList(names);
+ this.valueLists = Lists.newArrayList();
+
for (Object value : valueLists) {
- if (value instanceof List) {
- List<?> tuple = (List<?>) value;
- if (tuple.size() != names.size()) {
- throw new IllegalArgumentException(String.format("The number of names (%d) and values (%d) don't match", names.size(), tuple.size()));
+ if (value instanceof Iterable) {
+ List<?> tuple = Lists.newArrayList((Iterable<?>) value);
+ if (tuple.size() != this.names.size()) {
+ throw new IllegalArgumentException(String.format("The number of names (%d) and values (%d) don't match", this.names.size(), tuple.size()));
}
+ this.valueLists.add(tuple);
} else if (!(value instanceof BindMarker)) {
throw new IllegalArgumentException(String.format("Wrong element type for values list, expected List or BindMarker, got %s", value.getClass().getName()));
+ } else {
+ this.valueLists.add(value);
}
}
- this.names = names;
- this.valueLists = valueLists;
+ if (this.valueLists.size() > 65535)
+ throw new IllegalArgumentException("Too many values for IN clause, the maximum allowed is 65535");
}
@Override
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Delete.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Delete.java
index 5ce9c78..90d0ae2 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Delete.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Delete.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Insert.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Insert.java
index b9c0373..34cf016 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Insert.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Insert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
@@ -27,16 +27,21 @@
import static com.google.common.base.Preconditions.checkState;
/**
- * A built INSERT statement.
+ * A built {@code INSERT} statement.
*/
public class Insert extends BuiltStatement {
+ private enum JsonDefault {
+ NULL, UNSET
+ }
+
private final String table;
private final List<Object> names = new ArrayList<Object>();
private final List<Object> values = new ArrayList<Object>();
private final Options usings;
private boolean ifNotExists;
private Object json;
+ private JsonDefault jsonDefault;
Insert(String keyspace, String table) {
this(keyspace, table, null, null);
@@ -71,6 +76,10 @@
if (json != null) {
builder.append("JSON ");
Utils.appendValue(json, codecRegistry, builder, variables);
+ if (jsonDefault == JsonDefault.UNSET)
+ builder.append(" DEFAULT UNSET");
+ else if (jsonDefault == JsonDefault.NULL)
+ builder.append(" DEFAULT NULL");
} else {
builder.append("(");
Utils.joinAndAppendNames(builder, codecRegistry, names);
@@ -90,17 +99,17 @@
}
/**
- * Adds a column/value pair to the values inserted by this INSERT statement.
+ * Adds a column/value pair to the values inserted by this {@code INSERT} statement.
*
* @param name the name of the column to insert/update.
* @param value the value to insert/update for {@code name}.
- * @return this INSERT statement.
+ * @return this {@code INSERT} statement.
* @throws IllegalStateException if this method is called and the {@link #json(Object)}
* method has been called before, because it's not possible
* to mix {@code INSERT JSON} syntax with regular {@code INSERT} syntax.
*/
public Insert value(String name, Object value) {
- checkState(json == null, "Cannot mix INSERT JSON syntax with regular INSERT syntax");
+ checkState(json == null && jsonDefault == null, "Cannot mix INSERT JSON syntax with regular INSERT syntax");
names.add(name);
values.add(value);
checkForBindMarkers(value);
@@ -143,7 +152,7 @@
public Insert values(List<String> names, List<Object> values) {
if (names.size() != values.size())
throw new IllegalArgumentException(String.format("Got %d names but %d values", names.size(), values.size()));
- checkState(json == null, "Cannot mix INSERT JSON syntax with regular INSERT syntax");
+ checkState(json == null && jsonDefault == null, "Cannot mix INSERT JSON syntax with regular INSERT syntax");
this.names.addAll(names);
this.values.addAll(values);
for (int i = 0; i < names.size(); i++) {
@@ -219,28 +228,60 @@
}
/**
- * Adds a new options for this INSERT statement.
+ * Appends a {@code DEFAULT UNSET} clause to this {@code INSERT INTO ... JSON} statement.
+ * <p/>
+ * Support for {@code DEFAULT UNSET} has been introduced in Cassandra 3.10.
+ *
+ * @return this {@code INSERT} statement.
+ * @throws IllegalStateException if this method is called and any of the {@code value} or {@code values}
+ * methods have been called before, because it's not possible
+ * to mix {@code INSERT JSON} syntax with regular {@code INSERT} syntax.
+ */
+ public Insert defaultUnset() {
+ checkState(values.isEmpty() && names.isEmpty(), "Cannot mix INSERT JSON syntax with regular INSERT syntax");
+ this.jsonDefault = JsonDefault.UNSET;
+ return this;
+ }
+
+ /**
+ * Appends a {@code DEFAULT NULL} clause to this {@code INSERT INTO ... JSON} statement.
+ * <p/>
+ * Support for {@code DEFAULT NULL} has been introduced in Cassandra 3.10.
+ *
+ * @return this {@code INSERT} statement.
+ * @throws IllegalStateException if this method is called and any of the {@code value} or {@code values}
+ * methods have been called before, because it's not possible
+ * to mix {@code INSERT JSON} syntax with regular {@code INSERT} syntax.
+ */
+ public Insert defaultNull() {
+ checkState(values.isEmpty() && names.isEmpty(), "Cannot mix INSERT JSON syntax with regular INSERT syntax");
+ this.jsonDefault = JsonDefault.NULL;
+ return this;
+ }
+
+ /**
+ * Adds a new options for this {@code INSERT} statement.
*
* @param using the option to add.
- * @return the options of this INSERT statement.
+ * @return the options of this {@code INSERT} statement.
*/
public Options using(Using using) {
return usings.and(using);
}
/**
- * Returns the options for this INSERT statement.
+ * Returns the options for this {@code INSERT} statement.
* <p/>
* Chain this with {@link Options#and(Using)} to add options.
*
- * @return the options of this INSERT statement.
+ * @return the options of this {@code INSERT} statement.
*/
public Options using() {
return usings;
}
/**
- * Sets the 'IF NOT EXISTS' option for this INSERT statement.
+ * Sets the 'IF NOT EXISTS' option for this {@code INSERT} statement.
* <p/>
* An insert with that option will not succeed unless the row does not
* exist at the time the insertion is executed. The existence check and
@@ -254,7 +295,7 @@
* This will configure the statement as non-idempotent, see {@link com.datastax.driver.core.Statement#isIdempotent()}
* for more information.
*
- * @return this INSERT statement.
+ * @return this {@code INSERT} statement.
*/
public Insert ifNotExists() {
this.setNonIdempotentOps();
@@ -263,7 +304,7 @@
}
/**
- * The options of an INSERT statement.
+ * The options of an {@code INSERT} statement.
*/
public static class Options extends BuiltStatement.ForwardingStatement<Insert> {
@@ -276,7 +317,7 @@
/**
* Adds the provided option.
*
- * @param using an INSERT option.
+ * @param using an {@code INSERT} option.
* @return this {@code Options} object.
*/
public Options and(Using using) {
@@ -286,24 +327,24 @@
}
/**
- * Adds a column/value pair to the values inserted by this INSERT statement.
+ * Adds a column/value pair to the values inserted by this {@code INSERT} statement.
*
* @param name the name of the column to insert/update.
* @param value the value to insert/update for {@code name}.
- * @return the INSERT statement those options are part of.
+ * @return the {@code INSERT} statement those options are part of.
*/
public Insert value(String name, Object value) {
return statement.value(name, value);
}
/**
- * Adds multiple column/value pairs to the values inserted by this INSERT statement.
+ * Adds multiple column/value pairs to the values inserted by this {@code INSERT} statement.
*
* @param names a list of column names to insert/update.
* @param values a list of values to insert/update. The {@code i}th
* value in {@code values} will be inserted for the {@code i}th column
* in {@code names}.
- * @return the INSERT statement those options are part of.
+ * @return the {@code INSERT} statement those options are part of.
* @throws IllegalArgumentException if {@code names.length != values.length}.
*/
public Insert values(String[] names, Object[] values) {
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Ordering.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Ordering.java
index a68d91a..fd695f7 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Ordering.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Ordering.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/QueryBuilder.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/QueryBuilder.java
index 2ad1254..1d03c34 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/QueryBuilder.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/QueryBuilder.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
@@ -45,23 +45,36 @@
}
/**
- * Start building a new SELECT query that selects the provided names.
+ * Starts building a new {@code SELECT} query that selects the provided names.
* <p/>
- * Note that {@code select(c1, c2)} is just a shortcut for {@code select().column(c1).column(c2) }.
+ * Note that {@code select(c1, c2)} is just a shortcut for {@code select().column(c1).column(c2)}.
*
* @param columns the columns names that should be selected by the query.
- * @return an in-construction SELECT query (you will need to provide at
- * least a FROM clause to complete the query).
+ * @return an in-construction {@code SELECT} query (you will need to provide at
+ * least a {@code FROM} clause to complete the query).
*/
public static Select.Builder select(String... columns) {
- return new Select.Builder(Arrays.asList((Object[]) columns));
+ return select((Object[]) columns);
}
/**
- * Start building a new SELECT query.
+ * Starts building a new {@code SELECT} query that selects the provided names.
+ * <p/>
+ * Note that {@code select(c1, c2)} is just a shortcut for {@code select().column(c1).column(c2)}.
*
- * @return an in-construction SELECT query (you will need to provide a
- * column selection and at least a FROM clause to complete the query).
+ * @param columns the columns names that should be selected by the query.
+ * @return an in-construction {@code SELECT} query (you will need to provide at
+ * least a {@code FROM} clause to complete the query).
+ */
+ public static Select.Builder select(Object... columns) {
+ return new Select.Builder(Arrays.asList(columns));
+ }
+
+ /**
+ * Starts building a new {@code SELECT} query.
+ *
+ * @return an in-construction {@code SELECT} query (you will need to provide a
+ * column selection and at least a {@code FROM} clause to complete the query).
*/
public static Select.Selection select() {
// Note: the fact we return Select.Selection as return type is on purpose.
@@ -69,41 +82,41 @@
}
/**
- * Start building a new INSERT query.
+ * Starts building a new {@code INSERT} query.
*
* @param table the name of the table in which to insert.
- * @return an in-construction INSERT query.
+ * @return an in-construction {@code INSERT} query.
*/
public static Insert insertInto(String table) {
return new Insert(null, table);
}
/**
- * Start building a new INSERT query.
+ * Starts building a new {@code INSERT} query.
*
* @param keyspace the name of the keyspace to use.
* @param table the name of the table to insert into.
- * @return an in-construction INSERT query.
+ * @return an in-construction {@code INSERT} query.
*/
public static Insert insertInto(String keyspace, String table) {
return new Insert(keyspace, table);
}
/**
- * Start building a new INSERT query.
+ * Starts building a new {@code INSERT} query.
*
* @param table the name of the table to insert into.
- * @return an in-construction INSERT query.
+ * @return an in-construction {@code INSERT} query.
*/
public static Insert insertInto(TableMetadata table) {
return new Insert(table);
}
/**
- * Start building a new UPDATE query.
+ * Starts building a new {@code UPDATE} query.
*
* @param table the name of the table to update.
- * @return an in-construction UPDATE query (at least a SET and a WHERE
+ * @return an in-construction {@code UPDATE} query (at least a {@code SET} and a {@code WHERE}
* clause needs to be provided to complete the query).
*/
public static Update update(String table) {
@@ -111,11 +124,11 @@
}
/**
- * Start building a new UPDATE query.
+ * Starts building a new {@code UPDATE} query.
*
* @param keyspace the name of the keyspace to use.
* @param table the name of the table to update.
- * @return an in-construction UPDATE query (at least a SET and a WHERE
+ * @return an in-construction {@code UPDATE} query (at least a {@code SET} and a {@code WHERE}
* clause needs to be provided to complete the query).
*/
public static Update update(String keyspace, String table) {
@@ -123,10 +136,10 @@
}
/**
- * Start building a new UPDATE query.
+ * Starts building a new {@code UPDATE} query.
*
* @param table the name of the table to update.
- * @return an in-construction UPDATE query (at least a SET and a WHERE
+ * @return an in-construction {@code UPDATE} query (at least a {@code SET} and a {@code WHERE}
* clause needs to be provided to complete the query).
*/
public static Update update(TableMetadata table) {
@@ -134,10 +147,10 @@
}
/**
- * Start building a new DELETE query that deletes the provided names.
+ * Starts building a new {@code DELETE} query that deletes the provided names.
*
* @param columns the columns names that should be deleted by the query.
- * @return an in-construction DELETE query (At least a FROM and a WHERE
+ * @return an in-construction {@code DELETE} query (At least a {@code FROM} and a {@code WHERE}
* clause needs to be provided to complete the query).
*/
public static Delete.Builder delete(String... columns) {
@@ -145,10 +158,10 @@
}
/**
- * Start building a new DELETE query.
+ * Starts building a new {@code DELETE} query.
*
- * @return an in-construction SELECT query (you will need to provide a
- * column selection and at least a FROM and a WHERE clause to complete the
+ * @return an in-construction {@code DELETE} query (you will need to provide a
+ * column selection and at least a {@code FROM} and a {@code WHERE} clause to complete the
* query).
*/
public static Delete.Selection delete() {
@@ -156,12 +169,12 @@
}
/**
- * Built a new BATCH query on the provided statements.
+ * Builds a new {@code BATCH} query on the provided statements.
* <p/>
* This method will build a logged batch (this is the default in CQL3). To
* create unlogged batches, use {@link #unloggedBatch}. Also note that
* for convenience, if the provided statements are counter statements, this
- * method will create a COUNTER batch even though COUNTER batches are never
+ * method will create a {@code COUNTER} batch even though COUNTER batches are never
* logged (so for counters, using this method is effectively equivalent to
* using {@link #unloggedBatch}).
*
@@ -173,7 +186,7 @@
}
/**
- * Built a new UNLOGGED BATCH query on the provided statements.
+ * Builds a new {@code UNLOGGED BATCH} query on the provided statements.
* <p/>
* Compared to logged batches (the default), unlogged batch don't
* use the distributed batch log server side and as such are not
@@ -183,7 +196,7 @@
* faster than logged batch.
* <p/>
* If the statements added to the batch are counter statements, the
- * resulting batch will be a COUNTER one.
+ * resulting batch will be a {@code COUNTER} one.
*
* @param statements the statements to batch.
* @return a new {@code RegularStatement} that batch {@code statements} without
@@ -194,7 +207,7 @@
}
/**
- * Creates a new TRUNCATE query.
+ * Creates a new {@code TRUNCATE} query.
*
* @param table the name of the table to truncate.
* @return the truncation query.
@@ -204,7 +217,7 @@
}
/**
- * Creates a new TRUNCATE query.
+ * Creates a new {@code TRUNCATE} query.
*
* @param keyspace the name of the keyspace to use.
* @param table the name of the table to truncate.
@@ -215,7 +228,7 @@
}
/**
- * Creates a new TRUNCATE query.
+ * Creates a new {@code TRUNCATE} query.
*
* @param table the table to truncate.
* @return the truncation query.
@@ -225,7 +238,7 @@
}
/**
- * Quotes a columnName to make it case sensitive.
+ * Quotes a column name to make it case sensitive.
*
* @param columnName the column name to quote.
* @return the quoted column name.
@@ -260,13 +273,23 @@
public static String token(String... columnNames) {
StringBuilder sb = new StringBuilder();
sb.append("token(");
- Utils.joinAndAppendNames(sb, null, Arrays.asList((Object[]) columnNames));
+ Utils.joinAndAppendNames(sb, null, Arrays.asList(columnNames));
sb.append(')');
return sb.toString();
}
/**
- * Creates an "equal" where clause stating the provided column must be
+ * Returns a generic {@code token} function call.
+ *
+ * @param values the arguments of the {@code token} function.
+ * @return {@code token} function call.
+ */
+ public static Object token(Object... values) {
+ return new Utils.FCall("token", values);
+ }
+
+ /**
+ * Creates an "equal" {@code WHERE} clause stating the provided column must be
* equal to the provided value.
*
* @param name the column name
@@ -278,10 +301,10 @@
}
/**
- * Creates an "equal" where clause for a group of clustering columns.
+ * Creates an "equal" {@code WHERE} clause for a group of clustering columns.
* <p/>
* For instance, {@code eq(Arrays.asList("a", "b"), Arrays.asList(2, "test"))}
- * will generate the CQL WHERE clause {@code (a, b) = (2, 'test') }.
+ * will generate the CQL {@code WHERE} clause {@code (a, b) = (2, 'test') }.
* <p/>
* Please note that this variant is only supported starting with Cassandra 2.0.6.
*
@@ -290,15 +313,12 @@
* @return the corresponding where clause.
* @throws IllegalArgumentException if {@code names.size() != values.size()}.
*/
- public static Clause eq(List<String> names, List<?> values) {
- if (names.size() != values.size())
- throw new IllegalArgumentException(String.format("The number of names (%d) and values (%d) don't match", names.size(), values.size()));
-
+ public static Clause eq(Iterable<String> names, Iterable<?> values) {
return new Clause.CompoundClause(names, "=", values);
}
/**
- * Creates a "like" where clause stating that the provided column must be equal to the provided value.
+ * Creates a "like" {@code WHERE} clause stating that the provided column must be equal to the provided value.
*
* @param name the column name.
* @param value the value.
@@ -309,7 +329,7 @@
}
/**
- * Create an "in" where clause stating the provided column must be equal
+ * Create an "in" {@code WHERE} clause stating the provided column must be equal
* to one of the provided values.
*
* @param name the column name
@@ -321,24 +341,24 @@
}
/**
- * Create an "in" where clause stating the provided column must be equal
+ * Create an "in" {@code WHERE} clause stating the provided column must be equal
* to one of the provided values.
*
* @param name the column name
* @param values the values
* @return the corresponding where clause.
*/
- public static Clause in(String name, List<?> values) {
+ public static Clause in(String name, Iterable<?> values) {
return new Clause.InClause(name, values);
}
/**
- * Creates an "in" where clause for a group of clustering columns (a.k.a. "multi-column IN restriction").
+ * Creates an "in" {@code WHERE} clause for a group of clustering columns (a.k.a. "multi-column IN restriction").
* <p/>
* For instance, {@code in(Arrays.asList("a", "b"), Arrays.asList(Arrays.asList(1, "foo"), Arrays.asList(2, "bar")))}
- * will generate the CQL WHERE clause {@code (a, b) IN ((1, 'foo'), (2, 'bar'))}.
+ * will generate the CQL {@code WHERE} clause {@code (a, b) IN ((1, 'foo'), (2, 'bar'))}.
* <p/>
- * Each element in {@code values} must be either a {@link List list} containing exactly as many values
+ * Each element in {@code values} must be either an {@link Iterable iterable} containing exactly as many values
* as there are columns to match in {@code names},
* or a {@link #bindMarker() bind marker} – in which case, that marker is to be considered as
* a placeholder for one whole tuple of values to match.
@@ -351,12 +371,12 @@
* @throws IllegalArgumentException if the size of any tuple in {@code values} is not equal to {@code names.size()},
* or if {@code values} contains elements that are neither {@link List lists} nor {@link #bindMarker() bind markers}.
*/
- public static Clause in(List<String> names, List<?> values) {
+ public static Clause in(Iterable<String> names, Iterable<?> values) {
return new Clause.CompoundInClause(names, values);
}
/**
- * Creates a "contains" where clause stating the provided column must contain
+ * Creates a "contains" {@code WHERE} clause stating the provided column must contain
* the value provided.
*
* @param name the column name
@@ -368,7 +388,7 @@
}
/**
- * Creates a "contains key" where clause stating the provided column must contain
+ * Creates a "contains key" {@code WHERE} clause stating the provided column must contain
* the key provided.
*
* @param name the column name
@@ -380,7 +400,7 @@
}
/**
- * Creates a "lesser than" where clause stating the provided column must be less than
+ * Creates a "lesser than" {@code WHERE} clause stating the provided column must be less than
* the provided value.
*
* @param name the column name
@@ -392,10 +412,10 @@
}
/**
- * Creates a "lesser than" where clause for a group of clustering columns.
+ * Creates a "lesser than" {@code WHERE} clause for a group of clustering columns.
* <p/>
* For instance, {@code lt(Arrays.asList("a", "b"), Arrays.asList(2, "test"))}
- * will generate the CQL WHERE clause {@code (a, b) < (2, 'test') }.
+ * will generate the CQL {@code WHERE} clause {@code (a, b) < (2, 'test') }.
* <p/>
* Please note that this variant is only supported starting with Cassandra 2.0.6.
*
@@ -404,15 +424,12 @@
* @return the corresponding where clause.
* @throws IllegalArgumentException if {@code names.size() != values.size()}.
*/
- public static Clause lt(List<String> names, List<?> values) {
- if (names.size() != values.size())
- throw new IllegalArgumentException(String.format("The number of names (%d) and values (%d) don't match", names.size(), values.size()));
-
+ public static Clause lt(Iterable<String> names, Iterable<?> values) {
return new Clause.CompoundClause(names, "<", values);
}
/**
- * Creates a "lesser than or equal" where clause stating the provided column must
+ * Creates a "lesser than or equal" {@code WHERE} clause stating the provided column must
* be lesser than or equal to the provided value.
*
* @param name the column name
@@ -424,10 +441,10 @@
}
/**
- * Creates a "lesser than or equal" where clause for a group of clustering columns.
+ * Creates a "lesser than or equal" {@code WHERE} clause for a group of clustering columns.
* <p/>
* For instance, {@code lte(Arrays.asList("a", "b"), Arrays.asList(2, "test"))}
- * will generate the CQL WHERE clause {@code (a, b) <e; (2, 'test') }.
+ * will generate the CQL {@code WHERE} clause {@code (a, b) <e; (2, 'test') }.
* <p/>
* Please note that this variant is only supported starting with Cassandra 2.0.6.
*
@@ -436,15 +453,12 @@
* @return the corresponding where clause.
* @throws IllegalArgumentException if {@code names.size() != values.size()}.
*/
- public static Clause lte(List<String> names, List<?> values) {
- if (names.size() != values.size())
- throw new IllegalArgumentException(String.format("The number of names (%d) and values (%d) don't match", names.size(), values.size()));
-
+ public static Clause lte(Iterable<String> names, Iterable<?> values) {
return new Clause.CompoundClause(names, "<=", values);
}
/**
- * Creates a "greater than" where clause stating the provided column must
+ * Creates a "greater than" {@code WHERE} clause stating the provided column must
* be greater to the provided value.
*
* @param name the column name
@@ -456,10 +470,10 @@
}
/**
- * Creates a "greater than" where clause for a group of clustering columns.
+ * Creates a "greater than" {@code WHERE} clause for a group of clustering columns.
* <p/>
* For instance, {@code gt(Arrays.asList("a", "b"), Arrays.asList(2, "test"))}
- * will generate the CQL WHERE clause {@code (a, b) > (2, 'test') }.
+ * will generate the CQL {@code WHERE} clause {@code (a, b) > (2, 'test') }.
* <p/>
* Please note that this variant is only supported starting with Cassandra 2.0.6.
*
@@ -468,15 +482,12 @@
* @return the corresponding where clause.
* @throws IllegalArgumentException if {@code names.size() != values.size()}.
*/
- public static Clause gt(List<String> names, List<?> values) {
- if (names.size() != values.size())
- throw new IllegalArgumentException(String.format("The number of names (%d) and values (%d) don't match", names.size(), values.size()));
-
+ public static Clause gt(Iterable<String> names, Iterable<?> values) {
return new Clause.CompoundClause(names, ">", values);
}
/**
- * Creates a "greater than or equal" where clause stating the provided
+ * Creates a "greater than or equal" {@code WHERE} clause stating the provided
* column must be greater than or equal to the provided value.
*
* @param name the column name
@@ -488,10 +499,10 @@
}
/**
- * Creates a "greater than or equal" where clause for a group of clustering columns.
+ * Creates a "greater than or equal" {@code WHERE} clause for a group of clustering columns.
* <p/>
* For instance, {@code gte(Arrays.asList("a", "b"), Arrays.asList(2, "test"))}
- * will generate the CQL WHERE clause {@code (a, b) >e; (2, 'test') }.
+ * will generate the CQL {@code WHERE} clause {@code (a, b) >e; (2, 'test') }.
* <p/>
* Please note that this variant is only supported starting with Cassandra 2.0.6.
*
@@ -500,10 +511,7 @@
* @return the corresponding where clause.
* @throws IllegalArgumentException if {@code names.size() != values.size()}.
*/
- public static Clause gte(List<String> names, List<?> values) {
- if (names.size() != values.size())
- throw new IllegalArgumentException(String.format("The number of names (%d) and values (%d) don't match", names.size(), values.size()));
-
+ public static Clause gte(Iterable<String> names, Iterable<?> values) {
return new Clause.CompoundClause(names, ">=", values);
}
@@ -1171,4 +1179,106 @@
return fcall("fromJson", json);
}
+ /**
+ * Creates a {@code toJson()} function call.
+ * This is a shortcut for {@code fcall("toJson", QueryBuilder.column(name))}.
+ * <p/>
+ * Support for JSON functions has been added in Cassandra 2.2.
+ * The {@code toJson()} function is similar to {@code SELECT JSON} statements,
+ * but applies to a single column value instead of the entire row,
+ * and produces a JSON-encoded string representing the normal Cassandra column value.
+ * <p/>
+ * It may only be used in the selection clause of a {@code SELECT} statement.
+ *
+ * @param column the column to retrieve JSON from.
+ * @return the function call.
+ * @see <a href="http://cassandra.apache.org/doc/cql3/CQL-2.2.html#json">JSON Support for CQL</a>
+ * @see <a href="http://www.datastax.com/dev/blog/whats-new-in-cassandra-2-2-json-support">JSON Support in Cassandra 2.2</a>
+ */
+ public static Object toJson(Object column) {
+ // consider a String literal as a column name for user convenience,
+ // as CQL literals are not allowed here.
+ if (column instanceof String)
+ column = column(((String) column));
+ return new Utils.FCall("toJson", column);
+ }
+
+ /**
+ * Creates an alias for a given column.
+ * <p/>
+ * This is most useful when used with the method {@link #select(Object...)}.
+ *
+ * @param column The column to create an alias for.
+ * @param alias The column alias.
+ * @return a column alias.
+ */
+ public static Object alias(Object column, String alias) {
+ return new Utils.Alias(column, alias);
+ }
+
+ /**
+ * Creates a {@code count(x)} built-in function call.
+ *
+ * @return the function call.
+ */
+ public static Object count(Object column) {
+ // consider a String literal as a column name for user convenience,
+ // as CQL literals are not allowed here.
+ if (column instanceof String)
+ column = column(((String) column));
+ return new Utils.FCall("count", column);
+ }
+
+ /**
+ * Creates a {@code max(x)} built-in function call.
+ *
+ * @return the function call.
+ */
+ public static Object max(Object column) {
+ // consider a String literal as a column name for user convenience,
+ // as CQL literals are not allowed here.
+ if (column instanceof String)
+ column = column(((String) column));
+ return new Utils.FCall("max", column);
+ }
+
+ /**
+ * Creates a {@code min(x)} built-in function call.
+ *
+ * @return the function call.
+ */
+ public static Object min(Object column) {
+ // consider a String literal as a column name for user convenience,
+ // as CQL literals are not allowed here.
+ if (column instanceof String)
+ column = column(((String) column));
+ return new Utils.FCall("min", column);
+ }
+
+ /**
+ * Creates a {@code sum(x)} built-in function call.
+ *
+ * @return the function call.
+ */
+ public static Object sum(Object column) {
+ // consider a String literal as a column name for user convenience,
+ // as CQL literals are not allowed here.
+ if (column instanceof String)
+ column = column(((String) column));
+ return new Utils.FCall("sum", column);
+ }
+
+ /**
+ * Creates an {@code avg(x)} built-in function call.
+ *
+ * @return the function call.
+ */
+ public static Object avg(Object column) {
+ // consider a String literal as a column name for user convenience,
+ // as CQL literals are not allowed here.
+ if (column instanceof String)
+ column = column(((String) column));
+ return new Utils.FCall("avg", column);
+ }
+
}
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Select.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Select.java
index f349db8..510afe1 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Select.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Select.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
@@ -35,6 +35,7 @@
private final List<Object> columnNames;
private final Where where;
private List<Ordering> orderings;
+ private List<Object> groupByColumnNames;
private Object limit;
private Object perPartitionLimit;
private boolean allowFiltering;
@@ -95,6 +96,11 @@
Utils.joinAndAppend(builder, codecRegistry, " AND ", where.clauses, variables);
}
+ if (groupByColumnNames != null) {
+ builder.append(" GROUP BY ");
+ Utils.joinAndAppendNames(builder, codecRegistry, groupByColumnNames);
+ }
+
if (orderings != null) {
builder.append(" ORDER BY ");
Utils.joinAndAppend(builder, codecRegistry, ",", orderings, variables);
@@ -116,7 +122,7 @@
}
/**
- * Adds a WHERE clause to this statement.
+ * Adds a {@code WHERE} clause to this statement.
* <p/>
* This is a shorter/more readable version for {@code where().and(clause)}.
*
@@ -128,7 +134,7 @@
}
/**
- * Returns a Where statement for this query without adding clause.
+ * Returns a {@code WHERE} statement for this query without adding clause.
*
* @return the where clause of this query to which more clause can be added.
*/
@@ -137,20 +143,41 @@
}
/**
- * Adds an ORDER BY clause to this statement.
+ * Adds an {@code ORDER BY} clause to this statement.
*
* @param orderings the orderings to define for this query.
* @return this statement.
- * @throws IllegalStateException if an ORDER BY clause has already been
+ * @throws IllegalStateException if an {@code ORDER BY} clause has already been
* provided.
*/
public Select orderBy(Ordering... orderings) {
if (this.orderings != null)
throw new IllegalStateException("An ORDER BY clause has already been provided");
+ if (orderings.length == 0)
+ throw new IllegalArgumentException("Invalid ORDER BY argument, the orderings must not be empty.");
+
this.orderings = Arrays.asList(orderings);
- for (int i = 0; i < orderings.length; i++)
- checkForBindMarkers(orderings[i]);
+ for (Ordering ordering : orderings)
+ checkForBindMarkers(ordering);
+ return this;
+ }
+
+ /**
+ * Adds a {@code GROUP BY} clause to this statement.
+ * <p/>
+ * Note: support for {@code GROUP BY} clause is only available from
+ * Cassandra 3.10 onwards.
+ *
+ * @param columns the columns to group by.
+ * @return this statement.
+ * @throws IllegalStateException if a {@code GROUP BY} clause has already been provided.
+ */
+ public Select groupBy(Object... columns) {
+ if (this.groupByColumnNames != null)
+ throw new IllegalStateException("A GROUP BY clause has already been provided");
+
+ this.groupByColumnNames = Arrays.asList(columns);
return this;
}
@@ -194,7 +221,7 @@
/**
* Adds a {@code PER PARTITION LIMIT} clause to this statement.
- * <p>
+ * <p/>
* Note: support for {@code PER PARTITION LIMIT} clause is only available from
* Cassandra 3.6 onwards.
*
@@ -221,7 +248,7 @@
/**
* Adds a prepared {@code PER PARTITION LIMIT} clause to this statement.
- * <p>
+ * <p/>
* Note: support for {@code PER PARTITION LIMIT} clause is only available from
* Cassandra 3.6 onwards.
*
@@ -243,7 +270,7 @@
}
/**
- * Adds an ALLOW FILTERING directive to this statement.
+ * Adds an {@code ALLOW FILTERING} directive to this statement.
*
* @return this statement.
*/
@@ -253,7 +280,7 @@
}
/**
- * The WHERE clause of a SELECT statement.
+ * The {@code WHERE} clause of a {@code SELECT} statement.
*/
public static class Where extends BuiltStatement.ForwardingStatement<Select> {
@@ -264,10 +291,10 @@
}
/**
- * Adds the provided clause to this WHERE clause.
+ * Adds the provided clause to this {@code WHERE} clause.
*
* @param clause the clause to add.
- * @return this WHERE clause.
+ * @return this {@code WHERE} clause.
*/
public Where and(Clause clause) {
clauses.add(clause);
@@ -277,24 +304,37 @@
}
/**
- * Adds an ORDER BY clause to the SELECT statement this WHERE clause if
+ * Adds an ORDER BY clause to the {@code SELECT} statement this {@code WHERE} clause if
* part of.
*
* @param orderings the orderings to add.
- * @return the select statement this Where clause if part of.
- * @throws IllegalStateException if an ORDER BY clause has already been
- * provided.
+ * @return the {@code SELECT} statement this {@code WHERE} clause is part of.
+ * @throws IllegalStateException if an {@code ORDER BY} clause has already been provided.
*/
public Select orderBy(Ordering... orderings) {
return statement.orderBy(orderings);
}
/**
+ * Adds a {@code GROUP BY} clause to this statement.
+ * <p/>
+ * Note: support for {@code GROUP BY} clause is only available from
+ * Cassandra 3.10 onwards.
+ *
+ * @param columns the columns to group by.
+ * @return the {@code SELECT} statement this {@code WHERE} clause is part of.
+ * @throws IllegalStateException if a {@code GROUP BY} clause has already been provided.
+ */
+ public Select groupBy(Object... columns) {
+ return statement.groupBy(columns);
+ }
+
+ /**
* Adds a {@code LIMIT} clause to the {@code SELECT} statement this
- * {@code WHERE} clause if part of.
+ * {@code WHERE} clause is part of.
*
* @param limit the limit to set.
- * @return the {@code SELECT} statement this {@code WHERE} clause if part of.
+ * @return the {@code SELECT} statement this {@code WHERE} clause is part of.
* @throws IllegalArgumentException if {@code limit <= 0}.
* @throws IllegalStateException if a {@code LIMIT} clause has already been
* provided.
@@ -305,10 +345,10 @@
/**
* Adds a bind marker for the {@code LIMIT} clause to the {@code SELECT} statement this
- * {@code WHERE} clause if part of.
+ * {@code WHERE} clause is part of.
*
* @param limit the bind marker to use as limit.
- * @return the {@code SELECT} statement this {@code WHERE} clause if part of.
+ * @return the {@code SELECT} statement this {@code WHERE} clause is part of.
* @throws IllegalStateException if a {@code LIMIT} clause has already been
* provided.
*/
@@ -318,16 +358,15 @@
/**
* Adds a {@code PER PARTITION LIMIT} clause to the {@code SELECT} statement this
- * {@code WHERE} clause if part of.
+ * {@code WHERE} clause is part of.
* <p>
* Note: support for {@code PER PARTITION LIMIT} clause is only available from
* Cassandra 3.6 onwards.
*
* @param perPartitionLimit the limit to set per partition.
- * @return the {@code SELECT} statement this {@code WHERE} clause if part of.
+ * @return the {@code SELECT} statement this {@code WHERE} clause is part of.
* @throws IllegalArgumentException if {@code perPartitionLimit <= 0}.
- * @throws IllegalStateException if a {@code PER PARTITION LIMIT} clause has already been
- * provided.
+ * @throws IllegalStateException if a {@code PER PARTITION LIMIT} clause has already been provided.
* @throws IllegalStateException if this statement is a {@code SELECT DISTINCT} statement.
*/
public Select perPartitionLimit(int perPartitionLimit) {
@@ -336,21 +375,29 @@
/**
* Adds a bind marker for the {@code PER PARTITION LIMIT} clause to the {@code SELECT} statement this
- * {@code WHERE} clause if part of.
+ * {@code WHERE} clause is part of.
* <p>
* Note: support for {@code PER PARTITION LIMIT} clause is only available from
* Cassandra 3.6 onwards.
*
* @param limit the bind marker to use as limit per partition.
- * @return the {@code SELECT} statement this {@code WHERE} clause if part of.
- * @throws IllegalStateException if a {@code PER PARTITION LIMIT} clause has already been
- * provided.
+ * @return the {@code SELECT} statement this {@code WHERE} clause is part of.
+ * @throws IllegalStateException if a {@code PER PARTITION LIMIT} clause has already been provided.
* @throws IllegalStateException if this statement is a {@code SELECT DISTINCT} statement.
*/
public Select perPartitionLimit(BindMarker limit) {
return statement.perPartitionLimit(limit);
}
+ /**
+ * Adds an {@code ALLOW FILTERING} directive to the {@code SELECT} statement this
+ * {@code WHERE} clause is part of.
+ *
+ * @return the {@code SELECT} statement this {@code WHERE} clause is part of.
+ */
+ public Select allowFiltering() {
+ return statement.allowFiltering();
+ }
}
/**
@@ -578,23 +625,80 @@
/**
* Creates a {@code toJson()} function call.
* This is a shortcut for {@code fcall("toJson", QueryBuilder.column(name))}.
- * <p>
+ * <p/>
* Support for JSON functions has been added in Cassandra 2.2.
* The {@code toJson()} function is similar to {@code SELECT JSON} statements,
* but applies to a single column value instead of the entire row,
* and produces a JSON-encoded string representing the normal Cassandra column value.
- * <p>
+ * <p/>
* It may only be used in the selection clause of a {@code SELECT} statement.
*
+ * @param column the column to retrieve JSON from.
* @return the function call.
* @see <a href="http://cassandra.apache.org/doc/cql3/CQL-2.2.html#json">JSON Support for CQL</a>
* @see <a href="http://www.datastax.com/dev/blog/whats-new-in-cassandra-2-2-json-support">JSON Support in Cassandra 2.2</a>
*/
- public SelectionOrAlias toJson(String name) {
+ public SelectionOrAlias toJson(String column) {
// This method should be abstract like others here. But adding an abstract method is not binary-compatible,
// so we add this dummy implementation to make Clirr happy.
throw new UnsupportedOperationException("Not implemented. This should only happen if you've written your own implementation of Selection");
}
+
+ /**
+ * Creates a {@code count(x)} built-in function call.
+ *
+ * @return the function call.
+ */
+ public SelectionOrAlias count(Object column) {
+ // This method should be abstract like others here. But adding an abstract method is not binary-compatible,
+ // so we add this dummy implementation to make Clirr happy.
+ throw new UnsupportedOperationException("Not implemented. This should only happen if you've written your own implementation of Selection");
+ }
+
+ /**
+ * Creates a {@code max(x)} built-in function call.
+ *
+ * @return the function call.
+ */
+ public SelectionOrAlias max(Object column) {
+ // This method should be abstract like others here. But adding an abstract method is not binary-compatible,
+ // so we add this dummy implementation to make Clirr happy.
+ throw new UnsupportedOperationException("Not implemented. This should only happen if you've written your own implementation of Selection");
+ }
+
+ /**
+ * Creates a {@code min(x)} built-in function call.
+ *
+ * @return the function call.
+ */
+ public SelectionOrAlias min(Object column) {
+ // This method should be abstract like others here. But adding an abstract method is not binary-compatible,
+ // so we add this dummy implementation to make Clirr happy.
+ throw new UnsupportedOperationException("Not implemented. This should only happen if you've written your own implementation of Selection");
+ }
+
+ /**
+ * Creates a {@code sum(x)} built-in function call.
+ *
+ * @return the function call.
+ */
+ public SelectionOrAlias sum(Object column) {
+ // This method should be abstract like others here. But adding an abstract method is not binary-compatible,
+ // so we add this dummy implementation to make Clirr happy.
+ throw new UnsupportedOperationException("Not implemented. This should only happen if you've written your own implementation of Selection");
+ }
+
+ /**
+ * Creates an {@code avg(x)} built-in function call.
+ *
+ * @return the function call.
+ */
+ public SelectionOrAlias avg(Object column) {
+ // This method should be abstract like others here. But adding an abstract method is not binary-compatible,
+ // so we add this dummy implementation to make Clirr happy.
+ throw new UnsupportedOperationException("Not implemented. This should only happen if you've written your own implementation of Selection");
+ }
+
}
/**
@@ -680,7 +784,7 @@
@Override
public SelectionOrAlias cast(Object column, DataType targetType) {
- return queueName(new Utils.Cast(column, targetType));
+ return queueName(QueryBuilder.cast(column, targetType));
}
@Override
@@ -695,7 +799,32 @@
@Override
public SelectionOrAlias toJson(String name) {
- return queueName(new Utils.FCall("toJson", new Utils.CName(name)));
+ return queueName(QueryBuilder.toJson(name));
+ }
+
+ @Override
+ public SelectionOrAlias count(Object column) {
+ return queueName(QueryBuilder.count(column));
+ }
+
+ @Override
+ public SelectionOrAlias max(Object column) {
+ return queueName(QueryBuilder.max(column));
+ }
+
+ @Override
+ public SelectionOrAlias min(Object column) {
+ return queueName(QueryBuilder.min(column));
+ }
+
+ @Override
+ public SelectionOrAlias sum(Object column) {
+ return queueName(QueryBuilder.sum(column));
+ }
+
+ @Override
+ public SelectionOrAlias avg(Object column) {
+ return queueName(QueryBuilder.avg(column));
}
@Override
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Truncate.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Truncate.java
index e352d75..b76b8d4 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Truncate.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Truncate.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Update.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Update.java
index 8567566..5d3ffbb 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Update.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Update.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Using.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Using.java
index dc2dcd9..4f46ee3 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Using.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Using.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Utils.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Utils.java
index d003a87..da8d810 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Utils.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/Utils.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/package-info.java b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/package-info.java
index bf8de28..722b304 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/querybuilder/package-info.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/querybuilder/package-info.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
/**
* A CQL3 query builder.
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/AbstractCreateStatement.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/AbstractCreateStatement.java
index e63bd1b..101de6b 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/AbstractCreateStatement.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/AbstractCreateStatement.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/Alter.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/Alter.java
index c95959a..89f416a 100755
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/Alter.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/Alter.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/AlterKeyspace.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/AlterKeyspace.java
index 0ea6d51..a965ca8 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/AlterKeyspace.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/AlterKeyspace.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/ColumnType.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/ColumnType.java
index 6923737..a60225a 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/ColumnType.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/ColumnType.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/Create.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/Create.java
index 101473b..0224552 100755
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/Create.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/Create.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/CreateIndex.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/CreateIndex.java
index ac63402..02433a3 100755
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/CreateIndex.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/CreateIndex.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/CreateKeyspace.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/CreateKeyspace.java
index 03d630e..5108b16 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/CreateKeyspace.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/CreateKeyspace.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/CreateType.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/CreateType.java
index cf0cbc6..3bd0912 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/CreateType.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/CreateType.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/Drop.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/Drop.java
index 452ca46..144ab01 100755
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/Drop.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/Drop.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/DropKeyspace.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/DropKeyspace.java
index ff503ad..2bbbbd8 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/DropKeyspace.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/DropKeyspace.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/KeyspaceOptions.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/KeyspaceOptions.java
index f2e39ae..ae11e22 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/KeyspaceOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/KeyspaceOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/NativeColumnType.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/NativeColumnType.java
index f38755a..f49ff9b 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/NativeColumnType.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/NativeColumnType.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/SchemaBuilder.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/SchemaBuilder.java
index 3e40c5a..3162e2f 100755
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/SchemaBuilder.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/SchemaBuilder.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
@@ -257,6 +257,17 @@
}
/**
+ * Create options for the time window compaction strategy, to use in a CREATE or ALTER TABLE statement.
+ * <p/>
+ * This strategy was introduced in Cassandra 3.0.8 and 3.9.
+ *
+ * @return the options.
+ */
+ public static TableOptions.CompactionOptions.TimeWindowCompactionStrategyOptions timeWindowCompactionStrategy() {
+ return new TableOptions.CompactionOptions.TimeWindowCompactionStrategyOptions();
+ }
+
+ /**
* Create options for the {@code NONE} compression strategy, to use in a CREATE or ALTER TABLE statement.
*
* @return the options.
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/SchemaStatement.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/SchemaStatement.java
index 931b88b..f47df61 100755
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/SchemaStatement.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/SchemaStatement.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/StatementStart.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/StatementStart.java
index 5a7bdf5..215d8a8 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/StatementStart.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/StatementStart.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/TableOptions.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/TableOptions.java
index 240f656..9771d3c 100755
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/TableOptions.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/TableOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
@@ -506,8 +506,9 @@
* <p/>
* To create instances, use
* {@link SchemaBuilder#sizedTieredStategy()},
- * {@link SchemaBuilder#leveledStrategy()} or
- * {@link SchemaBuilder#dateTieredStrategy()}
+ * {@link SchemaBuilder#leveledStrategy()},
+ * {@link SchemaBuilder#dateTieredStrategy()} or
+ * {@link SchemaBuilder#timeWindowCompactionStrategy()}
*/
public static abstract class CompactionOptions<T extends CompactionOptions> {
@@ -940,10 +941,205 @@
}
/**
- * Compaction strategies. Possible values: SIZED_TIERED, LEVELED & DATE_TIERED
+ * Compaction options specific to the time window strategy.
+ */
+ public static class TimeWindowCompactionStrategyOptions extends CompactionOptions<TimeWindowCompactionStrategyOptions> {
+
+ public enum CompactionWindowUnit {MINUTES, HOURS, DAYS}
+
+ public enum TimeStampResolution {MICROSECONDS, MILLISECONDS}
+
+ private Optional<Double> bucketHigh = Optional.absent();
+
+ private Optional<Double> bucketLow = Optional.absent();
+
+ private Optional<CompactionWindowUnit> compactionWindowUnit = Optional.absent();
+
+ private Optional<Integer> compactionWindowSize = Optional.absent();
+
+ private Optional<Integer> minThreshold = Optional.absent();
+
+ private Optional<Integer> maxThreshold = Optional.absent();
+
+ private Optional<Long> minSSTableSizeInBytes = Optional.absent();
+
+ private Optional<TimeStampResolution> timestampResolution = Optional.absent();
+
+ private Optional<Boolean> unsafeAggressiveSSTableExpiration = Optional.absent();
+
+ TimeWindowCompactionStrategyOptions() {
+ super(Strategy.TIME_WINDOW);
+ }
+
+ /**
+ * Size-tiered compaction strategy (STCS) is used in the newest window, this method sets the bucketHigh value used in STCS.
+ * <p/>
+ * If no call is made to this method, the default value set by Cassandra is 1.5.
+ *
+ * @param bucketHigh the new value.
+ * @return this object (for call chaining).
+ */
+ public TimeWindowCompactionStrategyOptions bucketHigh(Double bucketHigh) {
+ this.bucketHigh = Optional.fromNullable(bucketHigh);
+ return this;
+ }
+
+ /**
+ * Size-tiered compaction strategy (STCS) is used in the newest window, this method sets the bucketLow value used in STCS.
+ * <p/>
+ * If no call is made to this method, the default value set by Cassandra is 0.5.
+ *
+ * @param bucketLow the new value.
+ * @return this object (for call chaining).
+ */
+ public TimeWindowCompactionStrategyOptions bucketLow(Double bucketLow) {
+ this.bucketLow = Optional.fromNullable(bucketLow);
+ return this;
+ }
+
+ /**
+ * Sets the time unit used to define the window size
+ * <p/>
+ * If no call is made to this method, the default value set by Cassandra is {@code DAYS}.
+ *
+ * @param compactionWindowUnit {@link CompactionWindowUnit#MINUTES}, {@link CompactionWindowUnit#HOURS} or {@link CompactionWindowUnit#DAYS}.
+ * @return this object (for call chaining).
+ */
+ public TimeWindowCompactionStrategyOptions compactionWindowUnit(CompactionWindowUnit compactionWindowUnit) {
+ this.compactionWindowUnit = Optional.fromNullable(compactionWindowUnit);
+ return this;
+ }
+
+ /**
+ * Sets the number of units that make up a window.
+ * <p/>
+ * If no call is made to this method, the default value set by Cassandra is 1.
+ *
+ * @param compactionWindowSize the size of the first window.
+ * @return this object (for call chaining).
+ */
+ public TimeWindowCompactionStrategyOptions compactionWindowSize(Integer compactionWindowSize) {
+ this.compactionWindowSize = Optional.fromNullable(compactionWindowSize);
+ return this;
+ }
+
+ /**
+ * Sets the minimum number of SSTables to trigger a minor compaction
+ * <p/>
+ * If no call is made to this method, the default value set by Cassandra is 4.
+ *
+ * @param minThreshold the new value.
+ * @return this object (for call chaining).
+ */
+ public TimeWindowCompactionStrategyOptions minThreshold(Integer minThreshold) {
+ this.minThreshold = Optional.fromNullable(minThreshold);
+ return this;
+ }
+
+ /**
+ * Sets the maximum number of SSTables to allow in a minor compaction.
+ * <p/>
+ * If no call is made to this method, the default value set by Cassandra is 32.
+ *
+ * @param maxThreshold the new value.
+ * @return this object (for call chaining).
+ */
+ public TimeWindowCompactionStrategyOptions maxThreshold(Integer maxThreshold) {
+ this.maxThreshold = Optional.fromNullable(maxThreshold);
+ return this;
+ }
+
+ /**
+ * Size-tiered compaction strategy (STCS) is used in the newest window, this method sets the minSSTableSize value used in STCS.
+ * <p/>
+ * If no call is made to this method, the default value set by Cassandra is 52428800 (50 MB).
+ *
+ * @param minSSTableSize the new value.
+ * @return this object (for call chaining).
+ */
+ public TimeWindowCompactionStrategyOptions minSSTableSizeInBytes(Long minSSTableSize) {
+ this.minSSTableSizeInBytes = Optional.fromNullable(minSSTableSize);
+ return this;
+ }
+
+ /**
+ * Sets the timestamp resolution, depending on the timestamp unit of the data you insert.
+ * <p/>
+ * If no call is made to this method, the default value set by Cassandra is {@code MICROSECONDS}.
+ *
+ * @param timestampResolution {@link TimeStampResolution#MICROSECONDS} or {@link TimeStampResolution#MILLISECONDS}.
+ * @return this object (for call chaining).
+ */
+ public TimeWindowCompactionStrategyOptions timestampResolution(TimeStampResolution timestampResolution) {
+ this.timestampResolution = Optional.fromNullable(timestampResolution);
+ return this;
+ }
+
+ /**
+ * Allow expired sstables to be dropped without checking if its data is shadowing other sstables.
+ * This is a potentially risky option that can lead to data loss or deleted data re-appearing.
+ * <p/>
+ * If no call is made to this method, the default value set by Cassandra is false.
+ *
+ * @param unsafeAggressiveSSTableExpiration whether to enable unsafe aggressive sstable expiration option.
+ * @return this object (for call chaining).
+ */
+ public TimeWindowCompactionStrategyOptions unsafeAggressiveSSTableExpiration(Boolean unsafeAggressiveSSTableExpiration) {
+ this.unsafeAggressiveSSTableExpiration = Optional.fromNullable(unsafeAggressiveSSTableExpiration);
+ return this;
+ }
+
+ @Override
+ public String build() {
+ final List<String> generalOptions = super.buildCommonOptions();
+
+ List<String> options = new ArrayList<String>(generalOptions);
+
+ if (bucketHigh.isPresent()) {
+ options.add("'bucket_high' : " + bucketHigh.get());
+ }
+
+ if (bucketLow.isPresent()) {
+ options.add("'bucket_low' : " + bucketLow.get());
+ }
+
+ if (compactionWindowUnit.isPresent()) {
+ options.add("'compaction_window_unit' : '" + compactionWindowUnit.get() + "'");
+ }
+
+ if (compactionWindowSize.isPresent()) {
+ options.add("'compaction_window_size' : " + compactionWindowSize.get());
+ }
+
+ if (minThreshold.isPresent()) {
+ options.add("'min_threshold' : " + minThreshold.get());
+ }
+
+ if (maxThreshold.isPresent()) {
+ options.add("'max_threshold' : " + maxThreshold.get());
+ }
+
+ if (minSSTableSizeInBytes.isPresent()) {
+ options.add("'min_sstable_size' : " + minSSTableSizeInBytes.get());
+ }
+
+ if (timestampResolution.isPresent()) {
+ options.add("'timestamp_resolution' : '" + timestampResolution.get() + "'");
+ }
+
+ if (unsafeAggressiveSSTableExpiration.isPresent()) {
+ options.add("'unsafe_aggressive_sstable_expiration' : '" + unsafeAggressiveSSTableExpiration.get() + "'");
+ }
+
+ return "{" + Joiner.on(", ").join(options) + "}";
+ }
+ }
+
+ /**
+ * Compaction strategies. Possible values: SIZED_TIERED, LEVELED, DATE_TIERED AND TIME_WINDOW
*/
public static enum Strategy {
- SIZED_TIERED("'SizeTieredCompactionStrategy'"), LEVELED("'LeveledCompactionStrategy'"), DATE_TIERED("'DateTieredCompactionStrategy'");
+ SIZED_TIERED("'SizeTieredCompactionStrategy'"), LEVELED("'LeveledCompactionStrategy'"), DATE_TIERED("'DateTieredCompactionStrategy'"), TIME_WINDOW("'TimeWindowCompactionStrategy'");
private String strategyClass;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/UDTType.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/UDTType.java
index b5dd0cf..fbbfbba 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/UDTType.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/UDTType.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/package-info.java b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/package-info.java
index 4bb9314..5302e30 100755
--- a/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/package-info.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/schemabuilder/package-info.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
/**
* A CQL3 schema builder.
diff --git a/driver-core/src/main/java/com/datastax/driver/core/utils/Bytes.java b/driver-core/src/main/java/com/datastax/driver/core/utils/Bytes.java
index f4517e8..882b310 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/utils/Bytes.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/utils/Bytes.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.utils;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/utils/MoreFutures.java b/driver-core/src/main/java/com/datastax/driver/core/utils/MoreFutures.java
index d0c4d15..ef22df1 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/utils/MoreFutures.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/utils/MoreFutures.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.utils;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/utils/MoreObjects.java b/driver-core/src/main/java/com/datastax/driver/core/utils/MoreObjects.java
index 4e7b32d..5d4230c 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/utils/MoreObjects.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/utils/MoreObjects.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.utils;
diff --git a/driver-core/src/main/java/com/datastax/driver/core/utils/UUIDs.java b/driver-core/src/main/java/com/datastax/driver/core/utils/UUIDs.java
index 39d5824..4f1737b 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/utils/UUIDs.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/utils/UUIDs.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.utils;
diff --git a/driver-core/src/main/resources/com/datastax/driver/core/Driver.properties b/driver-core/src/main/resources/com/datastax/driver/core/Driver.properties
index 383b98e..fe3c96a 100644
--- a/driver-core/src/main/resources/com/datastax/driver/core/Driver.properties
+++ b/driver-core/src/main/resources/com/datastax/driver/core/Driver.properties
@@ -1,17 +1,17 @@
#
-# Copyright (C) 2012-2015 DataStax Inc.
+# Copyright (C) 2012-2017 DataStax Inc.
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
driver.version=${project.version}
\ No newline at end of file
diff --git a/driver-core/src/test/java/com/datastax/driver/core/AbstractBatchIdempotencyTest.java b/driver-core/src/test/java/com/datastax/driver/core/AbstractBatchIdempotencyTest.java
index 9f809a1..ed7ecf2 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/AbstractBatchIdempotencyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/AbstractBatchIdempotencyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/AbstractPoliciesTest.java b/driver-core/src/test/java/com/datastax/driver/core/AbstractPoliciesTest.java
index 5f575ae..2ad5989 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/AbstractPoliciesTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/AbstractPoliciesTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/AbstractReconnectionHandlerTest.java b/driver-core/src/test/java/com/datastax/driver/core/AbstractReconnectionHandlerTest.java
index 367ca32..a4ec816 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/AbstractReconnectionHandlerTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/AbstractReconnectionHandlerTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/AbstractReplicationStrategyTest.java b/driver-core/src/test/java/com/datastax/driver/core/AbstractReplicationStrategyTest.java
index 7f9139e..28d4c9a 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/AbstractReplicationStrategyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/AbstractReplicationStrategyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/AggregateMetadataAssert.java b/driver-core/src/test/java/com/datastax/driver/core/AggregateMetadataAssert.java
index 6be43f4..6148ab6 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/AggregateMetadataAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/AggregateMetadataAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/AggregateMetadataTest.java b/driver-core/src/test/java/com/datastax/driver/core/AggregateMetadataTest.java
index abf84a3..d567b77 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/AggregateMetadataTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/AggregateMetadataTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -51,8 +51,9 @@
assertThat(aggregate.getStateType()).isEqualTo(text());
assertThat(aggregate.toString()).isEqualTo(cqlAggregate);
assertThat(aggregate.exportAsString()).isEqualTo(String.format("CREATE AGGREGATE %s.cat_tos(int)\n"
- + "SFUNC cat STYPE text\n"
- + "INITCOND '0';", this.keyspace));
+ + " SFUNC cat\n"
+ + " STYPE text\n"
+ + " INITCOND '0';", this.keyspace));
}
@Test(groups = "short")
@@ -78,8 +79,9 @@
assertThat(aggregate.getStateType()).isEqualTo(cint());
assertThat(aggregate.toString()).isEqualTo(cqlAggregate);
assertThat(aggregate.exportAsString()).isEqualTo(String.format("CREATE AGGREGATE %s.mycount()\n"
- + "SFUNC inc STYPE int\n"
- + "INITCOND 0;", this.keyspace));
+ + " SFUNC inc\n"
+ + " STYPE int\n"
+ + " INITCOND 0;", this.keyspace));
}
@Test(groups = "short")
@@ -108,9 +110,10 @@
assertThat(aggregate.getStateType()).isEqualTo(cint());
assertThat(aggregate.toString()).isEqualTo(cqlAggregate);
assertThat(aggregate.exportAsString()).isEqualTo(String.format("CREATE AGGREGATE %s.prettysum(int)\n"
- + "SFUNC plus STYPE int\n"
- + "FINALFUNC announce\n"
- + "INITCOND 0;", this.keyspace));
+ + " SFUNC plus\n"
+ + " STYPE int\n"
+ + " FINALFUNC announce\n"
+ + " INITCOND 0;", this.keyspace));
}
@Test(groups = "short")
@@ -136,7 +139,8 @@
assertThat(aggregate.getStateType()).isEqualTo(cint());
assertThat(aggregate.toString()).isEqualTo(cqlAggregate);
assertThat(aggregate.exportAsString()).isEqualTo(String.format("CREATE AGGREGATE %s.sum(int)\n"
- + "SFUNC plus2 STYPE int;", this.keyspace));
+ + " SFUNC plus2\n"
+ + " STYPE int;", this.keyspace));
}
@Test(groups = "short")
diff --git a/driver-core/src/test/java/com/datastax/driver/core/Assertions.java b/driver-core/src/test/java/com/datastax/driver/core/Assertions.java
index 2582412..d86a109 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/Assertions.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/Assertions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -87,8 +87,12 @@
public static VersionNumberAssert assertThat(VersionNumber actual) {
return new VersionNumberAssert(actual);
}
+
public static ResultSetAssert assertThat(ResultSet rows) {
return new ResultSetAssert(rows);
}
+ public static ColumnDefinitionsAssert assertThat(ColumnDefinitions variables) {
+ return new ColumnDefinitionsAssert(variables);
+ }
}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/AsyncQueryTest.java b/driver-core/src/test/java/com/datastax/driver/core/AsyncQueryTest.java
index 1054a76..b690447 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/AsyncQueryTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/AsyncQueryTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -20,7 +20,10 @@
import com.google.common.base.Function;
import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
-import com.google.common.util.concurrent.*;
+import com.google.common.util.concurrent.AsyncFunction;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.Uninterruptibles;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.DataProvider;
@@ -83,15 +86,19 @@
Cluster cluster2 = register(Cluster.builder()
.addContactPointsWithPorts(Lists.newArrayList(host.getSocketAddress()))
.build());
- Session session2 = cluster2.newSession();
+ try {
+ Session session2 = cluster2.newSession();
- // Neither cluster2 nor session2 are initialized at this point
- assertThat(cluster2.manager.metadata).isNull();
+ // Neither cluster2 nor session2 are initialized at this point
+ assertThat(cluster2.manager.metadata).isNull();
- ResultSetFuture future = session2.executeAsync("select release_version from system.local");
- Row row = Uninterruptibles.getUninterruptibly(future).one();
+ ResultSetFuture future = session2.executeAsync("select release_version from system.local");
+ Row row = Uninterruptibles.getUninterruptibly(future).one();
- assertThat(row.getString(0)).isNotEmpty();
+ assertThat(row.getString(0)).isNotEmpty();
+ } finally {
+ cluster2.close();
+ }
}
@Test(groups = "short", dataProvider = "keyspace", enabled = false,
diff --git a/driver-core/src/test/java/com/datastax/driver/core/AsyncResultSetTest.java b/driver-core/src/test/java/com/datastax/driver/core/AsyncResultSetTest.java
index fd440c2..c2b1991 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/AsyncResultSetTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/AsyncResultSetTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/AtomicMonotonicTimestampGeneratorTest.java b/driver-core/src/test/java/com/datastax/driver/core/AtomicMonotonicTimestampGeneratorTest.java
index 9d59bd4..df7ae1c 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/AtomicMonotonicTimestampGeneratorTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/AtomicMonotonicTimestampGeneratorTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/AuthenticationTest.java b/driver-core/src/test/java/com/datastax/driver/core/AuthenticationTest.java
index c96cc69..fa01f49 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/AuthenticationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/AuthenticationTest.java
@@ -1,22 +1,23 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
import com.datastax.driver.core.exceptions.AuthenticationException;
import com.google.common.util.concurrent.Uninterruptibles;
+import org.apache.log4j.Level;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -132,4 +133,38 @@
}, 2000);
}
+ /**
+ * Ensures that when a host replies with AuthenticationException
+ * during connection pool initialization the pool creation is aborted.
+ *
+ * @jira_ticket JAVA-1431
+ */
+ @Test(groups = "short")
+ public void should_not_create_pool_with_wrong_credentials() throws InterruptedException {
+ PlainTextAuthProvider authProvider = new PlainTextAuthProvider("cassandra", "cassandra");
+ Cluster cluster = register(Cluster.builder()
+ .addContactPoints(getContactPoints())
+ .withPort(ccm().getBinaryPort())
+ .withAuthProvider(authProvider)
+ .build());
+ cluster.init();
+ authProvider.setPassword("wrong");
+ Level previous = TestUtils.setLogLevel(Session.class, Level.WARN);
+ MemoryAppender logs = new MemoryAppender().enableFor(Session.class);
+ Session session;
+ try {
+ session = cluster.connect();
+ } finally {
+ TestUtils.setLogLevel(Session.class, previous);
+ logs.disableFor(Session.class);
+ }
+ assertThat(session.getState().getConnectedHosts()).isEmpty();
+ InetSocketAddress host = ccm().addressOfNode(1);
+ assertThat(logs.get())
+ .contains(
+ "Error creating pool to " + host,
+ "Authentication error on host " + host,
+ AuthenticationException.class.getSimpleName());
+ }
+
}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/BatchStatementIdempotencyTest.java b/driver-core/src/test/java/com/datastax/driver/core/BatchStatementIdempotencyTest.java
index 40ee2fd..2dc933a 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/BatchStatementIdempotencyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/BatchStatementIdempotencyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/BatchStatementTest.java b/driver-core/src/test/java/com/datastax/driver/core/BatchStatementTest.java
index 76ad6ab..360897c 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/BatchStatementTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/BatchStatementTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/BoundStatementTest.java b/driver-core/src/test/java/com/datastax/driver/core/BoundStatementTest.java
index fed5261..d12eae8 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/BoundStatementTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/BoundStatementTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CCMAccess.java b/driver-core/src/test/java/com/datastax/driver/core/CCMAccess.java
index 4d3b523..7a32c39 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CCMAccess.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CCMAccess.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -101,6 +101,16 @@
*/
InetSocketAddress addressOfNode(int n);
+ /**
+ * Returns the address that the @{code nth} host in the CCM cluster is listening on JMX on (counting from 1,
+ * i.e, {@code jmxAddressOfNode(1)} returns the jmx address of the first node.
+ * <p/>
+ * In multi-DC setups, nodes are numbered in ascending order of their datacenter number.
+ * E.g. with 2 DCs and 3 nodes in each DC, the first node in DC 2 is number 4.
+ *
+ * @return the address of the JMX listener of the {@code nth} host in the cluster
+ */
+ InetSocketAddress jmxAddressOfNode(int n);
// Methods altering the whole cluster
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java b/driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
index 683f66e..4181afd 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -34,7 +34,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import static com.datastax.driver.core.TestUtils.*;
+import static com.datastax.driver.core.TestUtils.executeNoFail;
public class CCMBridge implements CCMAccess {
@@ -270,6 +270,8 @@
private final int binaryPort;
+ private final String ipPrefix;
+
private final File ccmDir;
private final boolean isDSE;
@@ -284,11 +286,16 @@
private final int[] nodes;
- private CCMBridge(String clusterName, VersionNumber cassandraVersion, VersionNumber dseVersion,
- int storagePort, int thriftPort, int binaryPort, String jvmArgs, int[] nodes) {
+ private final int[] jmxPorts;
+
+
+ protected CCMBridge(String clusterName, VersionNumber cassandraVersion, VersionNumber dseVersion, String ipPrefix,
+ int storagePort, int thriftPort, int binaryPort, int[] jmxPorts, String jvmArgs, int[] nodes) {
+
this.clusterName = clusterName;
this.cassandraVersion = cassandraVersion;
this.dseVersion = dseVersion;
+ this.ipPrefix = ipPrefix;
this.storagePort = storagePort;
this.thriftPort = thriftPort;
this.binaryPort = binaryPort;
@@ -296,6 +303,7 @@
this.jvmArgs = jvmArgs;
this.nodes = nodes;
this.ccmDir = Files.createTempDir();
+ this.jmxPorts = jmxPorts;
}
public static Builder builder() {
@@ -307,9 +315,18 @@
return clusterName;
}
+ protected String ipOfNode(int n) {
+ return ipPrefix + n;
+ }
+
@Override
public InetSocketAddress addressOfNode(int n) {
- return new InetSocketAddress(TestUtils.ipOfNode(n), binaryPort);
+ return new InetSocketAddress(ipOfNode(n), binaryPort);
+ }
+
+ @Override
+ public InetSocketAddress jmxAddressOfNode(int n) {
+ return new InetSocketAddress("localhost", jmxPorts[n - 1]);
}
@Override
@@ -426,7 +443,7 @@
for (int dc = 1; dc <= nodes.length; dc++) {
int nodesInDc = nodes[dc - 1];
for (int i = 0; i < nodesInDc; i++) {
- InetSocketAddress addr = new InetSocketAddress(ipOfNode(n), binaryPort);
+ InetSocketAddress addr = addressOfNode(n);
logger.debug("Waiting for binary protocol to show up for {}", addr);
TestUtils.waitUntilPortIsUp(addr);
n++;
@@ -487,7 +504,7 @@
@Override
public void start(int n) {
- logger.debug(String.format("Starting: node %s (%s%s:%s) in %s", n, TestUtils.IP_PREFIX, n, binaryPort, this));
+ logger.debug(String.format("Starting: node %s (%s%s:%s) in %s", n, ipPrefix, n, binaryPort, this));
try {
String cmd = CCM_COMMAND + " node%d start " + jvmArgs + getStartWaitArguments();
if (isWindows() && this.cassandraVersion.compareTo(VersionNumber.parse("2.2.4")) >= 0) {
@@ -511,31 +528,31 @@
@Override
public void stop(int n) {
- logger.debug(String.format("Stopping: node %s (%s%s:%s) in %s", n, TestUtils.IP_PREFIX, n, binaryPort, this));
+ logger.debug(String.format("Stopping: node %s (%s%s:%s) in %s", n, ipPrefix, n, binaryPort, this));
execute(CCM_COMMAND + " node%d stop", n);
}
@Override
public void forceStop(int n) {
- logger.debug(String.format("Force stopping: node %s (%s%s:%s) in %s", n, TestUtils.IP_PREFIX, n, binaryPort, this));
+ logger.debug(String.format("Force stopping: node %s (%s%s:%s) in %s", n, ipPrefix, n, binaryPort, this));
execute(CCM_COMMAND + " node%d stop --not-gently", n);
}
@Override
public void pause(int n) {
- logger.debug(String.format("Pausing: node %s (%s%s:%s) in %s", n, TestUtils.IP_PREFIX, n, binaryPort, this));
+ logger.debug(String.format("Pausing: node %s (%s%s:%s) in %s", n, ipPrefix, n, binaryPort, this));
execute(CCM_COMMAND + " node%d pause", n);
}
@Override
public void resume(int n) {
- logger.debug(String.format("Resuming: node %s (%s%s:%s) in %s", n, TestUtils.IP_PREFIX, n, binaryPort, this));
+ logger.debug(String.format("Resuming: node %s (%s%s:%s) in %s", n, ipPrefix, n, binaryPort, this));
execute(CCM_COMMAND + " node%d resume", n);
}
@Override
public void remove(int n) {
- logger.debug(String.format("Removing: node %s (%s%s:%s) from %s", n, TestUtils.IP_PREFIX, n, binaryPort, this));
+ logger.debug(String.format("Removing: node %s (%s%s:%s) from %s", n, ipPrefix, n, binaryPort, this));
execute(CCM_COMMAND + " node%d remove", n);
}
@@ -546,18 +563,18 @@
@Override
public void add(int dc, int n) {
- logger.debug(String.format("Adding: node %s (%s%s:%s) to %s", n, TestUtils.IP_PREFIX, n, binaryPort, this));
- String thriftItf = TestUtils.ipOfNode(n) + ":" + thriftPort;
- String storageItf = TestUtils.ipOfNode(n) + ":" + storagePort;
- String binaryItf = TestUtils.ipOfNode(n) + ":" + binaryPort;
- String remoteLogItf = TestUtils.ipOfNode(n) + ":" + TestUtils.findAvailablePort();
+ logger.debug(String.format("Adding: node %s (%s%s:%s) to %s", n, ipPrefix, n, binaryPort, this));
+ String thriftItf = ipOfNode(n) + ":" + thriftPort;
+ String storageItf = ipOfNode(n) + ":" + storagePort;
+ String binaryItf = ipOfNode(n) + ":" + binaryPort;
+ String remoteLogItf = ipOfNode(n) + ":" + TestUtils.findAvailablePort();
execute(CCM_COMMAND + " add node%d -d dc%s -i %s%d -t %s -l %s --binary-itf %s -j %d -r %s -s -b" + (isDSE ? " --dse" : ""),
- n, dc, TestUtils.IP_PREFIX, n, thriftItf, storageItf, binaryItf, TestUtils.findAvailablePort(), remoteLogItf);
+ n, dc, ipPrefix, n, thriftItf, storageItf, binaryItf, TestUtils.findAvailablePort(), remoteLogItf);
}
@Override
public void decommission(int n) {
- logger.debug(String.format("Decommissioning: node %s (%s%s:%s) from %s", n, TestUtils.IP_PREFIX, n, binaryPort, this));
+ logger.debug(String.format("Decommissioning: node %s (%s%s:%s) from %s", n, ipPrefix, n, binaryPort, this));
// Special case for C* 3.12+, DSE 5.1+, force decommission (see CASSANDRA-12510)
String cmd = CCM_COMMAND + " node%d decommission";
if (this.cassandraVersion.compareTo(VersionNumber.parse("3.12")) >= 0) {
@@ -780,7 +797,9 @@
public static final String RANDOM_PORT = "__RANDOM_PORT__";
private static final Pattern RANDOM_PORT_PATTERN = Pattern.compile(RANDOM_PORT);
+ private String ipPrefix = TestUtils.IP_PREFIX;
int[] nodes = {1};
+ private int[] jmxPorts = {};
private boolean start = true;
private boolean dse = false;
private VersionNumber version = null;
@@ -798,6 +817,14 @@
}
/**
+ * IP Prefix to use for the address of each node. Its format has to be like {@code "127.1.1."}.
+ */
+ public Builder withIpPrefix(String ipPrefix) {
+ this.ipPrefix = ipPrefix;
+ return this;
+ }
+
+ /**
* Number of hosts for each DC. Defaults to [1] (1 DC with 1 node)
*/
public Builder withNodes(int... nodes) {
@@ -905,6 +932,11 @@
return this;
}
+ public Builder withJmxPorts(int... ports) {
+ this.jmxPorts = ports;
+ return this;
+ }
+
/**
* Sets the DSE workload for a given node.
*
@@ -943,13 +975,29 @@
int storagePort = Integer.parseInt(cassandraConfiguration.get("storage_port").toString());
int thriftPort = Integer.parseInt(cassandraConfiguration.get("rpc_port").toString());
int binaryPort = Integer.parseInt(cassandraConfiguration.get("native_transport_port").toString());
+
+ // Copy any supplied jmx ports over, and find available ports for the rest
+ int numNodes = 0;
+ for (int i : nodes) {
+ numNodes += i;
+ }
+
+ int[] generatedJmxPorts = new int[numNodes];
+ for (int i = 0; i < numNodes; i++) {
+ if (i >= jmxPorts.length) {
+ generatedJmxPorts[i] = TestUtils.findAvailablePort();
+ } else {
+ generatedJmxPorts[i] = jmxPorts[i];
+ }
+ }
+
if (!isThriftSupported(cassandraVersion)) {
// remove thrift configuration
cassandraConfiguration.remove("start_rpc");
cassandraConfiguration.remove("rpc_port");
cassandraConfiguration.remove("thrift_prepared_statements_cache_size_mb");
}
- final CCMBridge ccm = new CCMBridge(clusterName, cassandraVersion, dseVersion, storagePort, thriftPort, binaryPort, joinJvmArgs(), nodes);
+ final CCMBridge ccm = new CCMBridge(clusterName, cassandraVersion, dseVersion, ipPrefix, storagePort, thriftPort, binaryPort, generatedJmxPorts, joinJvmArgs(), nodes);
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
@@ -1010,7 +1058,7 @@
cassandraVersion, VersionNumber dseVersion) {
StringBuilder result = new StringBuilder(CCM_COMMAND + " create");
result.append(" ").append(clusterName);
- result.append(" -i ").append(TestUtils.IP_PREFIX);
+ result.append(" -i ").append(ipPrefix);
result.append(" ");
if (nodes.length > 0) {
result.append(" -n ");
@@ -1052,8 +1100,8 @@
for (int dc = 1; dc <= nodes.length; dc++) {
int nodesInDc = nodes[dc - 1];
for (int i = 0; i < nodesInDc; i++) {
- int jmxPort = findAvailablePort();
- int debugPort = findAvailablePort();
+ int jmxPort = ccm.jmxAddressOfNode(n).getPort();
+ int debugPort = TestUtils.findAvailablePort();
logger.trace("Node {} in cluster {} using JMX port {} and debug port {}", n, ccm.getClusterName(), jmxPort, debugPort);
File nodeConf = new File(ccm.getNodeDir(n), "node.conf");
File nodeConf2 = new File(ccm.getNodeDir(n), "node.conf.tmp");
@@ -1068,7 +1116,7 @@
if (line.startsWith("jmx_port")) {
line = String.format("jmx_port: '%s'", jmxPort);
} else if (line.startsWith("remote_debug_port")) {
- line = String.format("remote_debug_port: %s:%s", TestUtils.ipOfNode(n), debugPort);
+ line = String.format("remote_debug_port: %s:%s", ipPrefix + n, debugPort);
}
pw.println(line);
}
@@ -1128,6 +1176,7 @@
Builder builder = (Builder) o;
+ if (ipPrefix != builder.ipPrefix) return false;
if (dse != builder.dse) return false;
if (!Arrays.equals(nodes, builder.nodes)) return false;
if (version != null ? !version.equals(builder.version) : builder.version != null) return false;
@@ -1143,6 +1192,7 @@
// do not include start as it is not relevant to the settings of the cluster.
int result = Arrays.hashCode(nodes);
result = 31 * result + (dse ? 1 : 0);
+ result = 31 * result + ipPrefix.hashCode();
result = 31 * result + (version != null ? version.hashCode() : 0);
result = 31 * result + createOptions.hashCode();
result = 31 * result + jvmArgs.hashCode();
@@ -1153,4 +1203,4 @@
}
}
-}
+}
\ No newline at end of file
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CCMBridgeTest.java b/driver-core/src/test/java/com/datastax/driver/core/CCMBridgeTest.java
new file mode 100644
index 0000000..2ab741e
--- /dev/null
+++ b/driver-core/src/test/java/com/datastax/driver/core/CCMBridgeTest.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2012-2017 DataStax Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.datastax.driver.core;
+
+import org.testng.annotations.Test;
+
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+import java.net.InetSocketAddress;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * A simple test to validate jmx ports work
+ */
+@Test
+@CCMConfig(numberOfNodes = 3)
+public class CCMBridgeTest extends CCMTestsSupport {
+
+ @Test(groups = "short")
+ public void should_make_JMX_connection() throws Exception {
+ InetSocketAddress addr1 = ccm().jmxAddressOfNode(1);
+ InetSocketAddress addr2 = ccm().jmxAddressOfNode(2);
+ InetSocketAddress addr3 = ccm().jmxAddressOfNode(3);
+
+ assertThat(addr1.getPort()).isNotEqualTo(addr2.getPort());
+ assertThat(addr1.getPort()).isNotEqualTo(addr3.getPort());
+ assertThat(addr2.getPort()).isNotEqualTo(addr3.getPort());
+
+ JMXServiceURL url = new JMXServiceURL(
+ String.format(
+ "service:jmx:rmi:///jndi/rmi://%s:%d/jmxrmi",
+ addr2.getAddress().getHostAddress(), addr2.getPort()
+ )
+ );
+ JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
+ assertThat(jmxc.getConnectionId().isEmpty()).isFalse();
+ }
+
+ @Test(groups = "short")
+ public void should_configure_JMX_ports_through_builder() throws Exception {
+ CCMBridge.Builder ccmBuilder = CCMBridge.builder().withNodes(3).notStarted().withJmxPorts(12345);
+ CCMAccess ccm = ccmBuilder.build();
+ assertThat(ccm.jmxAddressOfNode(1).getPort()).isEqualTo(12345);
+
+ int port2 = ccm.jmxAddressOfNode(2).getPort();
+ int port3 = ccm.jmxAddressOfNode(3).getPort();
+ assertThat(port2).isBetween(0, 65535);
+ assertThat(port3).isBetween(0, 65535);
+ }
+}
\ No newline at end of file
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CCMCache.java b/driver-core/src/test/java/com/datastax/driver/core/CCMCache.java
index 0431904..9b83d46 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CCMCache.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CCMCache.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -104,6 +104,9 @@
}
@Override
+ public InetSocketAddress jmxAddressOfNode(int n) { return ccm.jmxAddressOfNode(n); }
+
+ @Override
public void start() {
ccm.start();
}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CCMConfig.java b/driver-core/src/test/java/com/datastax/driver/core/CCMConfig.java
index c246913..e8350f1 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CCMConfig.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CCMConfig.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CCMException.java b/driver-core/src/test/java/com/datastax/driver/core/CCMException.java
index 52a301c..2c4981c 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CCMException.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CCMException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CCMTestsSupport.java b/driver-core/src/test/java/com/datastax/driver/core/CCMTestsSupport.java
index 853d844..32903b1 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CCMTestsSupport.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CCMTestsSupport.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -93,6 +93,9 @@
}
@Override
+ public InetSocketAddress jmxAddressOfNode(int n) { return delegate.jmxAddressOfNode(n); }
+
+ @Override
public File getCcmDir() {
return delegate.getCcmDir();
}
@@ -1015,6 +1018,21 @@
keyspace = null;
}
+ protected void resetTestSession() throws Exception {
+ session.close();
+ Cluster.Builder builder = ccmTestConfig.clusterProvider(this);
+ // add contact points only if the provided builder didn't do so
+ if (builder.getContactPoints().isEmpty())
+ builder.addContactPoints(getContactPoints());
+ builder.withPort(ccm.getBinaryPort());
+ cluster = register(builder.build());
+ cluster.init();
+
+ session.close();
+ session = register(cluster.connect());
+ useKeyspace(session, keyspace);
+ }
+
protected void closeCloseables() {
if (closer != null)
executeNoFail(new Callable<Void>() {
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CCMWorkload.java b/driver-core/src/test/java/com/datastax/driver/core/CCMWorkload.java
index 9f0c6f7..8dd96b6 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CCMWorkload.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CCMWorkload.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CaseSensitivityTest.java b/driver-core/src/test/java/com/datastax/driver/core/CaseSensitivityTest.java
index d951f64..098c416 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CaseSensitivityTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CaseSensitivityTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ClockFactoryTest.java b/driver-core/src/test/java/com/datastax/driver/core/ClockFactoryTest.java
index 58623e6..603912d 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ClockFactoryTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ClockFactoryTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ClusterAssert.java b/driver-core/src/test/java/com/datastax/driver/core/ClusterAssert.java
index 579af08..c4dd0fa 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ClusterAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ClusterAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java b/driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java
index ea12209..1a365a3 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -270,7 +270,9 @@
.put("rpc_address", address)
.put("data_center", "datacenter1")
.put("rack", "rack1")
- .put("release_version", "2.0.1")
+ // Base release version on min cassandra version as this is important for the driver
+ // to consider the node.
+ .put("release_version", ProtocolVersion.NEWEST_SUPPORTED.minCassandraVersion().toString())
.put("tokens", ImmutableSet.of(Long.toString(Long.MIN_VALUE + i++)))
.put("host_id", UUID.randomUUID())
.build());
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ClusterStressTest.java b/driver-core/src/test/java/com/datastax/driver/core/ClusterStressTest.java
index 90c001f..f41c34f 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ClusterStressTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ClusterStressTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ClusterWidePercentileTrackerTest.java b/driver-core/src/test/java/com/datastax/driver/core/ClusterWidePercentileTrackerTest.java
index b139962..dc3dd06 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ClusterWidePercentileTrackerTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ClusterWidePercentileTrackerTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CodecRegistryTest.java b/driver-core/src/test/java/com/datastax/driver/core/CodecRegistryTest.java
index 4285436..7ab55aa 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CodecRegistryTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CodecRegistryTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ColumnDefinitionsAssert.java b/driver-core/src/test/java/com/datastax/driver/core/ColumnDefinitionsAssert.java
new file mode 100644
index 0000000..4f94bea
--- /dev/null
+++ b/driver-core/src/test/java/com/datastax/driver/core/ColumnDefinitionsAssert.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2012-2017 DataStax Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.datastax.driver.core;
+
+import org.assertj.core.api.AbstractAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.fail;
+
+public class ColumnDefinitionsAssert extends AbstractAssert<ColumnDefinitionsAssert, ColumnDefinitions> {
+
+ public ColumnDefinitionsAssert(ColumnDefinitions actual) {
+ super(actual, ColumnDefinitionsAssert.class);
+ }
+
+ public ColumnDefinitionsAssert hasSize(int expected) {
+ assertThat(actual.size()).isEqualTo(expected);
+ return this;
+ }
+
+ public ColumnDefinitionsAssert containsVariable(String name, DataType type) {
+ try {
+ assertThat(actual.getType(name)).isEqualTo(type);
+ } catch (Exception e) {
+ fail(String.format("Expected actual to contain variable %s of type %s, but it did not", name, type), e);
+ }
+ return this;
+ }
+
+ public ColumnDefinitionsAssert doesNotContainVariable(String name) {
+ assertThat(actual.getIndexOf(name)).isEqualTo(-1);
+ return this;
+ }
+}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ColumnDefinitionsTest.java b/driver-core/src/test/java/com/datastax/driver/core/ColumnDefinitionsTest.java
index 7a12faa..7e6183f 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ColumnDefinitionsTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ColumnDefinitionsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ColumnMetadataAssert.java b/driver-core/src/test/java/com/datastax/driver/core/ColumnMetadataAssert.java
index c705993..223e57d 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ColumnMetadataAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ColumnMetadataAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CompressionTest.java b/driver-core/src/test/java/com/datastax/driver/core/CompressionTest.java
index 8112cf8..7b2c462 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CompressionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CompressionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ConditionChecker.java b/driver-core/src/test/java/com/datastax/driver/core/ConditionChecker.java
index de29e1b..c3e7166 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ConditionChecker.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ConditionChecker.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ConditionalUpdateTest.java b/driver-core/src/test/java/com/datastax/driver/core/ConditionalUpdateTest.java
index 73ae78b..6c349c7 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ConditionalUpdateTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ConditionalUpdateTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ConnectionReleaseTest.java b/driver-core/src/test/java/com/datastax/driver/core/ConnectionReleaseTest.java
index 28334ec..3c091d0 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ConnectionReleaseTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ConnectionReleaseTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ConsistencyTest.java b/driver-core/src/test/java/com/datastax/driver/core/ConsistencyTest.java
index 3174e05..1daa549 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ConsistencyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ConsistencyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java b/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java
index e2c12f6..1c8c2ef 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CountingReconnectionPolicy.java b/driver-core/src/test/java/com/datastax/driver/core/CountingReconnectionPolicy.java
index fcf25cf..2928bd6 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CountingReconnectionPolicy.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CountingReconnectionPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CreateCCM.java b/driver-core/src/test/java/com/datastax/driver/core/CreateCCM.java
index b9727a4..878e84e 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CreateCCM.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CreateCCM.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CustomPayloadTest.java b/driver-core/src/test/java/com/datastax/driver/core/CustomPayloadTest.java
index c51575e..c4c7a1e 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CustomPayloadTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CustomPayloadTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CustomPercentileTrackerTest.java b/driver-core/src/test/java/com/datastax/driver/core/CustomPercentileTrackerTest.java
index f823c9d..904a072 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CustomPercentileTrackerTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CustomPercentileTrackerTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CustomTypeTest.java b/driver-core/src/test/java/com/datastax/driver/core/CustomTypeTest.java
index f2ccece..ff62e48 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/CustomTypeTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/CustomTypeTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/DataProviders.java b/driver-core/src/test/java/com/datastax/driver/core/DataProviders.java
index fe724e8..b58b9f7 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/DataProviders.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/DataProviders.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/DataTypeAssert.java b/driver-core/src/test/java/com/datastax/driver/core/DataTypeAssert.java
index 023edc4..626789f 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/DataTypeAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/DataTypeAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/DataTypeClassNameParserTest.java b/driver-core/src/test/java/com/datastax/driver/core/DataTypeClassNameParserTest.java
index 9255246..5194be6 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/DataTypeClassNameParserTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/DataTypeClassNameParserTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/DataTypeCqlNameParserTest.java b/driver-core/src/test/java/com/datastax/driver/core/DataTypeCqlNameParserTest.java
index 31418f5..705f425 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/DataTypeCqlNameParserTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/DataTypeCqlNameParserTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/DataTypeIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/DataTypeIntegrationTest.java
index d2ceddc..b1e8a7f 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/DataTypeIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/DataTypeIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/DataTypeTest.java b/driver-core/src/test/java/com/datastax/driver/core/DataTypeTest.java
index 20f8df7..ee979474 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/DataTypeTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/DataTypeTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/DelegatingClusterIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/DelegatingClusterIntegrationTest.java
index f8b36aa..bb4fc8f 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/DelegatingClusterIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/DelegatingClusterIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/DelegatingClusterTest.java b/driver-core/src/test/java/com/datastax/driver/core/DelegatingClusterTest.java
index 327016d..1a4481d 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/DelegatingClusterTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/DelegatingClusterTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/DirectCompressionTest.java b/driver-core/src/test/java/com/datastax/driver/core/DirectCompressionTest.java
index c447de6..d4aa82a 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/DirectCompressionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/DirectCompressionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/DirectedGraphTest.java b/driver-core/src/test/java/com/datastax/driver/core/DirectedGraphTest.java
index b138471..9341d99 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/DirectedGraphTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/DirectedGraphTest.java
@@ -1,37 +1,46 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
import com.datastax.driver.core.exceptions.DriverInternalError;
-import org.testng.annotations.Test;
-
+import java.util.Comparator;
import java.util.List;
+import org.testng.annotations.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class DirectedGraphTest {
+
+ private Comparator<String> alphaComparator = new Comparator<String>() {
+
+ @Override
+ public int compare(String o1, String o2) {
+ return o1.compareTo(o2);
+ }
+ };
+
@Test(groups = "unit")
public void should_sort_empty_graph() {
- DirectedGraph<String> g = new DirectedGraph<String>();
+ DirectedGraph<String> g = new DirectedGraph<String>(alphaComparator);
assertThat(g.topologicalSort()).isEmpty();
}
@Test(groups = "unit")
public void should_sort_graph_with_one_node() {
- DirectedGraph<String> g = new DirectedGraph<String>("A");
+ DirectedGraph<String> g = new DirectedGraph<String>(alphaComparator, "A");
assertThat(g.topologicalSort())
.containsExactly("A");
}
@@ -47,7 +56,7 @@
// B C
// |
// A
- DirectedGraph<String> g = new DirectedGraph<String>("A", "B", "C", "D", "E", "F", "G", "H");
+ DirectedGraph<String> g = new DirectedGraph<String>(alphaComparator, "A", "B", "C", "D", "E", "F", "G", "H");
g.addEdge("H", "F");
g.addEdge("G", "E");
g.addEdge("H", "D");
@@ -58,24 +67,54 @@
g.addEdge("D", "B");
g.addEdge("B", "A");
- // Topological sort order should be : GH,FE,D,CB,A
- // There's no guarantee on the order within the same level, so we use sublists:
+ // Topological sort order should be : GH,E,F,D,BC,A
List<String> sorted = g.topologicalSort();
- assertThat(sorted.subList(0, 2))
- .contains("G", "H");
- assertThat(sorted.subList(2, 4))
- .contains("F", "E");
- assertThat(sorted.subList(4, 5))
- .contains("D");
- assertThat(sorted.subList(5, 7))
- .contains("C", "B");
- assertThat(sorted.subList(7, 8))
- .contains("A");
+ assertThat(sorted).containsExactly("G", "H", "E", "F", "D", "B", "C", "A");
+ }
+
+ @Test(groups = "unit")
+ public void should_sort_complex_custom_comparator() {
+ // Version of should_sort_complex_graph using a custom comparator based on ordering largest values first.
+ // This is counter to how hashmaps should usually behave, so this should help ensure that the comparator is
+ // being used.
+ Comparator<Integer> highFirst = new Comparator<Integer>() {
+ @Override
+ public int compare(Integer o1, Integer o2) {
+ return o2 - o1;
+ }
+ };
+
+ // sort graph and use a alphaComparator that favors larger values ordered first.
+ // 7 6
+ // / \ /\
+ // 5 | 10
+ // \ / /
+ // 9 /
+ // / \/
+ // 1 2
+ // |
+ // 0
+ DirectedGraph<Integer> g = new DirectedGraph<Integer>(highFirst, 0, 1, 2, 9, 10, 5, 6, 7);
+ g.addEdge(7, 5);
+ g.addEdge(6, 10);
+ g.addEdge(7, 9);
+ g.addEdge(5, 9);
+ g.addEdge(6, 9);
+ g.addEdge(9, 2);
+ g.addEdge(10, 2);
+ g.addEdge(9, 1);
+ g.addEdge(1, 0);
+
+ // Topological sort order should be : [7,6],[5],[10],[9],[2,1],[0]
+ // 5 comes before 10 even though they appear at the same depth. This happens because 5's (7) dependency
+ // is evaluated before 10's (6), so it is placed first.
+ List<Integer> sorted = g.topologicalSort();
+ assertThat(sorted).containsExactly(7, 6, 5, 10, 9, 2, 1, 0);
}
@Test(groups = "unit", expectedExceptions = DriverInternalError.class)
public void should_fail_to_sort_if_graph_has_a_cycle() {
- DirectedGraph<String> g = new DirectedGraph<String>("A", "B", "C");
+ DirectedGraph<String> g = new DirectedGraph<String>(alphaComparator, "A", "B", "C");
g.addEdge("A", "B");
g.addEdge("B", "C");
g.addEdge("C", "B");
@@ -85,7 +124,7 @@
@Test(groups = "unit", expectedExceptions = DriverInternalError.class)
public void should_fail_to_sort_if_graph_is_a_cycle() {
- DirectedGraph<String> g = new DirectedGraph<String>("A", "B", "C");
+ DirectedGraph<String> g = new DirectedGraph<String>(alphaComparator, "A", "B", "C");
g.addEdge("A", "B");
g.addEdge("B", "C");
g.addEdge("C", "A");
diff --git a/driver-core/src/test/java/com/datastax/driver/core/DseCCMClusterTest.java b/driver-core/src/test/java/com/datastax/driver/core/DseCCMClusterTest.java
index 9cbfaf9..7c0e6b4 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/DseCCMClusterTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/DseCCMClusterTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/DurationCodecTest.java b/driver-core/src/test/java/com/datastax/driver/core/DurationCodecTest.java
index dd86f4d..e57d9e8 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/DurationCodecTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/DurationCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/DurationIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/DurationIntegrationTest.java
index dcbffb8..3c8a01b 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/DurationIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/DurationIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/DurationTest.java b/driver-core/src/test/java/com/datastax/driver/core/DurationTest.java
index bcaf683..558fe8b 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/DurationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/DurationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerIntegrationTest.java
index 5421710..327ae7d 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerTest.java b/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerTest.java
index de54414..b6cd5cd 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/EventDebouncerTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ExportAsStringTest.java b/driver-core/src/test/java/com/datastax/driver/core/ExportAsStringTest.java
new file mode 100644
index 0000000..10ea747
--- /dev/null
+++ b/driver-core/src/test/java/com/datastax/driver/core/ExportAsStringTest.java
@@ -0,0 +1,228 @@
+/*
+ * Copyright (C) 2012-2017 DataStax Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.datastax.driver.core;
+
+import com.datastax.driver.core.schemabuilder.SchemaBuilder;
+import com.datastax.driver.core.utils.CassandraVersion;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.io.ByteStreams;
+import com.google.common.io.Closer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.Test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintStream;
+import java.util.Map;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.fail;
+
+@CassandraVersion("2.0")
+@CCMConfig(config = "enable_user_defined_functions:true")
+public class ExportAsStringTest extends CCMTestsSupport {
+
+ private static final Logger logger = LoggerFactory.getLogger(ExportAsStringTest.class);
+
+ /**
+ * Creates a keyspace using a variety of features and ensures {@link KeyspaceMetadata#exportAsString()}
+ * contains the expected data in the expected order. This is not exhaustive, but covers quite a bit of different
+ * scenarios (materialized views, aggregates, functions, nested UDTs, etc.).
+ * <p>
+ * The test also verifies that the generated schema is the same whether the keyspace and its schema was created
+ * during the lifecycle of the cluster or before connecting.
+ * <p>
+ * Note that this test might be fragile in the future if default option values change in cassandra. In order to
+ * deal with new features, we create a schema for each tested C* version, and if one is not present the test
+ * is failed.
+ */
+ @Test(groups = "short")
+ public void should_create_schema_and_ensure_exported_cql_is_as_expected() {
+ String keyspace = "complex_ks";
+ Map<String, Object> replicationOptions = ImmutableMap.<String, Object>of("class", "SimpleStrategy", "replication_factor", 1);
+
+ // create keyspace
+ session().execute(SchemaBuilder.createKeyspace(keyspace).with().replication(replicationOptions));
+
+ // create session from this keyspace.
+ Session session = cluster().connect(keyspace);
+
+ KeyspaceMetadata ks;
+
+ // udts require 2.1+
+ if (ccm().getCassandraVersion().compareTo(VersionNumber.parse("2.1")) >= 0) {
+ // Usertype 'ztype' with two columns. Given name to ensure that even though it has an alphabetically
+ // later name, it shows up before other user types ('ctype') that depend on it.
+ session.execute(SchemaBuilder.createType("ztype")
+ .addColumn("c", DataType.text()).addColumn("a", DataType.cint()));
+
+ // Usertype 'xtype' with two columns. At same level as 'ztype' since both are depended on by ctype, should
+ // show up before 'ztype' because it's alphabetically before, even though it was created after.
+ session.execute(SchemaBuilder.createType("xtype")
+ .addColumn("d", DataType.text()));
+
+ ks = cluster().getMetadata().getKeyspace(keyspace);
+
+ // Usertype 'ctype' which depends on both ztype and xtype, therefore ztype and xtype should show up earlier.
+ session.execute(SchemaBuilder.createType("ctype")
+ .addColumn("\"Z\"", ks.getUserType("ztype").copy(true))
+ .addColumn("x", ks.getUserType("xtype").copy(true)));
+
+ // Usertype 'btype' which has no dependencies, should show up before 'xtype' and 'ztype' since it's
+ // alphabetically before.
+ session.execute(SchemaBuilder.createType("btype").addColumn("a", DataType.text()));
+
+ // Refetch keyspace for < 3.0 schema this is required as a new keyspace metadata reference may be created.
+ ks = cluster().getMetadata().getKeyspace(keyspace);
+
+ // Usertype 'atype' which depends on 'ctype', so should show up after 'ctype', 'xtype' and 'ztype'.
+ session.execute(SchemaBuilder.createType("atype")
+ .addColumn("c", ks.getUserType("ctype").copy(true)));
+
+ // A simple table with a udt column and LCS compaction strategy.
+ session.execute(SchemaBuilder.createTable("ztable")
+ .addPartitionKey("zkey", DataType.text())
+ .addColumn("a", ks.getUserType("atype").copy(true))
+ .withOptions().compactionOptions(SchemaBuilder.leveledStrategy().ssTableSizeInMB(95)));
+ } else {
+ // A simple table with LCS compaction strategy.
+ session.execute(SchemaBuilder.createTable("ztable")
+ .addPartitionKey("zkey", DataType.text())
+ .addColumn("a", DataType.cint())
+ .withOptions().compactionOptions(SchemaBuilder.leveledStrategy().ssTableSizeInMB(95)));
+ }
+
+ // date type requries 2.2+
+ if (ccm().getCassandraVersion().compareTo(VersionNumber.parse("2.2")) >= 0) {
+ // A table that will have materialized views (copied from mv docs)
+ session.execute(SchemaBuilder.createTable("cyclist_mv").addPartitionKey("cid", DataType.uuid())
+ .addColumn("name", DataType.text())
+ .addColumn("age", DataType.cint())
+ .addColumn("birthday", DataType.date())
+ .addColumn("country", DataType.text()));
+
+ // index on table with view, index should be printed first.
+ session.execute(SchemaBuilder.createIndex("cyclist_by_country")
+ .onTable("cyclist_mv")
+ .andColumn("country"));
+
+ // materialized views require 3.0+
+ if (ccm().getCassandraVersion().compareTo(VersionNumber.parse("3.0")) >= 0) {
+ // A materialized view for cyclist_mv, reverse clustering. created first to ensure creation order does not
+ // matter, alphabetical does.
+ session.execute("CREATE MATERIALIZED VIEW cyclist_by_r_age " +
+ "AS SELECT age, birthday, name, country " +
+ "FROM cyclist_mv " +
+ "WHERE age IS NOT NULL AND cid IS NOT NULL " +
+ "PRIMARY KEY (age, cid) " +
+ "WITH CLUSTERING ORDER BY (cid DESC)"
+ );
+
+ // A materialized view for cyclist_mv, select *
+ session.execute("CREATE MATERIALIZED VIEW cyclist_by_a_age " +
+ "AS SELECT * " +
+ "FROM cyclist_mv " +
+ "WHERE age IS NOT NULL AND cid IS NOT NULL " +
+ "PRIMARY KEY (age, cid)");
+
+ // A materialized view for cyclist_mv, select columns
+ session.execute("CREATE MATERIALIZED VIEW cyclist_by_age " +
+ "AS SELECT age, birthday, name, country " +
+ "FROM cyclist_mv " +
+ "WHERE age IS NOT NULL AND cid IS NOT NULL " +
+ "PRIMARY KEY (age, cid) WITH comment = 'simple view'");
+ }
+ }
+
+ // A table with a secondary index, taken from documentation on secondary index.
+ session.execute(SchemaBuilder.createTable("rank_by_year_and_name")
+ .addPartitionKey("race_year", DataType.cint())
+ .addPartitionKey("race_name", DataType.text())
+ .addClusteringColumn("rank", DataType.cint())
+ .addColumn("cyclist_name", DataType.text()));
+
+ session.execute(SchemaBuilder.createIndex("ryear")
+ .onTable("rank_by_year_and_name")
+ .andColumn("race_year"));
+
+ session.execute(SchemaBuilder.createIndex("rrank")
+ .onTable("rank_by_year_and_name")
+ .andColumn("rank"));
+
+ // udfs and udas require 2.22+
+ if (ccm().getCassandraVersion().compareTo(VersionNumber.parse("2.2")) >= 0) {
+ // UDFs
+ session.execute("CREATE OR REPLACE FUNCTION avgState ( state tuple<int,bigint>, val int ) CALLED ON NULL INPUT RETURNS tuple<int,bigint> LANGUAGE java AS \n" +
+ " 'if (val !=null) { state.setInt(0, state.getInt(0)+1); state.setLong(1, state.getLong(1)+val.intValue()); } return state;';");
+ session.execute("CREATE OR REPLACE FUNCTION avgFinal ( state tuple<int,bigint> ) CALLED ON NULL INPUT RETURNS double LANGUAGE java AS \n" +
+ " 'double r = 0; if (state.getInt(0) == 0) return null; r = state.getLong(1); r /= state.getInt(0); return Double.valueOf(r);';");
+
+ // UDAs
+ session.execute("CREATE AGGREGATE IF NOT EXISTS mean ( int ) \n" +
+ "SFUNC avgState STYPE tuple<int,bigint> FINALFUNC avgFinal INITCOND (0,0);");
+ session.execute("CREATE AGGREGATE IF NOT EXISTS average ( int ) \n" +
+ "SFUNC avgState STYPE tuple<int,bigint> FINALFUNC avgFinal INITCOND (0,0);");
+ }
+
+ ks = cluster().getMetadata().getKeyspace(keyspace);
+
+ // validate that the exported schema matches what was expected exactly.
+ assertThat(ks.exportAsString().trim()).isEqualTo(getExpectedCqlString());
+
+ // Also validate that when you create a Cluster with schema already created that the exported string
+ // is the same.
+ Cluster newCluster = this.createClusterBuilderNoDebouncing()
+ .addContactPointsWithPorts(this.getContactPointsWithPorts())
+ .build();
+ try {
+ newCluster.init();
+ ks = newCluster.getMetadata().getKeyspace(keyspace);
+ assertThat(ks.exportAsString().trim()).isEqualTo(getExpectedCqlString());
+ } finally {
+ newCluster.close();
+ }
+ }
+
+ private String getExpectedCqlString() {
+ String majorMinor = ccm().getCassandraVersion().getMajor() + "." + ccm().getCassandraVersion().getMinor();
+ String resourceName = "/export_as_string_test_" + majorMinor + ".cql";
+
+ Closer closer = Closer.create();
+ try {
+ InputStream is = ExportAsStringTest.class.getResourceAsStream(resourceName);
+ assertThat(is)
+ .as("No reference script for this version (was looking for src/test/resources" + resourceName + ")")
+ .isNotNull();
+ closer.register(is);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ PrintStream ps = new PrintStream(baos);
+ ByteStreams.copy(is, ps);
+ return baos.toString().trim();
+ } catch (IOException e) {
+ logger.warn("Failure to read {}", resourceName, e);
+ fail("Unable to read " + resourceName + " is it defined?");
+ } finally {
+ try {
+ closer.close();
+ } catch (IOException e) { // no op
+ logger.warn("Failure closing streams", e);
+ }
+ }
+ return "";
+ }
+}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ExtendedPeerCheckDisabledTest.java b/driver-core/src/test/java/com/datastax/driver/core/ExtendedPeerCheckDisabledTest.java
index ee5fc16..bac2ada 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ExtendedPeerCheckDisabledTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ExtendedPeerCheckDisabledTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/FakeHost.java b/driver-core/src/test/java/com/datastax/driver/core/FakeHost.java
index 76a162c..1629edd 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/FakeHost.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/FakeHost.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/FetchingTest.java b/driver-core/src/test/java/com/datastax/driver/core/FetchingTest.java
index 98dc5fc..2a9e597 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/FetchingTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/FetchingTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/FrameLengthTest.java b/driver-core/src/test/java/com/datastax/driver/core/FrameLengthTest.java
index 598a18e..4405ce1 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/FrameLengthTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/FrameLengthTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/FunctionMetadataAssert.java b/driver-core/src/test/java/com/datastax/driver/core/FunctionMetadataAssert.java
index 8fc6a1e..eec3190 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/FunctionMetadataAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/FunctionMetadataAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/FunctionMetadataTest.java b/driver-core/src/test/java/com/datastax/driver/core/FunctionMetadataTest.java
index 7bc4433..317103a 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/FunctionMetadataTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/FunctionMetadataTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -50,13 +50,11 @@
assertThat(function.toString())
.isEqualTo(cql);
assertThat(function.exportAsString())
- .isEqualTo(String.format("CREATE FUNCTION %s.plus(\n"
- + " s int,\n"
- + " v int)\n"
- + "RETURNS NULL ON NULL INPUT\n"
- + "RETURNS int\n"
- + "LANGUAGE java\n"
- + "AS 'return s+v;';", this.keyspace));
+ .isEqualTo(String.format("CREATE FUNCTION %s.plus(s int,v int)\n"
+ + " RETURNS NULL ON NULL INPUT\n"
+ + " RETURNS int\n"
+ + " LANGUAGE java\n"
+ + " AS 'return s+v;';", this.keyspace));
}
@Test(groups = "short")
@@ -81,10 +79,10 @@
.isEqualTo(cql);
assertThat(function.exportAsString())
.isEqualTo(String.format("CREATE FUNCTION %s.pi()\n"
- + "CALLED ON NULL INPUT\n"
- + "RETURNS double\n"
- + "LANGUAGE java\n"
- + "AS 'return Math.PI;';", this.keyspace));
+ + " CALLED ON NULL INPUT\n"
+ + " RETURNS double\n"
+ + " LANGUAGE java\n"
+ + " AS 'return Math.PI;';", this.keyspace));
}
@Test(groups = "short")
@@ -154,12 +152,11 @@
assertThat(function.toString())
.isEqualTo(cql);
assertThat(function.exportAsString())
- .isEqualTo(String.format("CREATE FUNCTION %s.complex(\n"
- + " x tuple<tuple<int>, map<int, int>>)\n"
- + "RETURNS NULL ON NULL INPUT\n"
- + "RETURNS int\n"
- + "LANGUAGE java\n"
- + "AS 'return 42;';", this.keyspace));
+ .isEqualTo(String.format("CREATE FUNCTION %s.complex(x tuple<tuple<int>, map<int, int>>)\n"
+ + " RETURNS NULL ON NULL INPUT\n"
+ + " RETURNS int\n"
+ + " LANGUAGE java\n"
+ + " AS 'return 42;';", this.keyspace));
}
@Override
diff --git a/driver-core/src/test/java/com/datastax/driver/core/GettableDataIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/GettableDataIntegrationTest.java
index 520e0ac..21018c4 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/GettableDataIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/GettableDataIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/HeapCompressionTest.java b/driver-core/src/test/java/com/datastax/driver/core/HeapCompressionTest.java
index a18bb88..bf80cad 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/HeapCompressionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/HeapCompressionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/HeartbeatTest.java b/driver-core/src/test/java/com/datastax/driver/core/HeartbeatTest.java
index b8d55db..2ccb800 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/HeartbeatTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/HeartbeatTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/HostAssert.java b/driver-core/src/test/java/com/datastax/driver/core/HostAssert.java
index 1308f7c..bdd66e9 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/HostAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/HostAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -21,6 +21,7 @@
import org.assertj.core.api.AbstractAssert;
import java.net.InetAddress;
+import java.util.UUID;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -197,4 +198,14 @@
assertThat(actual.getBroadcastAddress()).isNull();
return this;
}
+
+ public HostAssert hasHostId(UUID hostId) {
+ assertThat(actual.getHostId()).isEqualTo(hostId);
+ return this;
+ }
+
+ public HostAssert hasSchemaVersion(UUID schemaVersion) {
+ assertThat(actual.getSchemaVersion()).isEqualTo(schemaVersion);
+ return this;
+ }
}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolMultiTest.java b/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolMultiTest.java
index 9e0e295..90d91bc 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolMultiTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolMultiTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolTest.java b/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolTest.java
index 33d8567..63b2119 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/HostMetadataIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/HostMetadataIntegrationTest.java
index b0ca978..ca47236 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/HostMetadataIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/HostMetadataIntegrationTest.java
@@ -1,25 +1,27 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
+import com.datastax.driver.core.utils.UUIDs;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.testng.annotations.Test;
import java.net.InetAddress;
+import java.util.UUID;
import static com.datastax.driver.core.Assertions.assertThat;
import static com.datastax.driver.core.TestUtils.nonQuietClusterCloseOptions;
@@ -317,4 +319,39 @@
scassandraCluster.stop();
}
}
+
+ @Test(groups = "short")
+ public void should_parse_host_id_and_schema_version() {
+ UUID hostId1 = UUIDs.random();
+ UUID hostId2 = UUIDs.random();
+ UUID schemaVersion = UUIDs.random();
+
+ ScassandraCluster scassandraCluster = ScassandraCluster.builder()
+ .withIpPrefix(TestUtils.IP_PREFIX)
+ .withNodes(2)
+ .forcePeerInfo(1, 1, "host_id", hostId1)
+ .forcePeerInfo(1, 1, "schema_version", schemaVersion)
+ .forcePeerInfo(1, 2, "host_id", hostId2)
+ .forcePeerInfo(1, 2, "schema_version", schemaVersion)
+ .build();
+
+ Cluster cluster = Cluster.builder()
+ .addContactPoints(scassandraCluster.address(1).getAddress())
+ .withPort(scassandraCluster.getBinaryPort())
+ .build();
+
+ try {
+ scassandraCluster.init();
+ cluster.init();
+
+ assertThat(cluster).host(1).hasHostId(hostId1);
+ assertThat(cluster).host(1).hasSchemaVersion(schemaVersion);
+ assertThat(cluster).host(2).hasHostId(hostId2);
+ assertThat(cluster).host(2).hasSchemaVersion(schemaVersion);
+
+ } finally {
+ cluster.close();
+ scassandraCluster.stop();
+ }
+ }
}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/IndexMetadataAssert.java b/driver-core/src/test/java/com/datastax/driver/core/IndexMetadataAssert.java
index 18241cb..8607b4f 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/IndexMetadataAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/IndexMetadataAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/IndexMetadataTest.java b/driver-core/src/test/java/com/datastax/driver/core/IndexMetadataTest.java
index 4c5ff1f..3a1fa99 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/IndexMetadataTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/IndexMetadataTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/Jdk8SSLEncryptionTest.java b/driver-core/src/test/java/com/datastax/driver/core/Jdk8SSLEncryptionTest.java
index 6c8fdf3..49df45e 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/Jdk8SSLEncryptionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/Jdk8SSLEncryptionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/KeyspaceMetadataAssert.java b/driver-core/src/test/java/com/datastax/driver/core/KeyspaceMetadataAssert.java
index f3be9cb..77d014a 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/KeyspaceMetadataAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/KeyspaceMetadataAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/LargeDataTest.java b/driver-core/src/test/java/com/datastax/driver/core/LargeDataTest.java
index 573a90c..9418279 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/LargeDataTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/LargeDataTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java b/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java
index ca649db..0395009 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -19,7 +19,6 @@
import com.datastax.driver.core.policies.LoadBalancingPolicy;
import com.datastax.driver.core.policies.RoundRobinPolicy;
import com.datastax.driver.core.utils.MoreObjects;
-import com.google.common.base.Objects;
import com.google.common.collect.Lists;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -28,11 +27,13 @@
import java.util.Collection;
import java.util.List;
+import static com.datastax.driver.core.CreateCCM.TestMode.PER_METHOD;
import static com.datastax.driver.core.LoadBalancingPolicyBootstrapTest.HistoryPolicy.Action.*;
import static com.datastax.driver.core.LoadBalancingPolicyBootstrapTest.HistoryPolicy.entry;
import static org.assertj.core.api.Assertions.assertThat;
@CCMConfig(numberOfNodes = 2, dirtiesContext = true, createCluster = false)
+@CreateCCM(PER_METHOD)
public class LoadBalancingPolicyBootstrapTest extends CCMTestsSupport {
private static final Logger logger = LoggerFactory.getLogger(LoadBalancingPolicyBootstrapTest.class);
@@ -76,7 +77,7 @@
* @jira_ticket JAVA-613
* @since 2.0.10, 2.1.5
*/
- @Test(groups = "short", dependsOnMethods = "should_init_policy_with_up_contact_points")
+ @Test(groups = "long")
public void should_send_down_notifications_after_init_when_contact_points_are_down() throws Exception {
// In order to validate this behavior, we need to stop the first node that would be attempted to be
diff --git a/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyRefreshTest.java b/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyRefreshTest.java
index 60fd78e..f8878d5 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyRefreshTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyRefreshTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/LocalDateAssert.java b/driver-core/src/test/java/com/datastax/driver/core/LocalDateAssert.java
index 8b6f2b4..fb034b4 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/LocalDateAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/LocalDateAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/LocalDateTest.java b/driver-core/src/test/java/com/datastax/driver/core/LocalDateTest.java
index 7cdf2d0..78a43e9 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/LocalDateTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/LocalDateTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/M3PTokenFactoryTest.java b/driver-core/src/test/java/com/datastax/driver/core/M3PTokenFactoryTest.java
index e838e98..4e26fd7 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/M3PTokenFactoryTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/M3PTokenFactoryTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/M3PTokenIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/M3PTokenIntegrationTest.java
index efa5837..4bed18e 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/M3PTokenIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/M3PTokenIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/M3PTokenVnodeIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/M3PTokenVnodeIntegrationTest.java
index 9064431..82734bb 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/M3PTokenVnodeIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/M3PTokenVnodeIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/MappingCodec.java b/driver-core/src/test/java/com/datastax/driver/core/MappingCodec.java
index 58e1352..6271dc7 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/MappingCodec.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/MappingCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/MaterializedViewMetadataAssert.java b/driver-core/src/test/java/com/datastax/driver/core/MaterializedViewMetadataAssert.java
index 336668b..d1356af 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/MaterializedViewMetadataAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/MaterializedViewMetadataAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/MaterializedViewMetadataTest.java b/driver-core/src/test/java/com/datastax/driver/core/MaterializedViewMetadataTest.java
index 51cb1c0..51eb73e 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/MaterializedViewMetadataTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/MaterializedViewMetadataTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/MemoryAppender.java b/driver-core/src/test/java/com/datastax/driver/core/MemoryAppender.java
index 1ccc346..cc4bfbd 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/MemoryAppender.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/MemoryAppender.java
@@ -1,20 +1,21 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
+import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.WriterAppender;
import org.apache.log4j.spi.LoggingEvent;
@@ -95,4 +96,49 @@
nextLogIdx += next.length();
return next;
}
+
+ public MemoryAppender enableFor(Class<?>... loggers) {
+ for (Class<?> logger : loggers) {
+ enableFor(logger.getName());
+ }
+ return this;
+ }
+
+ public MemoryAppender enableFor(org.slf4j.Logger... loggers) {
+ for (org.slf4j.Logger logger : loggers) {
+ enableFor(logger.getName());
+ }
+ return this;
+ }
+
+ public MemoryAppender enableFor(String... loggers) {
+ for (String logger : loggers) {
+ Logger log4jLogger = Logger.getLogger(logger);
+ log4jLogger.addAppender(this);
+ }
+ return this;
+ }
+
+ public MemoryAppender disableFor(Class<?>... loggers) {
+ for (Class<?> logger : loggers) {
+ disableFor(logger.getName());
+ }
+ return this;
+ }
+
+ public MemoryAppender disableFor(org.slf4j.Logger... loggers) {
+ for (org.slf4j.Logger logger : loggers) {
+ disableFor(logger.getName());
+ }
+ return this;
+ }
+
+ public MemoryAppender disableFor(String... loggers) {
+ for (String logger : loggers) {
+ Logger log4jLogger = Logger.getLogger(logger);
+ log4jLogger.removeAppender(this);
+ }
+ return this;
+ }
+
}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/MetadataTest.java b/driver-core/src/test/java/com/datastax/driver/core/MetadataTest.java
index d7114cd..d28e6ae 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/MetadataTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/MetadataTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -125,6 +125,7 @@
public void handleId_should_lowercase_unquoted_alphanumeric_identifiers() {
assertThat(Metadata.handleId("FooBar1")).isEqualTo("foobar1");
assertThat(Metadata.handleId("Foo_Bar_1")).isEqualTo("foo_bar_1");
+ assertThat(Metadata.handleId("foo_bar_1")).isEqualTo("foo_bar_1");
}
@Test(groups = "unit")
@@ -161,4 +162,21 @@
assertThat(Metadata.quoteIfNecessary("columnfamily")).isEqualTo("\"columnfamily\"");
}
+ @Test(groups = "unit")
+ public void should_detect_reserved_keywords_in_upper_case() {
+ assertThat(Metadata.isReservedCqlKeyword("COLUMNFAMILY")).isTrue();
+ assertThat(Metadata.isReservedCqlKeyword("TEST_COLUMNFAMILY")).isFalse();
+ }
+
+ @Test(groups = "unit")
+ public void should_detect_reserved_keywords_in_lower_case() {
+ assertThat(Metadata.isReservedCqlKeyword("columnfamily")).isTrue();
+ assertThat(Metadata.isReservedCqlKeyword("test_columnfamily")).isFalse();
+ }
+
+ @Test(groups = "unit")
+ public void should_detect_reserved_keywords_in_mixed_case() {
+ assertThat(Metadata.isReservedCqlKeyword("ColumnFamily")).isTrue();
+ assertThat(Metadata.isReservedCqlKeyword("Test_ColumnFamily")).isFalse();
+ }
}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/MetricsInFlightTest.java b/driver-core/src/test/java/com/datastax/driver/core/MetricsInFlightTest.java
new file mode 100644
index 0000000..91298a7
--- /dev/null
+++ b/driver-core/src/test/java/com/datastax/driver/core/MetricsInFlightTest.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2012-2017 DataStax Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.datastax.driver.core;
+
+import org.scassandra.Scassandra;
+import org.scassandra.http.client.PrimingRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import static com.datastax.driver.core.TestUtils.nonQuietClusterCloseOptions;
+import static org.scassandra.http.client.PrimingRequest.then;
+
+public class MetricsInFlightTest {
+ private ScassandraCluster sCluster;
+
+ @BeforeMethod(groups = "short")
+ public void setUp() {
+ sCluster = ScassandraCluster.builder().withNodes(1).build();
+ sCluster.init();
+ }
+
+ @AfterMethod(groups = "short")
+ public void tearDown() {
+ clearActivityLog();
+ sCluster.stop();
+ }
+
+ public void clearActivityLog() {
+ for (Scassandra node : sCluster.nodes()) {
+ node.activityClient().clearAllRecordedActivity();
+ }
+ }
+
+ public Cluster.Builder builder() {
+ //Note: nonQuietClusterCloseOptions is used to speed up tests
+ return Cluster.builder()
+ .addContactPoints(sCluster.address(1).getAddress())
+ .withPort(sCluster.getBinaryPort()).withNettyOptions(nonQuietClusterCloseOptions);
+ }
+
+ @Test(groups = "short")
+ public void should_count_inflight_requests_metrics() {
+ sCluster.node(1).primingClient().prime(PrimingRequest.queryBuilder()
+ .withQuery("mock query")
+ .withThen(then().withFixedDelay(100000L))
+ .build()
+ );
+
+ Cluster cluster = null;
+ try {
+ cluster = builder().build();
+ Session session = cluster.connect();
+
+ assertThat(cluster.getMetrics().getInFlightRequests().getValue()).isEqualTo(0);
+ session.executeAsync("mock query");
+ session.executeAsync("mock query");
+ assertThat(cluster.getMetrics().getInFlightRequests().getValue()).isEqualTo(2);
+
+ } finally {
+ if (cluster != null) {
+ cluster.close();
+ }
+ }
+ }
+
+
+ @Test(groups = "short")
+ public void should_countdown_inflight_requests_metrics() {
+ sCluster.node(1).primingClient().prime(PrimingRequest.queryBuilder()
+ .withQuery("mock query")
+ .withThen(then())
+ .build()
+ );
+
+ Cluster cluster = null;
+ try {
+ cluster = builder().build();
+ Session session = cluster.connect();
+
+ assertThat(cluster.getMetrics().getInFlightRequests().getValue()).isEqualTo(0);
+ session.executeAsync("mock query").getUninterruptibly();
+ session.executeAsync("mock query").getUninterruptibly();
+ assertThat(cluster.getMetrics().getInFlightRequests().getValue()).isEqualTo(0);
+
+ } finally {
+ if (cluster != null) {
+ cluster.close();
+ }
+ }
+ }
+
+}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/MetricsTest.java b/driver-core/src/test/java/com/datastax/driver/core/MetricsTest.java
index c86acd4..0fce918 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/MetricsTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/MetricsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/MissingRpcAddressTest.java b/driver-core/src/test/java/com/datastax/driver/core/MissingRpcAddressTest.java
index d4810a0..56253d9 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/MissingRpcAddressTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/MissingRpcAddressTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/MockClocks.java b/driver-core/src/test/java/com/datastax/driver/core/MockClocks.java
index ef6dc30..9d988e5 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/MockClocks.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/MockClocks.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/NettyOptionsTest.java b/driver-core/src/test/java/com/datastax/driver/core/NettyOptionsTest.java
index 8d9a94a..520cf79 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/NettyOptionsTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/NettyOptionsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/NetworkTopologyStrategyTest.java b/driver-core/src/test/java/com/datastax/driver/core/NetworkTopologyStrategyTest.java
index efe6290..483c3a4 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/NetworkTopologyStrategyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/NetworkTopologyStrategyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/NodeListRefreshDebouncerTest.java b/driver-core/src/test/java/com/datastax/driver/core/NodeListRefreshDebouncerTest.java
index 6779f45..12dbaca 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/NodeListRefreshDebouncerTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/NodeListRefreshDebouncerTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/NodeRefreshDebouncerTest.java b/driver-core/src/test/java/com/datastax/driver/core/NodeRefreshDebouncerTest.java
index ae8e982..3ac7c0e 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/NodeRefreshDebouncerTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/NodeRefreshDebouncerTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/OPPTokenFactoryTest.java b/driver-core/src/test/java/com/datastax/driver/core/OPPTokenFactoryTest.java
index c74c484..33a325a 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/OPPTokenFactoryTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/OPPTokenFactoryTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/OPPTokenIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/OPPTokenIntegrationTest.java
index 91f3e8b..cd89a27 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/OPPTokenIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/OPPTokenIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/OPPTokenVnodeIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/OPPTokenVnodeIntegrationTest.java
index 0fae9a7..5875bcb 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/OPPTokenVnodeIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/OPPTokenVnodeIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/PagingStateTest.java b/driver-core/src/test/java/com/datastax/driver/core/PagingStateTest.java
index c5bd16c..27873fa 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/PagingStateTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/PagingStateTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ParseUtilsTest.java b/driver-core/src/test/java/com/datastax/driver/core/ParseUtilsTest.java
index 1071b07..6393f6a 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ParseUtilsTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ParseUtilsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/PerHostPercentileTrackerTest.java b/driver-core/src/test/java/com/datastax/driver/core/PerHostPercentileTrackerTest.java
index 9572125..e4febf6 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/PerHostPercentileTrackerTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/PerHostPercentileTrackerTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/PercentileTrackerTest.java b/driver-core/src/test/java/com/datastax/driver/core/PercentileTrackerTest.java
index 5136398..aa69fae 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/PercentileTrackerTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/PercentileTrackerTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/PoolingOptionsIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/PoolingOptionsIntegrationTest.java
index 2ff257b..d8092ee 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/PoolingOptionsIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/PoolingOptionsIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/PoolingOptionsTest.java b/driver-core/src/test/java/com/datastax/driver/core/PoolingOptionsTest.java
index 9889668..eda425f 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/PoolingOptionsTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/PoolingOptionsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/PreparedIdTest.java b/driver-core/src/test/java/com/datastax/driver/core/PreparedIdTest.java
index b6d0ea0..cfe0079 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/PreparedIdTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/PreparedIdTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementInvalidationTest.java b/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementInvalidationTest.java
new file mode 100644
index 0000000..2d70777
--- /dev/null
+++ b/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementInvalidationTest.java
@@ -0,0 +1,256 @@
+
+/*
+ * Copyright (C) 2012-2017 DataStax Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.datastax.driver.core;
+
+
+import com.datastax.driver.core.exceptions.NoHostAvailableException;
+import com.datastax.driver.core.utils.CassandraVersion;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import static com.datastax.driver.core.Assertions.assertThat;
+import static junit.framework.TestCase.fail;
+
+/**
+ * Note: at the time of writing, this test exercises features of an unreleased Cassandra version. To
+ * test against a local build, run with
+ *
+ * <pre>
+ * -Dcassandra.version=4.0.0 -Dcassandra.directory=/path/to/cassandra
+ * </pre>
+ */
+@CassandraVersion("4.0")
+public class PreparedStatementInvalidationTest extends CCMTestsSupport {
+
+ @Override
+ public Cluster.Builder createClusterBuilder() {
+ // TODO remove when protocol v5 is stable in C* 4
+ return super.createClusterBuilderNoDebouncing().allowBetaProtocolVersion();
+ }
+
+ @BeforeMethod(groups = "short", alwaysRun = true)
+ public void setup() throws Exception {
+ execute("CREATE TABLE prepared_statement_invalidation_test (a int PRIMARY KEY, b int, c int);");
+ execute("INSERT INTO prepared_statement_invalidation_test (a, b, c) VALUES (1, 1, 1);");
+ execute("INSERT INTO prepared_statement_invalidation_test (a, b, c) VALUES (2, 2, 2);");
+ execute("INSERT INTO prepared_statement_invalidation_test (a, b, c) VALUES (3, 3, 3);");
+ execute("INSERT INTO prepared_statement_invalidation_test (a, b, c) VALUES (4, 4, 4);");
+ }
+
+ @AfterMethod(groups = "short", alwaysRun = true)
+ public void teardown() throws Exception {
+ execute("DROP TABLE prepared_statement_invalidation_test");
+ }
+
+ @Test(groups = "short")
+ public void should_update_statement_id_when_metadata_changed_across_executions() {
+ // given
+ PreparedStatement ps = session().prepare("SELECT * FROM prepared_statement_invalidation_test WHERE a = ?");
+ MD5Digest idBefore = ps.getPreparedId().resultSetMetadata.id;
+ // when
+ session().execute("ALTER TABLE prepared_statement_invalidation_test ADD d int");
+ BoundStatement bs = ps.bind(1);
+ ResultSet rows = session().execute(bs);
+ // then
+ MD5Digest idAfter = ps.getPreparedId().resultSetMetadata.id;
+ assertThat(idBefore).isNotEqualTo(idAfter);
+ assertThat(ps.getPreparedId().resultSetMetadata.variables)
+ .hasSize(4)
+ .containsVariable("d", DataType.cint());
+ assertThat(bs.preparedStatement().getPreparedId().resultSetMetadata.variables)
+ .hasSize(4)
+ .containsVariable("d", DataType.cint());
+ assertThat(rows.getColumnDefinitions())
+ .hasSize(4)
+ .containsVariable("d", DataType.cint());
+ }
+
+ @Test(groups = "short")
+ public void should_update_statement_id_when_metadata_changed_across_pages() throws Exception {
+ // given
+ PreparedStatement ps = session().prepare("SELECT * FROM prepared_statement_invalidation_test");
+ ResultSet rows = session().execute(ps.bind().setFetchSize(2));
+ assertThat(rows.isFullyFetched()).isFalse();
+ MD5Digest idBefore = ps.getPreparedId().resultSetMetadata.id;
+ ColumnDefinitions definitionsBefore = rows.getColumnDefinitions();
+ assertThat(definitionsBefore)
+ .hasSize(3)
+ .doesNotContainVariable("d");
+ // consume the first page
+ int remaining = rows.getAvailableWithoutFetching();
+ while (remaining-- > 0) {
+ try {
+ rows.one().getInt("d");
+ fail("expected an error");
+ } catch (IllegalArgumentException e) { /*expected*/ }
+ }
+
+ // when
+ session().execute("ALTER TABLE prepared_statement_invalidation_test ADD d int");
+
+ // then
+ // this should trigger a background fetch of the second page, and therefore update the definitions
+ for (Row row : rows) {
+ assertThat(row.isNull("d")).isTrue();
+ }
+ MD5Digest idAfter = ps.getPreparedId().resultSetMetadata.id;
+ ColumnDefinitions definitionsAfter = rows.getColumnDefinitions();
+ assertThat(idBefore).isNotEqualTo(idAfter);
+ assertThat(definitionsAfter)
+ .hasSize(4)
+ .containsVariable("d", DataType.cint());
+ }
+
+ @Test(groups = "short")
+ public void should_update_statement_id_when_metadata_changed_across_sessions() {
+ Session session1 = cluster().connect();
+ useKeyspace(session1, keyspace);
+ Session session2 = cluster().connect();
+ useKeyspace(session2, keyspace);
+
+ PreparedStatement ps1 = session1.prepare("SELECT * FROM prepared_statement_invalidation_test WHERE a = ?");
+ PreparedStatement ps2 = session2.prepare("SELECT * FROM prepared_statement_invalidation_test WHERE a = ?");
+
+ MD5Digest id1a = ps1.getPreparedId().resultSetMetadata.id;
+ MD5Digest id2a = ps2.getPreparedId().resultSetMetadata.id;
+
+ ResultSet rows1 = session1.execute(ps1.bind(1));
+ ResultSet rows2 = session2.execute(ps2.bind(1));
+
+ assertThat(rows1.getColumnDefinitions())
+ .hasSize(3)
+ .containsVariable("a", DataType.cint())
+ .containsVariable("b", DataType.cint())
+ .containsVariable("c", DataType.cint());
+ assertThat(rows2.getColumnDefinitions())
+ .hasSize(3)
+ .containsVariable("a", DataType.cint())
+ .containsVariable("b", DataType.cint())
+ .containsVariable("c", DataType.cint());
+
+ session1.execute("ALTER TABLE prepared_statement_invalidation_test ADD d int");
+
+ rows1 = session1.execute(ps1.bind(1));
+ rows2 = session2.execute(ps2.bind(1));
+
+ MD5Digest id1b = ps1.getPreparedId().resultSetMetadata.id;
+ MD5Digest id2b = ps2.getPreparedId().resultSetMetadata.id;
+
+ assertThat(id1a).isNotEqualTo(id1b);
+ assertThat(id2a).isNotEqualTo(id2b);
+
+ assertThat(ps1.getPreparedId().resultSetMetadata.variables)
+ .hasSize(4)
+ .containsVariable("d", DataType.cint());
+ assertThat(ps2.getPreparedId().resultSetMetadata.variables)
+ .hasSize(4)
+ .containsVariable("d", DataType.cint());
+ assertThat(rows1.getColumnDefinitions())
+ .hasSize(4)
+ .containsVariable("d", DataType.cint());
+ assertThat(rows2.getColumnDefinitions())
+ .hasSize(4)
+ .containsVariable("d", DataType.cint());
+ }
+
+ @Test(groups = "short", expectedExceptions = NoHostAvailableException.class)
+ public void should_not_reprepare_invalid_statements() {
+ // given
+ session().execute("ALTER TABLE prepared_statement_invalidation_test ADD d int");
+ PreparedStatement ps = session().prepare("SELECT a, b, c, d FROM prepared_statement_invalidation_test WHERE a = ?");
+ session().execute("ALTER TABLE prepared_statement_invalidation_test DROP d");
+ // when
+ session().execute(ps.bind());
+ }
+
+ @Test(groups = "short")
+ public void should_never_update_statement_id_for_conditional_updates_in_modern_protocol() {
+ should_never_update_statement_id_for_conditional_updates(session());
+ }
+
+ private void should_never_update_statement_id_for_conditional_updates(Session session) {
+ // Given
+ PreparedStatement ps = session.prepare(
+ "INSERT INTO prepared_statement_invalidation_test (a, b, c) VALUES (?, ?, ?) IF NOT EXISTS");
+
+ // Never store metadata in the prepared statement for conditional updates, since the result set can change
+ // depending on the outcome.
+ assertThat(ps.getPreparedId().resultSetMetadata.variables).isNull();
+ MD5Digest idBefore = ps.getPreparedId().resultSetMetadata.id;
+
+ // When
+ ResultSet rs = session.execute(ps.bind(5, 5, 5));
+
+ // Then
+ // Successful conditional update => only contains the [applied] column
+ assertThat(rs.wasApplied()).isTrue();
+ assertThat(rs.getColumnDefinitions())
+ .hasSize(1)
+ .containsVariable("[applied]", DataType.cboolean());
+ // However the prepared statement shouldn't have changed
+ assertThat(ps.getPreparedId().resultSetMetadata.variables).isNull();
+ assertThat(ps.getPreparedId().resultSetMetadata.id).isEqualTo(idBefore);
+
+
+ // When
+ rs = session.execute(ps.bind(5, 5, 5));
+
+ // Then
+ // Failed conditional update => regular metadata
+ assertThat(rs.wasApplied()).isFalse();
+ assertThat(rs.getColumnDefinitions()).hasSize(4);
+ Row row = rs.one();
+ assertThat(row.getBool("[applied]")).isFalse();
+ assertThat(row.getInt("a")).isEqualTo(5);
+ assertThat(row.getInt("b")).isEqualTo(5);
+ assertThat(row.getInt("c")).isEqualTo(5);
+ // The prepared statement still shouldn't have changed
+ assertThat(ps.getPreparedId().resultSetMetadata.variables).isNull();
+ assertThat(ps.getPreparedId().resultSetMetadata.id).isEqualTo(idBefore);
+
+
+ // When
+ session.execute("ALTER TABLE prepared_statement_invalidation_test ADD d int");
+ rs = session.execute(ps.bind(5, 5, 5));
+
+ // Then
+ // Failed conditional update => regular metadata that should also contain the new column
+ assertThat(rs.wasApplied()).isFalse();
+ assertThat(rs.getColumnDefinitions()).hasSize(5);
+ row = rs.one();
+ assertThat(row.getBool("[applied]")).isFalse();
+ assertThat(row.getInt("a")).isEqualTo(5);
+ assertThat(row.getInt("b")).isEqualTo(5);
+ assertThat(row.getInt("c")).isEqualTo(5);
+ assertThat(row.isNull("d")).isTrue();
+ assertThat(ps.getPreparedId().resultSetMetadata.variables).isNull();
+ assertThat(ps.getPreparedId().resultSetMetadata.id).isEqualTo(idBefore);
+ }
+
+ @Test(groups = "short")
+ public void should_never_update_statement_for_conditional_updates_in_legacy_protocols() {
+ // Given
+ Cluster cluster = register(Cluster.builder()
+ .addContactPoints(getContactPoints())
+ .withPort(ccm().getBinaryPort())
+ .withProtocolVersion(ccm().getProtocolVersion(ProtocolVersion.V4))
+ .build());
+ Session session = cluster.connect(keyspace);
+ should_never_update_statement_id_for_conditional_updates(session);
+ }
+}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementTest.java b/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementTest.java
index a2dc022..be68e2f 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/PreparedStatementTest.java
@@ -1,37 +1,46 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
+import java.net.InetAddress;
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.util.concurrent.Uninterruptibles;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
+
import com.datastax.driver.core.exceptions.InvalidQueryException;
import com.datastax.driver.core.exceptions.UnsupportedFeatureException;
import com.datastax.driver.core.policies.FallthroughRetryPolicy;
import com.datastax.driver.core.utils.Bytes;
import com.datastax.driver.core.utils.CassandraVersion;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.util.concurrent.Uninterruptibles;
-import org.testng.annotations.Test;
-
-import java.net.InetAddress;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
import static com.datastax.driver.core.ProtocolVersion.V4;
-import static com.datastax.driver.core.TestUtils.*;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.testng.Assert.*;
+import static com.datastax.driver.core.TestUtils.getFixedValue;
+import static com.datastax.driver.core.TestUtils.getFixedValue2;
+import static com.datastax.driver.core.TestUtils.getValue;
+import static com.datastax.driver.core.TestUtils.setValue;
/**
* Prepared statement tests.
@@ -63,6 +72,18 @@
execute(createTestFixtures());
}
+ @AfterMethod(groups = "short")
+ public void tearDown() throws Exception {
+ execute(
+ String.format("TRUNCATE %s", ALL_NATIVE_TABLE),
+ String.format("TRUNCATE %s", ALL_LIST_TABLE),
+ String.format("TRUNCATE %s", ALL_SET_TABLE),
+ String.format("TRUNCATE %s", ALL_MAP_TABLE),
+ String.format("TRUNCATE %s", SIMPLE_TABLE),
+ String.format("TRUNCATE %s", SIMPLE_TABLE2)
+ );
+ }
+
private List<String> createTestFixtures() {
List<String> defs = new ArrayList<String>(4);
diff --git a/driver-core/src/test/java/com/datastax/driver/core/PrimitiveTypeSamples.java b/driver-core/src/test/java/com/datastax/driver/core/PrimitiveTypeSamples.java
index 7624b56..efb3351 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/PrimitiveTypeSamples.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/PrimitiveTypeSamples.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java b/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java
index ebb5ac5..a5da6d0 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ProtocolBetaVersionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ProtocolOptionsTest.java b/driver-core/src/test/java/com/datastax/driver/core/ProtocolOptionsTest.java
index 78d27a3..2ef4c36 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ProtocolOptionsTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ProtocolOptionsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ProtocolV1Test.java b/driver-core/src/test/java/com/datastax/driver/core/ProtocolV1Test.java
index 45ec9d1..07c2c2f 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ProtocolV1Test.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ProtocolV1Test.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java b/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java
index a1ffbac..38fe4d4 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ProtocolVersionRenegotiationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerErrorsTest.java b/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerErrorsTest.java
index 5a04c16..af54988 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerErrorsTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerErrorsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerTest.java b/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerTest.java
index 1d696c3..c611af5 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/QueryLoggerTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/QueryOptionsTest.java b/driver-core/src/test/java/com/datastax/driver/core/QueryOptionsTest.java
index 776e008..fe9bc88 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/QueryOptionsTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/QueryOptionsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/QueryTimestampTest.java b/driver-core/src/test/java/com/datastax/driver/core/QueryTimestampTest.java
index 537284a..4f33b4d 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/QueryTimestampTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/QueryTimestampTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/QueryTracker.java b/driver-core/src/test/java/com/datastax/driver/core/QueryTracker.java
index 47cfcc3..a021cc7 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/QueryTracker.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/QueryTracker.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/RPTokenFactoryTest.java b/driver-core/src/test/java/com/datastax/driver/core/RPTokenFactoryTest.java
index 6c017a1..42c3b78 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/RPTokenFactoryTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/RPTokenFactoryTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/RPTokenIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/RPTokenIntegrationTest.java
index 9c4ef4f..9fe9418 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/RPTokenIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/RPTokenIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/RPTokenVnodeIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/RPTokenVnodeIntegrationTest.java
index a336fa1..47bf02a 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/RPTokenVnodeIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/RPTokenVnodeIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ReadTimeoutTest.java b/driver-core/src/test/java/com/datastax/driver/core/ReadTimeoutTest.java
index 71777bc..3a6247b 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ReadTimeoutTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ReadTimeoutTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/RecommissionedNodeTest.java b/driver-core/src/test/java/com/datastax/driver/core/RecommissionedNodeTest.java
index cc52c76..bc79426 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/RecommissionedNodeTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/RecommissionedNodeTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ReconnectionPolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/ReconnectionPolicyTest.java
index ab2dc36..5e8f8b7 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ReconnectionPolicyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ReconnectionPolicyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java b/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java
index 6fed4ab..c455852 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/RefreshConnectedHostTest.java b/driver-core/src/test/java/com/datastax/driver/core/RefreshConnectedHostTest.java
index feb8c53..87fabe9 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/RefreshConnectedHostTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/RefreshConnectedHostTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ReplicationStrategyTest.java b/driver-core/src/test/java/com/datastax/driver/core/ReplicationStrategyTest.java
index e09ba42..6f11ebc 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ReplicationStrategyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ReplicationStrategyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/RequestHandlerTest.java b/driver-core/src/test/java/com/datastax/driver/core/RequestHandlerTest.java
index 1b903e8..6c9fb97 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/RequestHandlerTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/RequestHandlerTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ResultSetAssert.java b/driver-core/src/test/java/com/datastax/driver/core/ResultSetAssert.java
index 487309e..b886394 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ResultSetAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ResultSetAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ReusedStreamIdTest.java b/driver-core/src/test/java/com/datastax/driver/core/ReusedStreamIdTest.java
index 5aa63bf..8ed42d4 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ReusedStreamIdTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ReusedStreamIdTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SSLAuthenticatedEncryptionTest.java b/driver-core/src/test/java/com/datastax/driver/core/SSLAuthenticatedEncryptionTest.java
index 1371ecd..f96275a 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SSLAuthenticatedEncryptionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SSLAuthenticatedEncryptionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SSLEncryptionTest.java b/driver-core/src/test/java/com/datastax/driver/core/SSLEncryptionTest.java
index 36707fe..3e9c5d8 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SSLEncryptionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SSLEncryptionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SSLTestBase.java b/driver-core/src/test/java/com/datastax/driver/core/SSLTestBase.java
index 9c342dc..e470d5a 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SSLTestBase.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SSLTestBase.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java b/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java
index 0747809..87169ae 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -334,6 +334,7 @@
addPeerInfo(row, dc, n + 1, "rack", getPeerInfo(dc, n + 1, "rack", "rack1"));
addPeerInfo(row, dc, n + 1, "release_version", getPeerInfo(dc, n + 1, "release_version", cassandraVersion));
addPeerInfo(row, dc, n + 1, "tokens", ImmutableSet.of(tokens.get(n)));
+ addPeerInfo(row, dc, n + 1, "host_id", UUIDs.random());
addPeerInfo(row, dc, n + 1, "schema_version", schemaVersion);
addPeerInfo(row, dc, n + 1, "graph", false);
@@ -461,6 +462,7 @@
column("release_version", TEXT),
column("tokens", set(TEXT)),
column("graph", BOOLEAN),
+ column("host_id", UUID),
column("schema_version", UUID)
};
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ScassandraTestBase.java b/driver-core/src/test/java/com/datastax/driver/core/ScassandraTestBase.java
index aa64c89..1405921 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ScassandraTestBase.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ScassandraTestBase.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -51,7 +51,7 @@
protected static String ip = TestUtils.ipOfNode(1);
@BeforeClass(groups = {"short", "long"})
- public void startScassandra() {
+ public void beforeTestClass() {
scassandra = TestUtils.createScassandraServer();
scassandra.start();
primingClient = scassandra.primingClient();
@@ -61,7 +61,7 @@
}
@AfterClass(groups = {"short", "long"})
- public void stopScassandra() {
+ public void afterTestClass() {
if (scassandra != null)
scassandra.stop();
}
@@ -105,26 +105,20 @@
protected Host host;
- @BeforeClass(groups = {"short", "long"}, dependsOnMethods = "startScassandra")
- public void initCluster() {
+ @BeforeClass(groups = {"short", "long"})
+ public void beforeTestClass() {
+ super.beforeTestClass();
Cluster.Builder builder = createClusterBuilder();
cluster = builder.build();
host = retrieveSingleHost(cluster);
session = cluster.connect();
}
- @AfterClass(groups = {"short", "long"}, alwaysRun = true)
- public void closeCluster() {
+ @AfterClass(groups = {"short", "long"})
+ public void afterTestClass() {
if (cluster != null)
cluster.close();
+ super.afterTestClass();
}
-
- @AfterClass(groups = {"short", "long"}, dependsOnMethods = "closeCluster", alwaysRun = true)
- @Override
- public void stopScassandra() {
- super.stopScassandra();
- }
-
}
-
}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SchemaAgreementTest.java b/driver-core/src/test/java/com/datastax/driver/core/SchemaAgreementTest.java
index c125e92..99fcc00 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SchemaAgreementTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SchemaAgreementTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -48,7 +48,7 @@
assertThat(rs.getExecutionInfo().isSchemaInAgreement()).isTrue();
}
- @Test(groups = "short")
+ @Test(groups = "short", priority = 1)
public void should_unset_flag_on_failed_agreement() {
// Setting to 0 results in no query being set, so agreement fails
ProtocolOptions protocolOptions = cluster().getConfiguration().getProtocolOptions();
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesCCTest.java b/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesCCTest.java
index f68186e..995c5b1 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesCCTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesCCTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java b/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java
index 877ee9a..23f06c8 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SchemaRefreshDebouncerTest.java b/driver-core/src/test/java/com/datastax/driver/core/SchemaRefreshDebouncerTest.java
index a5e82b2..8099662 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SchemaRefreshDebouncerTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SchemaRefreshDebouncerTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SessionAssert.java b/driver-core/src/test/java/com/datastax/driver/core/SessionAssert.java
index f59a83c..83c44b4 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SessionAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SessionAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SessionErrorTest.java b/driver-core/src/test/java/com/datastax/driver/core/SessionErrorTest.java
new file mode 100644
index 0000000..aaa3418
--- /dev/null
+++ b/driver-core/src/test/java/com/datastax/driver/core/SessionErrorTest.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2012-2017 DataStax Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.datastax.driver.core;
+
+import org.apache.log4j.Level;
+import org.jboss.byteman.contrib.bmunit.BMNGListener;
+import org.jboss.byteman.contrib.bmunit.BMRule;
+import org.jboss.byteman.contrib.bmunit.BMUnitConfig;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Listeners;
+import org.testng.annotations.Test;
+
+import static com.datastax.driver.core.Cluster.builder;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.fail;
+
+/**
+ * Simple test of the Sessions methods against a one node cluster.
+ */
+@BMUnitConfig(loadDirectory = "target/test-classes")
+@Listeners(BMNGListener.class)
+@CCMConfig(createCluster = false)
+public class SessionErrorTest extends ScassandraTestBase {
+
+ private ScassandraCluster scassandra;
+ private Cluster cluster;
+
+ @BeforeClass(groups = "short")
+ public void setUp() throws Exception {
+ scassandra = ScassandraCluster.builder().withNodes(2).build();
+ scassandra.init();
+ cluster = builder()
+ .addContactPoints(scassandra.address(1).getAddress())
+ .withPort(scassandra.getBinaryPort())
+ .build();
+ cluster.init();
+ }
+
+ @AfterClass(groups = "short")
+ public void tearDown() throws Exception {
+ cluster.close();
+ scassandra.stop();
+ }
+
+ @Test(groups = "short")
+ @BMRule(name = "emulate OOME",
+ targetClass = "com.datastax.driver.core.Connection$4",
+ targetMethod = "apply(Void)",
+ action = "throw new OutOfMemoryError(\"not really\")"
+ )
+ public void should_propagate_errors() {
+ try {
+ cluster.connect();
+ fail("Expecting OOME");
+ } catch (OutOfMemoryError e) {
+ assertThat(e).hasMessage("not really");
+ }
+ }
+
+ @Test(groups = "short")
+ @BMRule(name = "emulate NPE",
+ targetClass = "com.datastax.driver.core.Connection$4",
+ targetMethod = "apply(Void)",
+ action = "throw new NullPointerException(\"not really\")"
+ )
+ public void should_not_propagate_unchecked_exceptions() {
+ Level previous = TestUtils.setLogLevel(HostConnectionPool.class, Level.WARN);
+ MemoryAppender logs = new MemoryAppender().enableFor(HostConnectionPool.class);
+ try {
+ Session session = cluster.connect();
+ // Pool to host1 should be still open because host1 is the control host,
+ // but its pool should have no active connection
+ // Pool to host2 should have been closed because host2 has no
+ // more active connections
+ Host host1 = scassandra.host(cluster, 1, 1);
+ Host host2 = scassandra.host(cluster, 1, 2);
+ TestUtils.waitForDown(TestUtils.ipOfNode(2), cluster);
+ Session.State state = session.getState();
+ assertThat(state.getOpenConnections(host1)).isEqualTo(0); // pool open but empty
+ assertThat(state.getOpenConnections(host2)).isEqualTo(0); // pool closed
+ assertThat(logs.get())
+ .contains(
+ "Unexpected error during transport initialization",
+ "not really",
+ NullPointerException.class.getSimpleName(),
+ "com.datastax.driver.core.Connection$4.apply");
+ HostConnectionPool pool1 = ((SessionManager)session).pools.get(host1);
+ HostConnectionPool pool2 = ((SessionManager)session).pools.get(host2);
+ assertThat(pool1).isNotNull();
+ assertThat(pool1.isClosed()).isFalse();
+ assertThat(pool2).isNull(); // pool2 should have been removed
+ } finally {
+ TestUtils.setLogLevel(HostConnectionPool.class, previous);
+ logs.disableFor(HostConnectionPool.class);
+ }
+ }
+
+}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SessionLeakTest.java b/driver-core/src/test/java/com/datastax/driver/core/SessionLeakTest.java
index 6d37222..956ef8c 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SessionLeakTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SessionLeakTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SessionStressTest.java b/driver-core/src/test/java/com/datastax/driver/core/SessionStressTest.java
index 1bb574d..a2827d3 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SessionStressTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SessionStressTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SessionTest.java b/driver-core/src/test/java/com/datastax/driver/core/SessionTest.java
index 9e14090..a1d56fd 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SessionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SessionTest.java
@@ -1,29 +1,32 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
-import com.datastax.driver.core.exceptions.SyntaxError;
-import com.google.common.util.concurrent.ListenableFuture;
-import org.testng.annotations.Test;
-
import java.util.List;
import java.util.Locale;
import java.util.concurrent.*;
-import static com.datastax.driver.core.Assertions.*;
+import com.google.common.util.concurrent.ListenableFuture;
+import org.testng.annotations.Test;
+
+import com.datastax.driver.core.exceptions.SyntaxError;
+
+import static com.datastax.driver.core.Assertions.assertThat;
+import static com.datastax.driver.core.Assertions.fail;
+import static com.datastax.driver.core.Assertions.offset;
import static com.datastax.driver.core.TestUtils.nonQuietClusterCloseOptions;
/**
@@ -31,10 +34,10 @@
*/
public class SessionTest extends CCMTestsSupport {
- private static final String TABLE1 = "test1";
- private static final String TABLE2 = "test2";
- private static final String TABLE3 = "test3";
- private static final String COUNTER_TABLE = "counters";
+ private static final String TABLE1 = TestUtils.generateIdentifier("test1");
+ private static final String TABLE2 = TestUtils.generateIdentifier("test2");
+ private static final String TABLE3 = TestUtils.generateIdentifier("test3");
+ private static final String COUNTER_TABLE = TestUtils.generateIdentifier("counters");
@Override
public void onTestContextInitialized() {
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SimpleJSONParserTest.java b/driver-core/src/test/java/com/datastax/driver/core/SimpleJSONParserTest.java
index 0e7b597..18e1539 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SimpleJSONParserTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SimpleJSONParserTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SimpleStatementIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/SimpleStatementIntegrationTest.java
index 9f2e2f0..fd86fac 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SimpleStatementIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SimpleStatementIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SimpleStatementTest.java b/driver-core/src/test/java/com/datastax/driver/core/SimpleStatementTest.java
index 8927103..1030586 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SimpleStatementTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SimpleStatementTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SimpleStrategyTest.java b/driver-core/src/test/java/com/datastax/driver/core/SimpleStrategyTest.java
index e50c7bf..df24ce8 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SimpleStrategyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SimpleStrategyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SingleConnectionPoolTest.java b/driver-core/src/test/java/com/datastax/driver/core/SingleConnectionPoolTest.java
index 6e721c4..31d80ab 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SingleConnectionPoolTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SingleConnectionPoolTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SingleTokenIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/SingleTokenIntegrationTest.java
index 5229ba1..f11e779 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SingleTokenIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SingleTokenIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SortingLoadBalancingPolicy.java b/driver-core/src/test/java/com/datastax/driver/core/SortingLoadBalancingPolicy.java
index 92f2f2d..a0c4594 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SortingLoadBalancingPolicy.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SortingLoadBalancingPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SpeculativeExecutionTest.java b/driver-core/src/test/java/com/datastax/driver/core/SpeculativeExecutionTest.java
index 3def90d..cdb2265 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/SpeculativeExecutionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/SpeculativeExecutionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -96,7 +96,11 @@
assertThat(row.getString("result")).isEqualTo("result1");
assertThat(errors.getSpeculativeExecutions().getCount()).isEqualTo(execStartCount);
- assertThat(rs.getExecutionInfo().getQueriedHost()).isEqualTo(host1);
+ ExecutionInfo executionInfo = rs.getExecutionInfo();
+ assertThat(executionInfo.getTriedHosts()).containsOnly(host1);
+ assertThat(executionInfo.getQueriedHost()).isEqualTo(host1);
+ assertThat(executionInfo.getSpeculativeExecutions()).isEqualTo(0);
+ assertThat(executionInfo.getSuccessfulExecutionIndex()).isEqualTo(0);
}
@Test(groups = "short")
@@ -128,7 +132,11 @@
assertThat(row.getString("result")).isEqualTo("result1");
assertThat(errors.getSpeculativeExecutions().getCount()).isEqualTo(execStartCount);
assertThat(errors.getRetriesOnReadTimeout().getCount()).isEqualTo(retriesStartCount + 1);
- assertThat(rs.getExecutionInfo().getQueriedHost()).isEqualTo(host1);
+ ExecutionInfo executionInfo = rs.getExecutionInfo();
+ assertThat(executionInfo.getTriedHosts()).containsOnly(host1);
+ assertThat(executionInfo.getQueriedHost()).isEqualTo(host1);
+ assertThat(executionInfo.getSpeculativeExecutions()).isEqualTo(0);
+ assertThat(executionInfo.getSuccessfulExecutionIndex()).isEqualTo(0);
}
@Test(groups = "short")
@@ -151,7 +159,61 @@
assertThat(row.getString("result")).isEqualTo("result2");
assertThat(errors.getSpeculativeExecutions().getCount()).isEqualTo(execStartCount + 1);
- assertThat(rs.getExecutionInfo().getQueriedHost()).isEqualTo(host2);
+ ExecutionInfo executionInfo = rs.getExecutionInfo();
+ // triedHosts does not contain host1 because the request to it had not completed yet
+ assertThat(executionInfo.getTriedHosts()).containsOnly(host2);
+ assertThat(executionInfo.getQueriedHost()).isEqualTo(host2);
+ assertThat(executionInfo.getSpeculativeExecutions()).isEqualTo(1);
+ assertThat(executionInfo.getSuccessfulExecutionIndex()).isEqualTo(1);
+ }
+
+ @Test(groups = "short")
+ public void should_start_speculative_execution_on_multiple_hosts_with_zero_delay() {
+ Cluster cluster = Cluster.builder()
+ .addContactPoints(scassandras.address(2).getAddress())
+ .withPort(scassandras.getBinaryPort())
+ .withLoadBalancingPolicy(loadBalancingPolicy)
+ .withSpeculativeExecutionPolicy(new ConstantSpeculativeExecutionPolicy(0, 2))
+ .withQueryOptions(new QueryOptions().setDefaultIdempotence(true))
+ .withRetryPolicy(new CustomRetryPolicy())
+ .withNettyOptions(nonQuietClusterCloseOptions)
+ .build();
+ Session session = cluster.connect();
+ host1 = TestUtils.findHost(cluster, 1);
+ host2 = TestUtils.findHost(cluster, 2);
+ host3 = TestUtils.findHost(cluster, 3);
+ errors = cluster.getMetrics().getErrorMetrics();
+
+ scassandras.node(1).primingClient().prime(PrimingRequest.queryBuilder()
+ .withQuery("mock query")
+ .withThen(then().withRows(row("result", "result1")).withFixedDelay(1000L))
+ .build()
+ );
+
+ scassandras.node(2).primingClient().prime(PrimingRequest.queryBuilder()
+ .withQuery("mock query")
+ .withThen(then().withRows(row("result", "result2")).withFixedDelay(1000L))
+ .build()
+ );
+
+ scassandras.node(3).primingClient().prime(PrimingRequest.queryBuilder()
+ .withQuery("mock query")
+ .withThen(then().withRows(row("result", "result3")))
+ .build()
+ );
+ long execStartCount = errors.getSpeculativeExecutions().getCount();
+
+ ResultSet rs = session.execute("mock query");
+ Row row = rs.one();
+
+ assertThat(row.getString("result")).isEqualTo("result3");
+ assertThat(errors.getSpeculativeExecutions().getCount()).isEqualTo(execStartCount + 2);
+ ExecutionInfo executionInfo = rs.getExecutionInfo();
+ // triedHosts does not contain host1 because the request to it had not completed yet
+ assertThat(executionInfo.getTriedHosts()).containsOnly(host3);
+ assertThat(executionInfo.getQueriedHost()).isEqualTo(host3);
+ assertThat(executionInfo.getSpeculativeExecutions()).isEqualTo(2);
+ assertThat(executionInfo.getSuccessfulExecutionIndex()).isEqualTo(2);
}
@Test(groups = "short")
@@ -186,7 +248,11 @@
assertThat(row.getString("result")).isEqualTo("result3");
assertThat(errors.getSpeculativeExecutions().getCount()).isEqualTo(execStartCount + 1);
- assertThat(rs.getExecutionInfo().getQueriedHost()).isEqualTo(host3);
+ ExecutionInfo executionInfo = rs.getExecutionInfo();
+ assertThat(executionInfo.getTriedHosts()).containsOnly(host1, host2, host3);
+ assertThat(executionInfo.getQueriedHost()).isEqualTo(host3);
+ assertThat(executionInfo.getSpeculativeExecutions()).isEqualTo(1);
+ assertThat(executionInfo.getSuccessfulExecutionIndex()).isEqualTo(0);
}
/**
diff --git a/driver-core/src/test/java/com/datastax/driver/core/StateListenerBase.java b/driver-core/src/test/java/com/datastax/driver/core/StateListenerBase.java
index 6eac8c0..c908d19 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/StateListenerBase.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/StateListenerBase.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/StateListenerTest.java b/driver-core/src/test/java/com/datastax/driver/core/StateListenerTest.java
index f8ae022..462b8b6 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/StateListenerTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/StateListenerTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/StatementIdempotenceTest.java b/driver-core/src/test/java/com/datastax/driver/core/StatementIdempotenceTest.java
index 90da169..bea976c 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/StatementIdempotenceTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/StatementIdempotenceTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/StatementWrapperTest.java b/driver-core/src/test/java/com/datastax/driver/core/StatementWrapperTest.java
index 0fc2429..eb66da1 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/StatementWrapperTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/StatementWrapperTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -30,6 +30,9 @@
private static final String INSERT_QUERY = "insert into test (k, v) values (?, ?)";
private static final String SELECT_QUERY = "select * from test where k = ?";
+ private static final String INSERT_MULTIPAGE_QUERY = "insert into test_multipage (k, v) values (?, ?)";
+ private static final String SELECT_MULTIPAGE_QUERY = "select * from test_multipage where k = ?";
+
CustomLoadBalancingPolicy loadBalancingPolicy = new CustomLoadBalancingPolicy();
CustomSpeculativeExecutionPolicy speculativeExecutionPolicy = new CustomSpeculativeExecutionPolicy();
CustomRetryPolicy retryPolicy = new CustomRetryPolicy();
@@ -37,6 +40,7 @@
@Override
public void onTestContextInitialized() {
execute("create table test (k text primary key, v int)");
+ execute("create table test_multipage (k text, v int, primary key (k, v))");
}
@Override
@@ -60,6 +64,67 @@
}
@Test(groups = "short")
+ @CassandraVersion(value = "2.0.0")
+ public void should_reuse_wrapped_simple_statement_for_multipage_query() {
+ loadBalancingPolicy.customStatementsHandled.set(0);
+
+ for (int v = 1; v <= 100; v++)
+ session().execute(new SimpleStatement(INSERT_MULTIPAGE_QUERY, "key_simple_multipage", v));
+
+ SimpleStatement s = new SimpleStatement(SELECT_MULTIPAGE_QUERY, "key_simple_multipage");
+ s.setFetchSize(1);
+
+ CustomStatement customStatement = new CustomStatement(s);
+
+ ResultSet rs = session().execute(customStatement);
+ assertThat(loadBalancingPolicy.customStatementsHandled.get()).isEqualTo(1);
+
+ Iterator<Row> it = rs.iterator();
+
+ assertThat(it.hasNext()).isTrue();
+ it.next();
+ assertThat(rs.getExecutionInfo().getStatement()).isEqualTo(customStatement);
+ assertThat(loadBalancingPolicy.customStatementsHandled.get()).isEqualTo(1);
+
+ assertThat(it.hasNext()).isTrue();
+ it.next();
+ assertThat(rs.getExecutionInfo().getStatement()).isEqualTo(customStatement);
+
+ assertThat(loadBalancingPolicy.customStatementsHandled.get()).isEqualTo(2);
+ }
+
+ @Test(groups = "short")
+ @CassandraVersion(value = "2.0.0")
+ public void should_reuse_wrapped_bound_statement_for_multipage_query() {
+ loadBalancingPolicy.customStatementsHandled.set(0);
+
+ for (int v = 1; v <= 100; v++)
+ session().execute(new SimpleStatement(INSERT_MULTIPAGE_QUERY, "key_prepared_multipage", v));
+
+ PreparedStatement ps = session().prepare(SELECT_MULTIPAGE_QUERY);
+ BoundStatement bs = ps.bind("key_prepared_multipage");
+ bs.setFetchSize(1);
+
+ CustomStatement customStatement = new CustomStatement(bs);
+
+ ResultSet rs = session().execute(customStatement);
+ assertThat(loadBalancingPolicy.customStatementsHandled.get()).isEqualTo(1);
+
+ Iterator<Row> it = rs.iterator();
+
+ assertThat(it.hasNext()).isTrue();
+ it.next();
+ assertThat(rs.getExecutionInfo().getStatement()).isEqualTo(customStatement);
+ assertThat(loadBalancingPolicy.customStatementsHandled.get()).isEqualTo(1);
+
+ assertThat(it.hasNext()).isTrue();
+ it.next();
+ assertThat(rs.getExecutionInfo().getStatement()).isEqualTo(customStatement);
+
+ assertThat(loadBalancingPolicy.customStatementsHandled.get()).isEqualTo(2);
+ }
+
+ @Test(groups = "short")
public void should_pass_wrapped_statement_to_speculative_execution_policy() {
speculativeExecutionPolicy.customStatementsHandled.set(0);
diff --git a/driver-core/src/test/java/com/datastax/driver/core/StreamIdGeneratorTest.java b/driver-core/src/test/java/com/datastax/driver/core/StreamIdGeneratorTest.java
index af9a04f..e89ca75 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/StreamIdGeneratorTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/StreamIdGeneratorTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TableMetadataAssert.java b/driver-core/src/test/java/com/datastax/driver/core/TableMetadataAssert.java
index cd248d6..f7e7ff3 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TableMetadataAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TableMetadataAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TableMetadataCDCTest.java b/driver-core/src/test/java/com/datastax/driver/core/TableMetadataCDCTest.java
index 6c1bc3c..76faa13 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TableMetadataCDCTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TableMetadataCDCTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TableMetadataTest.java b/driver-core/src/test/java/com/datastax/driver/core/TableMetadataTest.java
index d7c96f3..6565c97 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TableMetadataTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TableMetadataTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TestListener.java b/driver-core/src/test/java/com/datastax/driver/core/TestListener.java
index 60d3a129..fc379ff 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TestListener.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TestListener.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java b/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java
index 1f86d95..5ae5818 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TestUtils.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -24,6 +24,7 @@
import com.google.common.util.concurrent.Uninterruptibles;
import com.sun.management.OperatingSystemMXBean;
import io.netty.channel.EventLoopGroup;
+import org.apache.log4j.Level;
import org.scassandra.Scassandra;
import org.scassandra.ScassandraFactory;
import org.slf4j.Logger;
@@ -916,4 +917,19 @@
return res;
}
+ public static Level setLogLevel(Class<?> logger, Level newLevel) {
+ return setLogLevel(logger.getName(), newLevel);
+ }
+
+ public static Level setLogLevel(Logger logger, Level newLevel) {
+ return setLogLevel(logger.getName(), newLevel);
+ }
+
+ public static Level setLogLevel(String logger, Level newLevel) {
+ org.apache.log4j.Logger log4jLogger = org.apache.log4j.Logger.getLogger(logger);
+ Level oldLevel = log4jLogger.getLevel();
+ log4jLogger.setLevel(newLevel);
+ return oldLevel;
+ }
+
}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ThreadLocalMonotonicTimestampGeneratorTest.java b/driver-core/src/test/java/com/datastax/driver/core/ThreadLocalMonotonicTimestampGeneratorTest.java
index 14b3b7c..4bb081e 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ThreadLocalMonotonicTimestampGeneratorTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ThreadLocalMonotonicTimestampGeneratorTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ThreadingOptionsTest.java b/driver-core/src/test/java/com/datastax/driver/core/ThreadingOptionsTest.java
index 73e84fd..637bc50 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/ThreadingOptionsTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/ThreadingOptionsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TimeoutStressTest.java b/driver-core/src/test/java/com/datastax/driver/core/TimeoutStressTest.java
index 3be087d..0599012 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TimeoutStressTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TimeoutStressTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TokenIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TokenIntegrationTest.java
index 899c225..701d06e 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TokenIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TokenIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TokenRangeAssert.java b/driver-core/src/test/java/com/datastax/driver/core/TokenRangeAssert.java
index b41e462..eff5131 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TokenRangeAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TokenRangeAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TokenRangeTest.java b/driver-core/src/test/java/com/datastax/driver/core/TokenRangeTest.java
index d0185b4..5f7e6b9 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TokenRangeTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TokenRangeTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TracingTest.java b/driver-core/src/test/java/com/datastax/driver/core/TracingTest.java
index e9b0e92..bd9531b 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TracingTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TracingTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TupleTest.java b/driver-core/src/test/java/com/datastax/driver/core/TupleTest.java
index 9bdffcc..f83664c 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TupleTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TupleTest.java
@@ -1,32 +1,32 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
-import com.beust.jcommander.internal.Lists;
-import com.datastax.driver.core.utils.CassandraVersion;
-import com.google.common.base.Joiner;
-import org.testng.annotations.Test;
-
import java.nio.ByteBuffer;
import java.util.*;
+import com.google.common.base.Joiner;
+import org.testng.annotations.Test;
+
import static org.assertj.core.api.Assertions.assertThat;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
+import com.datastax.driver.core.utils.CassandraVersion;
+
@CassandraVersion("2.1.0")
public class TupleTest extends CCMTestsSupport {
@@ -88,8 +88,6 @@
/**
* Basic test of tuple functionality.
* Original code found in python-driver:integration.standard.test_types.py:test_tuple_type
- *
- * @throws Exception
*/
@Test(groups = "short")
public void tupleTypeTest() throws Exception {
@@ -154,8 +152,6 @@
* Test tuple types of lengths of 1, 2, 3, and 384 to ensure edge cases work
* as expected.
* Original code found in python-driver:integration.standard.test_types.py:test_tuple_type_varying_lengths
- *
- * @throws Exception
*/
@Test(groups = "short")
public void tupleTestTypeVaryingLengths() throws Exception {
@@ -200,12 +196,10 @@
/**
* Ensure tuple subtypes are appropriately handled.
* Original code found in python-driver:integration.standard.test_types.py:test_tuple_subtypes
- *
- * @throws Exception
*/
@Test(groups = "short")
public void tupleSubtypesTest() throws Exception {
- List<DataType> DATA_TYPE_PRIMITIVES = Lists.newArrayList(samples.keySet());
+ List<DataType> DATA_TYPE_PRIMITIVES = new ArrayList<DataType>(samples.keySet());
session().execute("CREATE KEYSPACE test_tuple_subtypes " +
"WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor': '1'}");
session().execute("USE test_tuple_subtypes");
@@ -258,12 +252,10 @@
/**
* Ensure tuple subtypes are appropriately handled for maps, sets, and lists.
* Original code found in python-driver:integration.standard.test_types.py:test_tuple_non_primitive_subtypes
- *
- * @throws Exception
*/
@Test(groups = "short")
public void tupleNonPrimitiveSubTypesTest() throws Exception {
- List<DataType> DATA_TYPE_PRIMITIVES = Lists.newArrayList(samples.keySet());
+ List<DataType> DATA_TYPE_PRIMITIVES = new ArrayList<DataType>(samples.keySet());
session().execute("CREATE KEYSPACE test_tuple_non_primitive_subtypes " +
"WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor': '1'}");
session().execute("USE test_tuple_non_primitive_subtypes");
@@ -417,8 +409,6 @@
/**
* Ensure nested are appropriately handled.
* Original code found in python-driver:integration.standard.test_types.py:test_nested_tuples
- *
- * @throws Exception
*/
@Test(groups = "short")
public void nestedTuplesTest() throws Exception {
@@ -455,8 +445,6 @@
/**
* Test for inserting null Tuple values into UDT's
* Original code found in python-driver:integration.standard.test_types.py:test_tuples_with_nulls
- *
- * @throws Exception
*/
@Test(groups = "short")
public void testTuplesWithNulls() throws Exception {
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecAssert.java b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecAssert.java
index 2afd1bf..c0a4305 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecCollectionsIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecCollectionsIntegrationTest.java
index 2460578..094e052 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecCollectionsIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecCollectionsIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecEncapsulationIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecEncapsulationIntegrationTest.java
index de3fd05..c1dba31 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecEncapsulationIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecEncapsulationIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecNestedCollectionsIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecNestedCollectionsIntegrationTest.java
index 07306c4..fa2a9b0 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecNestedCollectionsIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecNestedCollectionsIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecNestedUDTAndTupleIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecNestedUDTAndTupleIntegrationTest.java
index 35930c5..b9ed227 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecNestedUDTAndTupleIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecNestedUDTAndTupleIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecNumbersIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecNumbersIntegrationTest.java
index 1d03380..5f2851b 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecNumbersIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecNumbersIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecOverlappingJavaTypeIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecOverlappingJavaTypeIntegrationTest.java
index 7798f9b..3e3a623 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecOverlappingJavaTypeIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecOverlappingJavaTypeIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecTest.java b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecTest.java
index 1a499b2..7fc81fa 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecTupleIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecTupleIntegrationTest.java
index c15074a..1d3aff4 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecTupleIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecTupleIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecUDTIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecUDTIntegrationTest.java
index 2d7f0ae..ce36e5c 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/TypeCodecUDTIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/TypeCodecUDTIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/UnresolvedUserTypeTest.java b/driver-core/src/test/java/com/datastax/driver/core/UnresolvedUserTypeTest.java
index 610a522..ba7ae18 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/UnresolvedUserTypeTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/UnresolvedUserTypeTest.java
@@ -1,31 +1,72 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
import com.datastax.driver.core.utils.CassandraVersion;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
import org.testng.annotations.Test;
-import java.util.concurrent.ExecutionException;
-
import static com.datastax.driver.core.Assertions.assertThat;
-import static com.datastax.driver.core.DataType.*;
+import static com.datastax.driver.core.DataType.cint;
+import static com.datastax.driver.core.DataType.list;
+import static com.datastax.driver.core.DataType.map;
+import static com.datastax.driver.core.DataType.set;
@CassandraVersion("3.0")
public class UnresolvedUserTypeTest extends CCMTestsSupport {
+ private static final String KEYSPACE = "unresolved_user_type_test";
+
+ private static final String EXPECTED_SCHEMA = String.format("CREATE KEYSPACE %s WITH REPLICATION = { 'class' : 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1' } AND DURABLE_WRITES = true;\n" +
+ "\n" +
+ "CREATE TYPE %s.g (\n" +
+ " f1 int\n" +
+ ");\n" +
+ "\n" +
+ "CREATE TYPE %s.h (\n" +
+ " f1 int\n" +
+ ");\n" +
+ "\n" +
+ "CREATE TYPE %s.\"E\" (\n" +
+ " f1 frozen<list<frozen<%s.g>>>\n" +
+ ");\n" +
+ "\n" +
+ "CREATE TYPE %s.\"F\" (\n" +
+ " f1 frozen<%s.h>\n" +
+ ");\n" +
+ "\n" +
+ "CREATE TYPE %s.\"D\" (\n" +
+ " f1 frozen<tuple<\"F\", g, h>>\n" +
+ ");\n" +
+ "\n" +
+ "CREATE TYPE %s.\"B\" (\n" +
+ " f1 frozen<set<frozen<%s.\"D\">>>\n" +
+ ");\n" +
+ "\n" +
+ "CREATE TYPE %s.\"C\" (\n" +
+ " f1 frozen<map<frozen<%s.\"E\">, frozen<%s.\"D\">>>\n" +
+ ");\n" +
+ "\n" +
+ "CREATE TYPE %s.\"A\" (\n" +
+ " f1 frozen<%s.\"C\">\n" +
+ ");\n", KEYSPACE, KEYSPACE, KEYSPACE, KEYSPACE, KEYSPACE, KEYSPACE, KEYSPACE, KEYSPACE, KEYSPACE,
+ KEYSPACE, KEYSPACE, KEYSPACE, KEYSPACE, KEYSPACE, KEYSPACE);
+
@Override
public void onTestContextInitialized() {
execute(
@@ -43,16 +84,17 @@
|
A
- Topological sort order should be : GH,FE,D,CB,A
+ Topological sort order should be : gh,FE,D,CB,A
*/
- String.format("CREATE TYPE %s.h (f1 int)", keyspace),
- String.format("CREATE TYPE %s.g (f1 int)", keyspace),
- String.format("CREATE TYPE %s.\"F\" (f1 frozen<h>)", keyspace),
- String.format("CREATE TYPE %s.\"E\" (f1 frozen<list<g>>)", keyspace),
- String.format("CREATE TYPE %s.\"D\" (f1 frozen<tuple<\"F\",g,h>>)", keyspace),
- String.format("CREATE TYPE %s.\"C\" (f1 frozen<map<\"E\",\"D\">>)", keyspace),
- String.format("CREATE TYPE %s.\"B\" (f1 frozen<set<\"D\">>)", keyspace),
- String.format("CREATE TYPE %s.\"A\" (f1 frozen<\"C\">)", keyspace)
+ "CREATE KEYSPACE unresolved_user_type_test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}",
+ String.format("CREATE TYPE %s.h (f1 int)", KEYSPACE),
+ String.format("CREATE TYPE %s.g (f1 int)", KEYSPACE),
+ String.format("CREATE TYPE %s.\"F\" (f1 frozen<h>)", KEYSPACE),
+ String.format("CREATE TYPE %s.\"E\" (f1 frozen<list<g>>)", KEYSPACE),
+ String.format("CREATE TYPE %s.\"D\" (f1 frozen<tuple<\"F\",g,h>>)", KEYSPACE),
+ String.format("CREATE TYPE %s.\"C\" (f1 frozen<map<\"E\",\"D\">>)", KEYSPACE),
+ String.format("CREATE TYPE %s.\"B\" (f1 frozen<set<\"D\">>)", KEYSPACE),
+ String.format("CREATE TYPE %s.\"A\" (f1 frozen<\"C\">)", KEYSPACE)
);
}
@@ -73,7 +115,7 @@
}
private void checkUserTypes(Metadata metadata) {
- KeyspaceMetadata keyspaceMetadata = metadata.getKeyspace(keyspace);
+ KeyspaceMetadata keyspaceMetadata = metadata.getKeyspace(KEYSPACE);
UserType a = keyspaceMetadata.getUserType("\"A\"");
UserType b = keyspaceMetadata.getUserType("\"B\"");
@@ -92,5 +134,19 @@
assertThat(f).hasField("f1", h);
assertThat(g).hasField("f1", cint());
assertThat(h).hasField("f1", cint());
+
+ // JAVA-1407: ensure udts are listed in topological order
+ List<UserType> userTypes = new ArrayList<UserType>(keyspaceMetadata.getUserTypes());
+
+ assertThat(userTypes.subList(0, 2)).containsOnly(g, h);
+ assertThat(userTypes.subList(2, 4)).containsOnly(e, f);
+ assertThat(userTypes.subList(4, 5)).containsOnly(d);
+ assertThat(userTypes.subList(5, 7)).containsOnly(b, c);
+ assertThat(userTypes.subList(7, 8)).containsOnly(a);
+
+ String script = keyspaceMetadata.exportAsString();
+
+ // validate against a strict expectation that the schema is exactly as defined.
+ assertThat(script).isEqualTo(EXPECTED_SCHEMA);
}
}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/UserTypesTest.java b/driver-core/src/test/java/com/datastax/driver/core/UserTypesTest.java
index 780e2bd..6751fe1 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/UserTypesTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/UserTypesTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/VersionNumberAssert.java b/driver-core/src/test/java/com/datastax/driver/core/VersionNumberAssert.java
index e1614e7..9bfa3e7 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/VersionNumberAssert.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/VersionNumberAssert.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/VersionNumberTest.java b/driver-core/src/test/java/com/datastax/driver/core/VersionNumberTest.java
index adea816..c6127a7 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/VersionNumberTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/VersionNumberTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
@@ -98,6 +98,15 @@
assertOrder("2.0.0+build01", "2.0.0+build02", 0);
}
+ @Test(groups = "unit")
+ public void should_treat_same_prerelease_equal() {
+ VersionNumber version1 = VersionNumber.parse("3.0.15-SNAPSHOT");
+ VersionNumber version2 = VersionNumber.parse("3.0.15-SNAPSHOT");
+
+ assertThat(version1).isEqualTo(version2);
+ assertThat(version1.hashCode()).isEqualTo(version2.hashCode());
+ }
+
private void assertOrder(String version1, String version2, int expected) {
assertThat(VersionNumber.parse(version1).compareTo(VersionNumber.parse(version2))).isEqualTo(expected);
}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java b/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java
index addd79e..190b728 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ConnectionExceptionTest.java b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ConnectionExceptionTest.java
index d14b52f..eb322a1 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ConnectionExceptionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ConnectionExceptionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsScassandraTest.java b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsScassandraTest.java
index fc905c4..daa3347 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsScassandraTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsScassandraTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsTest.java b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsTest.java
index dfe2150..d5b1808 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ExceptionsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/exceptions/FunctionExecutionExceptionTest.java b/driver-core/src/test/java/com/datastax/driver/core/exceptions/FunctionExecutionExceptionTest.java
index a7c234a..a69a3f1 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/exceptions/FunctionExecutionExceptionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/exceptions/FunctionExecutionExceptionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/exceptions/NoHostAvailableExceptionTest.java b/driver-core/src/test/java/com/datastax/driver/core/exceptions/NoHostAvailableExceptionTest.java
index 79a2ff7..88fd09f 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/exceptions/NoHostAvailableExceptionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/exceptions/NoHostAvailableExceptionTest.java
@@ -1,27 +1,27 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
-import com.beust.jcommander.internal.Maps;
-import org.testng.annotations.Test;
-
import java.io.PrintWriter;
import java.net.InetSocketAddress;
+import java.util.HashMap;
import java.util.Map;
+import org.testng.annotations.Test;
+
import static org.assertj.core.api.Assertions.assertThat;
public class NoHostAvailableExceptionTest {
@@ -67,7 +67,7 @@
}
private static Map<InetSocketAddress, Throwable> buildMockErrors(int count) {
- Map<InetSocketAddress, Throwable> errors = Maps.newHashMap();
+ Map<InetSocketAddress, Throwable> errors = new HashMap<InetSocketAddress, Throwable>();
for (int i = 1; i <= count; i++) {
errors.put(new InetSocketAddress("127.0.0." + i, 9042), new MockError(i));
}
@@ -87,4 +87,4 @@
writer.printf("mock stack trace %d", i);
}
}
-}
\ No newline at end of file
+}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ReadWriteFailureExceptionTest.java b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ReadWriteFailureExceptionTest.java
index ed2a497..4d92f13 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/exceptions/ReadWriteFailureExceptionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/exceptions/ReadWriteFailureExceptionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.exceptions;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/AbstractRetryPolicyIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/AbstractRetryPolicyIntegrationTest.java
index 606d3ca..0c505d3 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/AbstractRetryPolicyIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/AbstractRetryPolicyIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/CloseableLoadBalancingPolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/CloseableLoadBalancingPolicyTest.java
index a5ac2c1..3b64a23 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/CloseableLoadBalancingPolicyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/CloseableLoadBalancingPolicyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/CustomRetryPolicyIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/CustomRetryPolicyIntegrationTest.java
index 6df66f1..de24112 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/CustomRetryPolicyIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/CustomRetryPolicyIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java
index 12bc23a..20ed08c 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/DCAwareRoundRobinPolicyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/DefaultRetryPolicyIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/DefaultRetryPolicyIntegrationTest.java
index 77df6b6..11084ae 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/DefaultRetryPolicyIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/DefaultRetryPolicyIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/DelegatingLoadBalancingPolicy.java b/driver-core/src/test/java/com/datastax/driver/core/policies/DelegatingLoadBalancingPolicy.java
index bb30f29..5803766 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/DelegatingLoadBalancingPolicy.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/DelegatingLoadBalancingPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/DelegatingSpeculativeExecutionPolicy.java b/driver-core/src/test/java/com/datastax/driver/core/policies/DelegatingSpeculativeExecutionPolicy.java
index 6ae9b8f..e60c24e 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/DelegatingSpeculativeExecutionPolicy.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/DelegatingSpeculativeExecutionPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/DowngradingConsistencyRetryPolicyIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/DowngradingConsistencyRetryPolicyIntegrationTest.java
index b119866..891c1b9 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/DowngradingConsistencyRetryPolicyIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/DowngradingConsistencyRetryPolicyIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslatorTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslatorTest.java
index 95a7153..0143416 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslatorTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslatorTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/ErrorAwarePolicyIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/ErrorAwarePolicyIntegrationTest.java
index 729b8d8..9e01658 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/ErrorAwarePolicyIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/ErrorAwarePolicyIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/FallthroughRetryPolicyIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/FallthroughRetryPolicyIntegrationTest.java
index ae1eda5..45eb5be 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/FallthroughRetryPolicyIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/FallthroughRetryPolicyIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/HostFilterPolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/HostFilterPolicyTest.java
index f5a38fb..1107760 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/HostFilterPolicyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/HostFilterPolicyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/IdempotenceAwareRetryPolicyIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/IdempotenceAwareRetryPolicyIntegrationTest.java
index b1d4409..d473b02 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/IdempotenceAwareRetryPolicyIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/IdempotenceAwareRetryPolicyIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/LatencyAwarePolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/LatencyAwarePolicyTest.java
index ce2ddd5..8604202 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/LatencyAwarePolicyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/LatencyAwarePolicyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/LimitingLoadBalancingPolicy.java b/driver-core/src/test/java/com/datastax/driver/core/policies/LimitingLoadBalancingPolicy.java
index 8b869cd..ab14972 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/LimitingLoadBalancingPolicy.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/LimitingLoadBalancingPolicy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/LoggingRetryPolicyIntegrationTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/LoggingRetryPolicyIntegrationTest.java
index a8d0f50..147f278 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/LoggingRetryPolicyIntegrationTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/LoggingRetryPolicyIntegrationTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
@@ -110,7 +110,7 @@
}
@Test(groups = "short")
- public void should_log_ignored_unavailabe() throws InterruptedException {
+ public void should_log_ignored_unavailable() throws InterruptedException {
simulateError(1, unavailable);
retryDecision = ignore();
query();
@@ -133,7 +133,7 @@
retryDecision = ignore();
query();
String line = appender.waitAndGet(5000);
- assertThat(line.trim()).isEqualTo(expectedMessage(IGNORING_REQUEST_ERROR, defaultCL, 0, new ServerError(host1.getSocketAddress(), "Server Error")));
+ assertThat(line.trim()).isEqualTo(expectedMessage(IGNORING_REQUEST_ERROR, defaultCL, 0, new ServerError(host1.getSocketAddress(), "Server Error").toString()));
}
@Test(groups = "short")
@@ -142,7 +142,7 @@
retryDecision = tryNextHost(LOCAL_ONE);
query();
String line = appender.waitAndGet(5000);
- assertThat(line.trim()).isEqualTo(expectedMessage(RETRYING_ON_REQUEST_ERROR, "next host", LOCAL_ONE, defaultCL, 0, new ServerError(host1.getSocketAddress(), "Server Error")));
+ assertThat(line.trim()).isEqualTo(expectedMessage(RETRYING_ON_REQUEST_ERROR, "next host", LOCAL_ONE, defaultCL, 0, new ServerError(host1.getSocketAddress(), "Server Error").toString()));
}
@Test(groups = "short")
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/RetryDecisionTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/RetryDecisionTest.java
index 6b653f8..00e192b 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/RetryDecisionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/RetryDecisionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/RollingCountTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/RollingCountTest.java
index fe80b41..5db8a80 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/RollingCountTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/RollingCountTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/RoundRobinPolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/RoundRobinPolicyTest.java
index da8e2a1..073b313 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/RoundRobinPolicyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/RoundRobinPolicyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/TokenAwarePolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/TokenAwarePolicyTest.java
index 948067c..5a5810c 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/TokenAwarePolicyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/TokenAwarePolicyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/policies/WhiteListPolicyTest.java b/driver-core/src/test/java/com/datastax/driver/core/policies/WhiteListPolicyTest.java
index 366b515..537dd8b 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/policies/WhiteListPolicyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/policies/WhiteListPolicyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.policies;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/BatchIdempotencyTest.java b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/BatchIdempotencyTest.java
index 141a6ec..76b4ff9 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/BatchIdempotencyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/BatchIdempotencyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilder21ExecutionTest.java b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilder21ExecutionTest.java
index 832d6f7..dd73519 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilder21ExecutionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilder21ExecutionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java
index 0519c04..5fb775d 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java
@@ -1,21 +1,22 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
import com.datastax.driver.core.*;
+import com.datastax.driver.core.exceptions.InvalidQueryException;
import com.datastax.driver.core.utils.CassandraVersion;
import org.assertj.core.api.iterable.Extractor;
import org.testng.annotations.Test;
@@ -34,8 +35,8 @@
public class QueryBuilderExecutionTest extends CCMTestsSupport {
- private static final String TABLE1 = "test1";
- private static final String TABLE2 = "test2";
+ private static final String TABLE1 = TestUtils.generateIdentifier("test1");
+ private static final String TABLE2 = TestUtils.generateIdentifier("test2");
@Override
public void onTestContextInitialized() {
@@ -385,4 +386,243 @@
row(2, 3, 3));
}
+ /**
+ * Validates that {@link QueryBuilder} can construct an INSERT INTO ... JSON query using the 'DEFAULT UNSET/NULL' clause.
+ *
+ * @test_category queries:builder
+ * @jira_ticket JAVA-1446
+ * @since 3.3.0
+ */
+ @CassandraVersion(value = "3.10", description = "Support for DEFAULT UNSET/NULL was added to C* 3.10 (CASSANDRA-11424)")
+ @Test(groups = "short")
+ public void should_support_insert_json_with_default_unset_and_default_null() throws Throwable {
+
+ String table = TestUtils.generateIdentifier("table");
+ execute(
+ String.format("CREATE TABLE %s (k int primary key, v1 int, v2 int)", table),
+ String.format("INSERT INTO %s JSON '{\"k\": 0, \"v1\": 0, \"v2\": 0}'", table)
+ );
+
+ // leave v1 unset
+ session().execute(session().prepare(insertInto(table).json(bindMarker()).defaultUnset()).bind("{\"k\": 0, \"v2\": 2}"));
+ assertThat(session().execute(select().from(table))).containsExactly(
+ row(0, 0, 2)
+ );
+
+ // explicit specification DEFAULT NULL
+ session().execute(session().prepare(insertInto(table).json(bindMarker()).defaultNull()).bind("{\"k\": 0, \"v2\": 2}"));
+ assertThat(session().execute(select().from(table))).containsExactly(
+ row(0, null, 2)
+ );
+
+ // implicitly setting v2 to null
+ session().execute(session().prepare(insertInto(table).json(bindMarker()).defaultNull()).bind("{\"k\": 0}"));
+ assertThat(session().execute(select().from(table))).containsExactly(
+ row(0, null, null)
+ );
+
+ // mix setting null explicitly with default unset:
+ // set values for all fields
+ session().execute(session().prepare(insertInto(table).json(bindMarker())).bind("{\"k\": 1, \"v1\": 1, \"v2\": 1}"));
+ // explicitly set v1 to null while leaving v2 unset which retains its value
+ session().execute(session().prepare(insertInto(table).json(bindMarker()).defaultUnset()).bind("{\"k\": 1, \"v1\": null}"));
+ assertThat(session().execute(select().from(table).where(eq("k", 1)))).containsExactly(
+ row(1, null, 1)
+ );
+
+ // test string literal instead of bind marker
+ session().execute(insertInto(table).json("{\"k\": 2, \"v1\": 2, \"v2\": 2}"));
+ // explicitly set v1 to null while leaving v2 unset which retains its value
+ session().execute(insertInto(table).json("{\"k\": 2, \"v1\": null}").defaultUnset());
+ assertThat(session().execute(select().from(table).where(eq("k", 2)))).containsExactly(
+ row(2, null, 2)
+ );
+ session().execute(insertInto(table).json("{\"k\": 2}").defaultNull());
+ assertThat(session().execute(select().from(table).where(eq("k", 2)))).containsExactly(
+ row(2, null, null)
+ );
+ }
+
+ /**
+ * Validates that {@link QueryBuilder} can construct a query using the 'GROUP BY' clause.
+ *
+ * @test_category queries:builder
+ * @jira_ticket JAVA-1443
+ * @since 3.3.0
+ */
+ @CassandraVersion(value = "3.10", description = "Support for GROUP BY was added to C* 3.10 (CASSANDRA-10707)")
+ @Test(groups = "short")
+ public void should_support_group_by() throws Exception {
+ String table = TestUtils.generateIdentifier("table");
+ execute(String.format("CREATE TABLE %s (a int, b int, c int, d int, e int, primary key (a, b, c, d))", table));
+
+ execute(
+ String.format("INSERT INTO %s (a, b, c, d, e) VALUES (1, 2, 1, 3, 6)", table),
+ String.format("INSERT INTO %s (a, b, c, d, e) VALUES (1, 2, 2, 6, 12)", table),
+ String.format("INSERT INTO %s (a, b, c, d, e) VALUES (1, 3, 2, 12, 24)", table),
+ String.format("INSERT INTO %s (a, b, c, d, e) VALUES (1, 4, 2, 12, 24)", table),
+ String.format("INSERT INTO %s (a, b, c, d, e) VALUES (1, 4, 2, 6, 12)", table),
+ String.format("INSERT INTO %s (a, b, c, d, e) VALUES (2, 2, 3, 3, 6)", table),
+ String.format("INSERT INTO %s (a, b, c, d, e) VALUES (2, 4, 3, 6, 12)", table),
+ String.format("INSERT INTO %s (a, b, c, d, e) VALUES (3, 3, 2, 12, 24)", table),
+ String.format("INSERT INTO %s (a, b, c, d, e) VALUES (4, 8, 2, 12, 24)", table)
+ );
+
+ // Make sure that we have some tombstones
+ execute(
+ String.format("DELETE FROM %s WHERE a = 1 AND b = 3 AND c = 2 AND d = 12", table),
+ String.format("DELETE FROM %s WHERE a = 3", table));
+
+ // Range queries
+ assertThat(session().execute(select("a", "b", "e", count("b"), max("e")).from(table).where(eq("b", 2)).groupBy("a", "b").allowFiltering())).containsExactly(
+ row(1, 2, 6, 2L, 12),
+ row(2, 2, 6, 1L, 6));
+
+ // Range query with LIMIT
+ assertThat(session().execute(select("a", "b", "e", count("b"), max("e")).from(table).groupBy("a", "b").limit(2))).containsExactly(
+ row(1, 2, 6, 2L, 12),
+ row(1, 4, 12, 2L, 24));
+
+ // Range queries with PER PARTITION LIMIT
+ assertThat(session().execute(select("a", "b", "e", count("b"), max("e")).from(table).groupBy("a", "b").perPartitionLimit(1))).containsExactly(
+ row(1, 2, 6, 2L, 12),
+ row(2, 2, 6, 1L, 6),
+ row(4, 8, 24, 1L, 24));
+
+ // Range query with PER PARTITION LIMIT and LIMIT
+ assertThat(session().execute(select("a", "b", "e", count("b"), max("e")).from(table).groupBy("a", "b").perPartitionLimit(1).limit(2))).containsExactly(
+ row(1, 2, 6, 2L, 12),
+ row(2, 2, 6, 1L, 6));
+
+ // Range query with DISTINCT
+ assertThat(session().execute(select("a", count("a")).distinct().from(table).groupBy("a"))).containsExactly(
+ row(1, 1L),
+ row(2, 1L),
+ row(4, 1L));
+
+ // Range query with DISTINCT and LIMIT
+ assertThat(session().execute(select("a", count("a")).distinct().from(table).groupBy("a").limit(2))).containsExactly(
+ row(1, 1L),
+ row(2, 1L));
+
+ // Single partition queries
+ assertThat(session().execute(select("a", "b", "e", count("b"), max("e")).from(table).where(eq("a", 1)).groupBy("a", "b", "c"))).containsExactly(
+ row(1, 2, 6, 1L, 6),
+ row(1, 2, 12, 1L, 12),
+ row(1, 4, 12, 2L, 24));
+
+ // Single partition queries with DISTINCT
+ assertThat(session().execute(select("a", count("a")).distinct().from(table).where(eq("a", 1)).groupBy("a"))).containsExactly(
+ row(1, 1L));
+
+ // Single partition queries with LIMIT
+ assertThat(session().execute(select("a", "b", "e", count("b"), max("e")).from(table).where(eq("a", 1)).groupBy("a", "b", "c").limit(2))).containsExactly(
+ row(1, 2, 6, 1L, 6),
+ row(1, 2, 12, 1L, 12));
+
+ // Single partition queries with PER PARTITION LIMIT
+ assertThat(session().execute(select("a", "b", "e", count("b"), max("e")).from(table).where(eq("a", 1)).groupBy("a", "b", "c").perPartitionLimit(2))).containsExactly(
+ row(1, 2, 6, 1L, 6),
+ row(1, 2, 12, 1L, 12));
+
+ // Single partition queries with ORDER BY
+ assertThat(session().execute(select("a", "b", "e", count("b"), max("e")).from(table).where(eq("a", 1)).groupBy("a", "b", "c").orderBy(desc("b"), desc("c")))).containsExactly(
+ row(1, 4, 24, 2L, 24),
+ row(1, 2, 12, 1L, 12),
+ row(1, 2, 6, 1L, 6));
+
+ // Single partition queries with ORDER BY and PER PARTITION LIMIT
+ assertThat(session().execute(select("a", "b", "e", count("b"), max("e")).from(table).where(eq("a", 1)).groupBy("a", "b", "c").orderBy(desc("b"), desc("c")).perPartitionLimit(1))).containsExactly(
+ row(1, 4, 24, 2L, 24));
+
+ // Single partition queries with ORDER BY and LIMIT
+ assertThat(session().execute(select("a", "b", "e", count("b"), max("e")).from(table).where(eq("a", 1)).groupBy("a", "b", "c").orderBy(desc("b"), desc("c")).limit(2))).containsExactly(
+ row(1, 4, 24, 2L, 24),
+ row(1, 2, 12, 1L, 12));
+
+ // Multi-partitions queries
+ assertThat(session().execute(select("a", "b", "e", count("b"), max("e")).from(table).where(in("a", 1, 2, 4)).and(eq("b", 2)).groupBy("a", "b", "c"))).containsExactly(
+ row(1, 2, 6, 1L, 6),
+ row(1, 2, 12, 1L, 12),
+ row(2, 2, 6, 1L, 6));
+
+ // Multi-partitions query with DISTINCT
+ assertThat(session().execute(select("a", count("a")).distinct().from(table).where(in("a", 1, 2, 4)).groupBy("a"))).containsExactly(
+ row(1, 1L),
+ row(2, 1L),
+ row(4, 1L));
+
+ // Multi-partitions query with DISTINCT and LIMIT
+ assertThat(session().execute(select("a", count("a")).distinct().from(table).where(in("a", 1, 2, 4)).groupBy("a").limit(2))).containsExactly(
+ row(1, 1L),
+ row(2, 1L));
+
+ // Multi-partitions queries with PER PARTITION LIMIT
+ assertThat(session().execute(select("a", "b", "e", count("b"), max("e")).from(table).where(in("a", 1, 2, 4)).groupBy("a", "b", "c").perPartitionLimit(1))).containsExactly(
+ row(1, 2, 6, 1L, 6),
+ row(2, 2, 6, 1L, 6),
+ row(4, 8, 24, 1L, 24));
+
+ assertThat(session().execute(select("a", "b", "e", count("b"), max("e")).from(table).where(in("a", 1, 2, 4)).groupBy("a", "b", "c").perPartitionLimit(2))).containsExactly(
+ row(1, 2, 6, 1L, 6),
+ row(1, 2, 12, 1L, 12),
+ row(2, 2, 6, 1L, 6),
+ row(2, 4, 12, 1L, 12),
+ row(4, 8, 24, 1L, 24));
+
+ // Multi-partitions queries with ORDER BY
+ assertThat(session().execute(select("a", "b", "c", count("b"), max("e")).from(table).where(in("a", 1, 2, 4)).groupBy("a", "b").orderBy(desc("b"), desc("c")).setFetchSize(Integer.MAX_VALUE))).containsExactly(
+ row(4, 8, 2, 1L, 24),
+ row(2, 4, 3, 1L, 12),
+ row(1, 4, 2, 2L, 24),
+ row(2, 2, 3, 1L, 6),
+ row(1, 2, 2, 2L, 12));
+
+ // Multi-partitions queries with ORDER BY and LIMIT
+ assertThat(session().execute(select("a", "b", "c", "d").from(table).where(in("a", 1, 2, 4)).groupBy("a", "b").orderBy(desc("b"), desc("c")).limit(3).setFetchSize(Integer.MAX_VALUE))).containsExactly(
+ row(4, 8, 2, 12),
+ row(2, 4, 3, 6),
+ row(1, 4, 2, 12));
+
+ try {
+ session().execute(select().column("a").column("b").as("clustering1").max("c").from(table).where(eq("a", 1)).groupBy("a", "clustering1"));
+ fail("Expecting IQE");
+ } catch (InvalidQueryException e) {
+ assertThat(e.getMessage()).isEqualTo("Undefined column name clustering1");
+ }
+
+ try {
+ session().execute(select().column("a").column("b").max("c").from(table).where(eq("a", 1)).groupBy("a", "b", "z"));
+ fail("Expecting IQE");
+ } catch (InvalidQueryException e) {
+ assertThat(e.getMessage()).isEqualTo("Undefined column name z");
+ }
+
+ // Test with composite partition key
+ table = TestUtils.generateIdentifier("table");
+ execute(String.format("CREATE TABLE %s (a int, b int, c int, d int, e int, primary key ((a, b), c, d))", table));
+
+ execute(
+ String.format("INSERT INTO %s (a, b, c, d, e) VALUES (1, 1, 1, 3, 6)", table),
+ String.format("INSERT INTO %s (a, b, c, d, e) VALUES (1, 1, 2, 6, 12)", table),
+ String.format("INSERT INTO %s (a, b, c, d, e) VALUES (1, 1, 3, 12, 24)", table),
+ String.format("INSERT INTO %s (a, b, c, d, e) VALUES (1, 2, 1, 12, 24)", table),
+ String.format("INSERT INTO %s (a, b, c, d, e) VALUES (1, 2, 2, 6, 12)", table)
+ );
+
+ try {
+ session().execute(select().column("a").column("b").max("d").from(table).groupBy("a"));
+ fail("Expecting IQE");
+ } catch (InvalidQueryException e) {
+ assertThat(e.getMessage()).isEqualTo("Group by is not supported on only a part of the partition key");
+ }
+
+ assertThat(session().execute(select("a", "b", max("d")).from(table).groupBy("a", "b"))).containsExactly(
+ row(1, 2, 12),
+ row(1, 1, 12));
+
+ assertThat(session().execute(select("a", "b", max("d")).from(table).where(eq("a", 1)).and(eq("b", 1)).groupBy("b"))).containsExactly(
+ row(1, 1, 12));
+ }
+
}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderITest.java b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderITest.java
index 5327d9e..c2fd604 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderITest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderITest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderRoutingKeyTest.java b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderRoutingKeyTest.java
index e1fe837..03bba01 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderRoutingKeyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderRoutingKeyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderTest.java b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderTest.java
index 1c8b681..7e12036 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
@@ -166,6 +166,13 @@
}
try {
+ select().from("foo").orderBy();
+ fail("Expected an IllegalArgumentException");
+ } catch (IllegalArgumentException e) {
+ assertEquals(e.getMessage(), "Invalid ORDER BY argument, the orderings must not be empty.");
+ }
+
+ try {
select().column("a").all().from("foo");
fail("Expected an IllegalStateException");
} catch (IllegalStateException e) {
@@ -604,6 +611,10 @@
select = select("a", "b").from("foo").where(in("a", "b", "c'); --comment"));
assertEquals(select.toString(), query);
+ query = "SELECT a,b FROM foo WHERE a IN ('a','b','c');";
+ select = select("a", "b").from("foo").where(in("a", Sets.newLinkedHashSet(Arrays.asList("a", "b", "c"))));
+ assertEquals(select.toString(), query);
+
// User Injection?
query = "SELECT * FROM bar; --(b) FROM foo;";
select = select().fcall("* FROM bar; --", column("b")).from("foo");
@@ -810,7 +821,7 @@
@Test(groups = "unit", expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Too many values for IN clause, the maximum allowed is 65535")
public void should_fail_if_compound_in_clause_has_too_many_values() {
- List<Object> values = Collections.<Object>nCopies(65536, "a");
+ List<Object> values = Collections.<Object>nCopies(65536, bindMarker());
select().all().from("foo").where(eq("k", 4)).and(in(ImmutableList.of("name"), values));
}
@@ -1109,6 +1120,12 @@
assertThat(
insertInto("users").json(bindMarker("json")).toString())
.isEqualTo("INSERT INTO users JSON :json;");
+ assertThat(
+ insertInto("example").json("{\"id\": 0, \"tupleval\": [1, \"abc\"], \"numbers\": [1, 2, 3], \"letters\": [\"a\", \"b\", \"c\"]}").defaultNull().toString())
+ .isEqualTo("INSERT INTO example JSON '{\"id\": 0, \"tupleval\": [1, \"abc\"], \"numbers\": [1, 2, 3], \"letters\": [\"a\", \"b\", \"c\"]}' DEFAULT NULL;");
+ assertThat(
+ insertInto("example").json("{\"id\": 0, \"tupleval\": [1, \"abc\"], \"numbers\": [1, 2, 3], \"letters\": [\"a\", \"b\", \"c\"]}").defaultUnset().toString())
+ .isEqualTo("INSERT INTO example JSON '{\"id\": 0, \"tupleval\": [1, \"abc\"], \"numbers\": [1, 2, 3], \"letters\": [\"a\", \"b\", \"c\"]}' DEFAULT UNSET;");
}
@Test(groups = "unit")
@@ -1119,6 +1136,12 @@
assertThat(
select().distinct().toJson("id").as("id").from("users").toString())
.isEqualTo("SELECT DISTINCT toJson(id) AS id FROM users;");
+ assertThat(
+ select(alias(toJson("id"), "id"), alias(toJson("age"), "age")).from("users").toString())
+ .isEqualTo("SELECT toJson(id) AS id,toJson(age) AS age FROM users;");
+ assertThat(
+ select(alias(toJson("id"), "id")).distinct().from("users").toString())
+ .isEqualTo("SELECT DISTINCT toJson(id) AS id FROM users;");
}
@Test(groups = "unit")
@@ -1239,4 +1262,44 @@
.isEqualTo("SELECT a.\"B\",c.\"D\" FROM tbl;");
}
+ /**
+ * @test_category queries:builder
+ * @jira_ticket JAVA-1443
+ * @jira_ticket CASSANDRA-10707
+ */
+ @Test(groups = "unit")
+ public void should_handle_group_by_clause() {
+ assertThat(
+ select().all().from("foo").groupBy("c1", column("c2"), raw("c3")).toString())
+ .isEqualTo("SELECT * FROM foo GROUP BY c1,c2,c3;");
+ assertThat(
+ select().all().from("foo").groupBy("c1", column("c2"), raw("c3")).orderBy(asc("c1")).toString())
+ .isEqualTo("SELECT * FROM foo GROUP BY c1,c2,c3 ORDER BY c1 ASC;");
+ assertThat(
+ select().all().from("foo").where(eq("x", 42)).groupBy("c1", column("c2"), raw("c3")).toString())
+ .isEqualTo("SELECT * FROM foo WHERE x=42 GROUP BY c1,c2,c3;");
+ assertThat(
+ select().all().from("foo").where(eq("x", 42)).groupBy("c1", column("c2"), raw("c3")).orderBy(asc("c1")).toString())
+ .isEqualTo("SELECT * FROM foo WHERE x=42 GROUP BY c1,c2,c3 ORDER BY c1 ASC;");
+ try {
+ select().all().from("foo").groupBy("foo").groupBy("bar");
+ fail("Should not allow GROUP BY twice");
+ } catch (IllegalStateException e) {
+ assertThat(e).hasMessage("A GROUP BY clause has already been provided");
+ }
+ }
+
+ /**
+ * @test_category queries:builder
+ */
+ @Test(groups = "unit")
+ public void should_handle_allow_filtering() {
+ assertThat(
+ select().all().from("foo").allowFiltering().toString())
+ .isEqualTo("SELECT * FROM foo ALLOW FILTERING;");
+ assertThat(
+ select().all().from("foo").where(eq("x", 42)).allowFiltering().toString())
+ .isEqualTo("SELECT * FROM foo WHERE x=42 ALLOW FILTERING;");
+ }
+
}
diff --git a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderTupleExecutionTest.java b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderTupleExecutionTest.java
index 3a63f8b..6db041c 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderTupleExecutionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderTupleExecutionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderUDTExecutionTest.java b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderUDTExecutionTest.java
index b648ccb..85a91f4 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderUDTExecutionTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderUDTExecutionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.querybuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/AlterKeyspaceTest.java b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/AlterKeyspaceTest.java
index 26b8828..534bd28 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/AlterKeyspaceTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/AlterKeyspaceTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/AlterTest.java b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/AlterTest.java
index 263222b..3deb2ef 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/AlterTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/AlterTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CompactionOptionsTest.java b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CompactionOptionsTest.java
index 9ac1373..dfff576 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CompactionOptionsTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CompactionOptionsTest.java
@@ -1,24 +1,26 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
import org.testng.annotations.Test;
import static com.datastax.driver.core.schemabuilder.SchemaBuilder.*;
-import static com.datastax.driver.core.schemabuilder.TableOptions.CompactionOptions.DateTieredCompactionStrategyOptions.TimeStampResolution;
+import static com.datastax.driver.core.schemabuilder.TableOptions.CompactionOptions.DateTieredCompactionStrategyOptions;
+import static com.datastax.driver.core.schemabuilder.TableOptions.CompactionOptions.TimeWindowCompactionStrategyOptions;
+import static com.datastax.driver.core.schemabuilder.TableOptions.CompactionOptions.TimeWindowCompactionStrategyOptions.CompactionWindowUnit;
import static org.assertj.core.api.Assertions.assertThat;
public class CompactionOptionsTest {
@@ -82,7 +84,7 @@
.maxSSTableAgeDays(400)
.minThreshold(2)
.maxThreshold(4)
- .timestampResolution(TimeStampResolution.MICROSECONDS)
+ .timestampResolution(DateTieredCompactionStrategyOptions.TimeStampResolution.MICROSECONDS)
.tombstoneCompactionIntervalInDay(3)
.tombstoneThreshold(0.7)
.uncheckedTombstoneCompaction(true)
@@ -102,6 +104,42 @@
}
@Test(groups = "unit")
+ public void should_create_time_window_compaction_option() throws Exception {
+ //When
+ String built = timeWindowCompactionStrategy()
+ .bucketLow(0.5)
+ .bucketHigh(1.2)
+ .compactionWindowUnit(CompactionWindowUnit.HOURS)
+ .compactionWindowSize(5)
+ .enabled(true)
+ .minThreshold(2)
+ .maxThreshold(4)
+ .minSSTableSizeInBytes(5000000L)
+ .timestampResolution(TimeWindowCompactionStrategyOptions.TimeStampResolution.MICROSECONDS)
+ .tombstoneCompactionIntervalInDay(3)
+ .tombstoneThreshold(0.7)
+ .uncheckedTombstoneCompaction(true)
+ .unsafeAggressiveSSTableExpiration(true)
+ .build();
+
+ //Then
+ assertThat(built).isEqualTo("{'class' : 'TimeWindowCompactionStrategy', " +
+ "'enabled' : true, " +
+ "'tombstone_compaction_interval' : 3, " +
+ "'tombstone_threshold' : 0.7, " +
+ "'unchecked_tombstone_compaction' : true, " +
+ "'bucket_high' : 1.2, " +
+ "'bucket_low' : 0.5, " +
+ "'compaction_window_unit' : 'HOURS', " +
+ "'compaction_window_size' : 5, " +
+ "'min_threshold' : 2, " +
+ "'max_threshold' : 4, " +
+ "'min_sstable_size' : 5000000, " +
+ "'timestamp_resolution' : 'MICROSECONDS', " +
+ "'unsafe_aggressive_sstable_expiration' : 'true'}");
+ }
+
+ @Test(groups = "unit")
public void should_handle_freeform_options() {
//When
String built = dateTieredStrategy()
diff --git a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CompressionOptionsTest.java b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CompressionOptionsTest.java
index aedf32e..9302adf 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CompressionOptionsTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CompressionOptionsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateIndexTest.java b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateIndexTest.java
index babb803..1088b82 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateIndexTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateIndexTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateKeyspaceTest.java b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateKeyspaceTest.java
index 4cf9208..71983d5 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateKeyspaceTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateKeyspaceTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateTest.java b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateTest.java
index 2481a2d..d2f5f29 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateTypeTest.java b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateTypeTest.java
index ebc0abf..fe4cd40 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateTypeTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/CreateTypeTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/DropKeyspaceTest.java b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/DropKeyspaceTest.java
index 706822e..b8329c0 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/DropKeyspaceTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/DropKeyspaceTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/DropTest.java b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/DropTest.java
index dd60190..708a50b 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/DropTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/DropTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/SchemaBuilderIT.java b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/SchemaBuilderIT.java
index f262216..14ce507 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/SchemaBuilderIT.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/schemabuilder/SchemaBuilderIT.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.schemabuilder;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/utils/CassandraVersion.java b/driver-core/src/test/java/com/datastax/driver/core/utils/CassandraVersion.java
index 0ff379c..b1a50b8 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/utils/CassandraVersion.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/utils/CassandraVersion.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.utils;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/utils/DseVersion.java b/driver-core/src/test/java/com/datastax/driver/core/utils/DseVersion.java
index f03ddbb..bd1955e 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/utils/DseVersion.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/utils/DseVersion.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.utils;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/utils/SocketChannelMonitor.java b/driver-core/src/test/java/com/datastax/driver/core/utils/SocketChannelMonitor.java
index 93635d7..bc2d902 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/utils/SocketChannelMonitor.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/utils/SocketChannelMonitor.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.utils;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsPIDFromPropertyTest.java b/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsPIDFromPropertyTest.java
index c24ee80..22e919a 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsPIDFromPropertyTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsPIDFromPropertyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.utils;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsPIDNativeTest.java b/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsPIDNativeTest.java
index 013fa8e..6ce6b4c 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsPIDNativeTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsPIDNativeTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.utils;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsPIDPropertyInvalidTest.java b/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsPIDPropertyInvalidTest.java
index 1007d0c..7e81244 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsPIDPropertyInvalidTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsPIDPropertyInvalidTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.utils;
diff --git a/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsTest.java b/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsTest.java
index 89b9a74..432f067 100644
--- a/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsTest.java
+++ b/driver-core/src/test/java/com/datastax/driver/core/utils/UUIDsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.core.utils;
diff --git a/driver-core/src/test/resources/export_as_string_test_2.0.cql b/driver-core/src/test/resources/export_as_string_test_2.0.cql
new file mode 100644
index 0000000..8da2646
--- /dev/null
+++ b/driver-core/src/test/resources/export_as_string_test_2.0.cql
@@ -0,0 +1,42 @@
+CREATE KEYSPACE complex_ks WITH REPLICATION = { 'class' : 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1' } AND DURABLE_WRITES = true;
+
+CREATE TABLE complex_ks.rank_by_year_and_name (
+ race_year int,
+ race_name text,
+ rank int,
+ cyclist_name text,
+ PRIMARY KEY ((race_year, race_name), rank)
+) WITH CLUSTERING ORDER BY (rank ASC)
+ AND read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND replicate_on_write = true
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.01
+ AND caching = 'KEYS_ONLY'
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
+ AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99.0PERCENTILE'
+ AND index_interval = 128;
+
+CREATE INDEX rrank ON complex_ks.rank_by_year_and_name (rank);
+
+CREATE INDEX ryear ON complex_ks.rank_by_year_and_name (race_year);
+
+CREATE TABLE complex_ks.ztable (
+ zkey text,
+ a int,
+ PRIMARY KEY (zkey)
+) WITH read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND replicate_on_write = true
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.1
+ AND caching = 'KEYS_ONLY'
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy', 'sstable_size_in_mb' : 95 }
+ AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99.0PERCENTILE'
+ AND index_interval = 128;
diff --git a/driver-core/src/test/resources/export_as_string_test_2.1.cql b/driver-core/src/test/resources/export_as_string_test_2.1.cql
new file mode 100644
index 0000000..4e90831
--- /dev/null
+++ b/driver-core/src/test/resources/export_as_string_test_2.1.cql
@@ -0,0 +1,64 @@
+CREATE KEYSPACE complex_ks WITH REPLICATION = { 'class' : 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1' } AND DURABLE_WRITES = true;
+
+CREATE TYPE complex_ks.btype (
+ a text
+);
+
+CREATE TYPE complex_ks.xtype (
+ d text
+);
+
+CREATE TYPE complex_ks.ztype (
+ c text,
+ a int
+);
+
+CREATE TYPE complex_ks.ctype (
+ "Z" frozen<complex_ks.ztype>,
+ x frozen<complex_ks.xtype>
+);
+
+CREATE TYPE complex_ks.atype (
+ c frozen<complex_ks.ctype>
+);
+
+CREATE TABLE complex_ks.rank_by_year_and_name (
+ race_year int,
+ race_name text,
+ rank int,
+ cyclist_name text,
+ PRIMARY KEY ((race_year, race_name), rank)
+) WITH CLUSTERING ORDER BY (rank ASC)
+ AND read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.01
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
+ AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99.0PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048;
+
+CREATE INDEX rrank ON complex_ks.rank_by_year_and_name (rank);
+
+CREATE INDEX ryear ON complex_ks.rank_by_year_and_name (race_year);
+
+CREATE TABLE complex_ks.ztable (
+ zkey text,
+ a frozen<complex_ks.atype>,
+ PRIMARY KEY (zkey)
+) WITH read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.1
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy', 'sstable_size_in_mb' : 95 }
+ AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99.0PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048;
diff --git a/driver-core/src/test/resources/export_as_string_test_2.2.cql b/driver-core/src/test/resources/export_as_string_test_2.2.cql
new file mode 100644
index 0000000..15c4788
--- /dev/null
+++ b/driver-core/src/test/resources/export_as_string_test_2.2.cql
@@ -0,0 +1,110 @@
+CREATE KEYSPACE complex_ks WITH REPLICATION = { 'class' : 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1' } AND DURABLE_WRITES = true;
+
+CREATE TYPE complex_ks.btype (
+ a text
+);
+
+CREATE TYPE complex_ks.xtype (
+ d text
+);
+
+CREATE TYPE complex_ks.ztype (
+ c text,
+ a int
+);
+
+CREATE TYPE complex_ks.ctype (
+ "Z" frozen<complex_ks.ztype>,
+ x frozen<complex_ks.xtype>
+);
+
+CREATE TYPE complex_ks.atype (
+ c frozen<complex_ks.ctype>
+);
+
+CREATE TABLE complex_ks.cyclist_mv (
+ cid uuid,
+ age int,
+ birthday date,
+ country text,
+ name text,
+ PRIMARY KEY (cid)
+) WITH read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.01
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
+ AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99.0PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048;
+
+CREATE INDEX cyclist_by_country ON complex_ks.cyclist_mv (country);
+
+CREATE TABLE complex_ks.rank_by_year_and_name (
+ race_year int,
+ race_name text,
+ rank int,
+ cyclist_name text,
+ PRIMARY KEY ((race_year, race_name), rank)
+) WITH CLUSTERING ORDER BY (rank ASC)
+ AND read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.01
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
+ AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99.0PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048;
+
+CREATE INDEX rrank ON complex_ks.rank_by_year_and_name (rank);
+
+CREATE INDEX ryear ON complex_ks.rank_by_year_and_name (race_year);
+
+CREATE TABLE complex_ks.ztable (
+ zkey text,
+ a frozen<complex_ks.atype>,
+ PRIMARY KEY (zkey)
+) WITH read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.1
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy', 'sstable_size_in_mb' : 95 }
+ AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99.0PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048;
+
+CREATE FUNCTION complex_ks.avgfinal(state tuple<int, bigint>)
+ CALLED ON NULL INPUT
+ RETURNS double
+ LANGUAGE java
+ AS 'double r = 0; if (state.getInt(0) == 0) return null; r = state.getLong(1); r /= state.getInt(0); return Double.valueOf(r);';
+
+CREATE FUNCTION complex_ks.avgstate(state tuple<int, bigint>,val int)
+ CALLED ON NULL INPUT
+ RETURNS tuple<int, bigint>
+ LANGUAGE java
+ AS 'if (val !=null) { state.setInt(0, state.getInt(0)+1); state.setLong(1, state.getLong(1)+val.intValue()); } return state;';
+
+CREATE AGGREGATE complex_ks.average(int)
+ SFUNC avgstate
+ STYPE tuple<int, bigint>
+ FINALFUNC avgfinal
+ INITCOND (0,0);
+
+CREATE AGGREGATE complex_ks.mean(int)
+ SFUNC avgstate
+ STYPE tuple<int, bigint>
+ FINALFUNC avgfinal
+ INITCOND (0,0);
diff --git a/driver-core/src/test/resources/export_as_string_test_3.0.cql b/driver-core/src/test/resources/export_as_string_test_3.0.cql
new file mode 100644
index 0000000..f90ec61
--- /dev/null
+++ b/driver-core/src/test/resources/export_as_string_test_3.0.cql
@@ -0,0 +1,173 @@
+CREATE KEYSPACE complex_ks WITH REPLICATION = { 'class' : 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1' } AND DURABLE_WRITES = true;
+
+CREATE TYPE complex_ks.btype (
+ a text
+);
+
+CREATE TYPE complex_ks.xtype (
+ d text
+);
+
+CREATE TYPE complex_ks.ztype (
+ c text,
+ a int
+);
+
+CREATE TYPE complex_ks.ctype (
+ "Z" frozen<complex_ks.ztype>,
+ x frozen<complex_ks.xtype>
+);
+
+CREATE TYPE complex_ks.atype (
+ c frozen<complex_ks.ctype>
+);
+
+CREATE TABLE complex_ks.cyclist_mv (
+ cid uuid,
+ age int,
+ birthday date,
+ country text,
+ name text,
+ PRIMARY KEY (cid)
+) WITH read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.01
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold' : 32, 'min_threshold' : 4 }
+ AND compression = { 'chunk_length_in_kb' : 64, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048
+ AND crc_check_chance = 1.0;
+
+CREATE INDEX cyclist_by_country ON complex_ks.cyclist_mv (country);
+
+CREATE MATERIALIZED VIEW complex_ks.cyclist_by_a_age AS
+ SELECT *
+ FROM complex_ks.cyclist_mv
+ WHERE age IS NOT NULL AND cid IS NOT NULL
+ PRIMARY KEY (age, cid)
+ WITH CLUSTERING ORDER BY (cid ASC)
+ AND read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.01
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold' : 32, 'min_threshold' : 4 }
+ AND compression = { 'chunk_length_in_kb' : 64, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048
+ AND crc_check_chance = 1.0;
+
+CREATE MATERIALIZED VIEW complex_ks.cyclist_by_age AS
+ SELECT age, cid, birthday, country, name
+ FROM complex_ks.cyclist_mv
+ WHERE age IS NOT NULL AND cid IS NOT NULL
+ PRIMARY KEY (age, cid)
+ WITH CLUSTERING ORDER BY (cid ASC)
+ AND read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.01
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = 'simple view'
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold' : 32, 'min_threshold' : 4 }
+ AND compression = { 'chunk_length_in_kb' : 64, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048
+ AND crc_check_chance = 1.0;
+
+CREATE MATERIALIZED VIEW complex_ks.cyclist_by_r_age AS
+ SELECT age, cid, birthday, country, name
+ FROM complex_ks.cyclist_mv
+ WHERE age IS NOT NULL AND cid IS NOT NULL
+ PRIMARY KEY (age, cid)
+ WITH CLUSTERING ORDER BY (cid DESC)
+ AND read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.01
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold' : 32, 'min_threshold' : 4 }
+ AND compression = { 'chunk_length_in_kb' : 64, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048
+ AND crc_check_chance = 1.0;
+
+CREATE TABLE complex_ks.rank_by_year_and_name (
+ race_year int,
+ race_name text,
+ rank int,
+ cyclist_name text,
+ PRIMARY KEY ((race_year, race_name), rank)
+) WITH CLUSTERING ORDER BY (rank ASC)
+ AND read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.01
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold' : 32, 'min_threshold' : 4 }
+ AND compression = { 'chunk_length_in_kb' : 64, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048
+ AND crc_check_chance = 1.0;
+
+CREATE INDEX rrank ON complex_ks.rank_by_year_and_name (rank);
+
+CREATE INDEX ryear ON complex_ks.rank_by_year_and_name (race_year);
+
+CREATE TABLE complex_ks.ztable (
+ zkey text,
+ a frozen<complex_ks.atype>,
+ PRIMARY KEY (zkey)
+) WITH read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.1
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy', 'sstable_size_in_mb' : 95 }
+ AND compression = { 'chunk_length_in_kb' : 64, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048
+ AND crc_check_chance = 1.0;
+
+CREATE FUNCTION complex_ks.avgfinal(state tuple<int, bigint>)
+ CALLED ON NULL INPUT
+ RETURNS double
+ LANGUAGE java
+ AS 'double r = 0; if (state.getInt(0) == 0) return null; r = state.getLong(1); r /= state.getInt(0); return Double.valueOf(r);';
+
+CREATE FUNCTION complex_ks.avgstate(state tuple<int, bigint>,val int)
+ CALLED ON NULL INPUT
+ RETURNS tuple<int, bigint>
+ LANGUAGE java
+ AS 'if (val !=null) { state.setInt(0, state.getInt(0)+1); state.setLong(1, state.getLong(1)+val.intValue()); } return state;';
+
+CREATE AGGREGATE complex_ks.average(int)
+ SFUNC avgstate
+ STYPE tuple<int, bigint>
+ FINALFUNC avgfinal
+ INITCOND (0,0);
+
+CREATE AGGREGATE complex_ks.mean(int)
+ SFUNC avgstate
+ STYPE tuple<int, bigint>
+ FINALFUNC avgfinal
+ INITCOND (0,0);
diff --git a/driver-core/src/test/resources/export_as_string_test_3.11.cql b/driver-core/src/test/resources/export_as_string_test_3.11.cql
new file mode 100644
index 0000000..6133df2
--- /dev/null
+++ b/driver-core/src/test/resources/export_as_string_test_3.11.cql
@@ -0,0 +1,179 @@
+CREATE KEYSPACE complex_ks WITH REPLICATION = { 'class' : 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1' } AND DURABLE_WRITES = true;
+
+CREATE TYPE complex_ks.btype (
+ a text
+);
+
+CREATE TYPE complex_ks.xtype (
+ d text
+);
+
+CREATE TYPE complex_ks.ztype (
+ c text,
+ a int
+);
+
+CREATE TYPE complex_ks.ctype (
+ "Z" frozen<complex_ks.ztype>,
+ x frozen<complex_ks.xtype>
+);
+
+CREATE TYPE complex_ks.atype (
+ c frozen<complex_ks.ctype>
+);
+
+CREATE TABLE complex_ks.cyclist_mv (
+ cid uuid,
+ age int,
+ birthday date,
+ country text,
+ name text,
+ PRIMARY KEY (cid)
+) WITH read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.01
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold' : 32, 'min_threshold' : 4 }
+ AND compression = { 'chunk_length_in_kb' : 64, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048
+ AND crc_check_chance = 1.0
+ AND cdc = false;
+
+CREATE INDEX cyclist_by_country ON complex_ks.cyclist_mv (country);
+
+CREATE MATERIALIZED VIEW complex_ks.cyclist_by_a_age AS
+ SELECT *
+ FROM complex_ks.cyclist_mv
+ WHERE age IS NOT NULL AND cid IS NOT NULL
+ PRIMARY KEY (age, cid)
+ WITH CLUSTERING ORDER BY (cid ASC)
+ AND read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.01
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold' : 32, 'min_threshold' : 4 }
+ AND compression = { 'chunk_length_in_kb' : 64, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048
+ AND crc_check_chance = 1.0
+ AND cdc = false;
+
+CREATE MATERIALIZED VIEW complex_ks.cyclist_by_age AS
+ SELECT age, cid, birthday, country, name
+ FROM complex_ks.cyclist_mv
+ WHERE age IS NOT NULL AND cid IS NOT NULL
+ PRIMARY KEY (age, cid)
+ WITH CLUSTERING ORDER BY (cid ASC)
+ AND read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.01
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = 'simple view'
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold' : 32, 'min_threshold' : 4 }
+ AND compression = { 'chunk_length_in_kb' : 64, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048
+ AND crc_check_chance = 1.0
+ AND cdc = false;
+
+CREATE MATERIALIZED VIEW complex_ks.cyclist_by_r_age AS
+ SELECT age, cid, birthday, country, name
+ FROM complex_ks.cyclist_mv
+ WHERE age IS NOT NULL AND cid IS NOT NULL
+ PRIMARY KEY (age, cid)
+ WITH CLUSTERING ORDER BY (cid DESC)
+ AND read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.01
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold' : 32, 'min_threshold' : 4 }
+ AND compression = { 'chunk_length_in_kb' : 64, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048
+ AND crc_check_chance = 1.0
+ AND cdc = false;
+
+CREATE TABLE complex_ks.rank_by_year_and_name (
+ race_year int,
+ race_name text,
+ rank int,
+ cyclist_name text,
+ PRIMARY KEY ((race_year, race_name), rank)
+) WITH CLUSTERING ORDER BY (rank ASC)
+ AND read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.01
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold' : 32, 'min_threshold' : 4 }
+ AND compression = { 'chunk_length_in_kb' : 64, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048
+ AND crc_check_chance = 1.0
+ AND cdc = false;
+
+CREATE INDEX rrank ON complex_ks.rank_by_year_and_name (rank);
+
+CREATE INDEX ryear ON complex_ks.rank_by_year_and_name (race_year);
+
+CREATE TABLE complex_ks.ztable (
+ zkey text,
+ a frozen<complex_ks.atype>,
+ PRIMARY KEY (zkey)
+) WITH read_repair_chance = 0.0
+ AND dclocal_read_repair_chance = 0.1
+ AND gc_grace_seconds = 864000
+ AND bloom_filter_fp_chance = 0.1
+ AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
+ AND comment = ''
+ AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy', 'sstable_size_in_mb' : 95 }
+ AND compression = { 'chunk_length_in_kb' : 64, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
+ AND default_time_to_live = 0
+ AND speculative_retry = '99PERCENTILE'
+ AND min_index_interval = 128
+ AND max_index_interval = 2048
+ AND crc_check_chance = 1.0
+ AND cdc = false;
+
+CREATE FUNCTION complex_ks.avgfinal(state tuple<int, bigint>)
+ CALLED ON NULL INPUT
+ RETURNS double
+ LANGUAGE java
+ AS 'double r = 0; if (state.getInt(0) == 0) return null; r = state.getLong(1); r /= state.getInt(0); return Double.valueOf(r);';
+
+CREATE FUNCTION complex_ks.avgstate(state tuple<int, bigint>,val int)
+ CALLED ON NULL INPUT
+ RETURNS tuple<int, bigint>
+ LANGUAGE java
+ AS 'if (val !=null) { state.setInt(0, state.getInt(0)+1); state.setLong(1, state.getLong(1)+val.intValue()); } return state;';
+
+CREATE AGGREGATE complex_ks.average(int)
+ SFUNC avgstate
+ STYPE tuple<int, bigint>
+ FINALFUNC avgfinal
+ INITCOND (0,0);
+
+CREATE AGGREGATE complex_ks.mean(int)
+ SFUNC avgstate
+ STYPE tuple<int, bigint>
+ FINALFUNC avgfinal
+ INITCOND (0,0);
diff --git a/driver-core/src/test/resources/log4j.properties b/driver-core/src/test/resources/log4j.properties
index 8f9c901..7e42170 100644
--- a/driver-core/src/test/resources/log4j.properties
+++ b/driver-core/src/test/resources/log4j.properties
@@ -1,17 +1,17 @@
#
-# Copyright (C) 2012-2015 DataStax Inc.
+# Copyright (C) 2012-2017 DataStax Inc.
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# Set root logger level to DEBUG and its only appender to A1.
diff --git a/driver-dist/pom.xml b/driver-dist/pom.xml
index a0181cd..2fd4eef 100644
--- a/driver-dist/pom.xml
+++ b/driver-dist/pom.xml
@@ -1,102 +1,63 @@
<!--
- Copyright (C) 2012-2015 DataStax Inc.
+ Copyright (C) 2012-2017 DataStax Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-parent</artifactId>
- <version>3.2.1-SNAPSHOT</version>
+ <version>3.3.3-SNAPSHOT</version>
</parent>
+
<artifactId>cassandra-driver-dist</artifactId>
-
- <properties>
- <main.basedir>${project.parent.basedir}</main.basedir>
- </properties>
-
<!-- Should be pom but Javadoc generation requires a "classpath-capable" package -->
<packaging>jar</packaging>
-
<name>DataStax Java Driver for Apache Cassandra - Binary distribution</name>
- <!-- These dependencies are only here to ensure proper build order -->
+ <!-- These dependencies are only here to ensure proper build order and proper inclusion of binaries in the final tarball -->
<dependencies>
+
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
- <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-mapping</artifactId>
- <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-extras</artifactId>
- <version>${project.parent.version}</version>
</dependency>
</dependencies>
<build>
+
<finalName>cassandra-java-driver-${project.version}</finalName>
+
<plugins>
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.9.1</version>
- <executions>
- <execution>
- <id>dependencies-javadoc</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- <configuration>
- <includeDependencySources>true</includeDependencySources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>3.0.0</version>
- <executions>
- <execution>
- <id>assemble-binary-tarball</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <appendAssemblyId>false</appendAssemblyId>
- <descriptors>
- <descriptor>src/assembly/binary-tarball.xml</descriptor>
- </descriptors>
- <tarLongFileMode>posix</tarLongFileMode>
- </configuration>
- </plugin>
+
<plugin>
<artifactId>maven-jar-plugin</artifactId>
- <version>3.0.2</version>
<!-- http://stackoverflow.com/questions/13218313/unable-to-disable-generation-of-empty-jar-maven-jar-plugin -->
<executions>
<execution>
@@ -105,24 +66,84 @@
</execution>
</executions>
</plugin>
+
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <configuration>
+ <skipSource>true</skipSource>
+ </configuration>
+ </plugin>
+
+ <plugin>
<artifactId>maven-install-plugin</artifactId>
- <version>2.5.1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
+
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
- <version>2.8.1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
+
</plugins>
+
</build>
+ <profiles>
+
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>dependencies-javadoc</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <includeDependencySources>true</includeDependencySources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>assemble-binary-tarball</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>src/assembly/binary-tarball.xml</descriptor>
+ </descriptors>
+ <tarLongFileMode>posix</tarLongFileMode>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <configuration>
+ <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
</project>
diff --git a/driver-dist/src/assembly/binary-tarball.xml b/driver-dist/src/assembly/binary-tarball.xml
index 69ce0b3..1b7b1a7 100644
--- a/driver-dist/src/assembly/binary-tarball.xml
+++ b/driver-dist/src/assembly/binary-tarball.xml
@@ -1,18 +1,18 @@
<!--
- Copyright (C) 2012-2015 DataStax Inc.
+ Copyright (C) 2012-2017 DataStax Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
@@ -67,6 +67,9 @@
<exclude>com.datastax.cassandra:cassandra-driver-core</exclude>
<exclude>com.datastax.cassandra:cassandra-driver-mapping</exclude>
<exclude>com.datastax.cassandra:cassandra-driver-extras</exclude>
+ <!-- already included in lib/core -->
+ <exclude>com.google.guava:guava</exclude>
+ <exclude>org.slf4j:slf4j-api</exclude>
</excludes>
<useTransitiveFiltering>true</useTransitiveFiltering>
</dependencySet>
@@ -74,7 +77,7 @@
</binaries>
</moduleSet>
- <!-- dependencies of module cassandra:cassandra-driver-extras -->
+ <!-- dependencies of module cassandra-driver-extras -->
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
@@ -92,6 +95,7 @@
<exclude>com.datastax.cassandra:cassandra-driver-extras</exclude>
<!-- already included in lib/core -->
<exclude>com.google.guava:guava</exclude>
+ <exclude>org.slf4j:slf4j-api</exclude>
</excludes>
<useTransitiveFiltering>true</useTransitiveFiltering>
</dependencySet>
diff --git a/driver-examples/pom.xml b/driver-examples/pom.xml
index b4617de..b2b9e1f 100644
--- a/driver-examples/pom.xml
+++ b/driver-examples/pom.xml
@@ -1,41 +1,33 @@
<!--
- Copyright (C) 2012-2015 DataStax Inc.
+ Copyright (C) 2012-2017 DataStax Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>cassandra-driver-parent</artifactId>
- <groupId>com.datastax.cassandra</groupId>
- <version>3.2.1-SNAPSHOT</version>
- </parent>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<modelVersion>4.0.0</modelVersion>
- <artifactId>cassandra-driver-examples</artifactId>
+ <parent>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-parent</artifactId>
+ <version>3.3.3-SNAPSHOT</version>
+ </parent>
+ <artifactId>cassandra-driver-examples</artifactId>
<name>DataStax Java Driver for Apache Cassandra - Examples</name>
<description>A collection of examples to demonstrate DataStax Java Driver for Apache Cassandra.</description>
- <url>https://github.com/datastax/java-driver</url>
-
- <properties>
- <main.basedir>${project.parent.basedir}</main.basedir>
- <jax-rs.version>2.0.1</jax-rs.version>
- <jersey.version>2.23.1</jersey.version>
- <hk2.version>2.4.0-b34</hk2.version>
- <logback.version>1.1.3</logback.version>
- </properties>
<dependencies>
@@ -44,13 +36,11 @@
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
- <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-extras</artifactId>
- <version>${project.parent.version}</version>
<optional>true</optional>
</dependency>
@@ -59,14 +49,12 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
- <version>${jackson.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
- <version>${jackson.version}</version>
<optional>true</optional>
</dependency>
@@ -75,14 +63,12 @@
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
- <version>${jsr353-api.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
- <version>${jsr353-ri.version}</version>
<optional>true</optional>
<scope>runtime</scope>
</dependency>
@@ -92,7 +78,6 @@
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
- <version>${jax-rs.version}</version>
<optional>true</optional>
</dependency>
@@ -101,31 +86,40 @@
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
- <version>${jersey.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
- <version>${jersey.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-jdk-http</artifactId>
- <version>${jersey.version}</version>
<optional>true</optional>
</dependency>
-
<!--CDI frameworks (HK2)-->
<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2-api</artifactId>
- <version>${hk2.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- Standard annotations -->
+
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>javax.annotation-api</artifactId>
<optional>true</optional>
</dependency>
@@ -134,7 +128,6 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
- <version>${logback.version}</version>
</dependency>
</dependencies>
@@ -146,7 +139,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.15</version>
<configuration>
<skip>true</skip>
</configuration>
@@ -155,25 +147,34 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>clirr-maven-plugin</artifactId>
- <version>2.7</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+
+ <plugin>
<artifactId>maven-install-plugin</artifactId>
- <version>2.5.1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
- <version>2.8.1</version>
<configuration>
<skip>true</skip>
</configuration>
@@ -183,27 +184,23 @@
</build>
- <licenses>
- <license>
- <name>Apache 2</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- <comments>Apache License Version 2.0</comments>
- </license>
- </licenses>
+ <profiles>
- <scm>
- <connection>scm:git:git@github.com:datastax/java-driver.git</connection>
- <developerConnection>scm:git:git@github.com:datastax/java-driver.git</developerConnection>
- <url>https://github.com/datastax/java-driver</url>
- <tag>HEAD</tag>
- </scm>
-
- <developers>
- <developer>
- <name>Various</name>
- <organization>DataStax</organization>
- </developer>
- </developers>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <configuration>
+ <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
</project>
diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/basic/CreateAndPopulateKeyspace.java b/driver-examples/src/main/java/com/datastax/driver/examples/basic/CreateAndPopulateKeyspace.java
index 61b1145..6a203f8 100644
--- a/driver-examples/src/main/java/com/datastax/driver/examples/basic/CreateAndPopulateKeyspace.java
+++ b/driver-examples/src/main/java/com/datastax/driver/examples/basic/CreateAndPopulateKeyspace.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.examples.basic;
diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/basic/ReadCassandraVersion.java b/driver-examples/src/main/java/com/datastax/driver/examples/basic/ReadCassandraVersion.java
index 69bac90..3863058 100644
--- a/driver-examples/src/main/java/com/datastax/driver/examples/basic/ReadCassandraVersion.java
+++ b/driver-examples/src/main/java/com/datastax/driver/examples/basic/ReadCassandraVersion.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.examples.basic;
diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/basic/ReadTopologyAndSchemaMetadata.java b/driver-examples/src/main/java/com/datastax/driver/examples/basic/ReadTopologyAndSchemaMetadata.java
index feebe7a..e08de79 100644
--- a/driver-examples/src/main/java/com/datastax/driver/examples/basic/ReadTopologyAndSchemaMetadata.java
+++ b/driver-examples/src/main/java/com/datastax/driver/examples/basic/ReadTopologyAndSchemaMetadata.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.examples.basic;
diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java b/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java
index 388f7ca..74e46c9 100644
--- a/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java
+++ b/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.examples.datatypes;
diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonColumn.java b/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonColumn.java
index b8058c7..0d72128 100644
--- a/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonColumn.java
+++ b/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonColumn.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.examples.json;
diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonFunction.java b/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonFunction.java
index f698990..5df584e 100644
--- a/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonFunction.java
+++ b/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonFunction.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.examples.json;
diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonRow.java b/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonRow.java
index e656b26..2bec148 100644
--- a/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonRow.java
+++ b/driver-examples/src/main/java/com/datastax/driver/examples/json/JacksonJsonRow.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.examples.json;
diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonColumn.java b/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonColumn.java
index d44a875..de7c96a 100644
--- a/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonColumn.java
+++ b/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonColumn.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.examples.json;
diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonFunction.java b/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonFunction.java
index 17dc9b2..7893909 100644
--- a/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonFunction.java
+++ b/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonFunction.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.examples.json;
diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonRow.java b/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonRow.java
index b9dfd86..2a7f868 100644
--- a/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonRow.java
+++ b/driver-examples/src/main/java/com/datastax/driver/examples/json/Jsr353JsonRow.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.examples.json;
diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/json/PlainTextJson.java b/driver-examples/src/main/java/com/datastax/driver/examples/json/PlainTextJson.java
index cf2f9a0..baedca8 100644
--- a/driver-examples/src/main/java/com/datastax/driver/examples/json/PlainTextJson.java
+++ b/driver-examples/src/main/java/com/datastax/driver/examples/json/PlainTextJson.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.examples.json;
diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/paging/ForwardPagingRestUi.java b/driver-examples/src/main/java/com/datastax/driver/examples/paging/ForwardPagingRestUi.java
index cfba625..bcfcebf 100644
--- a/driver-examples/src/main/java/com/datastax/driver/examples/paging/ForwardPagingRestUi.java
+++ b/driver-examples/src/main/java/com/datastax/driver/examples/paging/ForwardPagingRestUi.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.examples.paging;
diff --git a/driver-examples/src/main/java/com/datastax/driver/examples/paging/RandomPagingRestUi.java b/driver-examples/src/main/java/com/datastax/driver/examples/paging/RandomPagingRestUi.java
index 7f66808..3944aca 100644
--- a/driver-examples/src/main/java/com/datastax/driver/examples/paging/RandomPagingRestUi.java
+++ b/driver-examples/src/main/java/com/datastax/driver/examples/paging/RandomPagingRestUi.java
@@ -1,22 +1,21 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.examples.paging;
import com.datastax.driver.core.*;
-import com.google.common.collect.Lists;
import com.sun.net.httpserver.HttpServer;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.jdkhttp.JdkHttpServerFactory;
@@ -31,6 +30,7 @@
import javax.ws.rs.core.UriInfo;
import java.io.IOException;
import java.net.URI;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@@ -227,7 +227,7 @@
videos = Collections.emptyList();
} else {
int remaining = ITEMS_PER_PAGE;
- videos = Lists.newArrayListWithExpectedSize(remaining);
+ videos = new ArrayList<UserVideo>(remaining);
for (Row row : rs) {
UserVideo video = new UserVideo(
row.getInt("videoid"),
diff --git a/driver-examples/src/main/resources/logback.xml b/driver-examples/src/main/resources/logback.xml
index 3fb2dcf..25dd17c 100644
--- a/driver-examples/src/main/resources/logback.xml
+++ b/driver-examples/src/main/resources/logback.xml
@@ -1,18 +1,18 @@
<!--
- Copyright (C) 2012-2015 DataStax Inc.
+ Copyright (C) 2012-2017 DataStax Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
<configuration>
diff --git a/driver-extras/pom.xml b/driver-extras/pom.xml
index 9bd5f19..ce0b3fd 100644
--- a/driver-extras/pom.xml
+++ b/driver-extras/pom.xml
@@ -1,79 +1,74 @@
<!--
- Copyright (C) 2012-2015 DataStax Inc.
+ Copyright (C) 2012-2017 DataStax Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>cassandra-driver-parent</artifactId>
- <groupId>com.datastax.cassandra</groupId>
- <version>3.2.1-SNAPSHOT</version>
- </parent>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-parent</artifactId>
+ <version>3.3.3-SNAPSHOT</version>
+ </parent>
+
<artifactId>cassandra-driver-extras</artifactId>
<packaging>bundle</packaging>
<name>DataStax Java Driver for Apache Cassandra - Extras</name>
<description>Extended functionality for the Java driver.</description>
- <url>https://github.com/datastax/java-driver</url>
-
- <properties>
- <main.basedir>${project.parent.basedir}</main.basedir>
- <test.groups>unit</test.groups>
- <jdk8.excludes>none</jdk8.excludes>
- </properties>
<dependencies>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
- <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <version>${guava.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
- <version>${jackson.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
- <version>${joda.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
- <version>${jsr353-api.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
- <version>${project.parent.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
@@ -81,56 +76,48 @@
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-mapping</artifactId>
- <version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>${testng.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
- <version>${assertj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>${mockito.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-exec</artifactId>
- <version>${commons-exec.version}</version>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
- <version>${jsr353-ri.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-exec</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
- <version>${log4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
- <version>${slf4j-log4j12.version}</version>
<scope>test</scope>
</dependency>
@@ -141,102 +128,13 @@
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>${jdk8.excludes}</exclude>
- </excludes>
- <testExcludes>
- <exclude>${jdk8.excludes}</exclude>
- </testExcludes>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>animal-sniffer-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>check</id>
- <phase>process-classes</phase>
- <goals>
- <goal>check</goal>
- </goals>
- <configuration>
- <signature>
- <groupId>org.codehaus.mojo.signature</groupId>
- <artifactId>java16</artifactId>
- <version>1.0</version>
- </signature>
- <annotations>
- <annotation>com.datastax.driver.extras.codecs.jdk8.IgnoreJDK6Requirement</annotation>
- </annotations>
- </configuration>
- </execution>
- <execution>
- <id>check-jdk8</id>
- <phase>process-classes</phase>
- <goals>
- <goal>check</goal>
- </goals>
- <configuration>
- <signature>
- <groupId>org.codehaus.mojo.signature</groupId>
- <artifactId>java18</artifactId>
- <version>1.0</version>
- </signature>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- <configuration>
- <groups>${test.groups}</groups>
- <useFile>false</useFile>
- <systemPropertyVariables>
- <cassandra.version>${cassandra.version}</cassandra.version>
- <ipprefix>${ipprefix}</ipprefix>
- </systemPropertyVariables>
- <classpathDependencyExcludes>
- <classpathDependencyExcludes>io.netty:netty-transport-native-epoll</classpathDependencyExcludes>
- </classpathDependencyExcludes>
- <excludes>
- <exclude>${jdk8.excludes}</exclude>
- </excludes>
- </configuration>
- </plugin>
-
- <plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <version>2.4.0</version>
- <executions>
- <execution>
- <id>bundle-manifest</id>
- <phase>process-classes</phase>
- <goals>
- <goal>manifest</goal>
- </goals>
- </execution>
- </executions>
<configuration>
<instructions>
<Bundle-SymbolicName>com.datastax.driver.extras</Bundle-SymbolicName>
- <Bundle-Version>${project.version}</Bundle-Version>
- <_include>-osgi.bnd</_include>
<Import-Package><![CDATA[com.google.common.*;version="[16.0.1,22)",*]]></Import-Package>
</instructions>
- <supportedProjectTypes>
- <supportedProjectType>jar</supportedProjectType>
- <supportedProjectType>bundle</supportedProjectType>
- <supportedProjectType>pom</supportedProjectType>
- </supportedProjectTypes>
</configuration>
</plugin>
@@ -244,59 +142,4 @@
</build>
- <profiles>
-
- <profile>
- <id>short</id>
- <properties>
- <test.groups>unit,short</test.groups>
- </properties>
- </profile>
-
- <profile>
- <id>long</id>
- <properties>
- <test.groups>unit,short,long</test.groups>
- </properties>
- </profile>
-
- <!--
- This profile excludes all JDK 8 dependent classes from
- compilation. Use this when running tests with a legacy JDK (6 or 7)
- -->
- <profile>
- <id>legacy-jdks</id>
- <activation>
- <jdk>[,1.8)</jdk>
- </activation>
- <properties>
- <jdk8.excludes>**/jdk8/*.java</jdk8.excludes>
- </properties>
- </profile>
-
- </profiles>
-
- <licenses>
- <license>
- <name>Apache 2</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- <comments>Apache License Version 2.0</comments>
- </license>
- </licenses>
-
- <scm>
- <connection>scm:git:git@github.com:datastax/java-driver.git</connection>
- <developerConnection>scm:git:git@github.com:datastax/java-driver.git</developerConnection>
- <url>https://github.com/datastax/java-driver</url>
- <tag>HEAD</tag>
- </scm>
-
- <developers>
- <developer>
- <name>Various</name>
- <organization>DataStax</organization>
- </developer>
- </developers>
-
</project>
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/MappingCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/MappingCodec.java
index 340f2d5..83e938d 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/MappingCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/MappingCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/ParsingCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/ParsingCodec.java
index d260c5b..d716a6f 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/ParsingCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/ParsingCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/AbstractArrayCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/AbstractArrayCodec.java
index 00edca5..087ec67 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/AbstractArrayCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/AbstractArrayCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.arrays;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/AbstractPrimitiveArrayCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/AbstractPrimitiveArrayCodec.java
index f7e769f..cecb331 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/AbstractPrimitiveArrayCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/AbstractPrimitiveArrayCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.arrays;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/DoubleArrayCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/DoubleArrayCodec.java
index 2ea2090..cf3d540 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/DoubleArrayCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/DoubleArrayCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.arrays;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/FloatArrayCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/FloatArrayCodec.java
index 7d4e939..0925902 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/FloatArrayCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/FloatArrayCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.arrays;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.java
index c3e61d5..bdebabe 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.arrays;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/LongArrayCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/LongArrayCodec.java
index f8b12d0..4a344d0 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/LongArrayCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/LongArrayCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.arrays;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.java
index baaea3d..3ca7151 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.arrays;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/package-info.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/package-info.java
index cd32814..556a9d0 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/package-info.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/package-info.java
@@ -1,19 +1,18 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
/**
* This package contains a collection of convenience
* {@link com.datastax.driver.core.TypeCodec TypeCodec} instances useful for
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/date/SimpleDateCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/date/SimpleDateCodec.java
index 0c96700..57d3207 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/date/SimpleDateCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/date/SimpleDateCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.date;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.java
index c3c794e..fa074f3 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.date;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/date/package-info.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/date/package-info.java
index 04577b9..72f8875 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/date/package-info.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/date/package-info.java
@@ -1,19 +1,18 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
/**
* This package contains a collection of convenience
* {@link com.datastax.driver.core.TypeCodec TypeCodec} instances useful for
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/enums/EnumNameCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/enums/EnumNameCodec.java
index b43df2a..f6a2c7b 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/enums/EnumNameCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/enums/EnumNameCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.enums;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.java
index 92e6494..fbe2923 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.enums;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/enums/package-info.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/enums/package-info.java
index fb0d90c..22771b6 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/enums/package-info.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/enums/package-info.java
@@ -1,19 +1,18 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
/**
* This package contains a collection of convenience
* {@link com.datastax.driver.core.TypeCodec TypeCodec} instances useful for
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/guava/OptionalCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/guava/OptionalCodec.java
index ae08317..1aa73ef 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/guava/OptionalCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/guava/OptionalCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.guava;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/guava/package-info.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/guava/package-info.java
index 2e0ad0f..f3639d1 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/guava/package-info.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/guava/package-info.java
@@ -1,19 +1,18 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
/**
* This package contains a collection of convenience
* {@link com.datastax.driver.core.TypeCodec TypeCodec} instances useful for
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/IgnoreJDK6Requirement.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/IgnoreJDK6Requirement.java
index c7318ce..b64f3fc 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/IgnoreJDK6Requirement.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/IgnoreJDK6Requirement.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.jdk8;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/InstantCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/InstantCodec.java
index 23cc642..2673c17 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/InstantCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/InstantCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.jdk8;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.java
index fab4c5a..99d38a2 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.jdk8;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.java
index 9b6c8c5..eb5bd92 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.jdk8;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.java
index a09ec3c..3d70848 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.jdk8;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.java
index 7149cb0..525f4f0 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.jdk8;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/package-info.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/package-info.java
index 894b475..73b686b 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/package-info.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/package-info.java
@@ -1,19 +1,18 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
/**
* This package contains a collection of convenience
* {@link com.datastax.driver.core.TypeCodec TypeCodec} instances useful for
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/DateTimeCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/DateTimeCodec.java
index 1fcf68d..c6c48eb 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/DateTimeCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/DateTimeCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.joda;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/InstantCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/InstantCodec.java
index 9afac24..8c81d4b 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/InstantCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/InstantCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.joda;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/LocalDateCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/LocalDateCodec.java
index befd753..5ad74a4 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/LocalDateCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/LocalDateCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.joda;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.java
index d97da7b..2fd45c8 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.joda;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/package-info.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/package-info.java
index f23ff99..df95137 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/package-info.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/package-info.java
@@ -1,19 +1,18 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
/**
* This package contains a collection of convenience
* {@link com.datastax.driver.core.TypeCodec TypeCodec} instances useful for
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.java
index 907eed6..6584aa5 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.json;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.java
index 324aa86..4ce87e1 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.json;
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/package-info.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/package-info.java
index 0ae86d6..cf6352e 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/package-info.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/package-info.java
@@ -1,19 +1,18 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
/**
* This package contains a collection of convenience
* {@link com.datastax.driver.core.TypeCodec} instances useful for
diff --git a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/package-info.java b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/package-info.java
index 3b77d8d..0980862 100644
--- a/driver-extras/src/main/java/com/datastax/driver/extras/codecs/package-info.java
+++ b/driver-extras/src/main/java/com/datastax/driver/extras/codecs/package-info.java
@@ -1,19 +1,18 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
/**
* This package and its subpackages contain several convenience {@link com.datastax.driver.core.TypeCodec TypeCodec}s.
* <p/>
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/arrays/ArrayCodecsTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/arrays/ArrayCodecsTest.java
index fc7804b..79661ab 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/arrays/ArrayCodecsTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/arrays/ArrayCodecsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.arrays;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/date/SimpleDateCodecTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/date/SimpleDateCodecTest.java
index 23f54ce..e7ff2c3 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/date/SimpleDateCodecTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/date/SimpleDateCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.date;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/date/SimpleDateCodecsTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/date/SimpleDateCodecsTest.java
index d5b6469..65080fc 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/date/SimpleDateCodecsTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/date/SimpleDateCodecsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.date;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/date/SimpleTimestampCodecTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/date/SimpleTimestampCodecTest.java
index 026f6b3..8a655df 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/date/SimpleTimestampCodecTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/date/SimpleTimestampCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.date;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/enums/EnumCodecsTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/enums/EnumCodecsTest.java
index d882172..0649efa 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/enums/EnumCodecsTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/enums/EnumCodecsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.enums;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/guava/OptionalCodecTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/guava/OptionalCodecTest.java
index c85f624..871ea8a 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/guava/OptionalCodecTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/guava/OptionalCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.guava;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/InstantCodecTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/InstantCodecTest.java
index 14724f9..ce38457 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/InstantCodecTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/InstantCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.jdk8;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/Jdk8TimeCodecsTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/Jdk8TimeCodecsTest.java
index 3b9b277..cfd9db7 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/Jdk8TimeCodecsTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/Jdk8TimeCodecsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.jdk8;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/LocalDateCodecTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/LocalDateCodecTest.java
index 6295197..bf0804a 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/LocalDateCodecTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/LocalDateCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.jdk8;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodecTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodecTest.java
index b0b3dea..6f705f2 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodecTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.jdk8;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodecTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodecTest.java
index 6a86d86..4f90a4e 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodecTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.jdk8;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodecTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodecTest.java
index 7677fe4..9970204 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodecTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.jdk8;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/DateTimeCodecTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/DateTimeCodecTest.java
index 6e67830..c1c1a6b 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/DateTimeCodecTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/DateTimeCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.joda;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/InstantCodecTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/InstantCodecTest.java
index 3ffc564..fc1be3d 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/InstantCodecTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/InstantCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.joda;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/JodaTimeCodecsTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/JodaTimeCodecsTest.java
index 83dc02d..abc0e4e 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/JodaTimeCodecsTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/JodaTimeCodecsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.joda;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/LocalDateCodecTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/LocalDateCodecTest.java
index 3c52ce4..d76b50b 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/LocalDateCodecTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/LocalDateCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.joda;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/LocalTimeCodecTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/LocalTimeCodecTest.java
index 623446a..973e821 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/LocalTimeCodecTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/LocalTimeCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.joda;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/json/JacksonJsonCodecTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/json/JacksonJsonCodecTest.java
index cb172cb..15cc376 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/json/JacksonJsonCodecTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/json/JacksonJsonCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.json;
diff --git a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/json/Jsr353JsonCodecTest.java b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/json/Jsr353JsonCodecTest.java
index ccc1ea3..a79b76c 100644
--- a/driver-extras/src/test/java/com/datastax/driver/extras/codecs/json/Jsr353JsonCodecTest.java
+++ b/driver-extras/src/test/java/com/datastax/driver/extras/codecs/json/Jsr353JsonCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.extras.codecs.json;
diff --git a/driver-extras/src/test/resources/log4j.properties b/driver-extras/src/test/resources/log4j.properties
index c6f3416..a0990d8 100644
--- a/driver-extras/src/test/resources/log4j.properties
+++ b/driver-extras/src/test/resources/log4j.properties
@@ -1,17 +1,17 @@
#
-# Copyright (C) 2012-2015 DataStax Inc.
+# Copyright (C) 2012-2017 DataStax Inc.
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# Set root logger level to OFF and its only appender to A1.
diff --git a/driver-mapping/pom.xml b/driver-mapping/pom.xml
index cba79c4..c8616e7 100644
--- a/driver-mapping/pom.xml
+++ b/driver-mapping/pom.xml
@@ -1,129 +1,116 @@
<!--
- Copyright (C) 2012-2015 DataStax Inc.
+ Copyright (C) 2012-2017 DataStax Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-parent</artifactId>
- <version>3.2.1-SNAPSHOT</version>
+ <version>3.3.3-SNAPSHOT</version>
</parent>
+
<artifactId>cassandra-driver-mapping</artifactId>
<packaging>bundle</packaging>
<name>DataStax Java Driver for Apache Cassandra - Object Mapping</name>
<description>Object mapper for the DataStax CQL Java Driver.</description>
- <url>https://github.com/datastax/java-driver</url>
-
- <properties>
- <main.basedir>${project.parent.basedir}</main.basedir>
- <groovy.version>2.4.7</groovy.version>
- </properties>
<dependencies>
+
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
- <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>com.datastax.cassandra</groupId>
- <artifactId>cassandra-driver-core</artifactId>
- <version>${project.parent.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>${testng.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-core</artifactId>
+ <type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
- <version>${assertj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
- <version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
- <version>${commons-exec.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
- <artifactId>asm-all</artifactId>
- <version>5.0.3</version>
+ <artifactId>asm</artifactId>
<scope>test</scope>
</dependency>
- <!--
- <dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm</artifactId>
- <version>4.1</version>
- </dependency>
- <dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm-util</artifactId>
- <version>4.1</version>
- </dependency>
- -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
- <version>${log4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
- <version>${slf4j-log4j12.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
- <version>${groovy.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
+
<plugins>
+
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
- <version>1.12</version>
<executions>
<execution>
<id>add-source</id>
@@ -139,88 +126,26 @@
</execution>
</executions>
</plugin>
+
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <version>2.4.0</version>
- <executions>
- <execution>
- <id>bundle-manifest</id>
- <phase>process-classes</phase>
- <goals>
- <goal>manifest</goal>
- </goals>
- </execution>
- </executions>
<configuration>
<instructions>
<Bundle-SymbolicName>com.datastax.driver.mapping</Bundle-SymbolicName>
- <Bundle-Version>${project.version}</Bundle-Version>
- <_include>-osgi.bnd</_include>
<Import-Package><![CDATA[com.google.common.*;version="[16.0.1,22)",*]]></Import-Package>
</instructions>
- <supportedProjectTypes>
- <supportedProjectType>jar</supportedProjectType>
- <supportedProjectType>bundle</supportedProjectType>
- <supportedProjectType>pom</supportedProjectType>
- </supportedProjectTypes>
</configuration>
</plugin>
+
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
- <version>1.5</version>
- <extensions>true</extensions>
- <executions>
- <execution>
- <goals>
- <goal>testCompile</goal>
- </goals>
- <configuration>
- <sources>
- <fileset>
- <directory>${pom.basedir}/src/test/groovy</directory>
- <includes>
- <include>**/*.groovy</include>
- </includes>
- </fileset>
- </sources>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-all</artifactId>
- <version>${groovy.version}</version>
- </dependency>
- </dependencies>
</plugin>
+
</plugins>
+
</build>
- <licenses>
- <license>
- <name>Apache 2</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- <comments>Apache License Version 2.0</comments>
- </license>
- </licenses>
-
- <scm>
- <connection>scm:git:git@github.com:datastax/java-driver.git</connection>
- <developerConnection>scm:git:git@github.com:datastax/java-driver.git</developerConnection>
- <url>https://github.com/datastax/java-driver</url>
- <tag>HEAD</tag>
- </scm>
-
- <developers>
- <developer>
- <name>Various</name>
- <organization>DataStax</organization>
- </developer>
- </developers>
</project>
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/AccessorInvocationHandler.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/AccessorInvocationHandler.java
index 38a3e07..760ce92 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/AccessorInvocationHandler.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/AccessorInvocationHandler.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/AccessorMapper.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/AccessorMapper.java
index 68e6ca9..c59a083 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/AccessorMapper.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/AccessorMapper.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/AliasedMappedProperty.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/AliasedMappedProperty.java
index 16e6eca..bcf0b98 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/AliasedMappedProperty.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/AliasedMappedProperty.java
@@ -1,27 +1,35 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
-class AliasedMappedProperty<T> {
+class AliasedMappedProperty implements Comparable<AliasedMappedProperty> {
- final MappedProperty<T> mappedProperty;
+ final MappedProperty<Object> mappedProperty;
final String alias;
- AliasedMappedProperty(MappedProperty<T> mappedProperty, String alias) {
- this.mappedProperty = mappedProperty;
+ @SuppressWarnings("unchecked")
+ AliasedMappedProperty(MappedProperty<?> mappedProperty, String alias) {
+ this.mappedProperty = (MappedProperty<Object>) mappedProperty;
this.alias = alias;
}
+
+ @Override
+ public int compareTo(AliasedMappedProperty that) {
+ String thisColName = mappedProperty.getMappedName();
+ String thatColName = that.mappedProperty.getMappedName();
+ return thisColName.compareTo(thatColName);
+ }
}
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationChecks.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationChecks.java
index ffc30f9..ebc6823 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationChecks.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationChecks.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
@@ -95,9 +95,9 @@
}
}
- static void validateOrder(List<AliasedMappedProperty<?>> properties, String annotation) {
+ static void validateOrder(List<AliasedMappedProperty> properties, String annotation) {
for (int i = 0; i < properties.size(); i++) {
- AliasedMappedProperty<?> property = properties.get(i);
+ AliasedMappedProperty property = properties.get(i);
int pos = property.mappedProperty.getPosition();
if (pos != i)
throw new IllegalArgumentException(String.format("Invalid ordering value %d for annotation %s of property '%s', was expecting %d",
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationParser.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationParser.java
index b8e0c92..d071082 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationParser.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationParser.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
@@ -36,9 +36,9 @@
*/
class AnnotationParser {
- private static final Comparator<AliasedMappedProperty<?>> POSITION_COMPARATOR = new Comparator<AliasedMappedProperty<?>>() {
+ private static final Comparator<AliasedMappedProperty> POSITION_COMPARATOR = new Comparator<AliasedMappedProperty>() {
@Override
- public int compare(AliasedMappedProperty<?> o1, AliasedMappedProperty<?> o2) {
+ public int compare(AliasedMappedProperty o1, AliasedMappedProperty o2) {
return o1.mappedProperty.getPosition() - o2.mappedProperty.getPosition();
}
};
@@ -78,13 +78,13 @@
EntityMapper<T> mapper = new EntityMapper<T>(entityClass, ksName, tableName, writeConsistency, readConsistency);
- List<AliasedMappedProperty<?>> pks = new ArrayList<AliasedMappedProperty<?>>();
- List<AliasedMappedProperty<?>> ccs = new ArrayList<AliasedMappedProperty<?>>();
- List<AliasedMappedProperty<?>> rgs = new ArrayList<AliasedMappedProperty<?>>();
+ List<AliasedMappedProperty> pks = new ArrayList<AliasedMappedProperty>();
+ List<AliasedMappedProperty> ccs = new ArrayList<AliasedMappedProperty>();
+ List<AliasedMappedProperty> rgs = new ArrayList<AliasedMappedProperty>();
MappingConfiguration configuration = mappingManager.getConfiguration();
Set<? extends MappedProperty<?>> properties = configuration.getPropertyMapper().mapTable(entityClass);
- AtomicInteger columnCounter = mappingManager.isCassandraV1 ? null : new AtomicInteger(0);
+ AtomicInteger columnCounter = mappingManager.protocolVersionAsInt == 1 ? null : new AtomicInteger(0);
for (MappedProperty<?> mappedProperty : properties) {
@@ -92,9 +92,9 @@
? "col" + columnCounter.incrementAndGet()
: null;
- AliasedMappedProperty<?> aliasedMappedProperty = new AliasedMappedProperty(mappedProperty, alias);
+ AliasedMappedProperty aliasedMappedProperty = new AliasedMappedProperty(mappedProperty, alias);
- if (mappingManager.isCassandraV1 && mappedProperty.isComputed())
+ if (mappingManager.protocolVersionAsInt == 1 && mappedProperty.isComputed())
throw new UnsupportedOperationException("Computed properties are not supported with native protocol v1");
if (!mappedProperty.isComputed() && tableMetadata.getColumn(mappedProperty.getMappedName()) == null)
@@ -147,14 +147,14 @@
if (userType == null)
throw new IllegalArgumentException(String.format("User type %s does not exist in keyspace %s", udtName, ksName));
- Map<String, AliasedMappedProperty<?>> propertyMappers = new HashMap<String, AliasedMappedProperty<?>>();
+ Map<String, AliasedMappedProperty> propertyMappers = new HashMap<String, AliasedMappedProperty>();
MappingConfiguration configuration = mappingManager.getConfiguration();
Set<? extends MappedProperty<?>> properties = configuration.getPropertyMapper().mapUdt(udtClass);
for (MappedProperty<?> mappedProperty : properties) {
- AliasedMappedProperty<?> aliasedMappedProperty = new AliasedMappedProperty(mappedProperty, null);
+ AliasedMappedProperty aliasedMappedProperty = new AliasedMappedProperty(mappedProperty, null);
if (!userType.contains(mappedProperty.getMappedName()))
throw new IllegalArgumentException(String.format("Field %s does not exist in type %s.%s",
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultHierarchyScanStrategy.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultHierarchyScanStrategy.java
index 02bc8c2..6565cd4 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultHierarchyScanStrategy.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultHierarchyScanStrategy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultMappedProperty.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultMappedProperty.java
index 5b3c4f6..dea4ea0 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultMappedProperty.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultMappedProperty.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultNamingStrategy.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultNamingStrategy.java
index 088e044..a6edf54 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultNamingStrategy.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultNamingStrategy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultPropertyMapper.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultPropertyMapper.java
index b973f2f..08fb988 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultPropertyMapper.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/DefaultPropertyMapper.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/DriverThrowables.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/DriverThrowables.java
index dbb9db8..7e7da57 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/DriverThrowables.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/DriverThrowables.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/EntityMapper.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/EntityMapper.java
index b494763..6f239b5 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/EntityMapper.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/EntityMapper.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
@@ -29,10 +29,10 @@
final ConsistencyLevel writeConsistency;
final ConsistencyLevel readConsistency;
- final List<AliasedMappedProperty<?>> partitionKeys = new ArrayList<AliasedMappedProperty<?>>();
- final List<AliasedMappedProperty<?>> clusteringColumns = new ArrayList<AliasedMappedProperty<?>>();
+ final List<AliasedMappedProperty> partitionKeys = new ArrayList<AliasedMappedProperty>();
+ final List<AliasedMappedProperty> clusteringColumns = new ArrayList<AliasedMappedProperty>();
- final List<AliasedMappedProperty<?>> allColumns = new ArrayList<AliasedMappedProperty<?>>();
+ final List<AliasedMappedProperty> allColumns = new ArrayList<AliasedMappedProperty>();
EntityMapper(Class<T> entityClass, String keyspace, String table, ConsistencyLevel writeConsistency, ConsistencyLevel readConsistency) {
this.entityClass = entityClass;
@@ -46,11 +46,11 @@
return partitionKeys.size() + clusteringColumns.size();
}
- AliasedMappedProperty<?> getPrimaryKeyColumn(int i) {
+ AliasedMappedProperty getPrimaryKeyColumn(int i) {
return i < partitionKeys.size() ? partitionKeys.get(i) : clusteringColumns.get(i - partitionKeys.size());
}
- void addColumns(List<AliasedMappedProperty<?>> pks, List<AliasedMappedProperty<?>> ccs, List<AliasedMappedProperty<?>> rgs) {
+ void addColumns(List<AliasedMappedProperty> pks, List<AliasedMappedProperty> ccs, List<AliasedMappedProperty> rgs) {
partitionKeys.addAll(pks);
clusteringColumns.addAll(ccs);
allColumns.addAll(pks);
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/HierarchyScanStrategy.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/HierarchyScanStrategy.java
index b3ec589..eb9d89f 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/HierarchyScanStrategy.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/HierarchyScanStrategy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/MappedClassesOnlyHierarchyScanStrategy.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/MappedClassesOnlyHierarchyScanStrategy.java
index 5a80a86..fb0c0a9 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/MappedClassesOnlyHierarchyScanStrategy.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/MappedClassesOnlyHierarchyScanStrategy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/MappedProperty.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/MappedProperty.java
index ed424f2..a48b2d0 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/MappedProperty.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/MappedProperty.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/MappedUDTCodec.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/MappedUDTCodec.java
index 4730683..f6f430d 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/MappedUDTCodec.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/MappedUDTCodec.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
@@ -29,10 +29,10 @@
class MappedUDTCodec<T> extends TypeCodec.AbstractUDTCodec<T> {
private final UserType cqlUserType;
private final Class<T> udtClass;
- private final Map<String, AliasedMappedProperty<?>> columnMappers;
+ private final Map<String, AliasedMappedProperty> columnMappers;
private final CodecRegistry codecRegistry;
- MappedUDTCodec(UserType cqlUserType, Class<T> udtClass, Map<String, AliasedMappedProperty<?>> columnMappers, MappingManager mappingManager) {
+ MappedUDTCodec(UserType cqlUserType, Class<T> udtClass, Map<String, AliasedMappedProperty> columnMappers, MappingManager mappingManager) {
super(cqlUserType, udtClass);
this.cqlUserType = cqlUserType;
this.udtClass = udtClass;
@@ -52,7 +52,7 @@
@Override
protected ByteBuffer serializeField(T source, String fieldName, ProtocolVersion protocolVersion) {
@SuppressWarnings("unchecked")
- AliasedMappedProperty<Object> aliasedMappedProperty = (AliasedMappedProperty<Object>) columnMappers.get(fieldName);
+ AliasedMappedProperty aliasedMappedProperty = columnMappers.get(fieldName);
if (aliasedMappedProperty == null)
return null;
@@ -71,7 +71,7 @@
@Override
protected T deserializeAndSetField(ByteBuffer input, T target, String fieldName, ProtocolVersion protocolVersion) {
@SuppressWarnings("unchecked")
- AliasedMappedProperty<Object> aliasedMappedProperty = (AliasedMappedProperty<Object>) columnMappers.get(fieldName);
+ AliasedMappedProperty aliasedMappedProperty = columnMappers.get(fieldName);
if (aliasedMappedProperty != null) {
TypeCodec<Object> codec = aliasedMappedProperty.mappedProperty.getCustomCodec();
if (codec == null)
@@ -86,7 +86,7 @@
@Override
protected String formatField(T source, String fieldName) {
@SuppressWarnings("unchecked")
- AliasedMappedProperty<Object> aliasedMappedProperty = (AliasedMappedProperty<Object>) columnMappers.get(fieldName);
+ AliasedMappedProperty aliasedMappedProperty = columnMappers.get(fieldName);
if (aliasedMappedProperty == null)
return null;
Object value = aliasedMappedProperty.mappedProperty.getValue(source);
@@ -101,7 +101,7 @@
@Override
protected T parseAndSetField(String input, T target, String fieldName) {
@SuppressWarnings("unchecked")
- AliasedMappedProperty<Object> aliasedMappedProperty = (AliasedMappedProperty<Object>) columnMappers.get(fieldName);
+ AliasedMappedProperty aliasedMappedProperty = columnMappers.get(fieldName);
if (aliasedMappedProperty != null) {
TypeCodec<Object> codec = aliasedMappedProperty.mappedProperty.getCustomCodec();
if (codec == null)
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/Mapper.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/Mapper.java
index c3286f7..e2c0d90 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/Mapper.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/Mapper.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
@@ -171,15 +171,18 @@
* Creates a query that can be used to save the provided entity.
* <p/>
* This method is useful if you want to setup a number of options (tracing,
- * conistency level, ...) of the returned statement before executing it manually
+ * consistency level, ...) of the returned statement before executing it manually
* or need access to the {@code ResultSet} object after execution (to get the
* trace, the execution info, ...), but in other cases, calling {@link #save}
* or {@link #saveAsync} is shorter.
+ * <p/>
+ * Note: this method might block if the query is not prepared yet.
*
* @param entity the entity to save.
- * @return a query that saves {@code entity} (based on it's defined mapping).
+ * @return a query that saves {@code entity} (based on its defined mapping).
*/
public Statement saveQuery(T entity) {
+ checkNotInEventLoop();
try {
return Uninterruptibles.getUninterruptibly(saveQueryAsync(entity, this.defaultSaveOptions));
} catch (ExecutionException e) {
@@ -191,7 +194,7 @@
* Creates a query that can be used to save the provided entity.
* <p/>
* This method is useful if you want to setup a number of options (tracing,
- * conistency level, ...) of the returned statement before executing it manually
+ * consistency level, ...) of the returned statement before executing it manually
* or need access to the {@code ResultSet} object after execution (to get the
* trace, the execution info, ...), but in other cases, calling {@link #save}
* or {@link #saveAsync} is shorter.
@@ -203,11 +206,13 @@
* <li>Consistency level</li>
* <li>Tracing</li>
* </ul>
+ * Note: this method might block if the query is not prepared yet.
*
* @param entity the entity to save.
- * @return a query that saves {@code entity} (based on it's defined mapping).
+ * @return a query that saves {@code entity} (based on its defined mapping).
*/
public Statement saveQuery(T entity, Option... options) {
+ checkNotInEventLoop();
try {
return Uninterruptibles.getUninterruptibly(saveQueryAsync(entity, toMapWithDefaults(options, this.defaultSaveOptions)));
} catch (ExecutionException e) {
@@ -216,25 +221,26 @@
}
private ListenableFuture<BoundStatement> saveQueryAsync(T entity, final EnumMap<Option.Type, Option> options) {
- final Map<AliasedMappedProperty, Object> values = new HashMap<AliasedMappedProperty, Object>();
- boolean saveNullFields = shouldSaveNullFields(options);
+ final Map<AliasedMappedProperty, Object> columnToValue = new TreeMap<AliasedMappedProperty, Object>();
+ final boolean useUnsetForNullValue = !shouldSaveNullFields(options) && manager.protocolVersionAsInt >= 4;
+ final boolean includeColumnsWithNullValue = shouldSaveNullFields(options) || useUnsetForNullValue;
for (AliasedMappedProperty col : mapper.allColumns) {
Object value = col.mappedProperty.getValue(entity);
- if (!col.mappedProperty.isComputed() && (saveNullFields || value != null)) {
- values.put(col, value);
+ if (!col.mappedProperty.isComputed() && (includeColumnsWithNullValue || value != null)) {
+ columnToValue.put(col, value);
}
}
- return Futures.transform(getPreparedQueryAsync(QueryType.SAVE, values.keySet(), options), new Function<PreparedStatement, BoundStatement>() {
+ return Futures.transform(getPreparedQueryAsync(QueryType.SAVE, columnToValue.keySet(), options), new Function<PreparedStatement, BoundStatement>() {
@Override
public BoundStatement apply(PreparedStatement input) {
BoundStatement bs = input.bind();
int i = 0;
- for (Map.Entry<AliasedMappedProperty, Object> entry : values.entrySet()) {
+ for (Map.Entry<AliasedMappedProperty, Object> entry : columnToValue.entrySet()) {
AliasedMappedProperty mapper = entry.getKey();
Object value = entry.getValue();
- setObject(bs, i++, value, mapper);
+ setObject(bs, i++, value, mapper, useUnsetForNullValue);
}
if (mapper.writeConsistency != null)
@@ -255,9 +261,12 @@
return option == null || option.saveNullFields;
}
- private static <T> void setObject(BoundStatement bs, int i, T value, AliasedMappedProperty<T> mapper) {
- TypeCodec<T> customCodec = mapper.mappedProperty.getCustomCodec();
- if (customCodec != null)
+ private static <T> void setObject(BoundStatement bs, int i, T value, AliasedMappedProperty mapper, boolean saveNullFieldsAsUnset) {
+ @SuppressWarnings("unchecked")
+ TypeCodec<T> customCodec = (TypeCodec<T>) mapper.mappedProperty.getCustomCodec();
+ if (saveNullFieldsAsUnset && value == null)
+ bs.unset(i);
+ else if (customCodec != null)
bs.set(i, value, customCodec);
else
bs.set(i, value, mapper.mappedProperty.getPropertyType());
@@ -267,10 +276,13 @@
* Saves an entity mapped by this mapper.
* <p/>
* This method is basically equivalent to: {@code getManager().getSession().execute(saveQuery(entity))}.
+ * <p/>
+ * Note: this method will block until the entity is fully saved.
*
* @param entity the entity to save.
*/
public void save(T entity) {
+ checkNotInEventLoop();
try {
Uninterruptibles.getUninterruptibly(saveAsync(entity));
} catch (ExecutionException e) {
@@ -288,11 +300,13 @@
* <li>Consistency level</li>
* <li>Tracing</li>
* </ul>
+ * Note: this method will block until the entity is fully saved.
*
* @param entity the entity to save.
* @param options the options object specified defining special options when saving.
*/
public void save(T entity, Option... options) {
+ checkNotInEventLoop();
try {
Uninterruptibles.getUninterruptibly(saveAsync(entity, options));
} catch (ExecutionException e) {
@@ -342,7 +356,7 @@
* KEY (in the order of said primary key).
* <p/>
* This method is useful if you want to setup a number of options (tracing,
- * conistency level, ...) of the returned statement before executing it manually,
+ * consistency level, ...) of the returned statement before executing it manually,
* but in other cases, calling {@link #get} or {@link #getAsync} is shorter.
* <p/>
* This method allows you to provide a suite of {@link Option} to include in
@@ -351,6 +365,7 @@
* <li>Consistency level</li>
* <li>Tracing</li>
* </ul>
+ * Note: this method might block if the query is not prepared yet.
*
* @param objects the primary key of the entity to fetch, or more precisely
* the values for the columns of said primary key in the order of the primary key.
@@ -361,6 +376,7 @@
* at least one of those values is {@code null}.
*/
public Statement getQuery(Object... objects) {
+ checkNotInEventLoop();
try {
return Uninterruptibles.getUninterruptibly(getQueryAsync(objects));
} catch (ExecutionException e) {
@@ -393,14 +409,13 @@
BoundStatement bs = new MapperBoundStatement(input);
int i = 0;
for (Object value : primaryKeys) {
- @SuppressWarnings("unchecked")
- AliasedMappedProperty<Object> column = (AliasedMappedProperty<Object>) mapper.getPrimaryKeyColumn(i);
+ AliasedMappedProperty column = mapper.getPrimaryKeyColumn(i);
if (value == null) {
throw new IllegalArgumentException(
String.format("Invalid null value for PRIMARY KEY column %s (argument %d)",
column.mappedProperty.getMappedName(), i));
}
- setObject(bs, i++, value, column);
+ setObject(bs, i++, value, column, false);
}
if (mapper.readConsistency != null)
@@ -419,6 +434,8 @@
* Fetch an entity based on its primary key.
* <p/>
* This method is basically equivalent to: {@code map(getManager().getSession().execute(getQuery(objects))).one()}.
+ * <p/>
+ * Note: this method will block until the entity is fully fetched.
*
* @param objects the primary key of the entity to fetch, or more precisely
* the values for the columns of said primary key in the order of the primary key.
@@ -429,6 +446,7 @@
* at least one of those values is {@code null}.
*/
public T get(Object... objects) {
+ checkNotInEventLoop();
try {
return Uninterruptibles.getUninterruptibly(getAsync(objects));
} catch (ExecutionException e) {
@@ -471,7 +489,7 @@
* is supported for DELETE queries.
* <p/>
* This method is useful if you want to setup a number of options (tracing,
- * conistency level, ...) of the returned statement before executing it manually
+ * consistency level, ...) of the returned statement before executing it manually
* or need access to the {@code ResultSet} object after execution (to get the
* trace, the execution info, ...), but in other cases, calling {@link #delete}
* or {@link #deleteAsync} is shorter.
@@ -483,13 +501,15 @@
* <li>Consistency level</li>
* <li>Tracing</li>
* </ul>
+ * Note: this method might block if the query is not prepared yet.
*
* @param entity the entity to delete.
* @param options the options to add to the DELETE query.
- * @return a query that delete {@code entity} (based on it's defined mapping) with
+ * @return a query that delete {@code entity} (based on its defined mapping) with
* provided USING options.
*/
public Statement deleteQuery(T entity, Option... options) {
+ checkNotInEventLoop();
try {
return Uninterruptibles.getUninterruptibly(deleteQueryAsync(entity, toMapWithDefaults(options, defaultDeleteOptions)));
} catch (ExecutionException e) {
@@ -504,15 +524,18 @@
* provided entity and call {@link #deleteQuery(Object...)} with it.
* <p/>
* This method is useful if you want to setup a number of options (tracing,
- * conistency level, ...) of the returned statement before executing it manually
+ * consistency level, ...) of the returned statement before executing it manually
* or need access to the {@code ResultSet} object after execution (to get the
* trace, the execution info, ...), but in other cases, calling {@link #delete}
* or {@link #deleteAsync} is shorter.
+ * <p/>
+ * Note: this method might block if the query is not prepared yet.
*
* @param entity the entity to delete.
- * @return a query that delete {@code entity} (based on it's defined mapping).
+ * @return a query that delete {@code entity} (based on its defined mapping).
*/
public Statement deleteQuery(T entity) {
+ checkNotInEventLoop();
try {
return Uninterruptibles.getUninterruptibly(deleteQueryAsync(entity, defaultDeleteOptions));
} catch (ExecutionException e) {
@@ -530,7 +553,7 @@
* is supported for DELETE queries.
* <p/>
* This method is useful if you want to setup a number of options (tracing,
- * conistency level, ...) of the returned statement before executing it manually
+ * consistency level, ...) of the returned statement before executing it manually
* or need access to the {@code ResultSet} object after execution (to get the
* trace, the execution info, ...), but in other cases, calling {@link #delete}
* or {@link #deleteAsync} is shorter.
@@ -541,6 +564,7 @@
* <li>Consistency level</li>
* <li>Tracing</li>
* </ul>
+ * Note: this method might block if the query is not prepared yet.
*
* @param objects the primary key of the entity to delete, or more precisely
* the values for the columns of said primary key in the order of the primary key.
@@ -552,6 +576,7 @@
* at least one of those values is {@code null}.
*/
public Statement deleteQuery(Object... objects) {
+ checkNotInEventLoop();
try {
return Uninterruptibles.getUninterruptibly(deleteQueryAsync(objects));
} catch (ExecutionException e) {
@@ -602,12 +627,12 @@
int columnNumber = 0;
for (Object value : primaryKey) {
@SuppressWarnings("unchecked")
- AliasedMappedProperty<Object> column = (AliasedMappedProperty<Object>) mapper.getPrimaryKeyColumn(columnNumber);
+ AliasedMappedProperty column = mapper.getPrimaryKeyColumn(columnNumber);
if (value == null) {
throw new IllegalArgumentException(String.format("Invalid null value for PRIMARY KEY column %s (argument %d)",
column.mappedProperty.getMappedName(), i));
}
- setObject(bs, i++, value, column);
+ setObject(bs, i++, value, column, false);
columnNumber++;
}
return bs;
@@ -619,10 +644,13 @@
* Deletes an entity mapped by this mapper.
* <p/>
* This method is basically equivalent to: {@code getManager().getSession().execute(deleteQuery(entity))}.
+ * <p/>
+ * Note: this method will block until the entity is fully deleted.
*
* @param entity the entity to delete.
*/
public void delete(T entity) {
+ checkNotInEventLoop();
try {
Uninterruptibles.getUninterruptibly(deleteAsync(entity));
} catch (ExecutionException e) {
@@ -634,11 +662,14 @@
* Deletes an entity mapped by this mapper using provided options.
* <p/>
* This method is basically equivalent to: {@code getManager().getSession().execute(deleteQuery(entity, options))}.
+ * <p/>
+ * Note: this method will block until the entity is fully deleted.
*
* @param entity the entity to delete.
* @param options the options to add to the DELETE query.
*/
public void delete(T entity, Option... options) {
+ checkNotInEventLoop();
try {
Uninterruptibles.getUninterruptibly(deleteAsync(entity, options));
} catch (ExecutionException e) {
@@ -675,6 +706,8 @@
* Deletes an entity based on its primary key.
* <p/>
* This method is basically equivalent to: {@code getManager().getSession().execute(deleteQuery(objects))}.
+ * <p/>
+ * Note: this method will block until the entity is fully deleted.
*
* @param objects the primary key of the entity to delete, or more precisely
* the values for the columns of said primary key in the order
@@ -685,6 +718,7 @@
* at least one of those values is {@code null}.
*/
public void delete(Object... objects) {
+ checkNotInEventLoop();
try {
Uninterruptibles.getUninterruptibly(deleteAsync(objects));
} catch (ExecutionException e) {
@@ -728,7 +762,7 @@
* and vice-versa.
*/
public Result<T> map(ResultSet resultSet) {
- boolean useAlias = !manager.isCassandraV1 && isFromMapperQuery(resultSet);
+ boolean useAlias = (manager.protocolVersionAsInt > 1) && isFromMapperQuery(resultSet);
return new Result<T>(resultSet, mapper, useAlias);
}
@@ -765,7 +799,7 @@
*/
@Deprecated
public Result<T> mapAliased(ResultSet resultSet) {
- return (manager.isCassandraV1)
+ return (manager.protocolVersionAsInt == 1)
? map(resultSet) // no aliases
: new Result<T>(resultSet, mapper, true);
}
@@ -841,6 +875,13 @@
return result;
}
+ private void checkNotInEventLoop() {
+ Session session = manager.getSession();
+ if (session instanceof AbstractSession) {
+ ((AbstractSession) session).checkNotInEventLoop();
+ }
+ }
+
/**
* An option for a mapper operation.
* <p/>
@@ -1007,7 +1048,7 @@
@Override
void validate(QueryType qt, MappingManager manager) {
- checkArgument(!manager.isCassandraV1, "TTL option requires native protocol v2 or above");
+ checkArgument(!(manager.protocolVersionAsInt < 2), "TTL option requires native protocol v2 or above");
checkArgument(qt == QueryType.SAVE, "TTL option is only allowed in save queries");
}
@@ -1057,7 +1098,7 @@
@Override
void validate(QueryType qt, MappingManager manager) {
- checkArgument(!manager.isCassandraV1, "Timestamp option requires native protocol v2 or above");
+ checkArgument(!(manager.protocolVersionAsInt < 2), "Timestamp option requires native protocol v2 or above");
checkArgument(qt == QueryType.SAVE || qt == QueryType.DEL, "Timestamp option is only allowed in save and delete queries");
}
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/MapperBoundStatement.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/MapperBoundStatement.java
index d64cf81..77f5612 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/MapperBoundStatement.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/MapperBoundStatement.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/MappingConfiguration.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/MappingConfiguration.java
index 76b7541..3f851f8 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/MappingConfiguration.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/MappingConfiguration.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/MappingManager.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/MappingManager.java
index 56faaba..8514466 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/MappingManager.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/MappingManager.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
@@ -36,7 +36,7 @@
private final Session session;
private final MappingConfiguration configuration;
- final boolean isCassandraV1;
+ final int protocolVersionAsInt;
private final ConcurrentHashMap<Class<?>, Mapper<?>> mappers = new ConcurrentHashMap<Class<?>, Mapper<?>>();
private final ConcurrentHashMap<Class<?>, MappedUDTCodec<?>> udtCodecs = new ConcurrentHashMap<Class<?>, MappedUDTCodec<?>>();
@@ -108,11 +108,13 @@
public MappingManager(Session session, MappingConfiguration configuration, ProtocolVersion protocolVersion) {
this.session = session;
this.configuration = configuration;
- // This is not strictly correct because we could connect to C* 2.0 with the v1 protocol.
+
+ // This is not strictly correct in clusters with mixed C* node versions, which typically can occur when upgrading to
+ // a major version in Cassandra that has a protocol change.
// But mappers need to make a decision early so that generated queries are compatible, and we don't know in advance
// which nodes might join the cluster later.
// At least if protocol >=2 we know there won't be any 1.2 nodes ever.
- this.isCassandraV1 = (protocolVersion == ProtocolVersion.V1);
+ this.protocolVersionAsInt = protocolVersion.toInt();
session.getCluster().register(new SchemaChangeListenerBase() {
@Override
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/MethodMapper.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/MethodMapper.java
index 1d98cb2..e629367 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/MethodMapper.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/MethodMapper.java
@@ -1,21 +1,22 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
import com.datastax.driver.core.*;
+import com.datastax.driver.mapping.annotations.Defaults;
import com.google.common.collect.Sets;
import com.google.common.reflect.TypeToken;
import com.google.common.util.concurrent.Futures;
@@ -186,14 +187,7 @@
this.paramName = paramName;
this.paramIdx = paramIdx;
this.paramType = (TypeToken<Object>) paramType;
- try {
- this.codec = (codecClass == null) ? null : (TypeCodec<Object>) codecClass.newInstance();
- } catch (Exception e) {
- throw new IllegalArgumentException(String.format(
- "Cannot create instance of codec %s for parameter %s",
- codecClass, (paramName == null) ? paramIdx : paramName
- ), e);
- }
+ this.codec = codecClass == null || codecClass.equals(Defaults.NoCodec.class) ? null : (TypeCodec<Object>) ReflectionUtils.newInstance(codecClass);
}
void setValue(BoundStatement boundStatement, Object arg) {
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/NamingConvention.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/NamingConvention.java
index 89d221c..025ee03 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/NamingConvention.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/NamingConvention.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/NamingConventions.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/NamingConventions.java
index e0b0dde..7257464 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/NamingConventions.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/NamingConventions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/NamingStrategy.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/NamingStrategy.java
index 6758dfd..8fdb270 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/NamingStrategy.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/NamingStrategy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/PropertyAccessStrategy.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/PropertyAccessStrategy.java
index d1eda31..97b82e1 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/PropertyAccessStrategy.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/PropertyAccessStrategy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/PropertyMapper.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/PropertyMapper.java
index f396913..b83c116 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/PropertyMapper.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/PropertyMapper.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/PropertyTransienceStrategy.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/PropertyTransienceStrategy.java
index 046e1a8..b26ae61 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/PropertyTransienceStrategy.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/PropertyTransienceStrategy.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/QueryType.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/QueryType.java
index dab865e..1c8e18f 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/QueryType.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/QueryType.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/ReflectionUtils.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/ReflectionUtils.java
index dcd024d..79b727e 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/ReflectionUtils.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/ReflectionUtils.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/Result.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/Result.java
index 47d5fa7..4b08f18 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/Result.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/Result.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
@@ -39,9 +39,9 @@
private T map(Row row) {
T entity = mapper.newEntity();
- for (AliasedMappedProperty<?> c : mapper.allColumns) {
+ for (AliasedMappedProperty c : mapper.allColumns) {
@SuppressWarnings("unchecked")
- AliasedMappedProperty<Object> col = (AliasedMappedProperty<Object>) c;
+ AliasedMappedProperty col = c;
String name = col.alias != null && this.useAlias ? col.alias : col.mappedProperty.getMappedName();
if (!row.getColumnDefinitions().contains(name))
continue;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/TypeMappings.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/TypeMappings.java
index e8def3d..0b19ae9 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/TypeMappings.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/TypeMappings.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/Word.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/Word.java
index a612ea8..49a41c6 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/Word.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/Word.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Accessor.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Accessor.java
index 80cf2c6..a79580e 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Accessor.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Accessor.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/ClusteringColumn.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/ClusteringColumn.java
index 5b31a47..f47367a 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/ClusteringColumn.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/ClusteringColumn.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Column.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Column.java
index e0043be..0ceb561 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Column.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Column.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Computed.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Computed.java
index b83e403..ec9d24b 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Computed.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Computed.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Defaults.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Defaults.java
index 4908d8a..8fdc82c 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Defaults.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Defaults.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Field.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Field.java
index 8cbc886..439b8b3 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Field.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Field.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Frozen.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Frozen.java
index 9b2755a..499c1cf 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Frozen.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Frozen.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/FrozenKey.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/FrozenKey.java
index cb69a75..7212426 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/FrozenKey.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/FrozenKey.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/FrozenValue.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/FrozenValue.java
index 3d6ffc8..e863d56 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/FrozenValue.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/FrozenValue.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Param.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Param.java
index 0efd60f..fee2bac 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Param.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Param.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/PartitionKey.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/PartitionKey.java
index ee430b8..1dc6db6 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/PartitionKey.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/PartitionKey.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Query.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Query.java
index 4f16bf2..9b41adb 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Query.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Query.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/QueryParameters.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/QueryParameters.java
index 3265750..e0c2def 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/QueryParameters.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/QueryParameters.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Table.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Table.java
index ef3db48..060616b 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Table.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Table.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Transient.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Transient.java
index 7f74335..d72a24b 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Transient.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Transient.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/UDT.java b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/UDT.java
index 3d4f24a..d947fdf 100644
--- a/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/UDT.java
+++ b/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/UDT.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping.annotations;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAccessorParamsTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAccessorParamsTest.java
index 52da572..3f18c49 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAccessorParamsTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAccessorParamsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAccessorTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAccessorTest.java
index c28c827..2f91686 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAccessorTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAccessorTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAsyncResultTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAsyncResultTest.java
index 87bc75a..81fae44 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAsyncResultTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAsyncResultTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAsyncTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAsyncTest.java
index 4087c77..8ee04b1 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAsyncTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAsyncTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperCaseSensitivityTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperCaseSensitivityTest.java
index a312cf9..988d9e4 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperCaseSensitivityTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperCaseSensitivityTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperCompositeKeyTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperCompositeKeyTest.java
index f0b30cf..6ffc283 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperCompositeKeyTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperCompositeKeyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperComputedFieldsTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperComputedFieldsTest.java
index 6722dcb..b5f47f8 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperComputedFieldsTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperComputedFieldsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperCustomCodecTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperCustomCodecTest.java
index 676e608..daa93b2 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperCustomCodecTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperCustomCodecTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperDefaultKeyspaceTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperDefaultKeyspaceTest.java
index 6a82012..9a10cd9 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperDefaultKeyspaceTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperDefaultKeyspaceTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperInvalidAnnotationsTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperInvalidAnnotationsTest.java
index a6f3135..bdd12c1 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperInvalidAnnotationsTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperInvalidAnnotationsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperMaterializedViewTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperMaterializedViewTest.java
index f15ec3e..3921ae6 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperMaterializedViewTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperMaterializedViewTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperNestedCollectionsTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperNestedCollectionsTest.java
index b8fb15e..db5344b 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperNestedCollectionsTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperNestedCollectionsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperNestedUDTTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperNestedUDTTest.java
index bebd474..e3b9a06 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperNestedUDTTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperNestedUDTTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperOptionTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperOptionTest.java
index 8e17733..49558b2 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperOptionTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperOptionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPolymorphismTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPolymorphismTest.java
index 38c165d..1463dee 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPolymorphismTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPolymorphismTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPrimitiveTypes22Test.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPrimitiveTypes22Test.java
index dc03cf0..f86f7e8 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPrimitiveTypes22Test.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPrimitiveTypes22Test.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPrimitiveTypesTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPrimitiveTypesTest.java
index a16f437..d55b337 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPrimitiveTypesTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPrimitiveTypesTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperReconnectionTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperReconnectionTest.java
index 7c325e5..98bd34c 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperReconnectionTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperReconnectionTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperSaveNullFieldsTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperSaveNullFieldsTest.java
index 0479e1c..a8a5a2e 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperSaveNullFieldsTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperSaveNullFieldsTest.java
@@ -1,32 +1,38 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
import com.datastax.driver.core.BoundStatement;
import com.datastax.driver.core.CCMTestsSupport;
+import com.datastax.driver.core.Session;
import com.datastax.driver.core.utils.CassandraVersion;
import com.datastax.driver.mapping.Mapper.Option;
import com.datastax.driver.mapping.annotations.PartitionKey;
import com.datastax.driver.mapping.annotations.Table;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import java.util.List;
+import java.util.Set;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import static org.assertj.core.api.Assertions.assertThat;
@SuppressWarnings("unused")
+@CassandraVersion("2.1.0")
public class MapperSaveNullFieldsTest extends CCMTestsSupport {
Mapper<User> mapper;
@@ -41,6 +47,53 @@
mapper = new MappingManager(session()).mapper(User.class);
}
+ /**
+ * ensure that queries generated between different sessions consistently generates the same prepared statement
+ * query for different permutations of null columns being present and saved.
+ *
+ * @jira_ticket JAVA-1587
+ */
+ @Test(groups = "short")
+ public void should_order_save_query_prepared_statement_columns_consistently() {
+ List<List<String>> allSessionStatements = Lists.newArrayList();
+ for (int i = 0; i < 5; i++) {
+ Session session = cluster().connect(keyspace);
+ Mapper<User> userMapper = new MappingManager(session()).mapper(User.class);
+
+ List<String> statements = Lists.newArrayList();
+
+ // generate a variety of permutations of columns being present
+ // both present
+ statements.add(getQuery(userMapper, false, false, Option.saveNullFields(false)));
+ // neither name or phone present
+ statements.add(getQuery(userMapper, true, true, Option.saveNullFields(false)));
+ // name not present
+ statements.add(getQuery(userMapper, true, false, Option.saveNullFields(false)));
+ // phone not present
+ statements.add(getQuery(userMapper, false, true, Option.saveNullFields(false)));
+
+ allSessionStatements.add(statements);
+ session.close();
+ }
+
+ int statementCount = allSessionStatements.iterator().next().size();
+ for (int i = 0; i < statementCount; i++) {
+ Set<String> uniqueStatements = Sets.newTreeSet();
+ for (List<String> statements : allSessionStatements) {
+ uniqueStatements.add(statements.get(i));
+ }
+ assertThat(uniqueStatements).as("Expected only one statement permutation, must not be ordered consistently.").hasSize(1);
+ }
+ }
+
+ private String getQuery(Mapper<User> mapper, boolean nullName, boolean nullPhone, Option... options) {
+ String newName = nullName ? null : "new_name";
+ String newPhone = nullPhone ? null : "new_phone";
+ User newUser = new User("test_login", newName, newPhone);
+
+ return ((BoundStatement) mapper.saveQuery(newUser, options)).preparedStatement().getQueryString();
+ }
+
@CassandraVersion("2.1.0")
@Test(groups = "short")
void should_save_null_fields_if_requested() {
@@ -76,6 +129,8 @@
session().execute("insert into user(login, name, phone) "
+ "values ('test_login', 'previous_name', 'previous_phone')");
+ boolean unsetSupported = session().getCluster().getConfiguration().getProtocolOptions().getProtocolVersion().toInt() >= 4;
+
String newName = nullName ? null : "new_name";
String newPhone = nullPhone ? null : "new_phone";
String description = String.format("update with name=%s, phone = %s", newName, newPhone);
@@ -84,15 +139,27 @@
// Check if null fields are included in generated statement:
BoundStatement bs = (BoundStatement) mapper.saveQuery(newUser, options);
String queryString = bs.preparedStatement().getQueryString();
- if (nullName && !saveExpected)
- assertThat(queryString).as(description).doesNotContain("name");
- else
+ if (nullName && !saveExpected) {
+ if (unsetSupported) {
+ assertThat(queryString).as(description).contains("name");
+ assertThat(!bs.isSet("name"));
+ } else {
+ assertThat(queryString).as(description).doesNotContain("name");
+ }
+ } else {
assertThat(queryString).as(description).contains("name");
+ }
- if (nullPhone && !saveExpected)
- assertThat(queryString).as(description).doesNotContain("phone");
- else
+ if (nullPhone && !saveExpected) {
+ if (unsetSupported) {
+ assertThat(queryString).as(description).contains("phone");
+ assertThat(!bs.isSet("phone"));
+ } else {
+ assertThat(queryString).as(description).doesNotContain("phone");
+ }
+ } else {
assertThat(queryString).as(description).contains("phone");
+ }
// Save entity and check the data
mapper.save(newUser, options);
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperTest.java
index 751ec0a..15280c1 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
@@ -20,7 +20,12 @@
import com.datastax.driver.core.utils.MoreObjects;
import com.datastax.driver.core.utils.UUIDs;
import com.datastax.driver.mapping.annotations.*;
+import com.google.common.base.Function;
+import com.google.common.base.Throwables;
+import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.testng.annotations.Test;
import java.net.InetAddress;
@@ -29,7 +34,10 @@
import java.util.Set;
import java.util.UUID;
+import static com.datastax.driver.core.ConsistencyLevel.ONE;
+import static com.datastax.driver.mapping.Mapper.Option.consistencyLevel;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.fail;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
@@ -39,6 +47,8 @@
@SuppressWarnings({"unused", "WeakerAccess"})
public class MapperTest extends CCMTestsSupport {
+ Logger logger = LoggerFactory.getLogger(MapperTest.class);
+
@Override
public void onTestContextInitialized() {
// We'll allow to generate those create statement from the annotated entities later, but it's currently
@@ -156,7 +166,6 @@
@Column(name = "user_id")
private UUID userId;
-
private Set<String> tags;
public Post() {
@@ -367,7 +376,128 @@
m.delete(p3.getUserId(), p3.getPostId());
assertTrue(postAccessor.getAllAsync(u1.getUserId()).get().isExhausted());
+ }
+ /**
+ * Iterates over all the places where we check for io thread re-use and ensures that we throw
+ * the appropriate exception when io thread re-use is attempted.
+ *
+ * @jira_ticket JAVA-1458
+ * @test_category object_mapper
+ */
+ @Test(groups = "short")
+ public void should_fail_when_io_thread_used() throws Exception {
+ MappingManager manager = new MappingManager(session());
+ final Mapper<User> mapper = manager.mapper(User.class);
+ final User u = new User("Paul", "paul@yahoo.com");
+ ListenableFuture<Void> f = mapper.saveAsync(u);
+
+ //Get function
+ executeFunctionAndTestForException(u, mapper, new Function<Void, Thread>() {
+ @Override
+ public Thread apply(Void v) {
+ mapper.get(u.getUserId());
+ return Thread.currentThread();
+ }
+ });
+ //GetQuery function
+ executeFunctionAndTestForException(u, mapper, new Function<Void, Thread>() {
+ @Override
+ public Thread apply(Void v) {
+ mapper.getQuery(u.getUserId());
+ return Thread.currentThread();
+ }
+ });
+ //Save functions
+ executeFunctionAndTestForException(u, mapper, new Function<Void, Thread>() {
+ @Override
+ public Thread apply(Void v) {
+ mapper.save(u);
+ return Thread.currentThread();
+ }
+ });
+ executeFunctionAndTestForException(u, mapper, new Function<Void, Thread>() {
+ @Override
+ public Thread apply(Void v) {
+ mapper.save(u, consistencyLevel(ONE));
+ return Thread.currentThread();
+ }
+ });
+ //SaveQuery functions
+ executeFunctionAndTestForException(u, mapper, new Function<Void, Thread>() {
+ @Override
+ public Thread apply(Void v) {
+ mapper.saveQuery(u);
+ return Thread.currentThread();
+ }
+ });
+
+ executeFunctionAndTestForException(u, mapper, new Function<Void, Thread>() {
+ @Override
+ public Thread apply(Void v) {
+ mapper.saveQuery(u, consistencyLevel(ONE));
+ return Thread.currentThread();
+ }
+ });
+ //Delete functions
+ executeFunctionAndTestForException(u, mapper, new Function<Void, Thread>() {
+ @Override
+ public Thread apply(Void v) {
+ mapper.delete(u);
+ return Thread.currentThread();
+ }
+ });
+ executeFunctionAndTestForException(u, mapper, new Function<Void, Thread>() {
+ @Override
+ public Thread apply(Void v) {
+ mapper.delete(u, consistencyLevel(ONE));
+ return Thread.currentThread();
+ }
+ });
+
+ //DeleteQuery functions
+ executeFunctionAndTestForException(u, mapper, new Function<Void, Thread>() {
+ @Override
+ public Thread apply(Void v) {
+ mapper.deleteQuery(u);
+ return Thread.currentThread();
+ }
+ });
+ executeFunctionAndTestForException(u, mapper, new Function<Void, Thread>() {
+ @Override
+ public Thread apply(Void v) {
+ mapper.deleteQuery(u, consistencyLevel(ONE));
+ return Thread.currentThread();
+ }
+ });
+ executeFunctionAndTestForException(u, mapper, new Function<Void, Thread>() {
+ @Override
+ public Thread apply(Void v) {
+ mapper.deleteQuery(u.getUserId());
+ return Thread.currentThread();
+ }
+ });
+ }
+
+ private void executeFunctionAndTestForException(User u, Mapper<User> mapper, Function<Void, Thread> f2) {
+ ListenableFuture<Void> f = mapper.saveAsync(u);
+ ListenableFuture<Thread> toTest = Futures.transform(f, f2);
+ try {
+ Thread executedThread = toTest.get();
+ if (executedThread == Thread.currentThread()) {
+ // Callback was invoked on the same thread, which indicates that the future completed
+ // before the transform callback was registered. Try again to produce case where callback
+ // is called on io thread.
+ logger.warn("Future completed before transform callback registered, will try again.");
+ executeFunctionAndTestForException(u, mapper, f2);
+ } else {
+ fail("Expected a failed future, callback was executed on " + executedThread);
+ }
+ } catch (Exception e) {
+ assertThat(Throwables.getRootCause(e))
+ .isInstanceOf(IllegalStateException.class)
+ .hasMessageContaining("Detected a synchronous call on an I/O thread");
+ }
}
@Test(groups = "short")
@@ -502,7 +632,6 @@
assertThat(saveQuery.isIdempotent()).isTrue();
}
-
@Table(name = "users")
public static class UserUnknownColumn {
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTCollectionsTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTCollectionsTest.java
index 90aa474..a533835 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTCollectionsTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTCollectionsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java
index d393369..1288609 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationHierarchyScanStrategyTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationHierarchyScanStrategyTest.java
index 4a98260..99db686 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationHierarchyScanStrategyTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationHierarchyScanStrategyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationNamingStrategyTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationNamingStrategyTest.java
index f40339f..0d3c7e7 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationNamingStrategyTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationNamingStrategyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationPropertyAccessTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationPropertyAccessTest.java
index 8d0eea2..f2d50b7 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationPropertyAccessTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationPropertyAccessTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationTransienceStrategyTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationTransienceStrategyTest.java
index f936bef..7235fdd 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationTransienceStrategyTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationTransienceStrategyTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationTransientTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationTransientTest.java
index 058fadf..b5f43b2 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationTransientTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/MappingConfigurationTransientTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/NamingConventionsTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/NamingConventionsTest.java
index 3c0f50f..1957030 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/NamingConventionsTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/NamingConventionsTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/SyntheticFieldsMapperTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/SyntheticFieldsMapperTest.java
index 4bc8dc3..f0c23c1 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/SyntheticFieldsMapperTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/SyntheticFieldsMapperTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/java/com/datastax/driver/mapping/UDTFieldMapperTest.java b/driver-mapping/src/test/java/com/datastax/driver/mapping/UDTFieldMapperTest.java
index 4ad7106..e964c04 100644
--- a/driver-mapping/src/test/java/com/datastax/driver/mapping/UDTFieldMapperTest.java
+++ b/driver-mapping/src/test/java/com/datastax/driver/mapping/UDTFieldMapperTest.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.mapping;
diff --git a/driver-mapping/src/test/resources/log4j.properties b/driver-mapping/src/test/resources/log4j.properties
index d4363e8..e861d4a 100644
--- a/driver-mapping/src/test/resources/log4j.properties
+++ b/driver-mapping/src/test/resources/log4j.properties
@@ -1,17 +1,17 @@
#
-# Copyright (C) 2012-2015 DataStax Inc.
+# Copyright (C) 2012-2017 DataStax Inc.
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# Set root logger level to DEBUG and its only appender to A1.
diff --git a/driver-tests/osgi/pom.xml b/driver-tests/osgi/pom.xml
index f96bf89..15ef388 100644
--- a/driver-tests/osgi/pom.xml
+++ b/driver-tests/osgi/pom.xml
@@ -1,88 +1,84 @@
<!--
- Copyright (C) 2012-2015 DataStax Inc.
+ Copyright (C) 2012-2017 DataStax Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-tests-parent</artifactId>
- <version>3.2.1-SNAPSHOT</version>
+ <version>3.3.3-SNAPSHOT</version>
</parent>
<artifactId>cassandra-driver-tests-osgi</artifactId>
- <packaging>jar</packaging>
<name>DataStax Java Driver for Apache Cassandra Tests - OSGi</name>
<description>A test for the DataStax Java Driver in an OSGi container.</description>
- <url>https://github.com/datastax/java-driver</url>
-
- <properties>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <felix.version>4.4.1</felix.version>
- <!-- more recent version require JDK7+ -->
- <pax-exam.version>3.6.0</pax-exam.version>
- <url.version>2.4.0</url.version>
- <logback.version>1.1.3</logback.version>
- <slf4j.version>1.7.5</slf4j.version>
- <test.groups>none</test.groups>
- <!--
- Skip tests by default, short or long profile is required to run tests in this module
- since pax-exam will throw exception if it encounters a
- test with no matching methods.
- -->
- <test.skip>true</test.skip>
- <main.basedir>${project.parent.parent.basedir}</main.basedir>
- </properties>
<dependencies>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
- <version>${project.parent.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.github.jnr</groupId>
+ <artifactId>jnr-ffi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.github.jnr</groupId>
+ <artifactId>jnr-posix</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-mapping</artifactId>
- <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-extras</artifactId>
- <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
- <version>${felix.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>io.dropwizard.metrics</groupId>
+ <artifactId>metrics-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
- <version>${project.parent.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
@@ -90,78 +86,60 @@
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam</artifactId>
- <version>${pax-exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-testng</artifactId>
- <version>${pax-exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-container-forked</artifactId>
- <version>${pax-exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-link-mvn</artifactId>
- <version>${pax-exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.url</groupId>
<artifactId>pax-url-reference</artifactId>
- <version>${url.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
- <version>1.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>3.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
- <version>1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
- <version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
- <version>${logback.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-core</artifactId>
- <version>${logback.version}</version>
- <scope>test</scope>
</dependency>
</dependencies>
@@ -176,25 +154,16 @@
get automatically passed to tests run with IntelliJ
-->
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.18.1</version>
<configuration>
<skip>true</skip>
- <systemPropertyVariables>
- <cassandra.version>${cassandra.version}</cassandra.version>
- <ipprefix>${ipprefix}</ipprefix>
- </systemPropertyVariables>
</configuration>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
- <version>2.18.1</version>
<configuration>
- <skip>${test.skip}</skip>
- <groups>${test.groups}</groups>
+ <skip>${test.osgi.skip}</skip>
<systemPropertyVariables>
<cassandra.version>${cassandra.version}</cassandra.version>
<!-- pull in declared version properties, this ensures we test with the same versions used by the driver -->
@@ -207,29 +176,18 @@
<logback.version>${logback.version}</logback.version>
<metrics.version>${metrics.version}</metrics.version>
<testng.version>${testng.version}</testng.version>
+ <jsr353-api.version>${jsr353-api.version}</jsr353-api.version>
<ipprefix>${ipprefix}</ipprefix>
</systemPropertyVariables>
</configuration>
- <executions>
- <execution>
- <id>default</id>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
- </execution>
- </executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <version>2.4.0</version>
<configuration>
<instructions>
<Bundle-SymbolicName>com.datastax.driver.osgi</Bundle-SymbolicName>
- <Bundle-Version>${project.version}</Bundle-Version>
<Export-Package>com.datastax.driver.osgi.api,!com.datastax.driver.osgi.impl</Export-Package>
<Bundle-Activator>com.datastax.driver.osgi.impl.Activator</Bundle-Activator>
<_include>-osgi.bnd</_include>
@@ -238,7 +196,7 @@
<executions>
<execution>
<id>bundle-manifest</id>
- <phase>compile</phase>
+ <phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
@@ -246,73 +204,9 @@
</executions>
</plugin>
- <!--
- To launch Pax Runner and check that all driver bundles are correctly provisioned,
- do the following:
- mvn pax:run
- Note: you MUST run 'mvn install' on the entire project before!
- -->
- <plugin>
- <groupId>org.ops4j</groupId>
- <artifactId>maven-pax-plugin</artifactId>
- <version>1.6.0</version>
- <configuration>
- <framework>felix</framework>
- <showWarnings>true</showWarnings>
- <provision>
- <param>--platform=felix</param>
- <param>--version=${felix.version}</param>
- <param>--log=debug</param>
- <param>--systemPackages=sun.misc</param>
- </provision>
- </configuration>
- </plugin>
-
</plugins>
</build>
- <profiles>
-
- <profile>
- <id>short</id>
- <properties>
- <test.groups>unit,short</test.groups>
- <test.skip>false</test.skip>
- </properties>
- </profile>
-
- <profile>
- <id>long</id>
- <properties>
- <test.groups>unit,short,long</test.groups>
- <test.skip>false</test.skip>
- </properties>
- </profile>
-
- </profiles>
-
- <licenses>
- <license>
- <name>Apache 2</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- <comments>Apache License Version 2.0</comments>
- </license>
- </licenses>
-
- <scm>
- <connection>scm:git:git@github.com:datastax/java-driver.git</connection>
- <developerConnection>scm:git:git@github.com:datastax/java-driver.git</developerConnection>
- <url>https://github.com/datastax/java-driver</url>
- <tag>HEAD</tag>
- </scm>
-
- <developers>
- <developer>
- <name>Various</name>
- <organization>DataStax</organization>
- </developer>
- </developers>
</project>
diff --git a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxException.java b/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxException.java
index ce6f835..35f01aa 100644
--- a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxException.java
+++ b/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxException.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi.api;
diff --git a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxMessage.java b/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxMessage.java
index 10ca08b..bba7fac 100644
--- a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxMessage.java
+++ b/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxMessage.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi.api;
diff --git a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxService.java b/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxService.java
index ec277c4..2ef8201 100644
--- a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxService.java
+++ b/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxService.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi.api;
diff --git a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/Activator.java b/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/Activator.java
index 28d6539..3037fb4 100644
--- a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/Activator.java
+++ b/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/Activator.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi.impl;
diff --git a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/MailboxImpl.java b/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/MailboxImpl.java
index efc186f..0c4575b 100644
--- a/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/MailboxImpl.java
+++ b/driver-tests/osgi/src/main/java/com/datastax/driver/osgi/impl/MailboxImpl.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi.impl;
@@ -23,12 +23,16 @@
import com.datastax.driver.osgi.api.MailboxException;
import com.datastax.driver.osgi.api.MailboxMessage;
import com.datastax.driver.osgi.api.MailboxService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import static com.datastax.driver.core.querybuilder.QueryBuilder.*;
import static com.datastax.driver.osgi.api.MailboxMessage.TABLE;
public class MailboxImpl implements MailboxService {
+ private static final Logger LOGGER = LoggerFactory.getLogger(MailboxImpl.class);
+
private final Session session;
private final String keyspace;
@@ -61,6 +65,9 @@
mapper = mappingManager.mapper(MailboxMessage.class);
+ // Exercise metrics
+ LOGGER.info("Number of requests: {}", session.getCluster().getMetrics().getRequestsTimer().getCount());
+
initialized = true;
}
diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java
index aa22917..718fe31 100644
--- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java
+++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi;
@@ -20,16 +20,32 @@
import com.datastax.driver.core.ProtocolOptions;
import com.datastax.driver.core.TestUtils;
import com.google.common.collect.Lists;
+import java.util.List;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.options.CompositeOption;
import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
import org.ops4j.pax.exam.options.UrlProvisionOption;
import org.ops4j.pax.exam.util.PathUtils;
-import java.util.List;
+import static org.ops4j.pax.exam.CoreOptions.bootDelegationPackage;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemPackages;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-import static org.ops4j.pax.exam.CoreOptions.*;
-
+/**
+ * To check that all driver bundles are correctly provisioned, or to debug provisioning problems,
+ * run the Maven Pax Runner plugin:
+ * <pre>
+ * mvn pax:run
+ * </pre>
+ * The plugin will start a Felix Gogo interactive shell and attempt to provision the driver bundles.
+ * <p/>
+ * Note: you MUST run 'mvn install' on the entire project before!
+ *
+ * @see <a href="http://felix.apache.org/documentation/subprojects/apache-felix-gogo.html">Apache Felix Gogo Documentation</a>
+ */
public class BundleOptions {
public static UrlProvisionOption driverBundle() {
diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/CCMBridgeListener.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/CCMBridgeListener.java
index 40a133b..6956881 100644
--- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/CCMBridgeListener.java
+++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/CCMBridgeListener.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi;
diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceDefaultIT.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceDefaultIT.java
index 9c902e7..13fd90b 100644
--- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceDefaultIT.java
+++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceDefaultIT.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi;
diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava17IT.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava17IT.java
index 78d8789..522f319 100644
--- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava17IT.java
+++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava17IT.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi;
diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava18IT.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava18IT.java
index 89deef7..ae0e8e3 100644
--- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava18IT.java
+++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava18IT.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi;
diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava19IT.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava19IT.java
index 5e08ef5..b4047a5 100644
--- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava19IT.java
+++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava19IT.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi;
diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava20IT.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava20IT.java
index 833d713..2e04a8e 100644
--- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava20IT.java
+++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava20IT.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi;
diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava21IT.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava21IT.java
index 6235f5e..de4f308 100644
--- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava21IT.java
+++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava21IT.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi;
diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceHdrHistogramIT.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceHdrHistogramIT.java
index ac01c56..e843432 100644
--- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceHdrHistogramIT.java
+++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceHdrHistogramIT.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi;
diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceLZ4IT.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceLZ4IT.java
index 7cb2c80..6a1534c 100644
--- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceLZ4IT.java
+++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceLZ4IT.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi;
diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceShadedIT.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceShadedIT.java
index 105b24c..3b3ba67 100644
--- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceShadedIT.java
+++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceShadedIT.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi;
diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java
index 202e78a..bdaac64 100644
--- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java
+++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceSnappyIT.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi;
diff --git a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceTests.java b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceTests.java
index fea01f0..f0e7e2e 100644
--- a/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceTests.java
+++ b/driver-tests/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceTests.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.osgi;
diff --git a/driver-tests/osgi/src/test/resources/exam.properties b/driver-tests/osgi/src/test/resources/exam.properties
index 8e8132a..5d82c09 100644
--- a/driver-tests/osgi/src/test/resources/exam.properties
+++ b/driver-tests/osgi/src/test/resources/exam.properties
@@ -1,17 +1,17 @@
#
-# Copyright (C) 2012-2015 DataStax Inc.
+# Copyright (C) 2012-2017 DataStax Inc.
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
pax.exam.system=test
diff --git a/driver-tests/osgi/src/test/resources/logback.xml b/driver-tests/osgi/src/test/resources/logback.xml
index 16d7dea..316e0d6 100644
--- a/driver-tests/osgi/src/test/resources/logback.xml
+++ b/driver-tests/osgi/src/test/resources/logback.xml
@@ -1,18 +1,18 @@
<!--
- Copyright (C) 2012-2015 DataStax Inc.
+ Copyright (C) 2012-2017 DataStax Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
<configuration>
diff --git a/driver-tests/pom.xml b/driver-tests/pom.xml
index 64d9755..0741b14 100644
--- a/driver-tests/pom.xml
+++ b/driver-tests/pom.xml
@@ -1,65 +1,41 @@
<!--
- Copyright (C) 2012-2015 DataStax Inc.
+ Copyright (C) 2012-2017 DataStax Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-parent</artifactId>
- <version>3.2.1-SNAPSHOT</version>
+ <version>3.3.3-SNAPSHOT</version>
</parent>
+
<artifactId>cassandra-driver-tests-parent</artifactId>
<packaging>pom</packaging>
<name>DataStax Java Driver for Apache Cassandra Tests</name>
<description>Tests for the DataStax Java Driver for Apache Cassandra.</description>
- <url>https://github.com/datastax/java-driver</url>
-
- <properties>
- <main.basedir>${project.parent.basedir}</main.basedir>
- </properties>
<modules>
<module>stress</module>
<module>osgi</module>
+ <module>shading</module>
</modules>
- <licenses>
- <license>
- <name>Apache 2</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- <comments>Apache License Version 2.0</comments>
- </license>
- </licenses>
-
- <scm>
- <connection>scm:git:git@github.com:datastax/java-driver.git</connection>
- <developerConnection>scm:git:git@github.com:datastax/java-driver.git</developerConnection>
- <url>https://github.com/datastax/java-driver</url>
- <tag>HEAD</tag>
- </scm>
-
- <developers>
- <developer>
- <name>Various</name>
- <organization>DataStax</organization>
- </developer>
- </developers>
-
<build>
<plugins>
@@ -67,25 +43,41 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>clirr-maven-plugin</artifactId>
- <version>2.7</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <configuration>
+ <skipSource>true</skipSource>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+
+ <plugin>
<artifactId>maven-install-plugin</artifactId>
- <version>2.5.1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
- <version>2.8.1</version>
<configuration>
<skip>true</skip>
</configuration>
@@ -95,4 +87,23 @@
</build>
+ <profiles>
+
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <configuration>
+ <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
</project>
diff --git a/driver-tests/shading/pom.xml b/driver-tests/shading/pom.xml
new file mode 100644
index 0000000..46b9f0f
--- /dev/null
+++ b/driver-tests/shading/pom.xml
@@ -0,0 +1,47 @@
+<!--
+
+ Copyright (C) 2012-2017 DataStax Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-tests-parent</artifactId>
+ <version>3.3.3-SNAPSHOT</version>
+ </parent>
+
+ <packaging>pom</packaging>
+ <artifactId>cassandra-driver-tests-shading</artifactId>
+ <name>DataStax Java Driver for Apache Cassandra Tests - Shading</name>
+ <description>A test project for tests which ensure that the shading of the driver didn't break anything.</description>
+
+ <modules>
+ <module>shaded</module>
+ <module>unshaded</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
+
diff --git a/driver-tests/shading/shaded/pom.xml b/driver-tests/shading/shaded/pom.xml
new file mode 100644
index 0000000..86f7de1
--- /dev/null
+++ b/driver-tests/shading/shaded/pom.xml
@@ -0,0 +1,65 @@
+<!--
+
+ Copyright (C) 2012-2017 DataStax Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-tests-shading</artifactId>
+ <version>3.3.3-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>cassandra-driver-tests-shading-shaded</artifactId>
+ <name>DataStax Java Driver for Apache Cassandra Tests - Shading - Shaded</name>
+ <description>The shading detection tests for the shaded driver</description>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-core</artifactId>
+ <classifier>shaded</classifier>
+ <exclusions>
+ <exclusion>
+ <artifactId>*</artifactId>
+ <groupId>io.netty</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!--
+ Explicitly add netty to the classpath to simulate another netty in the classpath
+ (which is the main reason for shading)
+ -->
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-handler</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
+
diff --git a/driver-tests/shading/shaded/src/test/java/com/datastax/driver/core/NettyUtilIT.java b/driver-tests/shading/shaded/src/test/java/com/datastax/driver/core/NettyUtilIT.java
new file mode 100644
index 0000000..c31de86
--- /dev/null
+++ b/driver-tests/shading/shaded/src/test/java/com/datastax/driver/core/NettyUtilIT.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2012-2017 DataStax Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.datastax.driver.core;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class NettyUtilIT {
+
+ @Test(groups = "unit")
+ public void should_detect_shaded_driver() {
+ Assert.assertTrue(NettyUtil.isShaded());
+ }
+
+}
diff --git a/driver-tests/shading/unshaded/pom.xml b/driver-tests/shading/unshaded/pom.xml
new file mode 100644
index 0000000..efc5fd0
--- /dev/null
+++ b/driver-tests/shading/unshaded/pom.xml
@@ -0,0 +1,48 @@
+<!--
+
+ Copyright (C) 2012-2017 DataStax Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-tests-shading</artifactId>
+ <version>3.3.3-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>cassandra-driver-tests-shading-unshaded</artifactId>
+ <name>DataStax Java Driver for Apache Cassandra Tests - Shading - Unshaded</name>
+ <description>The shading detection tests for the unshaded driver</description>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
+
diff --git a/driver-tests/shading/unshaded/src/test/java/com/datastax/driver/core/NettyUtilIT.java b/driver-tests/shading/unshaded/src/test/java/com/datastax/driver/core/NettyUtilIT.java
new file mode 100644
index 0000000..ef1e77d
--- /dev/null
+++ b/driver-tests/shading/unshaded/src/test/java/com/datastax/driver/core/NettyUtilIT.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2012-2017 DataStax Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.datastax.driver.core;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class NettyUtilIT {
+
+ @Test(groups = "unit")
+ public void should_detect_non_shaded_driver() {
+ Assert.assertFalse(NettyUtil.isShaded());
+ }
+
+}
diff --git a/driver-tests/stress/pom.xml b/driver-tests/stress/pom.xml
index 76c85b3..ccc4c0b 100644
--- a/driver-tests/stress/pom.xml
+++ b/driver-tests/stress/pom.xml
@@ -1,42 +1,44 @@
<!--
- Copyright (C) 2012-2015 DataStax Inc.
+ Copyright (C) 2012-2017 DataStax Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-tests-parent</artifactId>
- <version>3.2.1-SNAPSHOT</version>
+ <version>3.3.3-SNAPSHOT</version>
</parent>
+
<artifactId>cassandra-driver-tests-stress</artifactId>
- <packaging>jar</packaging>
<name>DataStax Java Driver for Apache Cassandra Tests - Stress</name>
<description>A stress test example for DataStax Java Driver for Apache Cassandra.</description>
- <url>https://github.com/datastax/java-driver</url>
-
- <properties>
- <main.basedir>${project.parent.parent.basedir}</main.basedir>
- </properties>
<dependencies>
+
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
- <version>3.2.1-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
</dependency>
<dependency>
@@ -54,21 +56,21 @@
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
- <version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
- <version>1.7.5</version>
</dependency>
+
</dependencies>
<build>
+
<plugins>
+
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
- <version>2.4</version>
<configuration>
<archive>
<manifest>
@@ -80,30 +82,10 @@
</descriptorRefs>
</configuration>
</plugin>
+
</plugins>
+
</build>
- <licenses>
- <license>
- <name>Apache 2</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- <comments>Apache License Version 2.0</comments>
- </license>
- </licenses>
-
- <scm>
- <connection>scm:git:git@github.com:datastax/java-driver.git</connection>
- <developerConnection>scm:git:git@github.com:datastax/java-driver.git</developerConnection>
- <url>https://github.com/datastax/java-driver</url>
- <tag>HEAD</tag>
- </scm>
-
- <developers>
- <developer>
- <name>Various</name>
- <organization>DataStax</organization>
- </developer>
- </developers>
</project>
diff --git a/driver-tests/stress/src/main/java/com/datastax/driver/stress/AsynchronousConsumer.java b/driver-tests/stress/src/main/java/com/datastax/driver/stress/AsynchronousConsumer.java
index 71c03e7..60723ae 100644
--- a/driver-tests/stress/src/main/java/com/datastax/driver/stress/AsynchronousConsumer.java
+++ b/driver-tests/stress/src/main/java/com/datastax/driver/stress/AsynchronousConsumer.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.stress;
diff --git a/driver-tests/stress/src/main/java/com/datastax/driver/stress/BlockingConsumer.java b/driver-tests/stress/src/main/java/com/datastax/driver/stress/BlockingConsumer.java
index d6bd47e..94cb607 100644
--- a/driver-tests/stress/src/main/java/com/datastax/driver/stress/BlockingConsumer.java
+++ b/driver-tests/stress/src/main/java/com/datastax/driver/stress/BlockingConsumer.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.stress;
diff --git a/driver-tests/stress/src/main/java/com/datastax/driver/stress/ConsistencyLevelConverter.java b/driver-tests/stress/src/main/java/com/datastax/driver/stress/ConsistencyLevelConverter.java
index ef0b210..0529f72 100644
--- a/driver-tests/stress/src/main/java/com/datastax/driver/stress/ConsistencyLevelConverter.java
+++ b/driver-tests/stress/src/main/java/com/datastax/driver/stress/ConsistencyLevelConverter.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.stress;
diff --git a/driver-tests/stress/src/main/java/com/datastax/driver/stress/Consumer.java b/driver-tests/stress/src/main/java/com/datastax/driver/stress/Consumer.java
index 244e292..b0092a1 100644
--- a/driver-tests/stress/src/main/java/com/datastax/driver/stress/Consumer.java
+++ b/driver-tests/stress/src/main/java/com/datastax/driver/stress/Consumer.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.stress;
diff --git a/driver-tests/stress/src/main/java/com/datastax/driver/stress/Generators.java b/driver-tests/stress/src/main/java/com/datastax/driver/stress/Generators.java
index 2da610e..fb7ce31 100644
--- a/driver-tests/stress/src/main/java/com/datastax/driver/stress/Generators.java
+++ b/driver-tests/stress/src/main/java/com/datastax/driver/stress/Generators.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.stress;
diff --git a/driver-tests/stress/src/main/java/com/datastax/driver/stress/QueryGenerator.java b/driver-tests/stress/src/main/java/com/datastax/driver/stress/QueryGenerator.java
index 52345a1..13f2297 100644
--- a/driver-tests/stress/src/main/java/com/datastax/driver/stress/QueryGenerator.java
+++ b/driver-tests/stress/src/main/java/com/datastax/driver/stress/QueryGenerator.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.stress;
diff --git a/driver-tests/stress/src/main/java/com/datastax/driver/stress/Reporter.java b/driver-tests/stress/src/main/java/com/datastax/driver/stress/Reporter.java
index cb0bc8f..891375a 100644
--- a/driver-tests/stress/src/main/java/com/datastax/driver/stress/Reporter.java
+++ b/driver-tests/stress/src/main/java/com/datastax/driver/stress/Reporter.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.stress;
diff --git a/driver-tests/stress/src/main/java/com/datastax/driver/stress/Stress.java b/driver-tests/stress/src/main/java/com/datastax/driver/stress/Stress.java
index fd52717..6c75626 100644
--- a/driver-tests/stress/src/main/java/com/datastax/driver/stress/Stress.java
+++ b/driver-tests/stress/src/main/java/com/datastax/driver/stress/Stress.java
@@ -1,17 +1,17 @@
/*
- * Copyright (C) 2012-2015 DataStax Inc.
+ * Copyright (C) 2012-2017 DataStax Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.datastax.driver.stress;
diff --git a/faq/README.md b/faq/README.md
index 97f8f56..b9adb5c 100644
--- a/faq/README.md
+++ b/faq/README.md
@@ -35,7 +35,7 @@
Note that, unlike manual inspection, `wasApplied` does not consume the first row.
-[wasApplied]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/ResultSet.html#wasApplied--
+[wasApplied]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/ResultSet.html#wasApplied--
### What is a parameterized statement and how can I use it?
@@ -198,7 +198,7 @@
to the user giving the impression that `lastname` was deleted.
In cassandra 2.2 and later with protocol v4, bind parameters (`?`) can
-optionally be left unset
+optionally be left unset.
([CASSANDRA-7304]):
```java
@@ -213,10 +213,55 @@
Another possible root cause for this is using the object mapper and leaving
fields set to `null`. This also causes tombstones to be inserted unless
-setting `saveNullFields` option to false. See [Mapper options] for more
-details.
+setting `saveNullFields` option to false.
+See [Mapper options] for more details.
-[Blobs.java]: https://github.com/datastax/java-driver/tree/3.2.0/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java
+### I am encountering `BusyPoolException`, what does this mean and how do I avoid it?
+
+Often while writing a bulk loading program or an application that does many concurrent operations a user may encounter
+exceptions such as the following:
+
+> com.datastax.driver.core.exceptions.BusyPoolException: [/X.X.X.X] Pool is busy (no available connection and the queue
+> has reached its max size 256)
+
+This typically means that your application is submitting too many concurrent requests and not enforcing any limitation
+on the number of requests that are being processed at once. A common mistake users might make is firing off a bunch
+of queries using `executeAsync` and not waiting for them to complete before submitting more.
+
+One simple approach to remedying this is to use something like a [Semaphore] to limit the number of concurrent
+`executeAsync` requests at a time. Alternatively, one could submit requests X at a time and collect the returned
+`ResultSetFuture`s from `executeAsync` and use [Futures.allAsList] and wait on completion of the resulting future
+before submitting the next batch.
+
+See the [Acquisition queue] section of the Pooling section in the manual for explanation of how the driver enqueues
+requests when connections are over-utilized.
+
+### What is Netty's native epoll transport and how do I enable or disable it?
+
+Netty provides [native transport libraries](http://netty.io/wiki/native-transports.html) which generally generate less
+garbage and improve performance when compared to the default NIO-based transport.
+By default if the driver detects the `netty-transport-native-epoll` library in its classpath it will attempt to use
+[`EpollEventLoopGroup`](https://netty.io/4.0/api/io/netty/channel/epoll/EpollEventLoopGroup.html) for its underlying
+event loop.
+
+In the usual case this works fine in linux environments. On the other hand, many users have run into compatibility
+issues when the version of `netty-transport-native-epoll` is not compatible with a version of Netty in an application's
+classpath. One such case is where an application depends on a version of `netty-all` that is different than the
+version of `netty-handler` that the driver depends on. In such a case, a user may encounter an exception such as the
+one described in [JAVA-1535](https://datastax-oss.atlassian.net/browse/JAVA-1535).
+
+While the epoll transport may in general improve performance, we expect the improvement to be marginal for a lot of use
+cases. Therefore, if you don't want `netty-transport-native-epoll` to be used by the driver even if the library is
+present in an application's classpath, the most direct way to disable this is to provide the system property value
+`-Dcom.datastax.driver.FORCE_NIO=true` to your application to force the use of the default Netty NIO-based event loop.
+If properly used, the following log message will be logged at INFO on startup:
+
+> Found Netty's native epoll transport in the classpath, but NIO was forced through the FORCE_NIO system property.
+
+[Blobs.java]: https://github.com/datastax/java-driver/tree/3.3.2/driver-examples/src/main/java/com/datastax/driver/examples/datatypes/Blobs.java
[CASSANDRA-7304]: https://issues.apache.org/jira/browse/CASSANDRA-7304
[Parameters and Binding]: ../manual/statements/prepared/#parameters-and-binding
[Mapper options]: ../manual/object_mapper/using/#mapper-options
+[Acquisition queue]: ../manual/pooling/#acquisition-queue
+[Semaphore]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Semaphore.html
+[Futures.allAsList]: https://google.github.io/guava/releases/19.0/api/docs/com/google/common/util/concurrent/Futures.html#allAsList(java.lang.Iterable)
\ No newline at end of file
diff --git a/faq/osgi/README.md b/faq/osgi/README.md
index 3081174..0b1d375 100644
--- a/faq/osgi/README.md
+++ b/faq/osgi/README.md
@@ -113,13 +113,13 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <version>1.7.12</version>
+ <version>1.7.25</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
- <version>1.1.2</version>
+ <version>1.2.3</version>
<scope>runtime</scope>
</dependency>
@@ -127,43 +127,6 @@
Please consult their documentation for further details.
-### I'm getting the error: "Unable to access `sun.misc.Unsafe`"
-
-Some of the driver dependencies try to access non-API packages
-such as `sun.misc`, which is usually not available in an OSGi container.
-
-Most of these libraries are smart enough to check if this package
-is available or not before actually trying to use it.
-
-However, the [metrics library](../../manual/metrics/) used by the driver
-attempts to load `sun.misc.Unsafe` without
-probing for it first, which may lead to bundle activation errors.
-
-[JAVA-1203] has been created to track this issue, which
-should be fixed in the next major release of the library.
-
-There are a few workarounds:
-
-- Add `sun.misc` to the list of system packages (i.e., packages
-exported by the system bundle), or to the list of boot delegation
-packages (i.e., defer loading of `sun.misc` to the boot classloader).
-This is the best option as it benefits to other libraries as well.
-With Felix, this can be achieved with one of the following start options:
-
- ```
- --bootDelegation=sun.misc
- --systemPackages=sun.misc
- ```
-
-- Disable metrics altogether:
-
- ```java
- Cluster cluster = Cluster.builder()
- .addContactPoints(...)
- .withoutMetrics()
- .build();
- ```
-
### I'm getting the error: "Could not load JNR C Library"
The driver is able to perform native system calls through JNR in some cases,
@@ -190,12 +153,11 @@
[OSGi]:https://www.osgi.org
[Felix]:https://cwiki.apache.org/confluence/display/FELIX/Index
-[JAVA-1203]:https://datastax-oss.atlassian.net/browse/JAVA-1203
[JAVA-1127]:https://datastax-oss.atlassian.net/browse/JAVA-1127
[BND]:http://bnd.bndtools.org/
[Maven bundle plugin]:https://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Maven+Bundle+Plugin+%28BND%29
[OSGi examples repository]:https://github.com/datastax/java-driver-examples-osgi
-[without metrics]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics--
+[without metrics]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Cluster.Builder.html#withoutMetrics--
[SLF4J]:http://www.slf4j.org/
[Logback]:http://logback.qos.ch/
[Tycho]:https://eclipse.org/tycho/
diff --git a/manual/README.md b/manual/README.md
index 019d994..4565da7 100644
--- a/manual/README.md
+++ b/manual/README.md
@@ -209,7 +209,7 @@
<tr> <td>blob</td> <td>getBytes</td> <td>java.nio.ByteBuffer</td> </tr>
<tr> <td>boolean</td> <td>getBool</td> <td>boolean</td> </tr>
<tr> <td>counter</td> <td>getLong</td> <td>long</td> </tr>
- <tr> <td>date</td> <td>getDate</td> <td><a href="http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/LocalDate.html">LocalDate</a></td> </tr>
+ <tr> <td>date</td> <td>getDate</td> <td><a href="http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/LocalDate.html">LocalDate</a></td> </tr>
<tr> <td>decimal</td> <td>getDecimal</td> <td>java.math.BigDecimal</td> </tr>
<tr> <td>double</td> <td>getDouble</td> <td>double</td> </tr>
<tr> <td>float</td> <td>getFloat</td> <td>float</td> </tr>
@@ -277,6 +277,11 @@
}
```
+### Object mapping
+
+Besides explicit work with queries and rows, you can also use
+[Object Mapper](object_mapper/) to simplify retrieval & store of your data.
+
### More information
@@ -286,17 +291,17 @@
github.com](https://github.com/datastax/java-driver/tree/3.x/manual),
simply navigate to each sub-directory.
-[Cluster]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Cluster.html
-[Cluster.Builder]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Cluster.Builder.html
-[Initializer]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Cluster.Initializer.html
-[Session]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Session.html
-[ResultSet]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/ResultSet.html
-[Row]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Row.html
-[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/NettyOptions.html
-[QueryOptions]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/QueryOptions.html
-[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SocketOptions.html
-[Host.StateListener]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Host.StateListener.html
-[LatencyTracker]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/LatencyTracker.html
-[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SchemaChangeListener.html
-[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/NoHostAvailableException.html
-[LocalDate]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/LocalDate.html
\ No newline at end of file
+[Cluster]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Cluster.html
+[Cluster.Builder]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Cluster.Builder.html
+[Initializer]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Cluster.Initializer.html
+[Session]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Session.html
+[ResultSet]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/ResultSet.html
+[Row]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Row.html
+[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/NettyOptions.html
+[QueryOptions]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/QueryOptions.html
+[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SocketOptions.html
+[Host.StateListener]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Host.StateListener.html
+[LatencyTracker]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/LatencyTracker.html
+[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SchemaChangeListener.html
+[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/NoHostAvailableException.html
+[LocalDate]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/LocalDate.html
\ No newline at end of file
diff --git a/manual/address_resolution/README.md b/manual/address_resolution/README.md
index 619fdf5..9613f0b 100644
--- a/manual/address_resolution/README.md
+++ b/manual/address_resolution/README.md
@@ -102,8 +102,8 @@
-[AddressTranslator]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/AddressTranslator.html
-[EC2MultiRegionAddressTranslator]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslator.html
+[AddressTranslator]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/AddressTranslator.html
+[EC2MultiRegionAddressTranslator]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslator.html
[cassandra.yaml]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html
[rpc_address]: https://docs.datastax.com/en/cassandra/3.x/cassandra/configuration/configCassandra_yaml.html?scroll=configCassandra_yaml__rpc_address
diff --git a/manual/async/README.md b/manual/async/README.md
index abc9305..b40f611 100644
--- a/manual/async/README.md
+++ b/manual/async/README.md
@@ -51,8 +51,8 @@
page (see also the section on [paging](../paging/)).
Here is a full example:
-[getAvailableWithoutFetching]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/ResultSet.html#getAvailableWithoutFetching--
-[fetchMoreResults]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/ResultSet.html#fetchMoreResults--
+[getAvailableWithoutFetching]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/ResultSet.html#getAvailableWithoutFetching--
+[fetchMoreResults]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/ResultSet.html#fetchMoreResults--
```java
Statement statement = new SimpleStatement("select * from foo").setFetchSize(20);
@@ -134,5 +134,5 @@
hasn't been fetched already.
[ListenableFuture]: https://github.com/google/guava/wiki/ListenableFutureExplained
-[init]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Cluster.html#init--
-[query trace]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/QueryTrace.html
+[init]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Cluster.html#init--
+[query trace]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/QueryTrace.html
diff --git a/manual/auth/README.md b/manual/auth/README.md
index 430e776..1a58239 100644
--- a/manual/auth/README.md
+++ b/manual/auth/README.md
@@ -2,4 +2,4 @@
*Coming soon... In the meantime, see the javadoc for [AuthProvider].*
-[AuthProvider]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/AuthProvider.html
\ No newline at end of file
+[AuthProvider]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/AuthProvider.html
\ No newline at end of file
diff --git a/manual/compression/README.md b/manual/compression/README.md
index 6fc87a0..541777b 100644
--- a/manual/compression/README.md
+++ b/manual/compression/README.md
@@ -85,4 +85,4 @@
.build();
```
-[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.2.0/cassandra-driver-parent-3.2.0.pom
+[pom]: https://repo1.maven.org/maven2/com/datastax/cassandra/cassandra-driver-parent/3.3.2/cassandra-driver-parent-3.3.2.pom
diff --git a/manual/custom_codecs/README.md b/manual/custom_codecs/README.md
index 4251640..856c368 100644
--- a/manual/custom_codecs/README.md
+++ b/manual/custom_codecs/README.md
@@ -446,26 +446,26 @@
consider using prepared statements all the time.
[JAVA-721]: https://datastax-oss.atlassian.net/browse/JAVA-721
-[TypeCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/TypeCodec.html
-[LocalDate]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/LocalDate.html
+[TypeCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/TypeCodec.html
+[LocalDate]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/LocalDate.html
[ByteBuffer]: http://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html
+[serialize]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/TypeCodec.html#serialize-T-com.datastax.driver.core.ProtocolVersion-
+[deserialize]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/TypeCodec.html#deserialize-java.nio.ByteBuffer-com.datastax.driver.core.ProtocolVersion-
+[TypeCodec.format]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/TypeCodec.html#format-T-
+[TypeCodec.parse]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/TypeCodec.html#parse-java.lang.String-
+[accepts]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/TypeCodec.html#accepts-com.datastax.driver.core.DataType-
+[CodecRegistry]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/CodecRegistry.html
+[CodecNotFoundException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/CodecNotFoundException.html
[Jackson]: https://github.com/FasterXML/jackson
-[serialize]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/TypeCodec.html#serialize-T-com.datastax.driver.core.ProtocolVersion-
-[TypeCodec.format]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/TypeCodec.html#format-T-
-[deserialize]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/TypeCodec.html#deserialize-java.nio.ByteBuffer-com.datastax.driver.core.ProtocolVersion-
-[TypeCodec.parse]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/TypeCodec.html#parse-java.lang.String-
-[CodecRegistry]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/CodecRegistry.html
-[accepts]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/TypeCodec.html#accepts-com.datastax.driver.core.DataType-
-[CodecNotFoundException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/CodecNotFoundException.html
[AbstractType]: https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/marshal/AbstractType.java
+[UserType]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/UserType.html
+[UDTValue]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/UDTValue.html
+[TupleType]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/TupleType.html
+[TupleValue]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/TupleValue.html
+[CustomType]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/DataType.CustomType.html
[TypeToken]: https://google.github.io/guava/releases/19.0/api/docs/com/google/common/reflect/TypeToken.html
-[UserType]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/UserType.html
-[UDTValue]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/UDTValue.html
-[TupleType]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/TupleType.html
-[TupleValue]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/TupleValue.html
-[CustomType]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/DataType.CustomType.html
-[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SimpleStatement.html
-[BuiltStatement]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/querybuilder/BuiltStatement.html
-[setSet]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SettableByIndexData.html#setSet-int-java.util.Set-
-[setList]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SettableByIndexData.html#setList-int-java.util.List-
-[setMap]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SettableByIndexData.html#setMap-int-java.util.Map-
+[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SimpleStatement.html
+[BuiltStatement]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/querybuilder/BuiltStatement.html
+[setList]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SettableByIndexData.html#setList-int-java.util.List-
+[setSet]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SettableByIndexData.html#setSet-int-java.util.Set-
+[setMap]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SettableByIndexData.html#setMap-int-java.util.Map-
diff --git a/manual/custom_codecs/extras/README.md b/manual/custom_codecs/extras/README.md
index 61848e7..09cd8f8 100644
--- a/manual/custom_codecs/extras/README.md
+++ b/manual/custom_codecs/extras/README.md
@@ -10,7 +10,7 @@
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-extras</artifactId>
- <version>3.2.0</version>
+ <version>3.3.2</version>
</dependency>
```
@@ -58,10 +58,10 @@
ZonedDateTime.parse("2010-06-30T01:20:47.999+01:00"));
```
-[InstantCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/jdk8/InstantCodec.html
-[LocalDateCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.html
-[LocalTimeCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.html
-[ZonedDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.html
+[InstantCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/jdk8/InstantCodec.html
+[LocalDateCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.html
+[LocalTimeCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.html
+[ZonedDateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.html
[Instant]: https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html
[LocalDate]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html
[LocalTime]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html
@@ -111,10 +111,10 @@
DateTime.parse("2010-06-30T01:20:47.999+01:00"));
```
-[InstantCodec_joda]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/joda/InstantCodec.html
-[LocalDateCodec_joda]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/joda/LocalDateCodec.html
-[LocalTimeCodec_joda]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.html
-[DateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/joda/DateTimeCodec.html
+[InstantCodec_joda]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/joda/InstantCodec.html
+[LocalDateCodec_joda]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/joda/LocalDateCodec.html
+[LocalTimeCodec_joda]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.html
+[DateTimeCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/joda/DateTimeCodec.html
[DateTime]: http://www.joda.org/joda-time/apidocs/org/joda/time/DateTime.html
[Instant_joda]: http://www.joda.org/joda-time/apidocs/org/joda/time/Instant.html
[LocalDate_joda]: http://www.joda.org/joda-time/apidocs/org/joda/time/LocalDate.html
@@ -132,8 +132,8 @@
There is no extra codec for `time`, because by default the driver already maps that type to a `long` representing the
number of nanoseconds since midnight.
-[SimpleTimestampCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.html
-[SimpleDateCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/date/SimpleDateCodec.html
+[SimpleTimestampCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/date/SimpleTimestampCodec.html
+[SimpleDateCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/date/SimpleDateCodec.html
### Enums
@@ -171,8 +171,8 @@
In practice, this is unlikely to happen, because you'll probably stick to a single CQL type for a given enum type;
however, if you ever run into that issue, the workaround is to use [prepared statements](../../statements/prepared/), for which the driver knows the CQL type and can pick the exact codec.
-[EnumNameCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/enums/EnumNameCodec.html
-[EnumOrdinalCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.html
+[EnumNameCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/enums/EnumNameCodec.html
+[EnumOrdinalCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/enums/EnumOrdinalCodec.html
[name]: https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name--
[ordinal]: https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal--
@@ -217,8 +217,8 @@
// owner saved as '{"id":1,"name":"root"}'
```
+[JacksonJsonCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.html
[Jackson]: https://github.com/FasterXML/jackson
-[JacksonJsonCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.html
#### JSR 353
@@ -256,8 +256,8 @@
```
-[Jsr353JsonCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.html
-[JsonStructure]: https://javaee-spec.java.net/nonav/javadocs/javax/json/JsonStructure.html
+[Jsr353JsonCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.html
+[JsonStructure]: https://docs.oracle.com/javaee/7/tutorial/jsonp002.htm
### Optional
@@ -309,7 +309,7 @@
anonymous inner class; we recommend storing these tokens as constants in a utility class, to avoid creating them too
often.
-[OptionalCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.html
+[OptionalCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.html
[Optional]: https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html
[TypeToken]: http://google.github.io/guava/releases/19.0/api/docs/com/google/common/reflect/TypeToken.html
@@ -353,8 +353,8 @@
See the JDK8 Optional section above for explanations about [TypeToken].
+[OptionalCodec_guava]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/guava/OptionalCodec.html
[Optional_guava]: http://google.github.io/guava/releases/19.0/api/docs/com/google/common/base/Optional.html
-[OptionalCodec_guava]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/guava/OptionalCodec.html
### Arrays
@@ -378,9 +378,9 @@
Package [com.datastax.driver.extras.codecs.arrays][arrays] contains similar codecs for all primitive types, and
[ObjectArrayCodec] to map arrays of objects.
-[IntArrayCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.html
-[ObjectArrayCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.html
-[arrays]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/arrays/package-summary.html
+[IntArrayCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/arrays/IntArrayCodec.html
+[ObjectArrayCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/arrays/ObjectArrayCodec.html
+[arrays]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/arrays/package-summary.html
### Abstract utilities
@@ -410,5 +410,5 @@
optimal approach. If performance is paramount, it's better to start from scratch and convert your objects to
`ByteBuffer` directly.
-[MappingCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/MappingCodec.html
-[ParsingCodec]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/extras/codecs/ParsingCodec.html
+[MappingCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/MappingCodec.html
+[ParsingCodec]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/extras/codecs/ParsingCodec.html
diff --git a/manual/custom_payloads/README.md b/manual/custom_payloads/README.md
index d0b68a6..4a2531c 100644
--- a/manual/custom_payloads/README.md
+++ b/manual/custom_payloads/README.md
@@ -241,8 +241,8 @@
[CASSANDRA-8553]: https://issues.apache.org/jira/browse/CASSANDRA-8553
[v4spec]: https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec
[qh]: https://issues.apache.org/jira/browse/CASSANDRA-6659
-[nhae]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/NoHostAvailableException.html
+[nhae]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/NoHostAvailableException.html
[chm]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html
[immutablemap]: http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/ImmutableMap.html
-[ufe]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/UnsupportedFeatureException.html
+[ufe]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/UnsupportedFeatureException.html
diff --git a/manual/idempotence/README.md b/manual/idempotence/README.md
index 4d2b081..61f2311 100644
--- a/manual/idempotence/README.md
+++ b/manual/idempotence/README.md
@@ -125,8 +125,8 @@
If linearizability is important for you, you should ensure that lightweight transactions are appropriately flagged as
not idempotent.
-[isIdempotent]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Statement.html#isIdempotent--
-[setDefaultIdempotence]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/QueryOptions.html#setDefaultIdempotence-boolean-
-[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/querybuilder/QueryBuilder.html
+[isIdempotent]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Statement.html#isIdempotent--
+[setDefaultIdempotence]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/QueryOptions.html#setDefaultIdempotence-boolean-
+[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/querybuilder/QueryBuilder.html
[linearizability]: https://en.wikipedia.org/wiki/Linearizability#Definition_of_linearizability
\ No newline at end of file
diff --git a/manual/load_balancing/README.md b/manual/load_balancing/README.md
index f6b180c..b6c5fbc 100644
--- a/manual/load_balancing/README.md
+++ b/manual/load_balancing/README.md
@@ -295,11 +295,11 @@
Query plans are based on the child policy's, except that hosts that are currently excluded for being too slow are moved
to the end of the plan.
-[withExclusionThreshold]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withExclusionThreshold-double-
-[withMininumMeasurements]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withMininumMeasurements-int-
-[withRetryPeriod]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withRetryPeriod-long-java.util.concurrent.TimeUnit-
-[withScale]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withScale-long-java.util.concurrent.TimeUnit-
-[withUpdateRate]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withUpdateRate-long-java.util.concurrent.TimeUnit-
+[withExclusionThreshold]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withExclusionThreshold-double-
+[withMininumMeasurements]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withMininumMeasurements-int-
+[withRetryPeriod]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withRetryPeriod-long-java.util.concurrent.TimeUnit-
+[withScale]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withScale-long-java.util.concurrent.TimeUnit-
+[withUpdateRate]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/LatencyAwarePolicy.Builder.html#withUpdateRate-long-java.util.concurrent.TimeUnit-
### Filtering policies
@@ -317,15 +317,15 @@
complex ones like `DCAwareRoundRobinPolicy`.
-[LoadBalancingPolicy]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/LoadBalancingPolicy.html
-[RoundRobinPolicy]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/RoundRobinPolicy.html
-[DCAwareRoundRobinPolicy]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.html
-[TokenAwarePolicy]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/TokenAwarePolicy.html
-[LatencyAwarePolicy]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/LatencyAwarePolicy.html
-[HostFilterPolicy]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/HostFilterPolicy.html
-[WhiteListPolicy]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/WhiteListPolicy.html
-[HostDistance]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/HostDistance.html
-[refreshConnectedHosts]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/PoolingOptions.html#refreshConnectedHosts--
-[setMetadataEnabled]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/QueryOptions.html#setMetadataEnabled-boolean-
-[Statement#getKeyspace]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Statement.html#getKeyspace--
-[Statement#getRoutingKey]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Statement.html#getRoutingKey--
+[LoadBalancingPolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/LoadBalancingPolicy.html
+[RoundRobinPolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/RoundRobinPolicy.html
+[DCAwareRoundRobinPolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.html
+[TokenAwarePolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/TokenAwarePolicy.html
+[LatencyAwarePolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/LatencyAwarePolicy.html
+[HostFilterPolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/HostFilterPolicy.html
+[WhiteListPolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/WhiteListPolicy.html
+[HostDistance]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/HostDistance.html
+[refreshConnectedHosts]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/PoolingOptions.html#refreshConnectedHosts--
+[setMetadataEnabled]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/QueryOptions.html#setMetadataEnabled-boolean-
+[Statement#getKeyspace]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Statement.html#getKeyspace--
+[Statement#getRoutingKey]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Statement.html#getRoutingKey--
diff --git a/manual/logging/README.md b/manual/logging/README.md
index 3002b8c..39d6cdd 100644
--- a/manual/logging/README.md
+++ b/manual/logging/README.md
@@ -19,7 +19,7 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
- <version>1.1.3</version>
+ <version>1.2.3</version>
</dependency>
```
@@ -29,7 +29,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
- <version>1.7.12</version>
+ <version>1.7.25</version>
</dependency>
```
@@ -179,10 +179,7 @@
Currently the `QueryLogger` can be configured to track slow queries using either
a constant threshold in milliseconds (which is the default behavior), or
-a dynamic threshold based on per-host latency percentiles, as computed by `PerHostPercentileTracker`.
-
-**Dynamic thresholds are still a beta feature: they haven't been extensively
-tested yet, and the API is still subject to change.**
+a dynamic threshold based on per-host latency percentiles, as computed by a `PercentileTracker`.
Refer to the `QueryLogger` [API docs][query_logger] for an example of usage.
@@ -302,4 +299,4 @@
</log4j:configuration>
```
-[query_logger]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/QueryLogger.html
+[query_logger]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/QueryLogger.html
diff --git a/manual/metadata/README.md b/manual/metadata/README.md
index 4e4fd70..e77748c 100644
--- a/manual/metadata/README.md
+++ b/manual/metadata/README.md
@@ -4,7 +4,7 @@
is connected to. It is available via
[Cluster#getMetadata()][getMetadata].
-[getMetadata]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Cluster.html#getMetadata--
+[getMetadata]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Cluster.html#getMetadata--
### Schema metadata
@@ -12,8 +12,8 @@
to get keyspace-level metadata. From there you can access the keyspace's
objects (tables, and UDTs and UDFs if relevant).
-[getKeyspace]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Metadata.html#getKeyspace-java.lang.String-
-[getKeyspaces]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Metadata.html#getKeyspaces--
+[getKeyspace]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Metadata.html#getKeyspace-java.lang.String-
+[getKeyspaces]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Metadata.html#getKeyspaces--
#### Refreshes
@@ -47,8 +47,8 @@
otherwise the listener could be notified with a great deal of "Added" events as
the driver builds the schema metadata from scratch for the first time.
-[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SchemaChangeListener.html
-[registerListener]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Cluster.html#register-com.datastax.driver.core.SchemaChangeListener-
+[SchemaChangeListener]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SchemaChangeListener.html
+[registerListener]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Cluster.html#register-com.datastax.driver.core.SchemaChangeListener-
#### Schema agreement
@@ -135,9 +135,9 @@
Check out the API docs for the features in this section:
-* [withMaxSchemaAgreementWaitSeconds(int)](http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Cluster.Builder.html#withMaxSchemaAgreementWaitSeconds-int-)
-* [isSchemaInAgreement()](http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/ExecutionInfo.html#isSchemaInAgreement--)
-* [checkSchemaAgreement()](http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Metadata.html#checkSchemaAgreement--)
+* [withMaxSchemaAgreementWaitSeconds(int)](http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Cluster.Builder.html#withMaxSchemaAgreementWaitSeconds-int-)
+* [isSchemaInAgreement()](http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/ExecutionInfo.html#isSchemaInAgreement--)
+* [checkSchemaAgreement()](http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Metadata.html#checkSchemaAgreement--)
### Token metadata
@@ -181,14 +181,14 @@
table (see
[CASSANDRA-7688](https://issues.apache.org/jira/browse/CASSANDRA-7688)).
-[metadata]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Metadata.html
-[getTokenRanges]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Metadata.html#getTokenRanges--
-[getTokenRanges2]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Metadata.html#getTokenRanges-java.lang.String-com.datastax.driver.core.Host-
-[getReplicas]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Metadata.html#getReplicas-java.lang.String-com.datastax.driver.core.TokenRange-
-[newToken]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Metadata.html#newToken-java.lang.String-
-[newTokenRange]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Metadata.html#newTokenRange-com.datastax.driver.core.Token-com.datastax.driver.core.Token-
-[TokenRange]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/TokenRange.html
-[getTokens]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Host.html#getTokens--
-[setToken]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/BoundStatement.html#setToken-int-com.datastax.driver.core.Token-
-[getToken]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Row.html#getToken-int-
-[getPKToken]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Row.html#getPartitionKeyToken--
+[metadata]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Metadata.html
+[getTokenRanges]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Metadata.html#getTokenRanges--
+[getTokenRanges2]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Metadata.html#getTokenRanges-java.lang.String-com.datastax.driver.core.Host-
+[getReplicas]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Metadata.html#getReplicas-java.lang.String-com.datastax.driver.core.TokenRange-
+[newToken]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Metadata.html#newToken-java.lang.String-
+[newTokenRange]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Metadata.html#newTokenRange-com.datastax.driver.core.Token-com.datastax.driver.core.Token-
+[TokenRange]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/TokenRange.html
+[getTokens]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Host.html#getTokens--
+[setToken]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/BoundStatement.html#setToken-int-com.datastax.driver.core.Token-
+[getToken]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Row.html#getToken-int-
+[getPKToken]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Row.html#getPartitionKeyToken--
diff --git a/manual/metrics/README.md b/manual/metrics/README.md
index 7dc741b..cf9d34b 100644
--- a/manual/metrics/README.md
+++ b/manual/metrics/README.md
@@ -9,4 +9,4 @@
- getMetrics() returns null until Cluster initialized
-->
-[Metrics]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Metrics.html
\ No newline at end of file
+[Metrics]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Metrics.html
\ No newline at end of file
diff --git a/manual/native_protocol/README.md b/manual/native_protocol/README.md
index be945e7..2de03c6 100644
--- a/manual/native_protocol/README.md
+++ b/manual/native_protocol/README.md
@@ -63,7 +63,7 @@
[/127.0.0.1:9042] Host /127.0.0.1:9042 does not support protocol version V3 but V2))
```
-[gpv]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion--
+[gpv]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion--
#### Protocol version with mixed clusters
@@ -94,19 +94,19 @@
#### v1 to v2
* bound variables in simple statements
- ([Session#execute(String, Object...)](http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Session.html#execute-java.lang.String-java.lang.Object...-))
-* [batch statements](http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/BatchStatement.html)
+ ([Session#execute(String, Object...)](http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Session.html#execute-java.lang.String-java.lang.Object...-))
+* [batch statements](http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/BatchStatement.html)
* [query paging](../paging/)
#### v2 to v3
* the number of stream ids per connection goes from 128 to 32768 (see
[Connection pooling](../pooling/))
-* [serial consistency on batch statements](http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/BatchStatement.html#setSerialConsistencyLevel-com.datastax.driver.core.ConsistencyLevel-)
+* [serial consistency on batch statements](http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/BatchStatement.html#setSerialConsistencyLevel-com.datastax.driver.core.ConsistencyLevel-)
* [client-side timestamps](../query_timestamps/)
#### v3 to v4
-* [query warnings](http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/ExecutionInfo.html#getWarnings--)
+* [query warnings](http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/ExecutionInfo.html#getWarnings--)
* allowed unset values in bound statements
* [Custom payloads](../custom_payloads/)
diff --git a/manual/object_mapper/README.md b/manual/object_mapper/README.md
index 2786708..f4a9f92 100644
--- a/manual/object_mapper/README.md
+++ b/manual/object_mapper/README.md
@@ -11,7 +11,7 @@
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-mapping</artifactId>
- <version>3.2.0</version>
+ <version>3.3.2</version>
</dependency>
```
diff --git a/manual/object_mapper/creating/README.md b/manual/object_mapper/creating/README.md
index cbb14bf..8292e12 100644
--- a/manual/object_mapper/creating/README.md
+++ b/manual/object_mapper/creating/README.md
@@ -149,9 +149,9 @@
.setName("John Doe");
```
-[table]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/Table.html
+[table]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/Table.html
[case-sensitive]:http://docs.datastax.com/en/cql/3.3/cql/cql_reference/ucase-lcase_r.html
-[consistency level]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/ConsistencyLevel.html
+[consistency level]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/ConsistencyLevel.html
[java-beans]:https://docs.oracle.com/javase/tutorial/javabeans/writing/properties.html
[set-accessible]:https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/AccessibleObject.html#setAccessible-boolean-
@@ -189,7 +189,7 @@
private String userName;
```
-[column]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/Column.html
+[column]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/Column.html
#### Primary key fields
@@ -213,15 +213,15 @@
The order of the indices must match that of the columns in the table
declaration.
-[pk]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/PartitionKey.html
-[cc]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/ClusteringColumn.html
+[pk]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/PartitionKey.html
+[cc]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/ClusteringColumn.html
[pks]:http://thelastpickle.com/blog/2013/01/11/primary-keys-in-cql.html
#### Computed fields
[@Computed][computed] can be used on properties that are the result of a
computation on the Cassandra side, typically a function call. Native
-functions in Cassandra like `writetime()` or [User Defined Functions] are
+functions in Cassandra like `writetime()` or [User-Defined Functions] are
supported.
```java
@@ -249,8 +249,8 @@
version (see
[JAVA-832](https://datastax-oss.atlassian.net/browse/JAVA-832)).
-[User Defined Functions]:http://www.planetcassandra.org/blog/user-defined-functions-in-cassandra-3-0/
-[computed]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/Computed.html
+[User-Defined Functions]:http://www.planetcassandra.org/blog/user-defined-functions-in-cassandra-3-0/
+[computed]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/Computed.html
#### Transient properties
@@ -259,11 +259,11 @@
a Java bean property from being mapped. Like other column-level annotations,
it should be placed on either the field declaration or the property getter method.
-[transient]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/Transient.html
+[transient]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/Transient.html
### Mapping User Types
-[User Defined Types] can also be mapped by using [@UDT][udt]:
+[User-Defined Types] can also be mapped by using [@UDT][udt]:
```
CREATE TYPE address (street text, zip_code int);
@@ -321,9 +321,9 @@
This also works with UDTs inside collections or other UDTs, with any arbitrary
nesting level.
-[User Defined Types]: ../../udts/
-[udt]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/UDT.html
-[field]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/Field.html
+[User-Defined Types]: ../../udts/
+[udt]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/UDT.html
+[field]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/Field.html
### Mapping collections
@@ -359,9 +359,9 @@
private Map<String, List<Address>> frozenValueMap;
```
-[frozen]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/Frozen.html
-[frozenkey]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/FrozenKey.html
-[frozenvalue]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/FrozenValue.html
+[frozen]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/Frozen.html
+[frozenkey]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/FrozenKey.html
+[frozenvalue]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/FrozenValue.html
### Polymorphism support
diff --git a/manual/object_mapper/custom_codecs/README.md b/manual/object_mapper/custom_codecs/README.md
index 148164a..049aaa0 100644
--- a/manual/object_mapper/custom_codecs/README.md
+++ b/manual/object_mapper/custom_codecs/README.md
@@ -98,9 +98,9 @@
This also works with [@Field][field] and [@Param][param] annotations.
-[column]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/Column.html
-[field]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/Field.html
-[param]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/Param.html
+[column]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/Column.html
+[field]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/Field.html
+[param]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/Param.html
## Implicit UDT codecs
diff --git a/manual/object_mapper/using/README.md b/manual/object_mapper/using/README.md
index e6559db..6be548a 100644
--- a/manual/object_mapper/using/README.md
+++ b/manual/object_mapper/using/README.md
@@ -28,9 +28,9 @@
calling `manager#mapper` more than once for the same class will return
the previously generated mapper.
-[Mapper]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/Mapper.html
-[MappingManager]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/MappingManager.html
-[Session]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Session.html
+[Mapper]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/Mapper.html
+[MappingManager]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/MappingManager.html
+[Session]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Session.html
#### Basic CRUD operations
@@ -88,7 +88,8 @@
- `saveNullFields`: if set to true, fields with value `null` in an
instance that is to be persisted will be explicitly written as `null`
in the query. If set to false, fields with null value won't be included
- in the write query (thus avoiding tombstones). If not specified, the
+ in the write query (thus avoiding tombstones), or if using Protocol V4+
+ unset() will be used for null values. If not specified, the
default behavior is to persist `null` fields.
- `ifNotExists`: if set to true, adds an `IF NOT EXISTS` clause to the
save operation (use `ifNotExists(false)` if you enabled the option by
@@ -106,13 +107,13 @@
Some options don't apply to all operations:
<table border="1" style="text-align:center; width:100%;margin-bottom:1em;">
- <tr> <td><b>Option</b></td> <td><b>save/saveQuery</b></td> <td><b>get/getQuery</b></td> <td><b>delete/deleteQuery</b></td></tr>
- <tr> <td>Ttl</td> <td>yes</td> <td>no</td> <td>no</td> </tr>
- <tr> <td>Timestamp</td> <td>yes</td> <td>no</td> <td>yes</td> </tr>
- <tr> <td>ConsistencyLevel</td> <td>yes</td> <td>yes</td> <td>yes</td> </tr>
- <tr> <td>Tracing</td> <td>yes</td> <td>yes</td> <td>yes</td> </tr>
- <tr> <td>SaveNullFields</td> <td>yes</td> <td>no</td> <td>no</td> </tr>
- <tr> <td>IfNotExists</td> <td>yes</td> <td>no</td> <td>no</td> </tr>
+ <tr> <td><b>Option</b></td> <td><b>save/saveQuery</b></td> <td><b>get/getQuery</b></td> <td><b>delete/deleteQuery</b></td></tr>
+ <tr> <td>Ttl</td> <td>yes</td> <td>no</td> <td>no</td> </tr>
+ <tr> <td>Timestamp</td> <td>yes</td> <td>no</td> <td>yes</td> </tr>
+ <tr> <td>ConsistencyLevel</td> <td>yes</td> <td>yes</td> <td>yes</td> </tr>
+ <tr> <td>Tracing</td> <td>yes</td> <td>yes</td> <td>yes</td> </tr>
+ <tr> <td>SaveNullFields</td> <td>yes</td> <td>no</td> <td>no</td> </tr>
+ <tr> <td>IfNotExists</td> <td>yes</td> <td>no</td> <td>no</td> </tr>
</table>
Note that `Option.consistencyLevel` is redundant with the consistency
@@ -178,7 +179,7 @@
and `isExhausted()`. Note that iterating the `Result` will consume the
`ResultSet`, and vice-versa.
-[Result]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/Result.html
+[Result]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/Result.html
### Accessors
@@ -201,7 +202,7 @@
```java
UserAccessor userAccessor = manager.createAccessor(UserAccessor.class);
-User user = userAccessor.getOne(uuid);
+Result<User> users = userAccessor.getAll();
```
Like mappers, accessors are cached at the manager level and thus, are
@@ -228,7 +229,7 @@
ResultSet insert(@Param("u") UUID userId, @Param("n") String name);
```
-[param]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/Param.html
+[param]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/Param.html
If a method argument is a Java enumeration, it must be annotated with
`@Enumerated` to indicate how to convert it to a CQL type (the rules are
@@ -296,7 +297,7 @@
public ListenableFuture<Result<User>> getAllAsync();
```
-[@QueryParameters]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/annotations/QueryParameters.html
+[@QueryParameters]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/annotations/QueryParameters.html
### Mapping configuration
@@ -340,6 +341,6 @@
There is more to `DefaultPropertyMapper`; see the Javadocs and implementation for details.
-[MappingConfiguration]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/MappingConfiguration.html
-[PropertyMapper]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/PropertyMapper.html
-[DefaultPropertyMapper]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/mapping/DefaultPropertyMapper.html
+[MappingConfiguration]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/MappingConfiguration.html
+[PropertyMapper]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/PropertyMapper.html
+[DefaultPropertyMapper]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/mapping/DefaultPropertyMapper.html
diff --git a/manual/paging/README.md b/manual/paging/README.md
index 915600d..24925fc 100644
--- a/manual/paging/README.md
+++ b/manual/paging/README.md
@@ -176,8 +176,8 @@
}
```
-[result_set]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/ResultSet.html
-[paging_state]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/PagingState.html
+[result_set]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/ResultSet.html
+[paging_state]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/PagingState.html
Due to internal implementation details, `PagingState` instances are not
diff --git a/manual/pooling/README.md b/manual/pooling/README.md
index f8dbd94..dd2f087 100644
--- a/manual/pooling/README.md
+++ b/manual/pooling/README.md
@@ -283,16 +283,16 @@
[newConnectionThreshold][nct] so that enough connections are added by
the time you reach the bottleneck.
-[result_set_future]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/ResultSetFuture.html
-[pooling_options]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/PoolingOptions.html
-[lbp]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/LoadBalancingPolicy.html
-[nct]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/PoolingOptions.html#setNewConnectionThreshold-com.datastax.driver.core.HostDistance-int-
-[mrpc]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/PoolingOptions.html#setMaxRequestsPerConnection-com.datastax.driver.core.HostDistance-int-
-[sits]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/PoolingOptions.html#setIdleTimeoutSeconds-int-
-[rtm]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SocketOptions.html#getReadTimeoutMillis--
-[smqs]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/PoolingOptions.html#setMaxQueueSize-int-
-[sptm]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/PoolingOptions.html#setPoolTimeoutMillis-int-
-[nhae]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/NoHostAvailableException.html
-[getErrors]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors--
-[get_state]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Session.html#getState--
-[BusyPoolException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/BusyPoolException.html
+[result_set_future]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/ResultSetFuture.html
+[pooling_options]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/PoolingOptions.html
+[lbp]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/LoadBalancingPolicy.html
+[nct]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/PoolingOptions.html#setNewConnectionThreshold-com.datastax.driver.core.HostDistance-int-
+[mrpc]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/PoolingOptions.html#setMaxRequestsPerConnection-com.datastax.driver.core.HostDistance-int-
+[sits]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/PoolingOptions.html#setIdleTimeoutSeconds-int-
+[rtm]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SocketOptions.html#getReadTimeoutMillis--
+[smqs]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/PoolingOptions.html#setMaxQueueSize-int-
+[sptm]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/PoolingOptions.html#setPoolTimeoutMillis-int-
+[nhae]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/NoHostAvailableException.html
+[getErrors]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors--
+[get_state]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Session.html#getState--
+[BusyPoolException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/BusyPoolException.html
diff --git a/manual/query_timestamps/README.md b/manual/query_timestamps/README.md
index 249d62a..de57096 100644
--- a/manual/query_timestamps/README.md
+++ b/manual/query_timestamps/README.md
@@ -20,59 +20,29 @@
of Cassandra that supports [native protocol](../native_protocol) v3 or
above.
-A client timestamp will be sent by each query. It is generated by a
-[TimestampGenerator][tsg]. The default implementation is
-[AtomicMonotonicTimestampGenerator][amtsg].
+The driver will use a [TimestampGenerator] to generate a timestamp for each query, and send it
+to the server as part of the request.
-You can specify another generator at initialization:
+You can configure the generator at initialization:
```java
Cluster.builder().addContactPoint("127.0.0.1")
- .withTimestampGenerator(new MyCustomTimestampGenerator())
+ .withTimestampGenerator(new SomeTimestampGeneratorImpl())
.build();
```
-In addition, you can also override the default timestamp on a
-per-statement basis:
+Two generator implementations are provided out of the box:
-```java
-Statement statement = new SimpleStatement(
- "UPDATE users SET email = 'x@y.com' where id = 1");
-statement.setDefaultTimestamp(1234567890);
-session.execute(statement);
-```
-
-[tsg]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/TimestampGenerator.html
-[amtsg]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.html
-
-
-### Server-side generation
-
-This is the "legacy" behavior if you're connected to a Cassandra version
-that only supports protocol v2 or below. The server will assign a
-timestamp based on the time it receives the query.
-
-This can be a problem when the order of the writes matter: with unlucky
-timing (different coordinators, network latency, etc.), two successive
-requests from the same client might be processed in a different order
-server-side, and end up with out-of-order timestamps. If protocol v3 is
-not an option, the only workaround is to add `USING TIMESTAMP` in your
-queries.
-
-
-The driver ships with two implementations of `TimestampGenerator`:
-
-1. [AtomicMonotonicTimestampGenerator][amtsg], which guarantess monotonicity of timestamps for all threads;
-2. [ThreadLocalMonotonicTimestampGenerator][tlmtsg], which guarantees per-thread monotonicity of timestamps.
+1. [AtomicMonotonicTimestampGenerator], which guarantees monotonicity of timestamps for all
+ threads. This is the default implementation (i.e. what will be used if you don't call
+ `withTimestampGenerator`);
+2. [ThreadLocalMonotonicTimestampGenerator], which guarantees per-thread monotonicity of timestamps.
There is less contention using `ThreadLocalMonotonicTimestampGenerator`, but beware
that there is a risk of timestamp collision with this generator when accessed by more than one
thread; only use it when threads are not in direct competition for timestamp ties (i.e., they are executing
independent statements).
-[amtsg]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.html
-[tlmtsg]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.html
-
#### Accuracy
Both implementations strive to achieve microsecond resolution on a best-effort basis.
@@ -99,9 +69,6 @@
INFO com.datastax.driver.core.ClockFactory - Using native clock to generate timestamps
```
-[gettimeofday]: http://man7.org/linux/man-pages/man2/settimeofday.2.html
-[JNR]: https://github.com/jnr/jnr-ffi
-
#### Monotonicity
The aforementioned implementations also guarantee
@@ -116,6 +83,46 @@
`com.datastax.driver.core.TimestampGenerator`. See their non-default constructors for ways to control the warning
interval.
+
+#### Overriding the timestamp manually
+
+You can override the generator and provide and explicit timestamp for a given query:
+
+```java
+Statement statement = new SimpleStatement(
+ "UPDATE users SET email = 'x@y.com' where id = 1");
+statement.setDefaultTimestamp(1234567890);
+session.execute(statement);
+```
+
+
+### Server-side generation
+
+This is the "legacy" behavior if you're connected to a Cassandra version
+that only supports protocol v2 or below. The server will assign a
+timestamp based on the time it received the query.
+
+This can be a problem when the order of the writes matter: with unlucky
+timing (different coordinators, network latency, etc.), two successive
+requests from the same client might be processed in a different order
+server-side, and end up with out-of-order timestamps. This is why client-side
+generation is the default starting with protocol v3. With older versions, the
+only way to get client timestamps is to add a `USING TIMESTAMP` clause to your
+CQL queries.
+
+Note that, although client-side timestamps are recommended when available, you can still opt for
+server-side timestamps with protocol v3 or above, using [ServerSideTimestampGenerator]:
+
+```java
+Cluster.builder().addContactPoint("127.0.0.1")
+ .withTimestampGenerator(ServerSideTimestampGenerator.INSTANCE)
+ .build();
+```
+
+Server-side generation might be more suitable for situations where it is more difficult to keep
+time synchronized across all clients.
+
+
### Summary
As shown in the previous sections, there are multiple ways to provide a
@@ -131,3 +138,12 @@
4. otherwise, let the server assign the timestamp.
Steps 2 and 3 only apply if native protocol v3 or above is in use.
+
+
+[TimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/TimestampGenerator.html
+[AtomicMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.html
+[ThreadLocalMonotonicTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/ThreadLocalMonotonicTimestampGenerator.html
+[ServerSideTimestampGenerator]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/ServerSideTimestampGenerator.html
+
+[gettimeofday]: http://man7.org/linux/man-pages/man2/settimeofday.2.html
+[JNR]: https://github.com/jnr/jnr-ffi
diff --git a/manual/reconnection/README.md b/manual/reconnection/README.md
index ccd4598..1d705cb 100644
--- a/manual/reconnection/README.md
+++ b/manual/reconnection/README.md
@@ -8,4 +8,4 @@
- scheduled reconnections vs. gossip events
-->
-[ReconnectionPolicy]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/ReconnectionPolicy.html
\ No newline at end of file
+[ReconnectionPolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/ReconnectionPolicy.html
\ No newline at end of file
diff --git a/manual/retries/README.md b/manual/retries/README.md
index 9788cb4..8fa40a2 100644
--- a/manual/retries/README.md
+++ b/manual/retries/README.md
@@ -146,33 +146,33 @@
`IdempotenceAwareRetryPolicy` before).
-[onUnavailable]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onUnavailable-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-int-
-[onWriteTimeout]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onWriteTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.WriteType-int-int-int-
-[onReadTimeout]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int-
-[onRequestError]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-java.lang.Exception-int-
-[DefaultRetryPolicy]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/DefaultRetryPolicy.html
-[RetryPolicy]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/RetryPolicy.html
-[getErrors()]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors--
-[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/NoHostAvailableException.html
-[ignore()]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#ignore--
-[rethrow()]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#rethrow--
-[tryNextHost()]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#tryNextHost-com.datastax.driver.core.ConsistencyLevel-
-[retry()]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#retry-com.datastax.driver.core.ConsistencyLevel-
-[RetryDecision]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html
-[UnavailableException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/UnavailableException.html
-[ReadTimeoutException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/ReadTimeoutException.html
-[WriteTimeoutException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/WriteTimeoutException.html
-[ServerError]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/ServerError.html
-[OverloadedException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/OverloadedException.html
-[OperationTimedOutException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/OperationTimedOutException.html
-[QueryValidationException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/QueryValidationException.html
-[ConnectionException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/ConnectionException.html
-[InvalidQueryException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/InvalidQueryException.html
-[InvalidConfigurationInQueryException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.html
-[SyntaxError]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/SyntaxError.html
-[UnauthorizedException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/UnauthorizedException.html
-[TruncateException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/TruncateException.html
-[AlreadyExistsException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/AlreadyExistsException.html
+[RetryDecision]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html
+[retry()]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#retry-com.datastax.driver.core.ConsistencyLevel-
+[tryNextHost()]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#tryNextHost-com.datastax.driver.core.ConsistencyLevel-
+[rethrow()]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#rethrow--
+[ignore()]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html#ignore--
+[NoHostAvailableException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/NoHostAvailableException.html
+[getErrors()]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/NoHostAvailableException.html#getErrors--
+[RetryPolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/RetryPolicy.html
+[DefaultRetryPolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/DefaultRetryPolicy.html
+[onReadTimeout]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int-
+[onWriteTimeout]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onWriteTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.WriteType-int-int-int-
+[onUnavailable]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onUnavailable-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-int-
+[onRequestError]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/DefaultRetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int-
+[UnavailableException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/UnavailableException.html
+[ReadTimeoutException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/ReadTimeoutException.html
+[WriteTimeoutException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/WriteTimeoutException.html
+[OverloadedException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/OverloadedException.html
+[ServerError]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/ServerError.html
+[OperationTimedOutException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/OperationTimedOutException.html
+[ConnectionException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/ConnectionException.html
+[QueryValidationException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/QueryValidationException.html
+[InvalidQueryException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/InvalidQueryException.html
+[InvalidConfigurationInQueryException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException.html
+[UnauthorizedException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/UnauthorizedException.html
+[SyntaxError]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/SyntaxError.html
+[AlreadyExistsException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/AlreadyExistsException.html
+[TruncateException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/TruncateException.html
[query plan]: ../load_balancing/#query-plan
[connection pool]: ../pooling/
diff --git a/manual/shaded_jar/README.md b/manual/shaded_jar/README.md
index 38ee468..1973ab7 100644
--- a/manual/shaded_jar/README.md
+++ b/manual/shaded_jar/README.md
@@ -12,7 +12,7 @@
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
- <version>3.2.0</version>
+ <version>3.3.2</version>
<classifier>shaded</classifier>
<!-- Because the shaded JAR uses the original POM, you still need
to exclude this dependency explicitly: -->
@@ -32,7 +32,7 @@
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
- <version>3.2.0</version>
+ <version>3.3.2</version>
<classifier>shaded</classifier>
<exclusions>
<exclusion>
@@ -44,7 +44,7 @@
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-mapping</artifactId>
- <version>3.2.0</version>
+ <version>3.3.2</version>
<exclusions>
<exclusion>
<groupId>com.datastax.cassandra</groupId>
@@ -74,5 +74,5 @@
Detected shaded Netty classes in the classpath; native epoll transport will not work properly, defaulting to NIO.
-[NettyOptions]:http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/NettyOptions.html
+[NettyOptions]:http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/NettyOptions.html
[Netty native transports]:http://netty.io/wiki/native-transports.html
diff --git a/manual/socket_options/README.md b/manual/socket_options/README.md
index 8a0defd..40bef6d 100644
--- a/manual/socket_options/README.md
+++ b/manual/socket_options/README.md
@@ -117,15 +117,15 @@
We might rename `SocketOptions.setReadTimeoutMillis` in a future version to clear up any confusion.
-[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SocketOptions.html
-[setReadTimeoutMillis]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SocketOptions.html#setReadTimeoutMillis-int-
-[setConnectTimeoutMillis]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SocketOptions.html#setConnectTimeoutMillis-int-
-[setKeepAlive]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SocketOptions.html#setKeepAlive-boolean-
-[setReceiveBufferSize]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SocketOptions.html#setReceiveBufferSize-int-
-[setReuseAddress]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SocketOptions.html#setReuseAddress-boolean-
-[setSendBufferSize]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SocketOptions.html#setSendBufferSize-int-
-[setSoLinger]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SocketOptions.html#setSoLinger-int-
-[setTcpNoDelay]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SocketOptions.html#setTcpNoDelay-boolean-
-[onReadTimeout]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/RetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int-
-[onRequestError]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/RetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int-
-[OperationTimedOutException]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/exceptions/OperationTimedOutException.html
\ No newline at end of file
+[SocketOptions]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SocketOptions.html
+[setReadTimeoutMillis]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SocketOptions.html#setReadTimeoutMillis-int-
+[setConnectTimeoutMillis]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SocketOptions.html#setConnectTimeoutMillis-int-
+[setKeepAlive]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SocketOptions.html#setKeepAlive-boolean-
+[setReceiveBufferSize]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SocketOptions.html#setReceiveBufferSize-int-
+[setReuseAddress]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SocketOptions.html#setReuseAddress-boolean-
+[setSendBufferSize]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SocketOptions.html#setSendBufferSize-int-
+[setSoLinger]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SocketOptions.html#setSoLinger-int-
+[setTcpNoDelay]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SocketOptions.html#setTcpNoDelay-boolean-
+[onReadTimeout]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/RetryPolicy.html#onReadTimeout-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-int-int-boolean-int-
+[onRequestError]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/RetryPolicy.html#onRequestError-com.datastax.driver.core.Statement-com.datastax.driver.core.ConsistencyLevel-com.datastax.driver.core.exceptions.DriverException-int-
+[OperationTimedOutException]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/exceptions/OperationTimedOutException.html
\ No newline at end of file
diff --git a/manual/speculative_execution/README.md b/manual/speculative_execution/README.md
index fdc605f..127d440 100644
--- a/manual/speculative_execution/README.md
+++ b/manual/speculative_execution/README.md
@@ -7,7 +7,10 @@
One thing we can do to improve that is pre-emptively start a second
execution of the query against another node, before the first node has
replied or errored out. If that second node replies faster, we can send
-the response back to the client (we also cancel the first query):
+the response back to the client (we also cancel the first execution --
+note that "cancelling" in this context simply means discarding the response
+when it arrives later, Cassandra does not support cancellation of in flight
+requests at this stage):
```ditaa
client driver exec1 exec2
@@ -66,15 +69,15 @@
### Enabling speculative executions
Speculative executions are controlled by an instance of
-[SpeculativeExecutionPolicy][sep] provided when initializing the
+[SpeculativeExecutionPolicy] provided when initializing the
`Cluster`. This policy defines the threshold after which a new
speculative execution will be triggered.
-[sep]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html
+[SpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html
Two implementations are provided with the driver:
-#### [ConstantSpeculativeExecutionPolicy][csep]
+#### [ConstantSpeculativeExecutionPolicy]
This simple policy uses a constant threshold:
@@ -98,16 +101,13 @@
* if no response has been received at t0 + 1000 milliseconds, start
another speculative execution on a third node.
-[csep]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/ConstantSpeculativeExecutionPolicy.html
+[ConstantSpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/ConstantSpeculativeExecutionPolicy.html
-#### [PercentileSpeculativeExecutionPolicy][psep]
+#### [PercentileSpeculativeExecutionPolicy]
This policy sets the threshold at a given latency percentile for the
current host, based on recent statistics.
-**As of 2.1.6, this class is provided as a beta preview: it hasn't been
-extensively tested yet, and the API is still subject to change.**
-
First and foremost, make sure that the [HdrHistogram][hdr] library (used
under the hood to collect latencies) is in your classpath. It's defined
as an optional dependency in the driver's POM, so you'll need to
@@ -121,14 +121,22 @@
</dependency>
```
-Then create an instance of [PerHostPercentileTracker][phpt] that will collect
-latency statistics for your `Cluster`:
+Then create a [PercentileTracker] that will collect latency histograms for your `Cluster`. Two
+implementations are provided out of the box:
+
+* [ClusterWidePercentileTracker]: maintains a single histogram for the whole cluster. This means
+ queries will be compared against the global performance of all the hosts in the cluster.
+* [PerHostPercentileTracker]: maintains a histogram per host. This means queries to a host will
+ only be compared against previous queries to the same host.
+
+We recommend the cluster-wide strategy: in practice, we've found that it produces better results,
+because it does a better job at penalizing hosts that are consistently slower.
```java
// There are more options than shown here, please refer to the API docs
// for more information
-PerHostPercentileTracker tracker = PerHostPercentileTracker
- .builderWithHighestTrackableLatencyMillis(15000)
+PercentileTracker tracker = ClusterWidePercentileTracker
+ .builder(15000)
.build();
```
@@ -148,20 +156,15 @@
.build();
```
-Finally, don't forget to register your tracker with the cluster (the
-policy does not do this itself):
-
-```java
-cluster.register(tracker);
-```
-
-Note that `PerHostPercentileTracker` may also be used with a slow query
+Note that `PercentileTracker` may also be used with a slow query
logger (see the [Logging](../logging/) section). In that case, you would
create a single tracker object and share it with both components.
-[psep]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/PercentileSpeculativeExecutionPolicy.html
+[PercentileSpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/PercentileSpeculativeExecutionPolicy.html
+[PercentileTracker]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/PercentileTracker.html
+[ClusterWidePercentileTracker]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/ClusterWidePercentileTracker.html
+[PerHostPercentileTracker]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/PerHostPercentileTracker.html
[hdr]: http://hdrhistogram.github.io/HdrHistogram/
-[phpt]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/PerHostPercentileTracker.html
#### Using your own
@@ -207,7 +210,7 @@
The only impact is that all executions of the same query always share
the same query plan, so each host will be used by at most one execution.
-[retry_policy]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/RetryPolicy.html
+[retry_policy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/RetryPolicy.html
### Tuning and practical details
@@ -222,8 +225,8 @@
It should only be a few percents of the total number of requests
([cluster.getMetrics().getRequestsTimer().getCount()][request_metric]).
-[se_metric]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Metrics.Errors.html#getSpeculativeExecutions--
-[request_metric]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Metrics.html#getRequestsTimer--
+[se_metric]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Metrics.Errors.html#getSpeculativeExecutions--
+[request_metric]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Metrics.html#getRequestsTimer--
#### Stream id exhaustion
@@ -252,8 +255,8 @@
using, you can check with
[cluster.getConfiguration().getProtocolOptions().getProtocolVersion()][protocol_version].
-[session_state]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Session.State.html
-[protocol_version]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion--
+[session_state]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Session.State.html
+[protocol_version]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/ProtocolOptions.html#getProtocolVersion--
#### Request ordering and client timestamps
diff --git a/manual/ssl/README.md b/manual/ssl/README.md
index 213c539..0830c63 100644
--- a/manual/ssl/README.md
+++ b/manual/ssl/README.md
@@ -153,7 +153,7 @@
There are known runtime incompatibilities between newer versions of
netty-tcnative and the version of netty that the driver uses. For best
-results, use version 1.1.33.Fork26.
+results, use version 2.0.1.Final.
Using netty-tcnative requires JDK 1.7 or above and requires the presence of
OpenSSL on the system. It will not fall back to the JDK implementation.
@@ -185,8 +185,8 @@
.build();
```
-[RemoteEndpointAwareSSLOptions]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.html
-[RemoteEndpointAwareJdkSSLOptions]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html
-[newSSLEngine]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html#newSSLEngine-io.netty.channel.socket.SocketChannel-java.net.InetSocketAddress-
-[RemoteEndpointAwareNettySSLOptions]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.html
-[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/NettyOptions.html
+[RemoteEndpointAwareSSLOptions]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/RemoteEndpointAwareSSLOptions.html
+[RemoteEndpointAwareJdkSSLOptions]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html
+[newSSLEngine]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/RemoteEndpointAwareJdkSSLOptions.html#newSSLEngine-io.netty.channel.socket.SocketChannel-java.net.InetSocketAddress-
+[RemoteEndpointAwareNettySSLOptions]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/RemoteEndpointAwareNettySSLOptions.html
+[NettyOptions]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/NettyOptions.html
diff --git a/manual/statements/README.md b/manual/statements/README.md
index 6efd14c..eeda317 100644
--- a/manual/statements/README.md
+++ b/manual/statements/README.md
@@ -32,11 +32,11 @@
properties that influence statement execution. To achieve this, you can
wrap your statements in a custom [StatementWrapper] implementation.
-[Statement]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Statement.html
-[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/querybuilder/QueryBuilder.html
-[StatementWrapper]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/StatementWrapper.html
-[RetryPolicy]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/RetryPolicy.html
-[LoadBalancingPolicy]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/LoadBalancingPolicy.html
-[SpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html
-[execute]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement-
-[executeAsync]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement-
+[Statement]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Statement.html
+[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/querybuilder/QueryBuilder.html
+[StatementWrapper]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/StatementWrapper.html
+[RetryPolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/RetryPolicy.html
+[LoadBalancingPolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/LoadBalancingPolicy.html
+[SpeculativeExecutionPolicy]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html
+[execute]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement-
+[executeAsync]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement-
diff --git a/manual/statements/batch/README.md b/manual/statements/batch/README.md
index 5f3b793..8ae56c2 100644
--- a/manual/statements/batch/README.md
+++ b/manual/statements/batch/README.md
@@ -2,4 +2,4 @@
*Coming soon... In the meantime, see the javadoc for [BatchStatement].*
-[BatchStatement]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/BatchStatement.html
+[BatchStatement]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/BatchStatement.html
diff --git a/manual/statements/built/README.md b/manual/statements/built/README.md
index 405aa9d..93cd430 100644
--- a/manual/statements/built/README.md
+++ b/manual/statements/built/README.md
@@ -2,4 +2,4 @@
*Coming soon... In the meantime, see the javadoc for [QueryBuilder].*
-[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/querybuilder/QueryBuilder.html
\ No newline at end of file
+[QueryBuilder]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/querybuilder/QueryBuilder.html
\ No newline at end of file
diff --git a/manual/statements/prepared/README.md b/manual/statements/prepared/README.md
index 2132db7..b544d3a 100644
--- a/manual/statements/prepared/README.md
+++ b/manual/statements/prepared/README.md
@@ -122,10 +122,10 @@
// Using the unset method to unset previously set value.
// Positional setter:
-bound.unset("description");
+bound.unset(1);
// Named setter:
-bound.unset(1);
+bound.unset("description");
```
A bound statement also has getters to retrieve the values. Note that
@@ -257,11 +257,11 @@
This will be addressed in a future release of both Cassandra and the driver. Follow
[CASSANDRA-10786] and [JAVA-1196] for more information.
-[PreparedStatement]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/PreparedStatement.html
-[BoundStatement]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/BoundStatement.html
-[setPrepareOnAllHosts]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/QueryOptions.html#setPrepareOnAllHosts-boolean-
-[setReprepareOnUp]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/QueryOptions.html#setReprepareOnUp-boolean-
-[execute]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement-
-[executeAsync]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement-
+[PreparedStatement]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/PreparedStatement.html
+[BoundStatement]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/BoundStatement.html
+[setPrepareOnAllHosts]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/QueryOptions.html#setPrepareOnAllHosts-boolean-
+[setReprepareOnUp]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/QueryOptions.html#setReprepareOnUp-boolean-
+[execute]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement-
+[executeAsync]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement-
[CASSANDRA-10786]: https://issues.apache.org/jira/browse/CASSANDRA-10786
-[JAVA-1196]: https://datastax-oss.atlassian.net/browse/JAVA-1196
\ No newline at end of file
+[JAVA-1196]: https://datastax-oss.atlassian.net/browse/JAVA-1196
diff --git a/manual/statements/simple/README.md b/manual/statements/simple/README.md
index 9967b0e..4ba119e 100644
--- a/manual/statements/simple/README.md
+++ b/manual/statements/simple/README.md
@@ -128,4 +128,4 @@
1, bytes);
```
-[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/SimpleStatement.html
+[SimpleStatement]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/SimpleStatement.html
diff --git a/manual/tuples/README.md b/manual/tuples/README.md
index 27e8f9f..6652b81 100644
--- a/manual/tuples/README.md
+++ b/manual/tuples/README.md
@@ -1,5 +1,102 @@
-## Tuples
+## Using Tuples with the Java driver
-*Coming soon... In the meantime, see the javadoc for [TupleType].*
+Cassandra allows to use `tuple` data types [in tables and user-defined types](https://docs.datastax.com/en/cql/3.1/cql/cql_reference/tupleType.html):
-[TupleType]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/TupleType.html
\ No newline at end of file
+```
+CREATE TABLE ks.collect_things (
+ pk int,
+ ck1 text,
+ ck2 text,
+ v tuple<int, text, float>,
+ PRIMARY KEY (pk, ck1, ck2)
+);
+```
+
+### Fetching Tuples from Rows results
+
+The DataStax Java driver exposes a special [`TupleValue`][TupleValue] class to handle such columns.
+[`TupleValue`][TupleValue] exposes getters allowing to extract from the tuple all the data types
+supported by Cassandra:
+
+```java
+Row row = session.execute("SELECT v FROM ks.collect_things WHERE pk = 1").one();
+
+TupleValue tupleValue = row.getTupleValue("v");
+
+int firstValueInTuple = tupleValue.getInt(0);
+
+String secondValueInTuple = tupleValue.getString(1);
+
+Float thirdValueInTuple = tupleValue.getFloat(2);
+```
+
+### Using tuples as statement parameters
+
+A prepared statement may contain a Tuple as a query parameter. In such cases, users
+will need to create or gather a [`TupleType`][TupleType] first, in order to be able to create a [`TupleValue`][TupleValue]
+to bind:
+
+```java
+PreparedStatement ps = session.prepare("INSERT INTO ks.collect_things (pk, ck1, ck2, v) VALUES (:pk, :ck1, :ck2, :v)");
+
+TupleType tupleType = cluster.getMetadata().newTupleType(DataType.cint(), DataType.text(), DataType.cfloat());
+
+BoundStatement bs = ps.bind();
+bs.setInt("pk", 1);
+bs.setString("ck1", "1");
+bs.setString("ck2", "1");
+bs.setTupleValue("v", tupleType.newValue(1, "hello", 2.3f));
+
+session.execute(bs);
+```
+
+The method [`newValue(Object...)`][newValueVararg] follows the same rules as `new SimpleStatement(String, Object...)`;
+there can be ambiguities due to the fact that the driver will infer the data types from the values
+given in parameters of the method, whereas the data types required may differ (numeric
+literals are always interpreted as `int`).
+
+To avoid such ambiguities, a [`TupleValue`][TupleValue] returned by [`newValue()`][newValue] also exposes specific
+setters for all the existing Cassandra data types:
+
+```java
+TupleType tupleType = cluster.getMetadata().newTupleType(DataType.bigint(), DataType.text(), DataType.cfloat());
+
+TupleValue value = tupleType.newValue().setLong(0, 2).setString(1, "hello").setDouble(2, 2.3f);
+```
+
+#### More use cases
+
+Users can also define single-usage tuples in _SELECT_ queries with the `IN` keyword
+(called a "multi-column IN restriction"), usually for tables with composite clustering
+keys. In this case, a tuple will be usable the same way it was for prepared statements' parameters:
+
+```java
+TupleType oneTimeUsageTuple = cluster.getMetadata().newTupleType(DataType.text(), DataType.text());
+
+PreparedStatement ps = session.prepare("SELECT * FROM ks.collect_things WHERE pk = 1 and (ck1, ck2) IN (:t)");
+
+BoundStatement bs = ps.bind();
+bs.setTupleValue("t", oneTimeUsageTuple.newValue("1", "1"));
+
+session.execute(bs);
+```
+
+More generally, the `IN` keyword in a `SELECT` query will be used to define a *list* of
+desired values of the filtered clustering keys, those would simply be bound as a list of
+[`TupleValue`][TupleValue] with the Java driver:
+
+```java
+TupleType oneTimeUsageTuple = cluster.getMetadata().newTupleType(DataType.text(), DataType.text());
+
+PreparedStatement ps = session.prepare("SELECT * FROM ks.collect_things WHERE pk = 1 AND (ck1, ck2) IN :l");
+
+BoundStatement bs = ps.bind();
+bs.setList("l", Arrays.asList(oneTimeUsageTuple.newValue("1", "1"), oneTimeUsageTuple.newValue("1", "2"), oneTimeUsageTuple.newValue("2", "1")));
+
+session.execute(bs);
+```
+
+[TupleType]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/TupleType.html
+[TupleValue]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/TupleValue.html
+[newValueVararg]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/TupleType.html#newValue-java.lang.Object...-
+[newValue]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/TupleType.html#newValue--
diff --git a/manual/udts/README.md b/manual/udts/README.md
index 760b87e..b045690 100644
--- a/manual/udts/README.md
+++ b/manual/udts/README.md
@@ -2,4 +2,4 @@
*Coming soon... In the meantime, see the javadoc for [UserType].*
-[UserType]: http://docs.datastax.com/en/drivers/java/3.2/com/datastax/driver/core/UserType.html
\ No newline at end of file
+[UserType]: http://docs.datastax.com/en/drivers/java/3.3/com/datastax/driver/core/UserType.html
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 089726f..585a105 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,38 +1,36 @@
<!--
- Copyright (C) 2012-2015 DataStax Inc.
+ Copyright (C) 2012-2017 DataStax Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.sonatype.oss</groupId>
- <artifactId>oss-parent</artifactId>
- <version>7</version>
- <relativePath />
- </parent>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-parent</artifactId>
- <version>3.2.1-SNAPSHOT</version>
+ <version>3.3.3-SNAPSHOT</version>
<packaging>pom</packaging>
<name>DataStax Java Driver for Apache Cassandra</name>
- <description>A driver for Apache Cassandra 1.2+ that works exclusively with the Cassandra Query Language version 3
+ <description>
+ A driver for Apache Cassandra 1.2+ that works exclusively with the Cassandra Query Language version 3
(CQL3) and Cassandra's binary protocol.
</description>
+
<url>https://github.com/datastax/java-driver</url>
+
<inceptionYear>2012</inceptionYear>
<modules>
@@ -46,105 +44,889 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <cassandra.version>3.10</cassandra.version>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <cassandra.version>3.11.1</cassandra.version>
<java.version>1.6</java.version>
<log4j.version>1.2.17</log4j.version>
- <slf4j-log4j12.version>1.7.6</slf4j-log4j12.version>
+ <slf4j.version>1.7.25</slf4j.version>
+ <slf4j-log4j12.version>1.7.25</slf4j-log4j12.version>
<guava.version>19.0</guava.version>
- <netty.version>4.0.44.Final</netty.version>
- <metrics.version>3.1.2</metrics.version>
+ <netty.version>4.0.47.Final</netty.version>
+ <metrics.version>3.2.2</metrics.version>
<snappy.version>1.1.2.6</snappy.version>
<lz4.version>1.3.0</lz4.version>
<hdr.version>2.1.9</hdr.version>
- <!-- driver-extras module -->
- <jackson.version>2.6.3</jackson.version>
+ <jackson.version>2.8.8</jackson.version>
+ <!-- jackson-databind 2.7.x is the last to support java 6 -->
+ <jackson-databind.version>2.7.9.1</jackson-databind.version>
<joda.version>2.9.1</joda.version>
<jsr353-api.version>1.0</jsr353-api.version>
<jsr353-ri.version>1.0.4</jsr353-ri.version>
<jnr-ffi.version>2.0.7</jnr-ffi.version>
<jnr-posix.version>3.0.27</jnr-posix.version>
- <!-- test dependency versions -->
+ <groovy.version>2.4.7</groovy.version>
+ <jax-rs.version>2.0.1</jax-rs.version>
+ <jersey.version>2.23.1</jersey.version>
+ <hk2.version>2.4.0-b34</hk2.version>
+ <felix.version>4.4.1</felix.version>
+ <!-- more recent versions of pax-exam require JDK7+ -->
+ <pax-exam.version>3.6.0</pax-exam.version>
+ <url.version>2.4.0</url.version>
<testng.version>6.8.8</testng.version>
<assertj.version>1.7.0</assertj.version>
<mockito.version>1.10.8</mockito.version>
<commons-exec.version>1.3</commons-exec.version>
<scassandra.version>1.1.2</scassandra.version>
- <main.basedir>${project.basedir}</main.basedir>
+ <logback.version>1.2.3</logback.version>
+ <byteman.version>3.0.8</byteman.version>
<ipprefix>127.0.1.</ipprefix>
+ <!-- defaults below are overridden by profiles and/or submodules -->
<test.groups>unit</test.groups>
- <!-- Set default javadoc.opts, overriden by profiles -->
+ <test.osgi.skip>true</test.osgi.skip>
<javadoc.opts />
</properties>
- <profiles>
- <profile>
- <id>default</id>
- <properties>
- <env>default</env>
- <test.groups>unit</test.groups>
- </properties>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- </profile>
+ <dependencyManagement>
- <profile>
- <id>doclint-java8-disable</id>
- <activation>
- <jdk>[1.8,)</jdk>
- </activation>
- <properties>
- <javadoc.opts>-Xdoclint:none</javadoc.opts>
- </properties>
- </profile>
+ <dependencies>
- <profile>
- <id>short</id>
- <properties>
- <env>default</env>
- <test.groups>unit,short</test.groups>
- </properties>
- </profile>
- <profile>
- <id>long</id>
- <properties>
- <env>default</env>
- <test.groups>unit,short,long</test.groups>
- </properties>
- </profile>
- <profile>
- <id>duration</id>
- <properties>
- <env>default</env>
- <test.groups>unit,short,long,duration</test.groups>
- </properties>
- </profile>
- <profile>
- <id>doc</id>
- <properties>
- <env>default</env>
- <test.groups>unit,doc</test.groups>
- </properties>
- </profile>
- <profile>
- <!-- default profile settings for 'isolated' test group, will skip tests unless overridden in child module. -->
- <id>isolated</id>
- <properties>
- <env>default</env>
- <test.groups>isolated</test.groups>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- <configuration>
+ <dependency>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-core</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-core</artifactId>
+ <version>${project.parent.version}</version>
+ <classifier>shaded</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-core</artifactId>
+ <version>${project.parent.version}</version>
+ <type>test-jar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-mapping</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-extras</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>${guava.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-handler</artifactId>
+ <version>${netty.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>io.dropwizard.metrics</groupId>
+ <artifactId>metrics-core</artifactId>
+ <version>${metrics.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.github.jnr</groupId>
+ <artifactId>jnr-ffi</artifactId>
+ <version>${jnr-ffi.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.github.jnr</groupId>
+ <artifactId>jnr-posix</artifactId>
+ <version>${jnr-posix.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.xerial.snappy</groupId>
+ <artifactId>snappy-java</artifactId>
+ <version>${snappy.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.jpountz.lz4</groupId>
+ <artifactId>lz4</artifactId>
+ <version>${lz4.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-transport-native-epoll</artifactId>
+ <version>${netty.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hdrhistogram</groupId>
+ <artifactId>HdrHistogram</artifactId>
+ <version>${hdr.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>${jackson-databind.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish</groupId>
+ <artifactId>javax.json</artifactId>
+ <version>${jsr353-ri.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.json</groupId>
+ <artifactId>javax.json-api</artifactId>
+ <version>${jsr353-api.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>${jax-rs.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-server</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.media</groupId>
+ <artifactId>jersey-media-json-jackson</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.containers</groupId>
+ <artifactId>jersey-container-jdk-http</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.hk2</groupId>
+ <artifactId>hk2-api</artifactId>
+ <version>${hk2.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>javax.annotation-api</artifactId>
+ <version>1.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>${joda.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.framework</artifactId>
+ <version>${felix.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam</artifactId>
+ <version>${pax-exam.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-testng</artifactId>
+ <version>${pax-exam.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-container-forked</artifactId>
+ <version>${pax-exam.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-link-mvn</artifactId>
+ <version>${pax-exam.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.ops4j.pax.url</groupId>
+ <artifactId>pax-url-reference</artifactId>
+ <version>${url.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>${testng.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <version>${assertj.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>${mockito.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.scassandra</groupId>
+ <artifactId>java-client</artifactId>
+ <version>${scassandra.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-exec</artifactId>
+ <version>${commons-exec.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-tcnative</artifactId>
+ <version>2.0.1.Final</version>
+ <classifier>${os.detected.classifier}</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${slf4j-log4j12.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>${logback.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.ow2.asm</groupId>
+ <artifactId>asm</artifactId>
+ <version>5.0.3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ <version>${groovy.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ </dependencyManagement>
+
+ <build>
+
+ <extensions>
+
+ <extension>
+ <groupId>kr.motd.maven</groupId>
+ <artifactId>os-maven-plugin</artifactId>
+ <version>1.4.1.Final</version>
+ </extension>
+
+ </extensions>
+
+ <!--
+ Run the following command to check if plugin updates are available:
+ mvn versions:display-plugin-updates
+ -->
+ <pluginManagement>
+
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>3.0.0</version>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>3.0.2</version>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.6</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <!-- last version compatible with Java 6 -->
+ <version>1.9.1</version>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.4.1</version>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.6.1</version>
+ <configuration>
+ <source>${java.version}</source>
+ <target>${java.version}</target>
+ <optimize>true</optimize>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <!--
+ Avoids warnings when cross-compiling to older source levels, see
+ https://blogs.oracle.com/darcy/entry/bootclasspath_older_source
+ -->
+ <compilerArgument>-Xlint:-options</compilerArgument>
+ <!-- this actually means: use incremental compilation -->
+ <useIncrementalCompilation>false</useIncrementalCompilation>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.5</version>
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <goals>
+ <goal>testCompile</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <fileset>
+ <directory>${pom.basedir}/src/test/groovy</directory>
+ <includes>
+ <include>**/*.groovy</include>
+ </includes>
+ </fileset>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ <version>${groovy.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>3.0.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.10.4</version>
+ <inherited>true</inherited>
+ <configuration>
+ <quiet>true</quiet>
+ <verbose>false</verbose>
+ <additionalparam>${javadoc.opts}</additionalparam>
+ <links>
+ <link>https://docs.oracle.com/javase/8/docs/api/</link>
+ <link>https://google.github.io/guava/releases/19.0/api/docs/</link>
+ <link>http://netty.io/4.0/api/</link>
+ <link>http://www.joda.org/joda-time/apidocs/</link>
+ <link>http://fasterxml.github.io/jackson-core/javadoc/2.8/</link>
+ <link>http://fasterxml.github.io/jackson-databind/javadoc/2.7/</link>
+ <link>https://javaee-spec.java.net/nonav/javadocs/</link>
+ </links>
+ <!-- optional dependencies from other modules (must be explicitly declared here in order to be correctly resolved) -->
+ <additionalDependencies>
+ <additionalDependency>
+ <groupId>org.xerial.snappy</groupId>
+ <artifactId>snappy-java</artifactId>
+ <version>${snappy.version}</version>
+ </additionalDependency>
+ <additionalDependency>
+ <groupId>net.jpountz.lz4</groupId>
+ <artifactId>lz4</artifactId>
+ <version>${lz4.version}</version>
+ </additionalDependency>
+ <additionalDependency>
+ <groupId>org.hdrhistogram</groupId>
+ <artifactId>HdrHistogram</artifactId>
+ <version>${hdr.version}</version>
+ </additionalDependency>
+ <additionalDependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <version>${jackson.version}</version>
+ </additionalDependency>
+ <additionalDependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>${jackson.version}</version>
+ </additionalDependency>
+ <additionalDependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>${jackson-databind.version}</version>
+ </additionalDependency>
+ <additionalDependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>${joda.version}</version>
+ </additionalDependency>
+ <additionalDependency>
+ <groupId>javax.json</groupId>
+ <artifactId>javax.json-api</artifactId>
+ <version>${jsr353-api.version}</version>
+ </additionalDependency>
+ </additionalDependencies>
+ </configuration>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.0.2</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <!-- last version compatible with Java 6 -->
+ <version>2.5.4</version>
+ <configuration>
+ <instructions>
+ <Bundle-Version>${project.version}</Bundle-Version>
+ <_include>-osgi.bnd</_include>
+ </instructions>
+ <supportedProjectTypes>
+ <supportedProjectType>jar</supportedProjectType>
+ <supportedProjectType>bundle</supportedProjectType>
+ <supportedProjectType>pom</supportedProjectType>
+ </supportedProjectTypes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>3.0.0</version>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.5.3</version>
+ <configuration>
+ <tagNameFormat>@{project.version}</tagNameFormat>
+ <autoVersionSubmodules>true</autoVersionSubmodules>
+ <useReleaseProfile>false</useReleaseProfile>
+ <releaseProfiles>release</releaseProfiles>
+ <goals>deploy</goals>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>3.0.0</version>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>2.5.2</version>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8.2</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>clirr-maven-plugin</artifactId>
+ <!-- Last version compatible with Java 6 -->
+ <version>2.7</version>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <comparisonVersion>3.3.1</comparisonVersion>
+ <ignoredDifferencesFile>../clirr-ignores.xml</ignoredDifferencesFile>
+ <excludes>
+ <exclude>com/datastax/shaded/**</exclude>
+ </excludes>
+ </configuration>
+ <!--
+ Workaround to make clirr plugin work with Java 8.
+ The bug is actually in the BCEL library,
+ see https://issues.apache.org/jira/browse/BCEL-173.
+ See also https://github.com/RichardWarburton/lambda-behave/issues/31#issuecomment-86052095
+ -->
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>bcel-findbugs</artifactId>
+ <version>6.0</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <plugin>
+ <groupId>com.mycila</groupId>
+ <artifactId>license-maven-plugin</artifactId>
+ <version>3.0</version>
+ <configuration>
+ <inlineHeader><![CDATA[
+
+Copyright (C) 2012-2017 DataStax Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+]]>
+ </inlineHeader>
+ <includes>
+ <include>src/**/*.java</include>
+ <include>src/**/*.xml</include>
+ <include>src/**/*.properties</include>
+ <include>**/pom.xml</include>
+ </includes>
+ <mapping>
+ <java>SLASHSTAR_STYLE</java>
+ <properties>SCRIPT_STYLE</properties>
+ </mapping>
+ <strictCheck>true</strictCheck>
+ </configuration>
+ <executions>
+ <execution>
+ <id>check-license</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>animal-sniffer-maven-plugin</artifactId>
+ <version>1.15</version>
+ <executions>
+ <execution>
+ <id>check-jdk6</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <signature>
+ <groupId>org.codehaus.mojo.signature</groupId>
+ <artifactId>java16</artifactId>
+ <version>1.0</version>
+ </signature>
+ <annotations>
+ <annotation>com.datastax.driver.extras.codecs.jdk8.IgnoreJDK6Requirement
+ </annotation>
+ </annotations>
+ </configuration>
+ </execution>
+ <execution>
+ <id>check-jdk8</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <signature>
+ <groupId>org.codehaus.mojo.signature</groupId>
+ <artifactId>java18</artifactId>
+ <version>1.0</version>
+ </signature>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <!-- do not upgrade until https://issues.apache.org/jira/browse/SUREFIRE-1302 is fixed -->
+ <version>2.18</version>
+ <configuration>
+ <groups>${test.groups}</groups>
+ <useFile>false</useFile>
+ <systemPropertyVariables>
+ <cassandra.version>${cassandra.version}</cassandra.version>
+ <ipprefix>${ipprefix}</ipprefix>
+ <com.datastax.driver.NEW_NODE_DELAY_SECONDS>60</com.datastax.driver.NEW_NODE_DELAY_SECONDS>
+ </systemPropertyVariables>
+ <classpathDependencyExcludes>
+ <classpathDependencyExcludes>io.netty:netty-transport-native-epoll</classpathDependencyExcludes>
+ </classpathDependencyExcludes>
+ <properties>
<property>
<name>usedefaultlisteners</name>
<value>false
</value> <!-- disable default listeners as some of the html reports do a lot of File I/O -->
</property>
+ <property>
+ <!-- Don't skip tests after a @Before method throws a SkipException -->
+ <name>configfailurepolicy</name>
+ <value>continue</value>
+ </property>
+ </properties>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <!-- do not upgrade until https://issues.apache.org/jira/browse/SUREFIRE-1302 is fixed -->
+ <version>2.18</version>
+ <configuration>
+ <groups>${test.groups}</groups>
+ <useFile>false</useFile>
+ <systemPropertyVariables>
+ <cassandra.version>${cassandra.version}</cassandra.version>
+ <ipprefix>${ipprefix}</ipprefix>
+ <com.datastax.driver.NEW_NODE_DELAY_SECONDS>60</com.datastax.driver.NEW_NODE_DELAY_SECONDS>
+ </systemPropertyVariables>
+ <classpathDependencyExcludes>
+ <classpathDependencyExcludes>io.netty:netty-transport-native-epoll</classpathDependencyExcludes>
+ </classpathDependencyExcludes>
+ <properties>
+ <property>
+ <name>usedefaultlisteners</name>
+ <value>false
+ </value> <!-- disable default listeners as some of the html reports do a lot of File I/O -->
+ </property>
+ <property>
+ <!-- Don't skip tests after a @Before method throws a SkipException -->
+ <name>configfailurepolicy</name>
+ <value>continue</value>
+ </property>
+ </properties>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.5</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>1.6.8</version>
+ <extensions>true</extensions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.ops4j</groupId>
+ <artifactId>maven-pax-plugin</artifactId>
+ <version>1.6.0</version>
+ <configuration>
+ <framework>felix</framework>
+ <showWarnings>true</showWarnings>
+ <provision>
+ <param>--platform=felix</param>
+ <param>--version=${felix.version}</param>
+ <param>--log=debug</param>
+ <param>--systemPackages=sun.misc</param>
+ </provision>
+ </configuration>
+ </plugin>
+
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <artifactId>maven-jar-plugin</artifactId>
+ <versionRange>[2.2,)</versionRange>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore />
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ </pluginManagement>
+
+ <plugins>
+
+ <plugin>
+ <groupId>com.mycila</groupId>
+ <artifactId>license-maven-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>animal-sniffer-maven-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>clirr-maven-plugin</artifactId>
+ </plugin>
+
+ </plugins>
+
+ </build>
+
+ <profiles>
+
+ <profile>
+ <id>short</id>
+ <properties>
+ <test.groups>unit,short</test.groups>
+ <test.osgi.skip>false</test.osgi.skip>
+ </properties>
+ </profile>
+
+ <profile>
+ <id>long</id>
+ <properties>
+ <test.groups>unit,short,long</test.groups>
+ <test.osgi.skip>false</test.osgi.skip>
+ </properties>
+ </profile>
+
+ <profile>
+ <id>duration</id>
+ <properties>
+ <test.groups>unit,short,long,duration</test.groups>
+ <test.osgi.skip>false</test.osgi.skip>
+ </properties>
+ </profile>
+
+ <profile>
+ <id>doc</id>
+ <properties>
+ <test.groups>unit,doc</test.groups>
+ </properties>
+ </profile>
+
+ <!-- default profile settings for 'isolated' test group, will skip tests unless overridden in child module. -->
+ <profile>
+ <id>isolated</id>
+ <properties>
+ <test.groups>isolated</test.groups>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
<skip>true</skip>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
@@ -159,14 +941,16 @@
</build>
</profile>
+ <!--
+ Profile activated when releasing. See:
+ http://central.sonatype.org/pages/apache-maven.html
+ -->
<profile>
- <id>enforce-java8</id>
+ <id>release</id>
<build>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
- <version>1.4.1</version>
<executions>
<execution>
<id>enforce-java8</id>
@@ -183,18 +967,65 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <serverId>ossrh</serverId>
+ <nexusUrl>https://oss.sonatype.org/</nexusUrl>
+ <autoReleaseAfterClose>false</autoReleaseAfterClose>
+ <skipLocalStaging>true</skipLocalStaging>
+ </configuration>
+ </plugin>
</plugins>
</build>
</profile>
- <!--
- This profile excludes all JDK 8 dependent tests from being
- run with legacy JDKs (6 or 7).
- It is automatically activated when a legacy JDK is in use.
- Note that running tests with a legacy JDK require
- that you provide a non-legacy JDK for CCM through the
- system property ccm.java.home.
- -->
+ <profile>
+ <id>modern-jdks</id>
+ <activation>
+ <jdk>[1.8,)</jdk>
+ </activation>
+ <properties>
+ <javadoc.opts>-Xdoclint:none</javadoc.opts>
+ </properties>
+ </profile>
+
<profile>
<id>legacy-jdks</id>
<activation>
@@ -203,23 +1034,18 @@
<build>
<plugins>
<plugin>
- <!-- exclude Jdk8* test classes from being compiled -->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <testExcludes>
- <exclude>**/Jdk8*.java</exclude>
- </testExcludes>
- </configuration>
- </plugin>
- <plugin>
- <!-- exclude Jdk* test classes from being run
+ <!--
+ Exclude Jdk* test classes from being run
This is needed in event that code was built with JDK8
- and tests are ran with JDK6 or 7. -->
+ and tests are ran with JDK6 or 7.
+ Note that running CCM tests with a legacy JDK require
+ setting two system properties: ccm.java.home and ccm.path;
+ both should point to a valid JDK8+ installation.
+ -->
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
<configuration>
<excludes>
+ <exclude>**/jdk8/*.java</exclude>
<exclude>**/Jdk8*.java</exclude>
</excludes>
</configuration>
@@ -230,268 +1056,12 @@
</profiles>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.3</version>
- <configuration>
- <source>${java.version}</source>
- <target>${java.version}</target>
- <optimize>true</optimize>
- <showDeprecation>true</showDeprecation>
- <showWarnings>true</showWarnings>
- <!--
- Avoids warnings when cross-compiling to older source levels, see
- https://blogs.oracle.com/darcy/entry/bootclasspath_older_source
- -->
- <compilerArgument>-Xlint:-options</compilerArgument>
- <!-- this actually means: use incremental compilation -->
- <useIncrementalCompilation>false</useIncrementalCompilation>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.2.1</version>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>package</phase>
- <goals>
- <goal>jar-no-fork</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.9.1</version>
- <inherited>true</inherited>
- <configuration>
- <quiet>true</quiet>
- <verbose>false</verbose>
- <additionalparam>${javadoc.opts}</additionalparam>
- <links>
- <link>https://docs.oracle.com/javase/8/docs/api/</link>
- <link>https://google.github.io/guava/releases/19.0/api/docs/</link>
- <link>http://netty.io/4.0/api/</link>
- <!-- dependencies from driver-extras -->
- <link>http://www.joda.org/joda-time/apidocs/</link>
- <link>http://fasterxml.github.io/jackson-core/javadoc/2.6/</link>
- <link>http://fasterxml.github.io/jackson-databind/javadoc/2.6/</link>
- <link>https://javaee-spec.java.net/nonav/javadocs/</link>
- </links>
- <!-- optional dependencies from other modules (must be explicitly declared here in order to be correctly resolved) -->
- <additionalDependencies>
- <additionalDependency>
- <groupId>org.xerial.snappy</groupId>
- <artifactId>snappy-java</artifactId>
- <version>${snappy.version}</version>
- </additionalDependency>
- <additionalDependency>
- <groupId>net.jpountz.lz4</groupId>
- <artifactId>lz4</artifactId>
- <version>${lz4.version}</version>
- </additionalDependency>
- <additionalDependency>
- <groupId>org.hdrhistogram</groupId>
- <artifactId>HdrHistogram</artifactId>
- <version>${hdr.version}</version>
- </additionalDependency>
- <additionalDependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- <version>${jackson.version}</version>
- </additionalDependency>
- <additionalDependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- <version>${jackson.version}</version>
- </additionalDependency>
- <additionalDependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>${jackson.version}</version>
- </additionalDependency>
- <additionalDependency>
- <groupId>joda-time</groupId>
- <artifactId>joda-time</artifactId>
- <version>${joda.version}</version>
- </additionalDependency>
- <additionalDependency>
- <groupId>javax.json</groupId>
- <artifactId>javax.json-api</artifactId>
- <version>${jsr353-api.version}</version>
- </additionalDependency>
- </additionalDependencies>
- </configuration>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>2.5</version>
- <configuration>
- <tagNameFormat>@{project.version}</tagNameFormat>
- <preparationGoals>clean verify -Penforce-java8</preparationGoals>
- <!-- do NOT specify arguments tag here as it would override the arguments tag in this plugin's definition in the parent POM -->
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>clirr-maven-plugin</artifactId>
- <version>2.7</version>
- <executions>
- <execution>
- <phase>compile</phase>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <comparisonVersion>3.1.4</comparisonVersion>
- <ignoredDifferencesFile>../clirr-ignores.xml</ignoredDifferencesFile>
- </configuration>
- <!--
- Workaround to make clirr plugin work with Java 8.
- The bug is actually in the BCEL library,
- see https://issues.apache.org/jira/browse/BCEL-173.
- See also https://github.com/RichardWarburton/lambda-behave/issues/31#issuecomment-86052095
- -->
- <dependencies>
- <dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>bcel-findbugs</artifactId>
- <version>6.0</version>
- </dependency>
- </dependencies>
- </plugin>
- <!--
- To update license headers run:
- mvn license:format
- -->
- <plugin>
- <groupId>com.mycila</groupId>
- <artifactId>license-maven-plugin</artifactId>
- <version>2.8</version>
- <configuration>
- <header>${main.basedir}/src/license/header.txt</header>
- <includes>
- <include>src/**/*.java</include>
- <include>src/**/*.xml</include>
- <include>src/**/*.properties</include>
- <include>**/pom.xml</include>
- </includes>
- <excludes>
- <exclude>**/src/main/config/ide/**</exclude>
- </excludes>
- <mapping>
- <java>SLASHSTAR_STYLE</java>
- <properties>SCRIPT_STYLE</properties>
- </mapping>
- <strictCheck>true</strictCheck>
- </configuration>
- <executions>
- <execution>
- <id>check-license</id>
- <phase>initialize</phase>
- <goals>
- <goal>check</goal>
- </goals>
- <configuration>
- <properties>
- <currentYear>${currentYear}</currentYear>
- </properties>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.15</version>
- <configuration>
- <signature>
- <groupId>org.codehaus.mojo.signature</groupId>
- <artifactId>java16</artifactId>
- <version>1.0</version>
- </signature>
- </configuration>
- <executions>
- <execution>
- <id>check</id>
- <phase>compile</phase>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- <configuration>
- <groups>${test.groups}</groups>
- <useFile>false</useFile>
- <systemPropertyVariables>
- <cassandra.version>${cassandra.version}</cassandra.version>
- <ipprefix>${ipprefix}</ipprefix>
- <com.datastax.driver.NEW_NODE_DELAY_SECONDS>60</com.datastax.driver.NEW_NODE_DELAY_SECONDS>
- </systemPropertyVariables>
- <classpathDependencyExcludes>
- <classpathDependencyExcludes>io.netty:netty-transport-native-epoll</classpathDependencyExcludes>
- </classpathDependencyExcludes>
- <properties>
- <property>
- <name>usedefaultlisteners</name>
- <value>false
- </value> <!-- disable default listeners as some of the html reports do a lot of File I/O -->
- </property>
- <property>
- <!-- Don't skip tests after a @Before method throws a SkipException -->
- <name>configfailurepolicy</name>
- <value>continue</value>
- </property>
- </properties>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <version>2.16</version>
- <configuration>
- <groups>${test.groups}</groups>
- <useFile>false</useFile>
- <systemPropertyVariables>
- <cassandra.version>${cassandra.version}</cassandra.version>
- <ipprefix>${ipprefix}</ipprefix>
- <com.datastax.driver.NEW_NODE_DELAY_SECONDS>60</com.datastax.driver.NEW_NODE_DELAY_SECONDS>
- </systemPropertyVariables>
- <classpathDependencyExcludes>
- <classpathDependencyExcludes>io.netty:netty-transport-native-epoll</classpathDependencyExcludes>
- </classpathDependencyExcludes>
- <properties>
- <property>
- <!-- Don't skip tests after a @Before method throws a SkipException -->
- <name>configfailurepolicy</name>
- <value>continue</value>
- </property>
- </properties>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <distributionManagement>
+ <repository>
+ <id>ossrh</id>
+ <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+ </repository>
+ </distributionManagement>
<licenses>
<license>
@@ -515,4 +1085,5 @@
<organization>DataStax</organization>
</developer>
</developers>
+
</project>
diff --git a/src/license/header.txt b/src/license/header.txt
deleted file mode 100644
index 0dc2cb3..0000000
--- a/src/license/header.txt
+++ /dev/null
@@ -1,13 +0,0 @@
- Copyright (C) ${project.inceptionYear}-2015 DataStax Inc.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/upgrade_guide/README.md b/upgrade_guide/README.md
index 3fe68ae..b278a14 100644
--- a/upgrade_guide/README.md
+++ b/upgrade_guide/README.md
@@ -3,6 +3,14 @@
The purpose of this guide is to detail changes made by successive
versions of the Java driver.
+### 3.4.0
+
+`QueryBuilder` methods `in`, `lt`, `lte`, `eq`, `gt`, and `gte` now accept
+`Iterable` as input rather than just `List`. This should have no impact unless
+you were accessing these methods using reflection in which case you need to
+account for these new parameter types.
+
+
### 3.2.0
The `SSLOptions` interface is now deprecated in favor of