LoadBalanced — Documentation by YARD 0.9.37 (original) (raw)

Class: Mongo::Cluster::Topology::LoadBalanced

Inherits:

Base

Defined in:

lib/mongo/cluster/topology/load_balanced.rb

Overview

Defines behavior for when a cluster is in load-balanced topology.

Constant Summarycollapse

NAME =

The display name for the topology.

'LoadBalanced'.freeze

Constants included from Loggable

Loggable::PREFIX

Instance Attribute Summary

Attributes inherited from Base

#compatibility_error, #logical_session_timeout, #monitoring, #options, #server_descriptions

Attributes included from Monitoring::Publishable

#monitoring

Instance Method Summarycollapse

Methods inherited from Base

#addresses, #compatible?, #data_bearing_servers?, #initialize, #max_election_id, #max_set_version, #new_max_election_id, #new_max_set_version, #replica_set_name, #server_hosts_match_any?

Methods included from Monitoring::Publishable

#publish_cmap_event, #publish_event, #publish_sdam_event

Methods included from Loggable

#log_debug, #log_error, #log_fatal, #log_info, #log_warn, #logger

Instance Method Details

#display_name ⇒ String

31 32 33 # File 'lib/mongo/cluster/topology/load_balanced.rb', line 31 def display_name self.class.name.gsub(/.*::/, '') end

#has_readable_server?(cluster, server_selector = nil) ⇒ true

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

51 # File 'lib/mongo/cluster/topology/load_balanced.rb', line 51 def has_readable_server?(cluster, server_selector = nil); true; end

#has_writable_server?(cluster) ⇒ true

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

59 # File 'lib/mongo/cluster/topology/load_balanced.rb', line 59 def has_writable_server?(cluster); true; end

#replica_set? ⇒ false

Returns whether this topology is one of the replica set ones.

64 # File 'lib/mongo/cluster/topology/load_balanced.rb', line 64 def replica_set?; false; end

#servers(servers, name = nil) ⇒ Array<Server>

Select appropriate servers for this topology.

71 72 73 # File 'lib/mongo/cluster/topology/load_balanced.rb', line 71 def servers(servers, name = nil) servers end

#sharded? ⇒ false

Returns whether this topology is sharded.

78 # File 'lib/mongo/cluster/topology/load_balanced.rb', line 78 def sharded?; false; end

#single? ⇒ true

Returns whether this topology is Single.

83 # File 'lib/mongo/cluster/topology/load_balanced.rb', line 83 def single?; false; end

#summary ⇒ Object

Note:

This method is experimental and subject to change.

38 39 40 41 # File 'lib/mongo/cluster/topology/load_balanced.rb', line 38 def summary details = server_descriptions.keys.join(',') "#{display_name}[#{details}]" end

#unknown? ⇒ false

Returns whether this topology is Unknown.

88 # File 'lib/mongo/cluster/topology/load_balanced.rb', line 88 def unknown?; false; end