java-driver icon indicating copy to clipboard operation
java-driver copied to clipboard

Add BYPASS CACHE and USING TIMEOUT capabilities to mapper

Open Bouncheck opened this issue 1 year ago • 6 comments

Now Select, Insert and Update annotations used in DAOs can specify (usingTimeout = "durationString") in order to use Scylla CQL extension timeouts.

Bouncheck avatar Feb 22 '24 17:02 Bouncheck

My sincerest apologies to owners of Select, Insert and Update accounts that I've accidentally tagged. Feel free to review though.

Bouncheck avatar Feb 22 '24 17:02 Bouncheck

I've decided to go with "usingTimeout" to make it more distinct from @StatementAttributes(timeout) which AFAIK is a driver-side timeout.

Bouncheck avatar Feb 22 '24 17:02 Bouncheck

Ping - any updates to this PR?

mykaul avatar Mar 14 '24 13:03 mykaul

@Bouncheck / @avelanarius what is this one waiting for? Can we get a peer review in parallel?

roydahan avatar Apr 03 '24 20:04 roydahan

Ping.

roydahan avatar Apr 25 '24 11:04 roydahan

Thanks for the review, I see good points being raised. It has been a while so i may need to retrace some decisions I've made, but I'll try to address everything.

Bouncheck avatar Apr 30 '24 10:04 Bouncheck

USING TIMEOUT is added to select insert and update - what about delete and batch?

I've limited this change to queries mentioned in #168. Delete does not seem to support using timeout in QueryBuilder yet. I haven't seen batch and truncate used anywhere in mapper.

PR title mentions BYPASS CACHE [...], but there is no mention in PR description

Added mention in description.

Tests

Added tests that verify generated code, Added integration tests that run correct statements with valid timeouts, Added tests with invalid timeouts and valid but too low timeout, Duplicated some integration tests for Select annotation but with added bypass cache so that at least we know it does not break

Bouncheck avatar May 13 '24 07:05 Bouncheck