Couchbase C++ SDK 1.0.2 (rev. 51f4775)
Loading...
Searching...
No Matches
transactions_cleanup_config Class Reference

Configuration parameters for the background transaction cleanup threads. More...

#include <couchbase/transactions/transactions_cleanup_config.hxx>

Public Member Functions

auto cleanup_lost_attempts (bool value) -> transactions_cleanup_config &
 Enable/disable the lost attempts cleanup loop.
 
auto cleanup_lost_attempts () const -> bool
 Get lost attempts cleanup loop status.
 
auto cleanup_client_attempts (bool value) -> transactions_cleanup_config &
 Set state for the client attempts cleanup loop.
 
auto cleanup_client_attempts () const -> bool
 Get state of client attempts cleanup loop.
 
auto cleanup_window () const -> std::chrono::milliseconds
 Get cleanup window.
 
template<typename T >
auto cleanup_window (T duration) -> transactions_cleanup_config &
 Set cleanup window.
 
auto add_collection (const couchbase::transactions::transaction_keyspace &keyspace) -> transactions_cleanup_config &
 Add a collection to be cleaned.
 

Detailed Description

Configuration parameters for the background transaction cleanup threads.

Member Function Documentation

◆ add_collection()

auto add_collection ( const couchbase::transactions::transaction_keyspace & keyspace) -> transactions_cleanup_config&
inline

Add a collection to be cleaned.

This can be called multiple times, to add several collections, if needed.

◆ cleanup_client_attempts() [1/2]

auto cleanup_client_attempts ( ) const -> bool
inlinenodiscard

Get state of client attempts cleanup loop.

A transactions object will create a background thread to do any cleanup necessary for the transactions it has attempted. This can be disabled if set to false.

Returns
true if the thread is enabled, false if not.

◆ cleanup_client_attempts() [2/2]

auto cleanup_client_attempts ( bool value) -> transactions_cleanup_config&
inline

Set state for the client attempts cleanup loop.

See also
cleanup_client_attempts()
Parameters
valueIf true, run the cleanup client attempts loop.
Returns
reference to this, so calls can be chained.

◆ cleanup_lost_attempts() [1/2]

auto cleanup_lost_attempts ( ) const -> bool
inlinenodiscard

Get lost attempts cleanup loop status.

See also
cleanup_window() for description of the lost attempts cleanup loop.
Returns
If false, no lost attempts cleanup threads will be launched.

◆ cleanup_lost_attempts() [2/2]

auto cleanup_lost_attempts ( bool value) -> transactions_cleanup_config&
inline

Enable/disable the lost attempts cleanup loop.

See also
cleanup_window() for description of the cleanup lost attempts loop.
Parameters
valueIf false, do not start the lost attempts cleanup threads.
Returns
reference to this, so calls can be chained.

◆ cleanup_window() [1/2]

auto cleanup_window ( ) const -> std::chrono::milliseconds
inlinenodiscard

Get cleanup window.

Each transactions instance has background threads which looks for evidence of transactions that somehow were not cleaned up during ordinary processing. There is one of these per bucket. The thread looks through the active transaction records on that bucket once during each window. There are potentially 1024 of these records, so over one cleanup window period, the thread will look for all 1024 of these, and examine any it finds. Note you can disable this by setting cleanup_lost_attempts() false.

Returns
The cleanup window.

◆ cleanup_window() [2/2]

template<typename T >
auto cleanup_window ( T duration) -> transactions_cleanup_config&
inline

Set cleanup window.

See also
cleanup_window() for more info.
Parameters
durationAn std::chrono::duration representing the cleanup window duration.
Returns
reference to this, so calls can be chained.

The documentation for this class was generated from the following file: