Commit Graph

646 Commits

Author SHA1 Message Date
Mark Paluch
45d77ff73e DATACASS-344 - Polishing.
Switch heartbeatIntervalSeconds, idleTimeoutSeconds and poolTimeoutMilliseconds to primitive integers and compare values against defaults to decide whether to set these properties on PoolingOptions.
2016-10-12 14:11:50 +02:00
Mark Paluch
071c101c28 DATACASS-344 - Upgrade Cassandra Driver to 3.1.1.
We are now compatible with Datastax’ Cassandra Driver 3.1.1 and support the newly introduced configuration options MaxQueueSize for PoolingOptions.

This change also removes test assertions for PoolTimeoutMillis as this option was deprecated and made unusable with 3.1.1.
2016-10-12 14:11:47 +02:00
Mark Paluch
b07c708c7c DATACASS-346 - Upgrade embedded Cassandra to 3.9. 2016-10-12 12:25:45 +02:00
Oliver Gierke
5f57ce33e1 DATACASS-337 - Updated changelog. 2016-09-29 14:42:03 +02:00
Oliver Gierke
898d9bc716 DATACASS-341 - Updated changelog. 2016-09-29 11:42:05 +02:00
Mark Paluch
c3ee567196 DATACASS-339 - Rename Spring Data Cassandra to Spring Data for Apache Cassandra. 2016-09-21 09:47:46 +02:00
Oliver Gierke
a5cdf38c86 DATACASS-336 - Updated changelog. 2016-09-21 08:06:35 +02:00
Oliver Gierke
c6699b8b87 DATACASS-303 - Updated changelog. 2016-09-21 08:06:34 +02:00
John Blum
f293516ecd DATACASS-217 - Polish.
Original pull request: #82.
2016-08-29 16:10:19 -07:00
Mark Paluch
23cb654b18 DATACASS-217 - Add support for LZ4 compression.
Original pull request: #82.
2016-08-29 16:10:11 -07:00
Mark Paluch
5465afdbcf DATACASS-331 - Include netty as transient dependency of cassandra-driver-core.
Remove the previously added netty dependency exclusion in 237ac88 to include netty as transient dependency. Netty was excluded because of a dependency conflict between cassandra-driver-dse and cassandra-all. The conflict gets visible during build-time on CI hosts with symptoms of 100% CPU usage or network timeouts.

We now use cassandra-all 3.7 and cassandra-driver-core 3.1.0 which both require netty 4.0.37.Final.

Related pull request: #43.
2016-08-23 08:45:40 +02:00
Mark Paluch
cba267e80a DATACASS-334 - Upgrade embedded Cassandra to 3.7. 2016-08-23 08:45:30 +02:00
Mark Paluch
c4cb79aab5 DATACASS-332 - Assert compatibility with Cassandra driver 3.1.0. 2016-08-22 10:27:47 +02:00
Mark Paluch
25686fd2e2 DATACASS-326 - Assert compatibility with Spring 5.
Enable spring5-next profile build. Adopt tests to use the correct version comparison.
2016-08-22 10:01:54 +02:00
John Blum
c407aad8cf DATACASS-328 - Polish.
Original pull request: #81.
2016-08-09 14:59:39 -07:00
Mark Paluch
fd8e430592 DATACASS-328 - Revise QueryOptions and WriteOptions.
Deprecate our org.springframework.cassandra.core.ConsistencyLevel enum. Having an own consistency level type leads to confusion and it's always behind the driver. We don't want to maintain that type, so we decided to deprecate the own type and use the driver consistency levels.

We allow now the use of the driver retry policies aside of our consistency level enumeration. For most cases, our enumeration is the simpler approach. Some retry policies (IdempotenceAwareRetryPolicy, LoggingRetryPolicies) require further configuration and cannot be applied with just using a static enum value. We now support ReadTimeout, FetchSize, and Tracing via QueryOptions and WriteOptions and provide builders for QueryOptions and WriteOptions.

Original pull request: #81.
2016-08-09 14:59:28 -07:00
Mark Paluch
43ab34ac54 DATACASS-202 - Polishing.
Add author tags. Extend date range in headers. Simplify resolution by removing intermediate variables. Add test to verify ConsistencyLevel resolution. Guard consistency level against null.

Originall pull request: #54.
2016-07-28 15:27:17 +02:00
Antoine Toulme
da263df25c DATACASS-202 - Fix misspelled ConsistencyLevel enum constants.
Deprecate all misspelled consistency level enum values and add new consistency level enum values with correct spellings.

