Commit Graph

930 Commits

Author SHA1 Message Date
Mark Paluch
4538b2aa56 DATACASS-518 - Polishing.
Simplify unit tests by inlining tests into tests class and removing nested test enclosure classes.
2018-01-18 11:39:00 +01:00
Mark Paluch
3eedafb3e4 DATACASS-518 - Polishing.
Add convenience method to table specifications accepting String column names with ordering.
2018-01-18 11:39:00 +01:00
Mark Paluch
342b6b9334 DATACASS-518 - Fix CQL generator when using ordered clustering columns with options.
CreateTableCqlGenerator now creates correct CQL when using ordered clustering columns with and without table options.
2018-01-18 11:39:00 +01:00
Mark Paluch
4a592d9c0e DATACASS-516 - Polishing.
Apply fix also to reactive Cassandra example.

Original pull request: #117.
2018-01-15 11:14:47 +01:00
Dušan Andrić
f2fd2a1b8c DATACASS-516 - Add return type to sample code in reference docs.
Original pull request: #117.
2018-01-15 11:14:41 +01:00
Mark Paluch
afb55469de DATACASS-517 - Update copyright years to 2018. 2018-01-08 16:49:58 +01:00
Mark Paluch
7cd656bd94 DATACASS-508 - Updated changelog. 2017-11-27 16:43:41 +01:00
Mark Paluch
c2a19bf6c1 DATACASS-503 - Updated changelog. 2017-11-27 15:58:46 +01:00
Mark Paluch
87af85c26e DATACASS-513 - Polishing.
Upgrade test dependencies. Use build-managed failsafe plugin version.
2017-11-26 18:29:40 +01:00
Mark Paluch
35c2fa1969 DATACASS-513 - Upgrade to Cassandra Driver 3.3.2. 2017-11-26 18:26:18 +01:00
Mark Paluch
38dd4a7834 DATACASS-511 - Add test for limiting query methods. 2017-11-22 14:54:50 +01:00
John Blum
ea957d73fa DATACASS-509 - Review and polish. 2017-11-11 23:12:06 -08:00
Mark Paluch
65b4cd3c8c DATACASS-509 - Polishing.
Replace Mono creation via Future and CompletableFuture with Mono sink creation. Using sink directly does not require creation of a CompletableFuture.
2017-11-11 23:11:58 -08:00
Mark Paluch
8ab816b919 DATACASS-509 - Request subsequent result pages in ReactiveSession asynchronously.
We now no longer use a Scheduler to offload ResultSet's blocking paging but request the next result page asynchronously by adapting ResultSet.fetchMoreResults(). Result pages are requested once all elements of the previous ResultSet are emitted and the row publisher completes successfully. The Scheduler is no longer required.

The request progress is stored in a MonoProcessor to extend the result stream. Increase visibility of utility methods to avoid synthetic accessor creation.
2017-11-11 23:11:49 -08:00
Oliver Gierke
10c9c0c81d DATACASS-500 - Updated changelog. 2017-10-27 16:36:44 +02:00
Mark Paluch
5f61faeadb DATACASS-507 - Adapt API changes in Property in test cases. 2017-10-27 11:18:12 +02:00
Mark Paluch
9dce6b7273 DATACASS-506 - Resolve annotated and nested user-defined type references to stubs for UDT creation.
We now resolve user-defined type references to type stubs when constructing the create specification for a user-defined type instead of looking up the type from Cassandra if the particular property is annotated with @CassandraType(type = UDT). This applies to user-defined types nested in the to-be-created type. Stubbing is necessary to not prevent user-type creation during create specification construction. The actual execution happens after all creation specifications are built.
2017-10-24 16:12:57 +02:00
Oliver Gierke
dbd5a0e701 DATACASS-491 - Updated changelog. 2017-10-11 19:01:36 +02:00
Mark Paluch
2dcd9c86e5 DATACASS-502 - Polishing.
Add unit tests for Keyspace create/create-drop.
2017-10-04 11:03:55 +02:00
Mark Paluch
de92c84cab DATACASS-502 - Add support for keyspace alteration on cluster initialization.
We now support keyspace alteration using XML configuration during after CassandraClusterFactoryBean initialization.

