Class ClientRecord
- java.lang.Object
-
- com.couchbase.transactions.cleanup.ClientRecord
-
@Internal public class ClientRecord extends java.lang.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.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CLIENT_RECORD_DOC_ID
static java.lang.String
FIELD_CLIENTS
static java.lang.String
FIELD_OVERRIDE
static java.lang.String
FIELD_OVERRIDE_ENABLED
static java.lang.String
FIELD_OVERRIDE_EXPIRES
static java.lang.String
FIELD_RECORDS
-
Constructor Summary
Constructors Constructor Description ClientRecord(ClusterData clusterData)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected reactor.core.publisher.Mono<java.lang.Integer>
beforeCreateRecord(ClientRecord self)
protected reactor.core.publisher.Mono<java.lang.Integer>
beforeGetRecord(ClientRecord self)
protected reactor.core.publisher.Mono<java.lang.Integer>
beforeRemoveClient(ClientRecord self)
protected reactor.core.publisher.Mono<java.lang.Integer>
beforeUpdateCAS(ClientRecord self)
Deprecated.protected reactor.core.publisher.Mono<java.lang.Integer>
beforeUpdateRecord(ClientRecord self)
static reactor.core.publisher.Mono<com.couchbase.client.java.kv.LookupInResult>
getClientRecord(com.couchbase.client.java.ReactiveCollection collection, SpanWrapper span)
reactor.core.publisher.Mono<ClientRecordDetails>
getClientRecord(java.lang.String bucketName)
static ClientRecordDetails
parseClientRecord(com.couchbase.client.java.kv.LookupInResult clientRecord, java.lang.String clientUuid)
reactor.core.publisher.Mono<ClientRecordDetails>
processClient(java.lang.String clientUuid, com.couchbase.client.java.ReactiveCollection collection, MergedTransactionConfig config, SpanWrapper pspan)
reactor.core.publisher.Mono<ClientRecordDetails>
processClient(java.lang.String clientUuid, com.couchbase.client.java.ReactiveCollection collection, TransactionConfig config)
reactor.core.publisher.Flux<java.lang.Void>
removeClientFromAllBuckets(java.lang.String clientUuid)
reactor.core.publisher.Flux<java.lang.Void>
removeClientFromAllBuckets(java.lang.String clientUuid, java.time.Duration timeout)
Called on shutdown to cleanly remove a client from the client-record.
-
-
-
Field Detail
-
CLIENT_RECORD_DOC_ID
public static java.lang.String CLIENT_RECORD_DOC_ID
-
FIELD_RECORDS
public static final java.lang.String FIELD_RECORDS
- See Also:
- Constant Field Values
-
FIELD_CLIENTS
public static final java.lang.String FIELD_CLIENTS
- See Also:
- Constant Field Values
-
FIELD_OVERRIDE
public static final java.lang.String FIELD_OVERRIDE
- See Also:
- Constant Field Values
-
FIELD_OVERRIDE_ENABLED
public static final java.lang.String FIELD_OVERRIDE_ENABLED
- See Also:
- Constant Field Values
-
FIELD_OVERRIDE_EXPIRES
public static final java.lang.String FIELD_OVERRIDE_EXPIRES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClientRecord
public ClientRecord(ClusterData clusterData)
-
-
Method Detail
-
removeClientFromAllBuckets
public reactor.core.publisher.Flux<java.lang.Void> removeClientFromAllBuckets(java.lang.String clientUuid)
-
removeClientFromAllBuckets
public reactor.core.publisher.Flux<java.lang.Void> removeClientFromAllBuckets(java.lang.String clientUuid, java.time.Duration timeout)
Called on shutdown to cleanly remove a client from the client-record.
-
parseClientRecord
public static ClientRecordDetails parseClientRecord(com.couchbase.client.java.kv.LookupInResult clientRecord, java.lang.String clientUuid)
-
getClientRecord
public reactor.core.publisher.Mono<ClientRecordDetails> getClientRecord(java.lang.String bucketName)
-
getClientRecord
public static reactor.core.publisher.Mono<com.couchbase.client.java.kv.LookupInResult> getClientRecord(com.couchbase.client.java.ReactiveCollection collection, @Nullable SpanWrapper span)
-
processClient
public reactor.core.publisher.Mono<ClientRecordDetails> processClient(java.lang.String clientUuid, com.couchbase.client.java.ReactiveCollection collection, TransactionConfig config)
-
processClient
public reactor.core.publisher.Mono<ClientRecordDetails> processClient(java.lang.String clientUuid, com.couchbase.client.java.ReactiveCollection collection, MergedTransactionConfig config, @Nullable SpanWrapper pspan)
-
beforeCreateRecord
protected reactor.core.publisher.Mono<java.lang.Integer> beforeCreateRecord(ClientRecord self)
-
beforeRemoveClient
protected reactor.core.publisher.Mono<java.lang.Integer> beforeRemoveClient(ClientRecord self)
-
beforeUpdateCAS
@Deprecated protected reactor.core.publisher.Mono<java.lang.Integer> beforeUpdateCAS(ClientRecord self)
Deprecated.
-
beforeGetRecord
protected reactor.core.publisher.Mono<java.lang.Integer> beforeGetRecord(ClientRecord self)
-
beforeUpdateRecord
protected reactor.core.publisher.Mono<java.lang.Integer> beforeUpdateRecord(ClientRecord self)
-
-