Parent

MogileFS::Backend

This class communicates with the MogileFS trackers. You should not have to use this directly unless you are developing support for new commands or plugins for MogileFS

Attributes

lasterr[R]

The last error

lasterrstr[R]

The string attached to the last error

Public Class Methods

add_command(*names) view method source

Adds MogileFS commands names.

add_error(err_snake) view method source

this converts an error code from a mogilefsd tracker to an exception:

Examples of some exceptions that get created:

class AfterMismatchError < MogileFS::Error; end
class DomainNotFoundError < MogileFS::Error; end
class InvalidCharsError < MogileFS::Error; end
add_idempotent_command(*names) view method source

adds idempotent MogileFS commands names, these commands may be retried transparently on a different tracker if there is a network/server error.

Creates a new MogileFS::Backend.

:hosts is a required argument and must be an Array containing one or more ‘hostname:port’ pairs as Strings.

:timeout adjusts the request timeout before an error is returned.

Public Instance Methods

clear_cache(types = %w(all)) view method source

this command is special since the cache is per-tracker, so we connect to all backends and not just one

do_request(cmd, args, idempotent = false) view method source

Performs the cmd request with args.

error(err_snake) view method source

this converts an error code from a mogilefsd tracker to an exception Most of these exceptions should already be defined, but since the MogileFS server code is liable to change and we may not always be able to keep up with the changes

make_request(cmd, args) view method source

Makes a new request string for cmd and args.

parse_response(line, request = nil) view method source

Turns the line response from the server into a Hash of options, an error, or raises, as appropriate.

Closes this backend’s socket.

Returns a socket connected to a MogileFS tracker.

Originally generated with the Darkfish Rdoc Generator 2, modified by wrongdoc.