Original pull request: #54.
2016-07-28 15:26:25 +02:00
Oliver Gierke
e6f4822450 DATACASS-269 - After release cleanups. 2016-07-27 14:32:37 +02:00
Oliver Gierke
229dbce133 DATACASS-269 - Prepare next development iteration. 2016-07-27 14:32:34 +02:00
Oliver Gierke
96d21eda0d DATACASS-269 - Release version 1.5 M1 (Ingalls). 2016-07-27 13:52:12 +02:00
Oliver Gierke
24a0d65648 DATACASS-269 - Prepare 1.5 M1 (Ingalls). 2016-07-27 13:51:37 +02:00
Oliver Gierke
fc34ca5f57 DATACASS-269 - Updated changelog. 2016-07-27 13:51:29 +02:00
Mark Paluch
7d5b79b9e4 DATACASS-238 - Polishing.
Reformat field declarations. Add/enhance JavaDoc. Add since tags to the new methods.

Original pull requests: #79, #80.
2016-07-26 12:14:01 +02:00
John Blum
58ed9789de DATACASS-325 - Add ClusterBuilderConfigurer configuration API.
We allow users to provide a ClusterBuilderConfigurer that can be applied to the Cluster Builder. ClusterBuilderConfigurer is a callback interface to handle extended configuration when the DataStax API changes. It allows configuration of options after all provided properties were set.

Original pull request: #79.
Related pull request: #80.
2016-07-26 12:04:35 +02:00
John Blum
dfc7e3a716 DATACASS-238 - Add Cluster configuration options.
We now support configuration of the cluster name, AddressTranslator, MaxSchemaAgreementWaitSeconds, SpeculativeExecutionPolicy and TimestampGenerator in the Cassandra Cluster factory. The cluster name is derived from the bean name, if not configured otherwise.

Related tickets: DATACASS-120, DATACASS-316, DATACASS-317, DATACASS-319, DATACASS-320.
Original pull request: #79.
Related pull request: #80.
2016-07-26 12:04:29 +02:00
John Blum
d0610b2812 DATACASS-288 - Polish.
Re-implemented CassandraBatchTemplate to take a vararg array of Object entities rather than a single entity and guarded against null.

Original pull request: #78.
2016-07-24 20:23:29 -07:00
Mark Paluch
e818d3bc29 DATACASS-288 - Add support for Cassandra Batch operations.
We now support Cassandra batching via CassandraBatchOperations. Batch operations allow to insert/update/delete entities in an atomic way.

  Group walter = new Group(new GroupKey("users", "0x1", "walter"));
  Group mike = new Group(new GroupKey("users", "0x1", "mike"));
  Group tuco = new Group(new GroupKey("users", "0x1", "tuco"));

  CassandraBatchOperations batchOperations = cassandraOperations.batchOps();
  batchOperations.insert(walter).update(mike).delete(tuco).execute();

Original pull request: #78.
2016-07-24 20:23:23 -07:00
John Blum
f96e9383f3 DATACASS-7 - Polish.
Origin pull request: #74.
2016-07-24 19:34:05 -07:00
Mark Paluch
43fc7518b3 DATACASS-7 - Support query derivation in Cassandra repositories.
We now support query derivation in Cassandra repositories. Repositories may declare query methods and queries are created based on the repository declaration.

interface PersonRepository extends CassandraRepository<Person> {

	List<Person> findByLastname(@CassandraType(type = Name.VARCHAR) String lastname);
	List<Person> findByLastname(String lastname, Sort sort);
	List<Person> findByLastnameOrderByFirstnameAsc(String lastname);
	Collection<PersonProjection> findPersonProjectedBy();

	interface PersonProjection {

		String getFirstname();
	}
}

@Table
@Data
public class Person {
	@PrimaryKeyColumn(type = PrimaryKeyType.PARTITIONED, ordinal = 0)
	private String lastname;

	@PrimaryKeyColumn(type = PrimaryKeyType.CLUSTERED, ordinal = 1)
	private String firstname;
}

Query derivation supports a basic set of where predicates:
* = (Equals/Simple property)
* >= (Greater or equal)
* > (Greater)
* < (Less)
* <= (Less or equal)
* IN, LIKE (Like, Starting with, Ending with), CONTAINING
* = true (Is true)
* = false (Is false)

Derived queries work with primary-key and non-primary key columns. Non-primary key columns require a secondary index otherwise these fields can't be queried.

Original pull request: #74.
2016-07-24 19:33:52 -07:00
Ruben Dijkstra
6e176ba28d DATACASS-308 - Fix parameter assertion in MappingCassandraConverter.getWhereClauses(…).
Assert.notNull now checks the id parameter in MappingCassandraConverter.getWhereClauses(…).

Original pull request: #77.
2016-07-21 17:20:05 +02:00
Mark Paluch
491472d273 DATACASS-321 - Integrate version badge from spring.io.
Add version badge from spring.io and replace fixed version numbers in the repository readme file.
2016-07-20 09:05:31 +02:00
Mark Paluch
332443f9fa DATACASS-315 - Upgrade Cassandra Driver to 3.0.3. 2016-07-15 14:14:23 +02:00
Mark Paluch
1cc85fa68e DATACASS-305 - Polishing.
Add generics to list of specifications. Extract CQL generation in own method. Add author tag.

