xrootd
Loading...
Searching...
No Matches
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
 
std::unordered_map< std::string, CodingTablecache
 a cache of previously used coding tables
 
std::mutex mutex
 concurrency control
 

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

◆ RedundancyProvider()

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

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

Member Function Documentation

◆ compute()

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
stripesnData+nParity blocks, missing (empty) blocks will be computed if possible.

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

◆ getCodingTable()

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

◆ getErrorPattern()

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
stripesvector of nData+nParity blocks, missing (empty) blocks are errors
Returns
a string of stripe size describing the error pattern

◆ replication()

void XrdEc::RedundancyProvider::replication ( stripes_t stripes)
private

Member Data Documentation

◆ cache

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

a cache of previously used coding tables

◆ encode_matrix

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

the encoding matrix, required to compute any decode matrix

◆ mutex

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

concurrency control

◆ objcfg

ObjCfg XrdEc::RedundancyProvider::objcfg
private

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