|
Couchbase C++ SDK 1.5.0 (rev. 380784c)
|
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. | |
Options for from_index().
|
inlinenodiscard |
Returns the options as an immutable value.
|
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.
| value | whether to wrap around the available replicas |