Class: CassandraService
- Inherits:
-
Object
- Object
- CassandraService
- Includes:
- AbstractedCassandraRepository
- Defined in:
- lib/cassandra/cassandra_service.rb
Instance Attribute Summary collapse
-
#cassandra_cluster ⇒ Object
Returns the value of attribute cassandra_cluster.
Instance Method Summary collapse
-
#initialize ⇒ CassandraService
constructor
A new instance of CassandraService.
- #start ⇒ Object
- #stop ⇒ Object
Methods included from AbstractedCassandraRepository
#create, #delete, #find_all, #find_by_id, #save, #update
Constructor Details
#initialize ⇒ CassandraService
10 11 12 13 |
# File 'lib/cassandra/cassandra_service.rb', line 10 def initialize puts 'init cassandra' self.cassandra_cluster = Cassandra.cluster end |
Instance Attribute Details
#cassandra_cluster ⇒ Object
Returns the value of attribute cassandra_cluster.
8 9 10 |
# File 'lib/cassandra/cassandra_service.rb', line 8 def cassandra_cluster @cassandra_cluster end |
Instance Method Details
#start ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/cassandra/cassandra_service.rb', line 15 def start puts 'start cassandra, create cluster' if !cassandra_cluster cassandra_cluster = Cassandra.cluster end cassandra_cluster end |
#stop ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/cassandra/cassandra_service.rb', line 23 def stop puts 'stop cassandra' if cassandra_cluster puts 'closing' cassandra_cluster.close end end |