Replica reads
- class couchbase.replica_reads.GetReplicaStrategy
Selects the replica that
get_replicareads from.Create one with
from_index().- static from_index(replica_index: ReplicaIndex, wrap: bool = False) GetReplicaStrategyFromIndex
Read from the replica at
replica_index.- Parameters:
replica_index (
ReplicaIndex) – The replica to read from.wrap (bool, optional) – When the replica at
replica_indexcannot be read, because the bucket has fewer replicas or that replica is currently unavailable, read the next one that can be read instead, wrapping around the bucket’s replicas. Defaults to False.
- Returns:
The strategy.
- Return type:
- Raises:
InvalidArgumentException – If
replica_indexis not aReplicaIndex, orwrapis not a bool.
- class couchbase.replica_reads.GetReplicaStrategyFromIndex(replica_index: ReplicaIndex, wrap: bool)
Reads from the replica at a given index.
Created by
GetReplicaStrategy.from_index().- property replica_index: ReplicaIndex
The replica to read from.
- class couchbase.replica_reads.ReadPreference(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Which replicas a replica read may read from.
NO_PREFERENCE reads from any replica. SELECTED_SERVER_GROUP reads only from nodes in the server group the
preferred_server_groupcluster option names.- NO_PREFERENCE = 0
- SELECTED_SERVER_GROUP = 1