Class Mongo::Cluster::Topology::ReplicaSetNoPrimary
In: lib/mongo/cluster/topology/replica_set_no_primary.rb
Parent: Base

Defines behavior when a cluster is in replica set topology, and there is no primary or the primary has not yet been discovered by the driver.

@since 2.0.0

Methods

Constants

NAME = 'Replica Set'.freeze   The display name for the topology.

@since 2.0.0 @deprecated

Public Instance methods

Get the display name.

@example Get the display name.

  ReplicaSet.display_name

@return [ String ] The display name.

@since 2.0.0

Determine if the topology would select a readable server for the provided candidates and read preference.

@example Is a readable server present?

  topology.has_readable_server?(cluster, server_selector)

@param [ Cluster ] cluster The cluster. @param [ ServerSelector ] server_selector The server

  selector.

@return [ true, false ] If a readable server is present.

@since 2.4.0

Determine if the topology would select a writable server for the provided candidates.

@example Is a writable server present?

  topology.has_writable_server?(servers)

@param [ Cluster ] cluster The cluster.

@return [ true, false ] If a writable server is present.

@since 2.4.0

A replica set topology is a replica set.

@example Is the topology a replica set?

  topology.replica_set?

@return [ true ] Always true.

@since 2.0.0

Select appropriate servers for this topology.

@example Select the servers.

  ReplicaSet.servers(servers)

@param [ Array<Server> ] servers The known servers.

@return [ Array<Server> ] The servers in the replica set.

@since 2.0.0

A replica set topology is not sharded.

@example Is the topology sharded?

  ReplicaSet.sharded?

@return [ false ] Always false.

@since 2.0.0

A replica set topology is not single.

@example Is the topology single?

  ReplicaSet.single?

@return [ false ] Always false.

@since 2.0.0

@note This method is experimental and subject to change.

@api experimental @since 2.7.0

A replica set topology is not unknown.

@example Is the topology unknown?

  ReplicaSet.unknown?

@return [ false ] Always false.

@since 2.0.0

[Validate]