Module: Eurydice::Pelops
- Defined in:
- lib/eurydice/pelops.rb,
lib/eurydice/pelops/cluster.rb,
lib/eurydice/pelops/mutator.rb,
lib/eurydice/pelops/keyspace.rb,
lib/eurydice/pelops/column_family.rb
Defined Under Namespace
Modules: ByteHelpers, ConsistencyLevelHelpers, ExceptionHelpers
Classes: Cluster, ColumnFamily, Keyspace, Mutator
Class Method Summary
collapse
Class Method Details
.connect(options = {}) ⇒ Object
28
29
30
31
32
33
34
35
|
# File 'lib/eurydice/pelops.rb', line 28
def self.connect(options={})
host = options.fetch(:host, 'localhost')
port = options.fetch(:port, 9160)
pool_name = options.fetch(:pool_name, 'eurydice')
timeout = options.fetch(:timeout, ::Pelops::Cluster::DEFAULT_TIMEOUT)
dynamic_node_discovery = options.fetch(:dynamic_node_discovery, false)
Cluster.new(::Pelops::Cluster.new(host, port, timeout, dynamic_node_discovery))
end
|
.disconnect! ⇒ Object
43
44
45
|
# File 'lib/eurydice/pelops.rb', line 43
def self.disconnect!
::Pelops::Pelops.shutdown
end
|
.keyspace(keyspace_name, host = 'localhost', port = 9160, pool_name = 'eurydice') ⇒ Object
37
38
39
40
41
|
# File 'lib/eurydice/pelops.rb', line 37
def self.keyspace(keyspace_name, host='localhost', port=9160, pool_name='eurydice')
cluster = ::Pelops::Cluster.new(host, port)
::Pelops::Pelops.add_pool(pool_name, cluster, keyspace_name)
Keyspace.new(keyspace_name, cluster, pool_name)
end
|