Class: Mongo::Cluster::Topology::Sharded
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Base ,
Forwardable
|
|
Instance Chain:
|
|
Inherits: |
Mongo::Cluster::Topology::Base
|
Defined in: | lib/mongo/cluster/topology/sharded.rb |
Overview
Defines behavior for when a cluster is in sharded topology.
Constant Summary
-
NAME =
The display name for the topology.
'Sharded'.freeze
::Mongo::Loggable
- Included
Class Method Summary
Instance Attribute Summary
-
#replica_set? ⇒ false
readonly
A sharded topology is not a replica set.
-
#sharded? ⇒ true
readonly
A sharded topology is sharded.
-
#single? ⇒ false
readonly
A sharded topology is not single.
-
#unknown? ⇒ false
readonly
A sharded topology is not unknown.
Base
- Inherited
#compatibility_error, #compatible?, #data_bearing_servers?, | |
#logical_session_timeout | The logical session timeout value in minutes. |
#monitoring, #options, #server_descriptions, #cluster |
::Mongo::Monitoring::Publishable
- Included
Instance Method Summary
-
#display_name ⇒ String
Get the display name.
-
#has_readable_server?(cluster, server_selector = nil) ⇒ true
Determine if the topology would select a readable server for the provided candidates and read preference.
-
#has_writable_server?(cluster) ⇒ true
Determine if the topology would select a writable server for the provided candidates.
-
#servers(servers) ⇒ Array<Server>
Select appropriate servers for this topology.
- #summary
NoReplicaSetOptions
- Included
Base
- Inherited
#addresses, | |
#max_election_id | The largest electionId ever reported by a primary. |
#max_set_version | The largest setVersion ever reported by a primary. |
#new_max_election_id, #new_max_set_version, | |
#replica_set_name | Get the replica set name configured for this topology. |
#server_hosts_match_any? | Compares each server address against the list of patterns. |
#validate_options | Validates and/or transforms options as necessary for the topology. |
::Mongo::Monitoring::Publishable
- Included
#publish_cmap_event, #publish_event, #publish_sdam_event, #command_completed, #command_failed, #command_started, #command_succeeded, #duration |
::Mongo::Loggable
- Included
#log_debug | Convenience method to log debug messages with the standard prefix. |
#log_error | Convenience method to log error messages with the standard prefix. |
#log_fatal | Convenience method to log fatal messages with the standard prefix. |
#log_info | Convenience method to log info messages with the standard prefix. |
#log_warn | Convenience method to log warn messages with the standard prefix. |
#logger | Get the logger instance. |
#_mongo_log_prefix, #format_message |
Instance Attribute Details
#replica_set? ⇒ false
(readonly)
A sharded topology is not a replica set.
# File 'lib/mongo/cluster/topology/sharded.rb', line 90
def replica_set?; false; end
#sharded? ⇒ true
(readonly)
A sharded topology is sharded.
# File 'lib/mongo/cluster/topology/sharded.rb', line 114
def sharded?; true; end
#single? ⇒ false
(readonly)
A sharded topology is not single.
# File 'lib/mongo/cluster/topology/sharded.rb', line 124
def single?; false; end
#unknown? ⇒ false
(readonly)
A sharded topology is not unknown.
# File 'lib/mongo/cluster/topology/sharded.rb', line 134
def unknown?; false; end
Instance Method Details
#display_name ⇒ String
Get the display name.
# File 'lib/mongo/cluster/topology/sharded.rb', line 41
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.
# File 'lib/mongo/cluster/topology/sharded.rb', line 67
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.
# File 'lib/mongo/cluster/topology/sharded.rb', line 80
def has_writable_server?(cluster); true; end
#servers(servers) ⇒ Array
<Server>
Select appropriate servers for this topology.
# File 'lib/mongo/cluster/topology/sharded.rb', line 102
def servers(servers) servers.select { |server| server.mongos? } end
#summary
This method is experimental and subject to change.
# File 'lib/mongo/cluster/topology/sharded.rb', line 49
def summary details = server_descriptions.keys.join(',') "#{display_name}[#{details}]" end