Class: Mongo::Cluster::Topology::Unknown
- Includes:
- NoReplicaSetOptions
- Defined in:
- build/ruby-driver-v2.19/lib/mongo/cluster/topology/unknown.rb
Overview
Defines behavior for when a cluster is in an unknown state.
Constant Summary collapse
- NAME =
The display name for the topology.
'Unknown'.freeze
Constants included from Loggable
Instance Attribute Summary
Attributes inherited from Base
#compatibility_error, #logical_session_timeout, #monitoring, #options, #server_descriptions
Attributes included from Monitoring::Publishable
Instance Method Summary collapse
-
#display_name ⇒ String
Get the display name.
-
#has_readable_server?(cluster, server_selector = nil) ⇒ false
Determine if the topology would select a readable server for the provided candidates and read preference.
-
#has_writable_server?(cluster) ⇒ false
Determine if the topology would select a writable server for the provided candidates.
-
#replica_set? ⇒ false
An unknown topology is not a replica set.
-
#servers(servers) ⇒ Object
Select appropriate servers for this topology.
-
#sharded? ⇒ false
An unknown topology is not sharded.
-
#single? ⇒ true
An unknown topology is not single.
- #summary ⇒ Object
-
#unknown? ⇒ true
An unknown topology is unknown.
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
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
Constructor Details
This class inherits a constructor from Mongo::Cluster::Topology::Base
Instance Method Details
#display_name ⇒ String
Get the display name.
41 42 43 |
# File 'build/ruby-driver-v2.19/lib/mongo/cluster/topology/unknown.rb', line 41 def display_name self.class.name.gsub(/.*::/, '') end |
#has_readable_server?(cluster, server_selector = nil) ⇒ false
Determine if the topology would select a readable server for the provided candidates and read preference.
67 |
# File 'build/ruby-driver-v2.19/lib/mongo/cluster/topology/unknown.rb', line 67 def has_readable_server?(cluster, server_selector = nil); false; end |
#has_writable_server?(cluster) ⇒ false
Determine if the topology would select a writable server for the provided candidates.
80 |
# File 'build/ruby-driver-v2.19/lib/mongo/cluster/topology/unknown.rb', line 80 def has_writable_server?(cluster); false; end |
#replica_set? ⇒ false
An unknown topology is not a replica set.
90 |
# File 'build/ruby-driver-v2.19/lib/mongo/cluster/topology/unknown.rb', line 90 def replica_set?; false; end |
#servers(servers) ⇒ Object
Select appropriate servers for this topology.
103 104 105 |
# File 'build/ruby-driver-v2.19/lib/mongo/cluster/topology/unknown.rb', line 103 def servers(servers) [] end |
#sharded? ⇒ false
An unknown topology is not sharded.
115 |
# File 'build/ruby-driver-v2.19/lib/mongo/cluster/topology/unknown.rb', line 115 def sharded?; false; end |
#single? ⇒ true
An unknown topology is not single.
125 |
# File 'build/ruby-driver-v2.19/lib/mongo/cluster/topology/unknown.rb', line 125 def single?; false; end |
#summary ⇒ Object
This method is experimental and subject to change.
49 50 51 52 |
# File 'build/ruby-driver-v2.19/lib/mongo/cluster/topology/unknown.rb', line 49 def summary details = server_descriptions.keys.join(',') "#{display_name}[#{details}]" end |
#unknown? ⇒ true
An unknown topology is unknown.
135 |
# File 'build/ruby-driver-v2.19/lib/mongo/cluster/topology/unknown.rb', line 135 def unknown?; true; end |