Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 65 lines (56 sloc) 1.826 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
NAME
    Net::Cassandra - Interface to Cassandra

SYNOPSIS
      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 $@;

DESCRIPTION
    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.

AUTHOR
    Leon Brocard <acme@astray.com>.

COPYRIGHT
    Copyright (C) 2009-2010, Leon Brocard

LICENSE
    This module is free software; you can redistribute it or modify it under
    the same terms as Perl itself.
Something went wrong with that request. Please try again.