12 Feb 2015 16:39:48 UTC
- Distribution: Net-Async-CassandraCQL
- Module version: 0.12
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (430 / 5 / 8)
- KwaliteeBus factor: 1
- 81.45% Coverage
- License: perl_5
- Activity24 month
- Download (46.68KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- $id = $conn->nodeid
- $conn->connect( %args ) ==> $conn
- $conn->send_message( $opcode, $frame ) ==> ( $reply_opcode, $reply_frame, $reply_version )
- $conn->startup ==> ()
- $conn->options ==> $options
- $conn->query( $cql, $consistency, %other_args ) ==> ( $type, $result )
- $conn->prepare( $cql ) ==> $query
- $conn->execute( $id, $data, $consistency, %other_args ) ==> ( $type, $result )
- $conn->register( $events ) ==> ()
- $conn->close_when_idle ==> $conn
Net::Async::CassandraCQL::Connection- connect to a single Cassandra database node
A registered event occurred.
@argswill 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,
@argswill contain the actual Protocol::CassandraCQL::Frame object.
The cluster topology has changed.
$nodeis a packed socket address.
The node's status has changed.
$nodeis a packed socket address.
A keyspace or table schema has changed.
The following named parameters may be passed to
- username => STRING
- password => STRING
Optional. Authentication details to use for
- cql_version => INT
Optional. Version of the CQL wire protocol to negotiate during connection. Defaults to 1.
Returns the connection's node ID (the string form of its IP address), which is used as its ID in the
Connects to the Cassandra node an send the
OPCODE_STARTUPmessage. The returned Future will yield the connection itself on success.
Takes the following named arguments:
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.
Sends the initial connection setup message. On success, the returned Future yields nothing.
Normally this is not required as the
connectmethod performs it implicitly.
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.
Performs a CQL query. On success, the values returned from the Future will depend on the type of query.
USEqueries, the type is
$resultis a string giving the name of the new keyspace.
DROPqueries, the type is
$resultis a 3-element ARRAY reference containing the type of change, the keyspace and the table name.
SELECTqueries, the type is
$resultis an instance of Protocol::CassandraCQL::Result containing the returned row data.
For other queries, such as
DELETE, the future returns nothing.
Any other arguments will be passed on to the underlying
build_query_framefunction of Protocol::CassandraCQL::Frames.
Prepares a CQL query for later execution. On success, the returned Future yields an instance of Net::Async::CassandraCQL::Query.
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
$datashould contain a list of encoded byte-string values. Any other arguments will be passed on to the underlying
build_execute_framefunction of Protocol::CassandraCQL::Frames.
Normally this method is not directly required - instead, use the
executemethod on the query object itself, as this will encode the parameters correctly.
Registers the connection's interest in receiving events of the types given in the ARRAY reference. Event names may be
SCHEMA_CHANGE. On success, the returned Future yields nothing.
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.
This code was paid for by
Paul Evans <email@example.com>
Module Install Instructions
To install Net::Async::CassandraCQL, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Net::Async::CassandraCQL
For more information on module installation, please visit the detailed CPAN module installation guide.