Class: Pool

Pool

new Pool

Creates a connection to a keyspace for each of the servers in the pool;

Parameters:
Name Type Description
options Object The options for the connection Example: var pool = new ConnectionPool({ hosts : ['host1:9160', 'host2:9170', 'host3', 'host4'], keyspace : 'database', user : 'mary', pass : 'qwerty', timeout : 30000, cqlVersion : '3.0.0' });
Source:
  • pool.js, line 28

Methods

close

Closes all open connections

Source:
  • pool.js, line 269

connect

Connects to each of the servers in the connection pool TODO: Implement Retries

Parameters:
Name Type Description
callback Function The callback to invoke when all connections have been made
Source:
  • pool.js, line 58

cql

Executes a CQL Query Against the DB.

Parameters:
Name Type Description
cmd String A string representation of the query: 'select %s, %s from MyCf where key=%s'
args0...argsN arguments An Array of arguments for the string ['arg0', 'arg1', 'arg2']
callback Function The callback function for the results
Source:
  • pool.js, line 160

createKeyspace

Creates a keyspace see Connection.prototype.createKeyspace

Source:
  • pool.js, line 203

dropKeyspace

Creates a keyspace see Connection.prototype.createKeyspace

Source:
  • pool.js, line 211

execute

Executes a command on a single client from the pool

Parameters:
Name Type Description
command String The command to execute additional params are supplied to the command to be executed
Source:
  • pool.js, line 147

getConnection

Gets a random connection from the connection pool

Source:
  • pool.js, line 170

monitorConnections

Monitors the dead pool to ensure that if a connection has dropped, it will get retried until it connects or until all connections have been lost

Source:
  • pool.js, line 220

use

Changes the current keyspace for the connection

Source:
  • pool.js, line 118

<private, static> NOOP

A No-Operation default for empty callbacks

Source:
  • pool.js, line 9