Switch heartbeatIntervalSeconds, idleTimeoutSeconds and poolTimeoutMilliseconds to primitive integers and compare values against defaults to decide whether to set these properties on PoolingOptions.
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.
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.
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.
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.
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.
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.
Re-implemented CassandraBatchTemplate to take a vararg array of Object entities rather than a single entity and guarded against null.
Original pull request: #78.
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.
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.
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.
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.
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.
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.
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.
Extend alter table specification and the linked CQL generator to support RENAME and DROP operations. Cleanup code in that area.
Original pull request: #69.
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.