Class: Cassandra::Host

Inherits:
Object
  • Object
show all
Defined in:
lib/cassandra/host.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#broadcast_addressIPAddr, String (readonly)

Note:

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

#datacenterString? (readonly)

Note:

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

#idCassandra::Uuid? (readonly)

Note:

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

#ipIPAddr (readonly)



22
23
24
# File 'lib/cassandra/host.rb', line 22

def ip
  @ip
end

#listen_addressIPAddr, String (readonly)

Note:

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

#rackString? (readonly)

Note:

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_versionString? (readonly)

Note:

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

#statusSymbol (readonly)



39
40
41
# File 'lib/cassandra/host.rb', line 39

def status
  @status
end

#tokensArray<String> (readonly)

Note:

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



78
79
80
# File 'lib/cassandra/host.rb', line 78

def down?
  @status == :down
end

#up?Boolean



73
74
75
# File 'lib/cassandra/host.rb', line 73

def up?
  @status == :up
end