Class ClientRecord
- java.lang.Object
-
- com.couchbase.client.core.transaction.cleanup.ClientRecord
-
@Internal public class ClientRecord extends Object
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 Modifier and Type Field Description static String
CLIENT_RECORD_DOC_ID
static String
FIELD_CLIENTS
static String
FIELD_OVERRIDE
static String
FIELD_OVERRIDE_ENABLED
static String
FIELD_OVERRIDE_EXPIRES
static String
FIELD_RECORDS
-
Constructor Summary
Constructors Constructor Description ClientRecord(Core core)
-
Method Summary
-
-
-
Field Detail
-
CLIENT_RECORD_DOC_ID
public static String CLIENT_RECORD_DOC_ID
-
FIELD_RECORDS
public static final String FIELD_RECORDS
- See Also:
- Constant Field Values
-
FIELD_CLIENTS
public static final String FIELD_CLIENTS
- See Also:
- Constant Field Values
-
FIELD_OVERRIDE
public static final String FIELD_OVERRIDE
- See Also:
- Constant Field Values
-
FIELD_OVERRIDE_ENABLED
public static final String FIELD_OVERRIDE_ENABLED
- See Also:
- Constant Field Values
-
FIELD_OVERRIDE_EXPIRES
public static final String FIELD_OVERRIDE_EXPIRES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClientRecord
public ClientRecord(Core core)
-
-
Method Detail
-
removeClientFromCleanupSet
public Flux<Void> removeClientFromCleanupSet(String clientUuid, Set<CollectionIdentifier> cleanupSet)
-
removeClientFromCleanupSet
public Flux<Void> removeClientFromCleanupSet(String clientUuid, Duration timeout, Set<CollectionIdentifier> cleanupSet)
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
protected Mono<Integer> beforeCreateRecord(ClientRecord self)
-
beforeRemoveClient
protected Mono<Integer> beforeRemoveClient(ClientRecord self)
-
beforeUpdateCAS
@Deprecated protected Mono<Integer> beforeUpdateCAS(ClientRecord self)
Deprecated.
-
beforeGetRecord
protected Mono<Integer> beforeGetRecord(ClientRecord self)
-
beforeUpdateRecord
protected Mono<Integer> beforeUpdateRecord(ClientRecord self)
-
-