Class: Auger::Cassandra
- Inherits:
-
Connection
- Object
- Connection
- Auger::Cassandra
- Defined in:
- lib/plugins/cassandra.rb
Instance Attribute Summary
Attributes inherited from Connection
#connection, #options, #requests, #response, #roles
Instance Method Summary collapse
- #close(cassandra) ⇒ Object
- #cluster_name(&block) ⇒ Object
- #open(host, options) ⇒ Object
- #ring(&block) ⇒ Object
- #schema_agreement?(&block) ⇒ Boolean
- #version(&block) ⇒ Object
Methods inherited from Connection
#do_open, #initialize, load, #method_missing, #timeout
Constructor Details
This class inherits a constructor from Auger::Connection
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Auger::Connection
Instance Method Details
#close(cassandra) ⇒ Object
16 17 18 |
# File 'lib/plugins/cassandra.rb', line 16 def close(cassandra) cassandra.disconnect! end |
#cluster_name(&block) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/plugins/cassandra.rb', line 20 def cluster_name(&block) @requests << Class.new(Auger::Request) do def run(cassandra) cassandra.cluster_name end end.load(nil, &block) end |
#open(host, options) ⇒ Object
12 13 14 |
# File 'lib/plugins/cassandra.rb', line 12 def open(host, ) ::Cassandra.new([:keyspace], "#{host}:#{[:port]}") end |
#ring(&block) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/plugins/cassandra.rb', line 28 def ring(&block) @requests << Class.new(Auger::Request) do def run(cassandra) cassandra.ring end end.load(nil, &block) end |