XRootD
Loading...
Searching...
No Matches
XrdEc Namespace Reference

Classes

struct  block_t
 
class  BufferPool
 Pool of buffer for caching writes. More...
 
class  Config
 Global configuration for the EC module. More...
 
class  Convert
 
class  IOError
 Generic I/O exception, wraps up XrdCl::XRootDStatus (. More...
 
struct  ObjCfg
 
class  OpenOnlyImpl
 
class  Reader
 
class  RedundancyProvider
 
class  ResponseJob
 
struct  stripe_t
 A buffer with stripe data and info on validity. More...
 
class  StrmWriter
 
struct  sync_queue
 
class  ThreadPool
 
class  WrtBuff
 

Typedefs

typedef std::vector< char > buffer_t
 a buffer type
 
typedef std::function< void(const XrdCl::XRootDStatus &, uint32_t)> callback_t
 
typedef std::vector< stripe_tstripes_t
 All stripes in a block.
 

Functions

static size_t fntoblk (const std::string &fn)
 
static int gf_gen_decode_matrix (unsigned char *encode_matrix, unsigned char *decode_matrix, unsigned int *decode_index, unsigned char *src_err_list, unsigned char *src_in_err, unsigned int nerrs, unsigned int nsrcerrs, unsigned int k, unsigned int m)
 
static uint32_t isal_crc32 (uint32_t crc, void const *buf, size_t len)
 ISAL crc32 implementation.
 
OpenOnlyImpl< false > OpenOnly (XrdCl::Ctx< XrdCl::ZipArchive > zip, XrdCl::Arg< std::string > fn, XrdCl::Arg< bool > updt, uint16_t timeout=0)
 
void ScheduleHandler (uint64_t offset, uint32_t size, void *buffer, XrdCl::ResponseHandler *handler)
 
void ScheduleHandler (XrdCl::ResponseHandler *handler, const XrdCl::XRootDStatus &st)
 

Variables

static const std::string ObjStr = "obj"
 

Typedef Documentation

◆ buffer_t

typedef std::vector< char > XrdEc::buffer_t

a buffer type

Definition at line 49 of file XrdEcReader.hh.

◆ callback_t

typedef std::function<void( const XrdCl::XRootDStatus&, uint32_t )> XrdEc::callback_t

Definition at line 53 of file XrdEcReader.hh.

◆ stripes_t

typedef std::vector<stripe_t> XrdEc::stripes_t

All stripes in a block.

Definition at line 64 of file XrdEcUtilities.hh.

Function Documentation

◆ fntoblk()

static size_t XrdEc::fntoblk ( const std::string & fn)
inlinestatic

Definition at line 251 of file XrdEcUtilities.hh.

252 {
253 size_t end = fn.rfind( '.' );
254 size_t begin = fn.rfind( '.', end - 1 ) + 1;
255 size_t len = end - begin;
256 return std::stoul( fn.substr( begin, len ) );
257 }

◆ gf_gen_decode_matrix()

static int XrdEc::gf_gen_decode_matrix ( unsigned char * encode_matrix,
unsigned char * decode_matrix,
unsigned int * decode_index,
unsigned char * src_err_list,
unsigned char * src_in_err,
unsigned int nerrs,
unsigned int nsrcerrs,
unsigned int k,
unsigned int m )
static

Definition at line 73 of file XrdEcRedundancyProvider.cc.

84{
85 unsigned i, j, p;
86 unsigned int r;
87 unsigned char* invert_matrix, * backup, * b, s;
88 int incr = 0;
89
90 std::vector<unsigned char> memory((size_t) (m * k * 3));
91 b = &memory[0];
92 backup = &memory[m * k];
93 invert_matrix = &memory[2 * m * k];
94
95 // Construct matrix b by removing error rows
96 for (i = 0, r = 0; i < k; i++, r++) {
97 while (src_in_err[r]) {
98 r++;
99 }
100 for (j = 0; j < k; j++) {
101 b[k * i + j] = encode_matrix[k * r + j];
102 backup[k * i + j] = encode_matrix[k * r + j];
103 }
104 decode_index[i] = r;
105 }
106 incr = 0;
107 while (gf_invert_matrix(b, invert_matrix, k) < 0) {
108 if (nerrs == (m - k)) {
109 return -1;
110 }
111 incr++;
112 memcpy(b, backup, (size_t) (m * k));
113 for (i = nsrcerrs; i < nerrs - nsrcerrs; i++) {
114 if (src_err_list[i] == (decode_index[k - 1] + incr)) {
115 // skip the erased parity line
116 incr++;
117 continue;
118 }
119 }
120 if (decode_index[k - 1] + incr >= m) {
121 return -1;
122 }
123 decode_index[k - 1] += incr;
124 for (j = 0; j < k; j++) {
125 b[k * (k - 1) + j] = encode_matrix[k * decode_index[k - 1] + j];
126 }
127
128 };
129
130 for (i = 0; i < nsrcerrs; i++) {
131 for (j = 0; j < k; j++) {
132 decode_matrix[k * i + j] = invert_matrix[k * src_err_list[i] + j];
133 }
134 }
135 /* src_err_list from encode_matrix * invert of b for parity decoding */
136 for (p = nsrcerrs; p < nerrs; p++) {
137 for (i = 0; i < k; i++) {
138 s = 0;
139 for (j = 0; j < k; j++) {
140 s ^= gf_mul(invert_matrix[j * k + i],
141 encode_matrix[k * src_err_list[p] + j]);
142 }
143
144 decode_matrix[k * p + i] = s;
145 }
146 }
147 return 0;
148}

◆ isal_crc32()

static uint32_t XrdEc::isal_crc32 ( uint32_t crc,
void const * buf,
size_t len )
inlinestatic

ISAL crc32 implementation.

Definition at line 26 of file XrdEcObjCfg.hh.

27 {
28 const unsigned char* buffer = reinterpret_cast<const unsigned char*>( buf );
29 return crc32_gzip_refl( crc, buffer, len );
30 }

Referenced by XrdEc::ObjCfg::ObjCfg().

+ Here is the caller graph for this function:

◆ OpenOnly()

OpenOnlyImpl< false > XrdEc::OpenOnly ( XrdCl::Ctx< XrdCl::ZipArchive > zip,
XrdCl::Arg< std::string > fn,
XrdCl::Arg< bool > updt,
uint16_t timeout = 0 )
inline

Definition at line 105 of file XrdEcReader.cc.

109 {
110 return OpenOnlyImpl<false>( std::move( zip ), std::move( fn ),
111 std::move( updt ) ).Timeout( timeout );
112 }
Derived< HasHndl > Timeout(uint16_t timeout)
Set operation timeout.

References XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::Timeout().

Referenced by XrdEc::Reader::Open().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ScheduleHandler() [1/2]

void XrdEc::ScheduleHandler ( uint64_t offset,
uint32_t size,
void * buffer,
XrdCl::ResponseHandler * handler )

A utility function for scheduling read operation handler

Parameters
offset: offset of the read
size: number of bytes read
buffer: buffer with the data read
handler: user callback

Definition at line 64 of file XrdEcUtilities.cc.

65 {
66 if( !handler ) return;
67
69 chunk->offset = offset;
70 chunk->length = size;
71 chunk->buffer = buffer;
72
74 resp->Set( chunk );
75
76 ResponseJob *job = new ResponseJob( handler, new XrdCl::XRootDStatus(), resp );
78 }
void Set(Type object, bool own=true)
static PostMaster * GetPostMaster()
Get default post master.
void QueueJob(Job *job, void *arg=0)
Add a job to be run.
JobManager * GetJobManager()
Get the job manager object user by the post master.
Describe a data chunk for vector read.
void * buffer
length of the chunk
uint32_t length
offset in the file

References XrdCl::ChunkInfo::buffer, XrdCl::PostMaster::GetJobManager(), XrdCl::DefaultEnv::GetPostMaster(), XrdCl::ChunkInfo::length, XrdCl::ChunkInfo::offset, XrdCl::JobManager::QueueJob(), and XrdCl::AnyObject::Set().

Referenced by XrdEc::Reader::Close(), XrdEc::StrmWriter::Close(), XrdEc::Reader::Read(), and XrdEc::StrmWriter::Write().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ScheduleHandler() [2/2]

void XrdEc::ScheduleHandler ( XrdCl::ResponseHandler * handler,
const XrdCl::XRootDStatus & st = XrdCl::XRootDStatus() )

A utility function for scheduling an operation handler

Parameters
handler: user callback
st: operation status

Definition at line 83 of file XrdEcUtilities.cc.

84 {
85 if( !handler ) return;
86
87 ResponseJob *job = new ResponseJob( handler, new XrdCl::XRootDStatus( st ), 0 );
89 }

References XrdCl::PostMaster::GetJobManager(), XrdCl::DefaultEnv::GetPostMaster(), and XrdCl::JobManager::QueueJob().

+ Here is the call graph for this function:

Variable Documentation

◆ ObjStr

const std::string XrdEc::ObjStr = "obj"
static

Definition at line 32 of file XrdEcObjCfg.hh.

Referenced by XrdEc::ObjCfg::GetFileName().