Class ClientRecord
java.lang.Object
com.couchbase.client.core.transaction.cleanup.ClientRecord
Represents the ClientRecord doc, a single document that contains an entry for every client (app) current
participating
in the cleanup of 'lost' transactions.
ClientRecord isn't as contended as it appears. It's only read and written to by each client once per cleanup window (default for this is 60 seconds). It does remain a single point of failure, but with a sensible number of replicas this is unlikely to be a problem.
All writes are non-durable. If a write is rolled back then it's not critical, it will just take a little longer to find lost txns.
- Author:
- Graham Pople
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected reactor.core.publisher.Mono
<Integer> protected reactor.core.publisher.Mono
<Integer> beforeGetRecord
(ClientRecord self) protected reactor.core.publisher.Mono
<Integer> protected reactor.core.publisher.Mono
<Integer> beforeUpdateCAS
(ClientRecord self) Deprecated.protected reactor.core.publisher.Mono
<Integer> reactor.core.publisher.Mono
<CoreSubdocGetResult> getClientRecord
(CollectionIdentifier collection, SpanWrapper span) static ClientRecordDetails
parseClientRecord
(CoreSubdocGetResult clientRecord, String clientUuid) reactor.core.publisher.Mono
<ClientRecordDetails> processClient
(String clientUuid, CollectionIdentifier collection, CoreTransactionsConfig config, SpanWrapper pspan) reactor.core.publisher.Flux
<Void> removeClientFromClientRecord
(String clientUuid, Duration timeout, Set<CollectionIdentifier> collections) Called on shutdown to cleanly remove a client from the client-record.reactor.core.publisher.Flux
<Void> removeClientFromClientRecord
(String clientUuid, Set<CollectionIdentifier> cleanupSet)
-
Field Details
-
CLIENT_RECORD_DOC_ID
- See Also:
-
FIELD_RECORDS
- See Also:
-
FIELD_CLIENTS
- See Also:
-
FIELD_OVERRIDE
- See Also:
-
FIELD_OVERRIDE_ENABLED
- See Also:
-
FIELD_OVERRIDE_EXPIRES
- See Also:
-
-
Constructor Details
-
ClientRecord
-
-
Method Details
-
removeClientFromClientRecord
public reactor.core.publisher.Flux<Void> removeClientFromClientRecord(String clientUuid, Set<CollectionIdentifier> cleanupSet) -
removeClientFromClientRecord
public reactor.core.publisher.Flux<Void> removeClientFromClientRecord(String clientUuid, Duration timeout, Set<CollectionIdentifier> collections) Called on shutdown to cleanly remove a client from the client-record. -
parseClientRecord
public static ClientRecordDetails parseClientRecord(CoreSubdocGetResult clientRecord, String clientUuid) -
getClientRecord
public reactor.core.publisher.Mono<CoreSubdocGetResult> getClientRecord(CollectionIdentifier collection, @Nullable SpanWrapper span) -
processClient
public reactor.core.publisher.Mono<ClientRecordDetails> processClient(String clientUuid, CollectionIdentifier collection, CoreTransactionsConfig config, @Nullable SpanWrapper pspan) -
beforeCreateRecord
-
beforeRemoveClient
-
beforeUpdateCAS
Deprecated. -
beforeGetRecord
-
beforeUpdateRecord
-