xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdEc::RedundancyProvider Class Reference

#include <XrdEcRedundancyProvider.hh>

Collaboration diagram for XrdEc::RedundancyProvider:
Collaboration graph
[legend]

Classes

struct  CodingTable
 

Public Member Functions

void compute (stripes_t &stripes)
 
 RedundancyProvider (const ObjCfg &objcfg)
 

Private Member Functions

std::string getErrorPattern (stripes_t &stripes) const
 
CodingTablegetCodingTable (const std::string &pattern)
 
void replication (stripes_t &stripes)
 

Private Attributes

ObjCfg objcfg
 
std::vector< unsigned char > encode_matrix
 the encoding matrix, required to compute any decode matrix More...
 
std::unordered_map
< std::string, CodingTable
cache
 a cache of previously used coding tables More...
 
std::mutex mutex
 concurrency control More...
 

Detailed Description

The redundancy provider class offers automatic parity computing and data recovery. Depending on configuration it will use erasure coding or replication.

Constructor & Destructor Documentation

XrdEc::RedundancyProvider::RedundancyProvider ( const ObjCfg objcfg)

Constructor. Stripe parameters (number of data and parity blocks) are constant per ErasureEncoding object.

Member Function Documentation

void XrdEc::RedundancyProvider::compute ( stripes_t stripes)

Compute all missing data and parity blocks in the the stripe. Stripe size has to equal nData+nParity. Blocks can be arbitrary size, but size has to be equal within a stripe. Function will throw on incorrect input.

Parameters
stripenData+nParity blocks, missing (empty) blocks will be computed if possible.

Referenced by XrdEc::WrtBuff::Encode().

CodingTable& XrdEc::RedundancyProvider::getCodingTable ( const std::string &  pattern)
private

Returns a reference to the coding table for the requested error pattern, if possible from the cache. If that particular table has not been requested before, it will be constructed.

Parameters
patternerror pattern / signature
Returns
reference to the coding table for the supplied error pattern
std::string XrdEc::RedundancyProvider::getErrorPattern ( stripes_t stripes) const
private

Constructs a string of the error pattern / signature. Each missing block in the stripe is counted as an error block, existing blocks are assumed to be correct (crc integrity checks of blocks should be done previously to attempting erasure decoding).

Parameters
stripevector of nData+nParity blocks, missing (empty) blocks are errors
Returns
a string of stripe size describing the error pattern
void XrdEc::RedundancyProvider::replication ( stripes_t stripes)
private

Member Data Documentation

std::unordered_map<std::string, CodingTable> XrdEc::RedundancyProvider::cache
private

a cache of previously used coding tables

std::vector<unsigned char> XrdEc::RedundancyProvider::encode_matrix
private

the encoding matrix, required to compute any decode matrix

std::mutex XrdEc::RedundancyProvider::mutex
private

concurrency control

ObjCfg XrdEc::RedundancyProvider::objcfg
private

The documentation for this class was generated from the following file: