Couchbase C++ SDK 1.5.0 (rev. 380784c)
Loading...
Searching...
No Matches
get_replica_strategy_from_index_options Struct Reference

Options for from_index(). More...

#include <couchbase/get_replica_strategy.hxx>

Classes

struct  built
 Immutable value object representing consistent options. More...

Public Member Functions

auto wrap (bool value) -> get_replica_strategy_from_index_options &
 Resolve an index that cannot be read as requested to the next one that can, instead of failing with replica_index_out_of_bounds or replica_index_currently_unavailable.
auto build () const -> built
 Returns the options as an immutable value.

Detailed Description

Options for from_index().

Since
1.5.0
Committed
Generally available API and should be preferred in production

Member Function Documentation

◆ build()

auto build ( ) const -> built
inlinenodiscard

Returns the options as an immutable value.

Returns
the options as an immutable value
Since
1.5.0
Internal
Internal interface

◆ wrap()

auto wrap ( bool value) -> get_replica_strategy_from_index_options &
inline

Resolve an index that cannot be read as requested to the next one that can, instead of failing with replica_index_out_of_bounds or replica_index_currently_unavailable.

The search walks the bucket's configured replica count, starting at the requested index modulo that count. An index beyond the vbucket map's current row therefore still reaches the replicas the row does list.

Two failures remain. A bucket configured for no replicas reports replica_index_out_of_bounds. A full lap that finds nothing readable reports replica_index_currently_unavailable.

Resolution follows the vbucket map, not node health: a replica the map places on a node is selected even when that node cannot be reached, and the operation retries against it until its timeout rather than moving on to another replica.

Parameters
valuewhether to wrap around the available replicas
Returns
this options builder for chaining purposes.
Since
1.5.0
Committed
Generally available API and should be preferred in production

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