Class 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 Detail

      • CLIENT_RECORD_DOC_ID

        public static java.lang.String CLIENT_RECORD_DOC_ID
      • 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)
      • 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)