Previously, ALTER keyspace actions resulted in IllegalStateException.
2017-10-04 10:47:33 +02:00
Mark Paluch
0f688b878e DATACASS-492 - After release cleanups. 2017-10-02 11:37:23 +02:00
Mark Paluch
7100fcd261 DATACASS-492 - Prepare next development iteration. 2017-10-02 11:37:22 +02:00
Mark Paluch
3d0268ebc4 DATACASS-492 - Release version 2.0 GA (Kay). 2017-10-02 11:10:23 +02:00
Mark Paluch
13440fcbfa DATACASS-492 - Prepare 2.0 GA (Kay). 2017-10-02 11:09:17 +02:00
Mark Paluch
f0f5304993 DATACASS-492 - Updated changelog. 2017-10-02 11:09:12 +02:00
Mark Paluch
243b81fd4f DATACASS-499 - Adapt to changed Spring Framework 5 documentation structure.
Update links in the reference docs to their new locations.
2017-09-27 14:00:09 +02:00
Mark Paluch
9798638e91 DATACASS-495 - Downgrade to CDI 1.0.
We now build against CDI 1.0 again while using CDI 2.0 for testing.
2017-09-21 13:59:20 +02:00
Mark Paluch
0df95821e8 DATACASS-496 - Added explicit automatic module name for JDK 9. 2017-09-21 13:58:53 +02:00
Mark Paluch
d1fb7e2fae DATACASS-495 - Upgrade to OpenWebBeans 2.0.1. 2017-09-18 15:26:23 +02:00
Mark Paluch
43602ae30c DATACASS-494 - Upgrade to embedded Apache Cassandra 3.11.
Upgrade embedded Cassandra version and build profiles.
2017-09-14 12:26:41 +02:00
Mark Paluch
b4ded9168e DATACASS-493 - Update reference documentation for 2.0.
Update what's new and include migration guide.
2017-09-14 11:43:50 +02:00
John Blum
41457a40d1 DATACASS-489 - Polish. 2017-09-13 08:47:23 -07:00
Mark Paluch
4115cd3ca2 DATACASS-489 - Document SessionFactory in reference docs. 2017-09-13 08:41:14 -07:00
John Blum
018aea1288 DATACASS-56 - Polish. 2017-09-11 23:34:44 -07:00
Mark Paluch
90bfa5317b DATACASS-56 - Cassandra paging support.
We now support forward-only paging with Cassandra through the Template API and Repositories. Results in Cassandra are paged by navigating forward-only through pages described by a binary paging state encapsulated by CassandraPageRequest and accessible via the returned Slice. Spring Data Page's do not fit to Cassandra's paging concept because Cassandra paging is not based on limit/offset.

Page requests are applicable to a Query and as parameter of query methods.

Query query = Query.empty().pageRequest(CassandraPageRequest.first(10));
Slice<User> slice = template.slice(query, User.class);

do {

    // consume slice

    if (slice.hasNext()) {
        slice = template.select(query, slice.nextPageable(), User.class);
    } else {
        break;
    }
} while (!slice.getContent().isEmpty());

assertThat(ids).hasSize(100);
assertThat(iterations).isEqualTo(10);

interface UserRepository implements Repository<User, String> {

    Slice<User> findAllByName(String name, Pageable pageRequest);
}
2017-09-11 23:22:43 -07:00
Mark Paluch
62e6d33314 DATACASS-56 - Allow query options mutation.
We now allow query option mutation through QueryOptions.mutate() returning an initialized builder. The mutation builder is initialized with the state of the QueryOptions object and allows further customization without changing the previous state of the immutable QueryOptions object.

QueryOptions queryOptions = …;

QueryOptions mutated = queryOptions.mutate().readTimeout(Duration.ofSeconds(5)).build();
2017-09-11 23:14:43 -07:00
John Blum
1cb5a8bd99 DATACASS-146 - Polish. 2017-09-11 23:14:09 -07:00
Mark Paluch
0ee5190f09 DATACASS-146 - Enhance Repository methods to accept QueryOptions as arguments.
We now support Repository query methods with query options. Query options can be passed either as an additional parameter to a Repository query method or applied with annotation.
Annotation-based query options are supported via @Consistency. A query options parameter has precedence over the annotation if a method declares both, an annotation-based consistency level and accepts a query options parameter.

interface SampleRepository extends Repository<Person, String> {

  @Query("SELECT * FROM person WHERE lastname = ?0;")
  @Consistency(ConsistencyLevel.LOCAL_ONE)
  Person findByLastname(String lastname);

  @Consistency(ConsistencyLevel.LOCAL_ONE)
  Person findByAge(int age);

  Person findByAge(int age, QueryOptions options);
}

SampleRepository repository = …;

repository.findByAge(42, QueryOptions.builder().fetchSize(44).build());
2017-09-11 23:14:00 -07:00
John Blum
d00ff35b19 DATACASS-145 - Polish. 2017-09-11 18:11:46 -07:00
Mark Paluch
997888678a DATACASS-145 - Make SimpleCassandraRepository.createInsert(…) protected.
Expose createInsert(…) in the synchronous and reactive repository base classes to simplify base class extension. Derived classes are no longer required to implement createInsert(…) themselves but can reuse the existing methods. Extract createInsert(…) body to InsertUtil.
2017-09-11 18:11:38 -07:00
John Blum
9fc7cd9eaa DATACASS-467 - Polish. 2017-09-11 16:30:18 -07:00
Mark Paluch
58e7bcc36d DATACASS-467 - Add migration guide describing upgrade paths from 1.5 to 2.0. 2017-09-11 16:29:21 -07:00
Mark Paluch
7e6556e3bd DATACASS-467 - Update documentation. 2017-09-11 16:29:06 -07:00
Oliver Gierke
e084ec2efd DATACASS-480 - After release cleanups. 2017-09-11 17:40:21 +02:00
Oliver Gierke
1cf3595b6b DATACASS-480 - Prepare next development iteration. 2017-09-11 17:40:18 +02:00
Oliver Gierke
bdbcb3565b DATACASS-480 - Release version 2.0 RC3 (Kay). 2017-09-11 17:24:45 +02:00
Oliver Gierke
8aa59ff4a2 DATACASS-480 - Prepare 2.0 RC3 (Kay). 2017-09-11 17:23:52 +02:00
Oliver Gierke
6dc6421076 DATACASS-480 - Updated changelog. 2017-09-11 17:23:44 +02:00
Mark Paluch
e53972880a DATACASS-481 - Updated changelog. 2017-09-11 12:43:51 +02:00
Mark Paluch
759ef416ed DATACASS-490 - Switch to VM-based TravisCI build.
We now switched to VM-based builds by requiring sudo to apply higher memory limits as we exceeded memory limits of the container-based build.
2017-09-05 09:46:35 +02:00