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
Net::Cassandra(3) User Contributed Perl Documentation Net::Cassandra(3)

Net::Cassandra - Interface to Cassandra

  my $cassandra = Net::Cassandra->new( hostname => 'localhost' );
  my $client    = $cassandra->client;

  my $key       = '123';
  my $timestamp = time;

  eval {
      $client->insert(
          'Keyspace1',
          $key,
          Net::Cassandra::Backend::ColumnPath->new(
              { column_family => 'Standard1', column => 'name' }
          ),
          'Leon Brocard',
          $timestamp,
          Net::Cassandra::Backend::ConsistencyLevel::ZERO
      );
  };
  die $@->why if $@;

  eval {
      my $what = $client->get(
          'Keyspace1',
          $key,
          Net::Cassandra::Backend::ColumnPath->new(
              { column_family => 'Standard1', column => 'name' }
          ),
          Net::Cassandra::Backend::ConsistencyLevel::QUORUM
      );
      my $value     = $what->column->value;
      my $timestamp = $what->column->timestamp;
      warn "$value / $timestamp";
  };
  die $@->why if $@;

  eval {
      $client->remove(
          'Keyspace1',
          $key,
          Net::Cassandra::Backend::ColumnPath->new(
              { column_family => 'Standard1', column => 'name' }
          ),
          $timestamp
      );
  };
  die $@->why if $@;

This module provides an interface the to Cassandra distributed database. It uses the Thrift interface. This is changing rapidly and supports version 0.5.0 of Cassandra.

Leon Brocard <acme@astray.com>.

Copyright (C) 2009-2010, Leon Brocard

This module is free software; you can redistribute it or modify it under the same terms as Perl itself.
2010-02-01 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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