Alex Bowley
and 1 contributors

NAME

Ceph::Rados - Perl wrapper to librados.

SYNOPSIS

  use Ceph::Rados;

  my $cluster = Ceph::Rados->new('admin');
  $cluster->set_config_file;
  $cluster->set_config_option( keyring => '/etc/ceph/ceph.client.admin.keyring');
  $cluster->connect;

  my $io = $cluster->io('testing_pool');
  $io->write('greeting', 'hello');
  my $stored_data = $io->read('greeting',10);
  my ($len, $mtime) = $io->stat('greeting');
  $io->delete('greeting');

  my $list = $io->list;
  while (my $entry = $list->next) {
      print "Found $entry\n";
  }

DESCRIPTION

This module provides a very limited subset of the librados API, currently just read/write/stat and lists.

If no length is passed to the read() call, the object is first stat'd to determine the correct read length.

METHODS

set_config_file()

Wraps rados_conf_read_file(). If not passed a path, the following locations are tried, in order:

$ENV{CEPH_CONF}
/etc/ceph/ceph.conf
~/.ceph/config
./ceph.conf

set_config_option()

Wraps rados_conf_set(). Typically used to set the keyring.

connect()

Wraps rados_connect(). Connects to the rados cluster, using the config provided.

io()

Wraps rados_ioctx_create(). Opens an IO context to the specified pool. Returns a Ceph::Rados::IO object.

SEE ALSO

librados documentation - http://docs.ceph.com/docs/master/rados/api/librados/

AUTHOR

Alex Bowley, <alex@openimp.com>

COPYRIGHT AND LICENSE

Copyright (C) 2014-2017 by Alex Bowley.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.