xrootd
|
#include <XrdEcRedundancyProvider.hh>
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 |
CodingTable & | getCodingTable (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, CodingTable > | cache |
a cache of previously used coding tables | |
std::mutex | mutex |
concurrency control | |
The redundancy provider class offers automatic parity computing and data recovery. Depending on configuration it will use erasure coding or replication.
XrdEc::RedundancyProvider::RedundancyProvider | ( | const ObjCfg & | objcfg | ) |
Constructor. Stripe parameters (number of data and parity blocks) are constant per ErasureEncoding object.
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.
stripes | nData+nParity blocks, missing (empty) blocks will be computed if possible. |
Referenced by XrdEc::WrtBuff::Encode().
|
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.
pattern | error pattern / signature |
|
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).
stripes | vector of nData+nParity blocks, missing (empty) blocks are errors |
|
private |
|
private |
a cache of previously used coding tables
|
private |
the encoding matrix, required to compute any decode matrix
|
private |
concurrency control
|
private |