Commit graph

290 commits

Author SHA1 Message Date
Greg Burd
828c456814 Add MaterialziedView entity support and the beginnings of a CoveringIndex (which is another name for MaterializedView). 2017-10-10 13:40:41 -04:00
Greg Burd
01102e2299 Enabled Helenus.dsl() to return a valid object even when the cluster metadata isn't known in advance and later learn more when it is. Changed the AbstractEntityDraft to have both by-string and by-getter mutation/accessor methods. These two combine to make Draft objects more type safe. 2017-10-10 13:40:41 -04:00
Greg Burd
0e9d1086ed Use backingMap for the mutated key set (and save some space/overhead). 2017-10-10 13:40:41 -04:00
Greg Burd
306c9e68ef Merge branch 'develop' into gburd/wip-facet-cache 2017-10-05 09:42:32 -04:00
Greg Burd
25c5c6b969 Enabled Helenus.dsl() to return a valid object even when the cluster metadata isn't known in advance and later learn more when it is. Changed the AbstractEntityDraft to have both by-string and by-getter mutation/accessor methods. These two combine to make Draft objects more type safe. 2017-10-04 15:46:01 -04:00
Greg Burd
be8d1bf029 Use backingMap for the mutated key set (and save some space/overhead). 2017-09-29 10:48:37 -04:00
Greg Burd
bf1d5f217f First fetch from the backingMap. 2017-09-29 09:47:15 -04:00
Greg Burd
efa87b2d4f WIP: working toward a faceted cache. 2017-09-26 10:37:08 -04:00
Greg Burd
16af6ea175 When items are reset, they may also be null which would incorrectly return false. 2017-09-26 10:18:55 -04:00
Greg Burd
5c8a0360a2 Reset of a value in AbstractEntityDraft should update with the current value is either null or not equal to desired value, fixed logic. 2017-09-26 09:26:06 -04:00
Greg Burd
d3c24b70bf Be sure to pick up all inherited interfaces and scan those with the @InheritedTable annotation for methods. When doing that, if we encounter the same method name twice prefer the least generic implementation. 2017-09-25 15:50:29 -04:00
Greg Burd
844ebd9155 Add support for marking queries as idempotent so that the C* driver will apply the retry policy and in some cases perform speculative execution. (see: https://docs.datastax.com/en/developer/java-driver/3.1/manual/retries/ and https://docs.datastax.com/en/developer/java-driver/3.1/manual/speculative_execution/). 2017-09-22 09:46:59 -04:00
Greg Burd
a7094abdfa Re-work API for UnitOfWork so as to be able to instantiate custom sub-classes if need be. 2017-09-21 14:38:19 -04:00
Greg Burd
ac7db5f243 Alias writeTime and ttl on SELECT/caching. Shorten UOW log to avoid leaking information. 2017-09-20 10:48:47 -04:00
Greg Burd
67dbb36194 Cache keys must contain all primary key values. 2017-09-18 13:40:06 -04:00
Greg Burd
f9ab9f91a1 Fix cache lookup. 2017-09-18 11:07:09 -04:00
Greg Burd
895921c598 Another spot I missed allowing null UOW in {a}sync(). 2017-09-14 13:16:06 -04:00
Greg Burd
97f74776d5 Allow UOW to be null in {a}sync(UnitOfWork uow). 2017-09-14 09:34:12 -04:00
Greg Burd
8c165a689b Another oversight. 2017-09-13 15:08:50 -04:00
Greg Burd
9e3fabb2f9 Forgot to add type to begin() call in HelenusSession. 2017-09-13 14:27:08 -04:00
Greg Burd
90e1aafd94 Need to parameterize the exception type. 2017-09-13 13:27:34 -04:00
Greg Burd
efca86783c Allow configuration of the exception class used when conflicts arise at UnitOfWork commit time to enable clients to provide custom/advanced/specific exceptions without having to do a bunch of encapsulation. 2017-09-13 12:28:40 -04:00
Greg Burd
66578d77d5 Allow subclasses of UnitOfWork (remove 'final'). 2017-09-13 10:55:23 -04:00
Greg Burd
75aff52312 Honor the ignoreCache() when selecting from UOW cache. 2017-09-13 08:33:48 -04:00
Greg Burd
83ef8d7b0c Adjust how entity draft auditing works. 2017-09-12 15:51:49 -04:00
Greg Burd
58b29ad181 Caching entity results within the context of a UOW (even nested) seems to be working. 2017-09-12 14:09:51 -04:00
Greg Burd
1b46ee0ed1 WIP: More work toward entity cache, very broken at this point. 2017-09-01 15:38:58 -04:00
Greg Burd
cb09324ac6 Commented out the UOW cache (as it's not yet finished/working) and updated the version number. 2017-08-31 14:10:26 -04:00
Greg Burd
5089be2c22 Adding more support for the Draft/Builder pattern for entity objects. Fixed a number of issues and added more tests. 2017-08-31 14:06:44 -04:00
Greg Burd
3cd889ea61 WIP: More work toward UOW caching but mainly a lot of work to cleanup the API. 2017-08-30 13:41:15 -04:00
Greg Burd
09b06f4ca4 WIP: Fixed the ordering of commit.andThen(() -> {}) to match the nesting and fire iff the outter most UOW has committed. Made UnitOfWork Closable which will abort the work iff it has not previously been committed or aborted. Started to add tests to exercise Helenus UnitOfWork (transactions). 2017-08-29 10:13:29 -04:00
Greg Burd
c35d6d19d1 WIP: toward caching at session and unit of work. 2017-08-25 16:13:31 -04:00
Greg Burd
7ac9288eb8 Added update(draft). 2017-08-25 16:09:06 -04:00
Greg Burd
933526b05b WIP: still working toward a solid caching scheme, progress but far from done. 2017-08-18 16:44:30 -04:00
Greg Burd
28aa3b1bae WIP: Working toward a solution that can cache result sets and/or transformed entity instances when annotated with @Cacheable in the Session cache. 2017-08-17 16:00:19 -04:00
Greg Burd
94ce778451 formatting 2017-08-17 12:14:00 -04:00
Greg Burd
142688a215 Funnel all paths to the database through one single method implementation (the 'Executioner') so as to ensure all calls into Cassandra are wrapped in a common way (traced, measured, cached, etc.) in a single place. 2017-08-17 12:05:50 -04:00
Greg Burd
6ad99fc459 formatting 2017-08-17 10:22:03 -04:00
Greg Burd
602e3521b4 Values return to the client in a proxy object should be converted to the proper type. 2017-08-16 13:43:46 -04:00
Greg Burd
9c4d14cc93 Enable serialization of proxied entity objects. Enable the use of default implementation for getter methods to supply default values when the map contains a 'null' (or doesn't contain that key). 2017-08-15 14:58:07 -04:00
Greg Burd
89303f9179 Fix the InsertOperation transform method to properly hydrate the pojo with all property values or, in some cases, their default values before returning it to the caller. 2017-08-11 12:19:53 -04:00
Greg Burd
90e19907d2 Merge branch '2.0.15-SNAPSHOT' into develop 2017-08-10 16:10:31 -04:00
Greg Burd
cf2740337e Add 'Drafted' interface and extend the InsertOperation to recognize that so as to be able to persist the mutated set of keys only yet return a pojo with values matching the draft, not just the mutations.
Changed {in,up}sert() to return the instance of the object.
2017-08-10 16:06:31 -04:00
Greg Burd
8569eaa76f Add 'Drafted' interface and extend the InsertOperation to recognize that so as to be able to persist the mutated set of keys only yet return a pojo with values matching the draft, not just the mutations. 2017-08-10 13:09:34 -04:00
Greg Burd
a126607c09 Added check for mutated set so that the backingMap could contain all object values. The other option was to auto-refresh the instance's backing map when a getter is invoked for a valid property that isn't included in the backing map (which still may be handy/required for caching to work). 2017-08-09 16:20:38 -04:00
Greg Burd
871c8d0c90 Fix minor error. 2017-08-09 15:12:24 -04:00
Greg Burd
fa39908f4c Remove Integer/Enum conversion, it wasn't necessary. 2017-08-09 15:00:19 -04:00
Greg Burd
f008a33e53 Changed Zipkin API a bit, now requires a TraceContext rather than a Span before sync/async calls. 2017-08-09 10:22:59 -04:00
Greg Burd
b9600ac931 Fix Zipkin tracing logic. 2017-08-08 15:28:51 -04:00
Greg Burd
71e84da3bd Start plumbing for Dropwizard metrics and Zipkin tracing. Ensure proper bean value when working with enums. 2017-08-08 12:02:32 -04:00
Greg Burd
f4dbf34920 Remove Scala support and trim Future support at some point I'll re-introduce using Java 8 classes rather than Guava's or Scala's 2017-08-04 11:18:54 -04:00
Greg Burd
c42803b964 Return a Function on successful UnitOfWork.commit() so as to allow users to execute code post-commit iff that commit was successful. 2017-08-04 09:26:58 -04:00
Greg Burd
7497cf5a18 Add compatibility with Java 8 CompletableFuture converting our Guava-supplied ListenableFuture. 2017-08-03 15:38:13 -04:00
Greg Burd
b44c898682 Add the LOCAL_* consistency levels. Add a way to provide a default consistency level for all session operations. 2017-08-02 12:54:01 -04:00
Greg Burd
18cfc85f45 Move logic that filters out unset columns from INSERT statements into InsertOperations because we need to use the proxy implementation's ability to fetch default type-specific values in other places. This change also enables concrete implementations of mapped interfaces to implement MapExportable and use the same method to filter unset values. 2017-08-02 11:35:11 -04:00
Greg Burd
03567dc57e Enable partial updates using partial entity maps. 2017-08-01 12:48:14 -04:00
Greg Burd
de495ae0eb Fixed the embedded Cassandra server by using a newer version, no published artifact so had to include JAR file. Ran Facebook tool called 'infer' which was fairly clean (mvn clean; infer -- mvn package -Dmaven.test.skip=true), two minor potential resource leaks and one possible null pointer dereference 2017-07-28 11:44:48 -04:00
Greg Burd
715fb0e673 Helenus was the son of King Priam and Queen Hecuba of Troy, and the twin brother of the prophetess Cassandra. Like Cassandra, he was always right, but unlike her, others believed him. Seems like a good name for a layer to access DataStax, Apache, or ScyllaDB's implementations of the Cassandra database.
- move to 3.x DataStax drivers (NOTE, this broke the Casser.dsl() API a bit)
 - introduce UnitOfWork-style pseudo transactional scoping (WIP as of this commit)
 - introduce session and UnitOfWork scoped caches (WIP as of this commit)
 - add support for SASI-based secondary index types (such as case insensitive matching, etc.)
 - add support for Lucene-based secondary index types (WIP https://github.com/Stratio/cassandra-lucene-index)
 - update types for Java 8 (WIP)
 - add in Codahale/Dropwizard and Zipkin metrics/tracing support (WIP)
 - and a lot more...
2017-07-27 15:02:17 -04:00
Alex Shvid
13a2f5bffa update information about author 2016-07-04 10:24:04 -07:00
Albert Shift
c1f710584a refactor Timeuuid, add minOf and maxOf methods for Timeuuid 2015-09-12 20:35:24 -07:00
Albert Shift
071f6466ae use Scala Option and Stream in Scala future results 2015-06-23 08:34:20 -07:00
Albert Shift
ba416ba1ff correct java docs 2015-06-19 13:56:09 -07:00
Albert Shift
49b7c07ab2 add java doc comments to all annotations in mapping 2015-06-19 12:55:38 -07:00
Albert Shift
c1ca49fbea query syntax sugar fix in 'in()' operator 2015-06-14 14:07:11 -07:00
Albert Shift
66ccb0feb1 skeep annotations in package scaning process 2015-06-10 16:51:19 -07:00
Albert Shift
1eb3c17d6b support annotaiton on constraint annotation 2015-06-10 16:46:57 -07:00
Albert Shift
52c3f19ea2 add value validator implementation for simple types (does not support
collections and maps)
2015-06-09 23:18:42 -07:00
Albert Shift
c0b16c2db6 Add CasserValidator for property values 2015-06-09 14:55:57 -07:00
Albert Shift
49cb219849 parse contraint annotations and initilize validators 2015-06-09 13:23:25 -07:00
Albert Shift
9919fd9e25 implement common validators for constraints 2015-06-09 12:48:55 -07:00
Albert Shift
46a476a34f update comments in Constraints 2015-06-08 23:18:22 -07:00
Albert Shift
7e87bce918 rename annotation name 2015-06-08 21:52:18 -07:00
Albert Shift
3966640694 rename Constraint class to Constraints 2015-06-08 21:50:00 -07:00
Albert Shift
99db68d75c update Constraint java docs and annotations 2015-06-07 12:52:04 -07:00
Albert Shift
78d076768e Constraint name for the data integrity annotation 2015-06-07 12:35:33 -07:00
Albert Shift
fe3782bf10 check columns for UDT types as well as Tables 2015-06-07 00:24:31 -07:00
Albert Shift
a46421fcce addPackage test 2015-06-06 15:27:14 -07:00
Albert Shift
6e3a130279 add package of entities 2015-06-06 15:12:21 -07:00
Albert Shift
ba86534086 add java doc in Types annotations 2015-06-05 14:16:45 -07:00
Albert Shift
18ee6ab214 add Data annotations 2015-06-05 13:02:28 -07:00
Albert Shift
7f68e7a027 add single() method in SelectOperation 2015-06-03 13:29:33 -07:00
Albert Shift
a4260436e8 change version and add more scala future methods 2015-06-03 12:51:05 -07:00
Albert Shift
869fd0aae3 add scala 2.11 support 2015-06-03 12:22:22 -07:00
Albert Shift
323ce05162 removed Example.java, the file from what the project was started ;) 2015-04-27 20:50:16 -07:00
Albert Shift
5f5e99f26f add Casser.shutdown() method 2015-04-27 20:08:32 -07:00
Albert Shift
9453aef063 showValues setting for showCql in all operations 2015-04-27 17:42:52 -07:00
Albert Shift
4dd187ed77 rename register to singleton in Casser 2015-04-26 14:13:36 -07:00
Albert Shift
579785279f fix small bug on update schema 2015-04-24 23:07:44 -07:00
Albert Shift
14a771ca9c group converter packages by type 2015-04-23 00:12:39 -07:00
Albert Shift
6f9a9ed802 tuple collections converters and tests 2015-04-23 00:07:19 -07:00
Albert Shift
557e6c19d6 more fun with transformers, guava does not supports nulls for lists 2015-04-22 16:28:29 -07:00
Albert Shift
5ad93b2e78 refactor transformers in converters 2015-04-22 16:01:21 -07:00
Albert Shift
c6d0043aa6 optimize immutables for single entries 2015-04-22 13:49:48 -07:00
Albert Shift
2f2b43a529 implement rest udt map converters and cover by tests 2015-04-21 17:48:39 -07:00
Albert Shift
fdc7b27f7c UDTKeyMap convertion and test 2015-04-21 13:53:12 -07:00
Albert Shift
f7de3257c2 UDT tests decomposition 2015-04-20 22:50:40 -07:00
Albert Shift
46742cd2df add UDTList converters and tests 2015-04-20 22:37:01 -07:00
Albert Shift
ec36db0b5f implement UDTSet test and operations 2015-04-20 21:50:15 -07:00
Albert Shift
f59bf9ec2f Set and UDTSet converter 2015-04-18 11:28:20 -07:00
Albert Shift
153c7cc7bf refactoring and prepare for UDT collection tests 2015-04-17 21:54:29 -07:00