#include <userver/storages/mongo/options.hpp>
Read preference.
Definition at line 27 of file options.hpp.
Public Types | |
enum | Mode { kPrimary , kSecondary , kPrimaryPreferred , kSecondaryPreferred , kNearest } |
Public Member Functions | |
ReadPreference (Mode mode) | |
ReadPreference (Mode mode, std::vector< formats::bson::Document > tags) | |
Mode | GetMode () const |
std::optional< std::chrono::seconds > | GetMaxStaleness () const |
const std::vector< formats::bson::Document > & | GetTags () const |
ReadPreference & | SetMaxStaleness (std::optional< std::chrono::seconds > max_staleness) |
Sets maximum replication lag for eligible replica. | |
ReadPreference & | AddTag (formats::bson::Document tag) |
Adds a tag to the tag set. | |
Definition at line 29 of file options.hpp.
ReadPreference & storages::mongo::options::ReadPreference::AddTag | ( | formats::bson::Document | tag | ) |
Adds a tag to the tag set.
ReadPreference & storages::mongo::options::ReadPreference::SetMaxStaleness | ( | std::optional< std::chrono::seconds > | max_staleness | ) |
Sets maximum replication lag for eligible replica.