GeezerVison is showing github.com — Support ReadOptions in v1beta3 · Issue #637 · googleapis/google-cloud-java
Support ReadOptions in v1beta3 #637DescriptionRead options for lookups and queries should be disabled within transactions. Transaction options should only be available when creating a new transaction. Activitychanged the title [-]Support eventually consisent lookups and queries.[/-] [+]Support ReadOptions and TransactionOptions in v1beta3[/+] on Feb 17, 2016ajkannan commented on Feb 17, 2016 Disabling read options from within a transaction is a bit challenging because the Datastore and Transaction interfaces both inherit DatastoreReaderWriter. Two ways to solve this to include:
- Setting read options when creating a
Datastore service object. (If users want some actions to use eventual consistency and others to use the default level of consistency, then they could create two service objects).
- Including varargs read options for lookup/query methods in the
Datastore interface, but throwing an exception at runtime if a user attempts to set read options from within a transaction.
Any opinions/suggestions @aozarov @pcostell? aozarov commented on Feb 17, 2016 We should also consider this option:
- Add read-only to
TransactionOption
- Add a new
ReadOptions class that only includes ReadConsistency settings.
- Add only to the
Datastore interface get and run(Query) methods that accept ReadOptions
- Modify Datastore implementation for runInTransaction to defer transaction creating until the first lookup or query and if none use
CommitRequest with TransactionOptions
pcostell commented on Feb 17, 2016 I agree with Arie's proposal --
transaction options can be made available to the user at the call to runInTransaction or newTransaction. There isn't a need to expose TransactionOptions directly on get and runQuery calls because it's effectively an optimization that runInTransaction should take advantage of to avoid the call to beginTransaction. ajkannan commented on Feb 26, 2016 Since transaction options are coming in a later release of v1beta3, I will create a separate issue for transaction options and keep this issue for read options. changed the title [-]Support ReadOptions and TransactionOptions in v1beta3[/-] [+]Support ReadOptions in v1beta3[/+] on Feb 26, 2016ajkannan commented on Mar 2, 2016
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|