Original pull request: #70.
2016-07-05 09:34:33 +02:00
Stefan Birkner
5154d2b531 DATACASS-305 - Improve readability of CassandraCqlClusterFactoryBean.executeSpecsAndScripts.
We now check first whether any CQL statements need to be executed. This makes the code simpler because we don't have to check whether the session has already been created. Rename the Session variable system to session to omit confusion. Remove CQL logging here as CQL statements are logged inside the CqlTemplate.

Original pull request: #70.
2016-07-05 09:34:19 +02:00
John Blum
570d71a905 DATACASS-304 - CqlTemplate.doExecute does not translate Cassandra Exceptions. 2016-07-01 17:50:32 -07:00
John Blum
ab73021187 DATACASS-310 - Fix CqlTemplate and CassandraTemplate returning null for data access operations returning a Collection. 2016-07-01 17:26:04 -07:00
John Blum
931e777498 DATACASS-206, DATACASS-308 - Polish.
Original pull request: #73.
2016-07-01 14:35:54 -07:00
Mark Paluch
937fbf3c18 DATACASS-206 - Polishing.
Reorder fields in MappingCassandraConverter. Remove code duplicates. Improve JavaDoc in CassandraOperations. Align entity class parameter names in CassandraTemplate. Enhance JavaDoc for built statement factory methods. Add guards to method arguments.

Original pull request: #73.
2016-07-01 14:35:43 -07:00
Mark Paluch
52211305ad DATACASS-308 - Fix NullPointerException using MapId with unknown property names.
We now reject unknown/misspelled property names when using MapId. The Id conversion and extraction takes now place in the Cassandra Converter. The Id handling code in CassandraTemplate is deprecated.

Original pull request: #73.
2016-07-01 14:35:37 -07:00
Mark Paluch
580adfb5c1 DATACASS-206 - Fix delete using custom column names.
We now use the specified column name from the entity annotation to construct the where clause in a delete statement.

Original pull request: #73.
2016-07-01 14:35:29 -07:00
Mark Paluch
f63d2cb26a DATACASS-182 - Use hasItem instead of contains in MappingCassandraConverterUnitTests assertions.
Use hasItem assertion matchers for asserting insert values as contains asserts all values within the collection and we just want to pick particular entries to assert.
2016-07-01 12:10:06 +02:00
Mark Paluch
b584322545 DATACASS-307 - Run TravisCI build against various Cassandra versions.
We now run TravisCI builds against various Cassandra versions.
2016-06-30 14:07:45 +02:00
John Blum
1c824f2965 DATACASS-296 - Polish.
Original pull request: #68.
2016-06-29 19:22:48 -07:00
Mark Paluch
66a69c0926 DATACASS-296 - Use CustomConversions for JSR-310, Joda and ThreeTen Backport types.
We now allow registering CustomConversions to register custom converters (read and write targets). CustomConversions registers by default JSR-310, Joda Time and ThreeTen backport type converters.
These types (LocalDate, LocalDateTime) can be used in domain classes and with query method arguments. Date-only types map to Cassandra's date type, Date and time types map to Cassandra's timestamp type. Type mapping works for singular and collection types (List and Set).

```
@Table
public Person

    @Id String id;

    java.time.LocalDate date;

    @CassandraType(type = Name.TIMESTAMP)
    java.time.LocalDate timestamp;

    List<org.threeten.bp.Instant> timestamps;
}
```

Original pull request: #68.
2016-06-29 19:21:08 -07:00
John Blum
fae1ba8591 DATACASS-192 - Polish.
Original pull request: #69.
2016-06-28 14:30:57 -07:00
Mark Paluch
f1e3ef48e8 DATACASS-192 - Support RENAME and DROP in ALTER TABLE specification.
Extend alter table specification and the linked CQL generator to support RENAME and DROP operations. Cleanup code in that area.

Original pull request: #69.
2016-06-28 14:30:50 -07:00
Mark Paluch
38fef212e4 DATACASS-192 - Fix syntax error when adding columns using CQL generators.
The Add-Column CQL generator now generates correct CQL statements.

Original pull request: #69.
2016-06-28 14:30:40 -07:00
John Blum
6ee70916ff DATACASS-182 - Polish.
Original pull request: #72.
2016-06-28 12:43:59 -07:00
Mark Paluch
e10c71722d DATACASS-182 - Add ability to update/store null into fields.
We now support the removal of columns for properties with null values by allowing null values in Insert and Update statements written by MappingCassandraConverter. Objects are stored with all persistent properties. Insert and update perform no longer conditional inserting of non-null values but take all values into account.

Original pull request: #72.
2016-06-28 12:33:07 -07:00