Class: Cassandra::Host
- Inherits:
-
Object
- Object
- Cassandra::Host
- Defined in:
- lib/cassandra/host.rb
Instance Attribute Summary collapse
-
#broadcast_address ⇒ IPAddr, String
readonly
Broadcast address, if available.
-
#datacenter ⇒ String?
readonly
Host datacenter.
-
#id ⇒ Cassandra::Uuid?
readonly
Host id.
-
#ip ⇒ IPAddr
readonly
Host ip that clients use to connect to this host.
-
#listen_address ⇒ IPAddr, String
readonly
Listen address, if available.
-
#rack ⇒ String?
readonly
Host rack.
-
#release_version ⇒ String?
readonly
Version of cassandra that a host is running.
-
#status ⇒ Symbol
readonly
Host status.
-
#tokens ⇒ Array<String>
readonly
A list of tokens owned by this host.
Instance Method Summary collapse
-
#down? ⇒ Boolean
Whether this host's status is
:down
. -
#up? ⇒ Boolean
Whether this host's status is
:up
.
Instance Attribute Details
#broadcast_address ⇒ IPAddr, String (readonly)
This is the public IP address of the host if the cluster is deployed across multiple Amazon EC2 regions (or equivalently multiple networks). Cassandra nodes in other EC2 regions use this address to connect to this host.
Returns broadcast address, if available.
44 45 46 |
# File 'lib/cassandra/host.rb', line 44 def broadcast_address @broadcast_address end |
#datacenter ⇒ String? (readonly)
Host datacenter can be nil
before cluster has connected.
Returns host datacenter.
28 29 30 |
# File 'lib/cassandra/host.rb', line 28 def datacenter @datacenter end |
#id ⇒ Cassandra::Uuid? (readonly)
Host id can be nil
before cluster has connected.
Returns host id.
25 26 27 |
# File 'lib/cassandra/host.rb', line 25 def id @id end |
#ip ⇒ IPAddr (readonly)
Returns host ip that clients use to connect to this host.
22 23 24 |
# File 'lib/cassandra/host.rb', line 22 def ip @ip end |
#listen_address ⇒ IPAddr, String (readonly)
This is the address that other Cassandra nodes use to connect to this host.
Returns listen address, if available.
47 48 49 |
# File 'lib/cassandra/host.rb', line 47 def listen_address @listen_address end |
#rack ⇒ String? (readonly)
Host rack can be nil
before cluster has connected.
Returns host rack.
31 32 33 |
# File 'lib/cassandra/host.rb', line 31 def rack @rack end |
#release_version ⇒ String? (readonly)
Host's cassandra version can be nil
before cluster has connected.
Returns version of cassandra that a host is running.
34 35 36 |
# File 'lib/cassandra/host.rb', line 34 def release_version @release_version end |
#status ⇒ Symbol (readonly)
Returns host status. Must be :up
or :down
.
39 40 41 |
# File 'lib/cassandra/host.rb', line 39 def status @status end |
#tokens ⇒ Array<String> (readonly)
Host tokens will be empty before cluster has connected.
Returns a list of tokens owned by this host.
37 38 39 |
# File 'lib/cassandra/host.rb', line 37 def tokens @tokens end |
Instance Method Details
#down? ⇒ Boolean
Returns whether this host's status is :down
.
78 79 80 |
# File 'lib/cassandra/host.rb', line 78 def down? @status == :down end |
#up? ⇒ Boolean
Returns whether this host's status is :up
.
73 74 75 |
# File 'lib/cassandra/host.rb', line 73 def up? @status == :up end |