GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::ASYNC::CASSANDRACQL::CONNECTION (3)

.ds Aq ’

NAME

"Net::Async::CassandraCQL::Connection" - connect to a single Cassandra database node

CONTENTS

DESCRIPTION

TODO

EVENTS

on_event CW$name, CW@args

A registered event occurred. @args will depend on the event name. Each is also available as its own event, with the name in lowercase. If the event is not one of the types recognised below, @args will contain the actual Protocol::CassandraCQL::Frame object.

on_topology_change CW$type, CW$node

The cluster topology has changed. $node is a packed socket address.

on_status_change CW$status, CW$node

The node’s status has changed. $node is a packed socket address.

on_schema_change CW$type, CW$keyspace, CW$table

A keyspace or table schema has changed.

PARAMETERS

The following named parameters may be passed to new or configure:
username => STRING
password => STRING Optional. Authentication details to use for PasswordAuthenticator.
cql_version => INT Optional. Version of the CQL wire protocol to negotiate during connection. Defaults to 1.

METHODS

CW$id = CW$conn->nodeid

Returns the connection’s node ID (the string form of its IP address), which is used as its ID in the system.peers table.

CW$conn->connect( CW%args ) ==> CW$conn

Connects to the Cassandra node an send the OPCODE_STARTUP message. The returned Future will yield the connection itself on success.

Takes the following named arguments:
host => STRING
service => STRING

CW$conn->send_message( CW$opcode, CW$frame ) ==> ( CW$reply_opcode, CW$reply_frame, CW$reply_version )

Sends a message with the given opcode and Protocol::CassandraCQL::Frame for the message body. The returned Future will yield the response opcode, frame and version number (with the RESPONSE bit masked off).

This is a low-level method; applications should instead use one of the wrapper methods below.

CW$conn->startup ==> ()

Sends the initial connection setup message. On success, the returned Future yields nothing.

Normally this is not required as the connect method performs it implicitly.

CW$conn->options ==> CW$options

Requests the list of supported options from the server node. On success, the returned Future yields a HASH reference mapping option names to ARRAY references containing valid values.

CW$conn->query( CW$cql, CW$consistency, CW%other_args ) ==> ( CW$type, CW$result )

Performs a CQL query. On success, the values returned from the Future will depend on the type of query.

For USE queries, the type is keyspace and $result is a string giving the name of the new keyspace.

For CREATE, ALTER and DROP queries, the type is schema_change and $result is a 3-element ARRAY reference containing the type of change, the keyspace and the table name.

For SELECT queries, the type is rows and $result is an instance of Protocol::CassandraCQL::Result containing the returned row data.

For other queries, such as INSERT, UPDATE and DELETE, the future returns nothing.

Any other arguments will be passed on to the underlying build_query_frame function of Protocol::CassandraCQL::Frames.

CW$conn->prepare( CW$cql ) ==> CW$query

Prepares a CQL query for later execution. On success, the returned Future yields an instance of Net::Async::CassandraCQL::Query.

CW$conn->execute( CW$id, CW$data, CW$consistency, CW%other_args ) ==> ( CW$type, CW$result )

Executes a previously-prepared statement, given its ID and the binding data. On success, the returned Future will yield results of the same form as the query method. $data should contain a list of encoded byte-string values. Any other arguments will be passed on to the underlying build_execute_frame function of Protocol::CassandraCQL::Frames.

Normally this method is not directly required - instead, use the execute method on the query object itself, as this will encode the parameters correctly.

CW$conn->register( CW$events ) ==> ()

Registers the connection’s interest in receiving events of the types given in the ARRAY reference. Event names may be TOPOLOGY_CHANGE, STATUS_CHANGE or SCHEMA_CHANGE. On success, the returned Future yields nothing.

CW$conn->close_when_idle ==> CW$conn

If the connection is idle (has no outstanding queries), then it is closed immediately. If not, it is put into close-pending mode, where it will accept no more queries, and will close when the last pending one is complete.

Returns a future which will eventually yield the (closed) connection when it becomes closed.

SPONSORS

This code was paid for by
o Perceptyx <http://www.perceptyx.com/>
o Shadowcat Systems <http://www.shadow.cat>

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::ASYNC::CASSANDRACQL::CONNECTION (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.