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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbeforeGetRecord
(ClientRecord self) beforeUpdateCAS
(ClientRecord self) Deprecated.getClientRecord
(CollectionIdentifier collection, SpanWrapper span) static ClientRecordDetails
parseClientRecord
(SubdocGetResponse clientRecord, String clientUuid) processClient
(String clientUuid, CollectionIdentifier collection, CoreTransactionsConfig config, SpanWrapper pspan) removeClientFromClientRecord
(String clientUuid, Duration timeout, Set<CollectionIdentifier> collections) Called on shutdown to cleanly remove a client from the client-record.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 Flux<Void> removeClientFromClientRecord(String clientUuid, Set<CollectionIdentifier> cleanupSet) -
removeClientFromClientRecord
public 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(SubdocGetResponse clientRecord, String clientUuid) -
getClientRecord
public Mono<SubdocGetResponse> getClientRecord(CollectionIdentifier collection, @Nullable SpanWrapper span) -
processClient
public Mono<ClientRecordDetails> processClient(String clientUuid, CollectionIdentifier collection, CoreTransactionsConfig config, @Nullable SpanWrapper pspan) -
beforeCreateRecord
-
beforeRemoveClient
-
beforeUpdateCAS
Deprecated. -
beforeGetRecord
-
beforeUpdateRecord
-