NAME

Ceph::Rados::Striper - Perl extension to wrap libradosstriper-dev and provide striping for Ceph::Rados.

SYNOPSIS

use Ceph::Rados;
use Ceph::Rados::Striper;

Ceph::Rados::Striper->new($ioctx);

DESCRIPTION

A mostly drop-in replacement for Ceph::Radio::IO objects, which provides read/write/delete/stat methods

EXPORT

None by default.

Exportable constants

LIBRADOSSTRIPER_VERSION_CODE
LIBRADOSSTRIPER_VER_EXTRA
LIBRADOSSTRIPER_VER_MAJOR
LIBRADOSSTRIPER_VER_MINOR

METHODS

object(stripe_unit, stripe_count, object_size)

Sets the object layout. Defaults are 64k, 5, and 120Mb.

Stripe unit is the smallest unit of data. Files will be zero padded up to a multiple of this.

Stripe count is the number of stripes per object.

Object size is the threshold at which an extra set of stripes will be created. i.e. for the defaults, a 121Mb file will have 10 stripes.

write(soid, source)

Wraps rados_write(). Write data from the source, to a ceph object with the supplied ID. Source can either be a perl scalar, or a handle to read data from. Returns 1 on success. Croaks on failure.

write_data(soid, data)

write_handle(soid, handle)

As write_data(), but explicitly declaring the source type.

append(soid, data)

Wraps rados_striper_append(). Appends data to the ceph object with the supplied ID. Data must be a perl scalar, not a handle. Returns 1 on success. Croaks on failure.

stat(soid)

Wraps rados_striper_stat(). Returns a 2-element list of (filesize, mtime) for the ceph object with the supplied ID.

read(soid, len=filesize, offset=0)

Wraps rados_striper_read(). Read data from the ceph object with the supplied ID, and return the data read. Croaks on failure.

read_handle(soid, handle)

As read(), but writes the data directly to the supplied handle instead of returning it.

remove(soid)

Wraps rados_striper_remove(). Deletes the ceph object with the supplied ID. Returns 1 on success. Croaks on failure.

SEE ALSO

libradosstriper-dev Ceph::Rados

AUTHOR

Alex Bowley, <alex@openimp.net>

COPYRIGHT AND LICENSE

Copyright (C) 2020 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.26.1 or, at your option, any later version of Perl 5 you may have available.