striper

package
v0.31.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package striper contains a set of wrappers around Ceph's libradosstriper API.

The Striper type supports synchronous operations to read and write data, as well as read and manipulate xattrs. Note that a striped object will consist of one or more objects in RADOS.

There is no object list API in libradosstriper. Listing objects must be done using the base RADOS APIs. Striped objects will be stored in RADOS using the provided Striped Object ID (soid) suffixed by a dot (.) and a 16 byte 0-prefixed hex number (for example, "foo.0000000000000000" or "bar.000000000000000a"). The object suffixed with ".0000000000000000" is the 0-index stripe and will also possess striper specific xattrs (see the ceph libradosstriper implementation for a list) that are hidden from the libradosstriper xattr APIs. You can use the name and/or these striper xattrs to distinguish a striped object from a non-striped RADOS object.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Layout

type Layout struct {
	StripeUnit  uint
	StripeCount uint
	ObjectSize  uint
}

Layout contains a group of values used to define the size parameters of striped objects. Note that these parameters only effect new striped objects. Existing striped objects retain the parameters they were created with.

type StatInfo

type StatInfo struct {
	Size    uint64
	ModTime Timespec
}

StatInfo contains values returned by a Striper's Stat call.

type Striper

type Striper struct {
	// contains filtered or unexported fields
}

Striper helps manage the reading, writing, and management of RADOS striped objects.

func New

func New(ioctx *rados.IOContext) (*Striper, error)

New returns a rados Striper object created from a rados IOContext.

func NewWithLayout

func NewWithLayout(ioctx *rados.IOContext, layout Layout) (*Striper, error)

NewWithLayout returns a rados Striper object created from a rados IOContext and striper layout parameters. These parameters will be used when new objects are created.

func (*Striper) Append

func (s *Striper) Append(soid string, data []byte) error

Append the bytes in data to the end of the striped object.

Implements:

int rados_striper_append(rados_striper_t striper,
                         const char *soid,
                         const char *buf,
                         size_t len);

func (*Striper) Destroy

func (s *Striper) Destroy()

Destroy the radosstriper object at the Ceph API level.

func (*Striper) GetXattr

func (s *Striper) GetXattr(soid string, name string, data []byte) (int, error)

GetXattr retrieves an extended attribute (xattr) of the given name from the specified striped object.

Implements:

int rados_striper_getxattr(rados_striper_t striper,
                           const char *oid,
                           const char *name,
                           char *buf,
                           size_t len);

func (*Striper) ListXattrs

func (s *Striper) ListXattrs(soid string) (map[string][]byte, error)

ListXattrs returns a map containing all of the extended attributes (xattrs) for a striped object. The xattr names provide the key strings and the map's values are byte slices.

Implements:

int rados_striper_getxattrs(rados_striper_t striper,
                            const char *oid,
                            rados_xattrs_iter_t *iter);

func (*Striper) Read

func (s *Striper) Read(soid string, data []byte, offset uint64) (int, error)

Read bytes into data from the striped object at the specified offset.

Implements:

int rados_striper_read(rados_striper_t striper,
                       const char *soid,
                       const char *buf,
                       size_t len,
                       uint64_t off);

func (*Striper) Remove

func (s *Striper) Remove(soid string) error

Remove a striped RADOS object.

Implements:

int rados_striper_remove(rados_striper_t striper,
                         const char *soid);

func (*Striper) RmXattr

func (s *Striper) RmXattr(soid string, name string) error

RmXattr removes the extended attribute (xattr) of the given name from the striped object.

Implements:

int rados_striper_rmxattr(rados_striper_t striper,
                          const char *oid,
                          const char *name);

func (*Striper) SetObjectLayoutObjectSize

func (s *Striper) SetObjectLayoutObjectSize(count uint) error

SetObjectLayoutObjectSize sets the object size value used to layout new objects.

Implements:

int rados_striper_set_object_layout_object_size(rados_striper_t striper,
                                                unsigned int object_size);

func (*Striper) SetObjectLayoutStripeCount

func (s *Striper) SetObjectLayoutStripeCount(count uint) error

SetObjectLayoutStripeCount sets the stripe count value used to layout new objects.

Implements:

int rados_striper_set_object_layout_stripe_count(rados_striper_t striper,
                                                 unsigned int stripe_count);

func (*Striper) SetObjectLayoutStripeUnit

func (s *Striper) SetObjectLayoutStripeUnit(count uint) error

SetObjectLayoutStripeUnit sets the stripe unit value used to layout new objects.

Implements:

int rados_striper_set_object_layout_stripe_unit(rados_striper_t striper,
                                                unsigned int stripe_unit);

func (*Striper) SetXattr

func (s *Striper) SetXattr(soid string, name string, data []byte) error

SetXattr sets an extended attribute (xattr) of the given name on the specified striped object.

Implements:

int rados_striper_setxattr(rados_striper_t striper,
                           const char *oid,
                           const char *name,
                           const char *buf,
                           size_t len);

func (*Striper) Stat

func (s *Striper) Stat(soid string) (StatInfo, error)

Stat returns metadata describing the striped object.

Implements:

int rados_striper_stat2(rados_striper_t striper,
                       const char* soid,
                       uint64_t *psize,
                       struct timespec *pmtime);

func (*Striper) Truncate

func (s *Striper) Truncate(soid string, size uint64) error

Truncate a striped object, setting it to the specified size.

Implements:

int rados_striper_trunc(rados_striper_t striper, const char *soid, uint64_t size);

func (*Striper) Write

func (s *Striper) Write(soid string, data []byte, offset uint64) error

Write bytes from data into the striped object at the specified offset.

Implements:

int rados_striper_write(rados_striper_t striper,
                        const char *soid,
                        const char *buf,
                        size_t len,
                        uint64_t off);

func (*Striper) WriteFull

func (s *Striper) WriteFull(soid string, data []byte) error

WriteFull writes all of the bytes in data to the striped object, truncating the object to the length of data.

Implements:

int rados_striper_write_full(rados_striper_t striper,
                             const char *soid,
                             const char *buf,
                             size_t len);

type Timespec

type Timespec ts.Timespec

Timespec behaves similarly to C's struct timespec.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL