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_t > | stripes_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()

size_t XrdEc::fntoblk | ( | const std::string & | fn | ) |

inline static

Definition at line 251 of file XrdEcUtilities.hh.

{
size_t end = fn.rfind( '.' );
size_t begin = fn.rfind( '.', end - 1 ) + 1;
size_t len = end - begin;
return std::stoul( fn.substr( begin, len ) );
}

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

Here is the caller graph for this function:

## gf_gen_decode_matrix()

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.

{
unsigned i, j, p;
unsigned int r;
unsigned char* invert_matrix, * backup, * b, s;
int incr = 0;
size_t mk = (size_t)m * (size_t)k;
std::vector<unsigned char> memory(3 * mk);
b = &memory[0];
backup = &memory[mk];
invert_matrix = &memory[2 * mk];
// Construct matrix b by removing error rows
for (i = 0, r = 0; i < k; i++, r++) {
while (src_in_err[r]) {
r++;
}
for (j = 0; j < k; j++) {
b[k * i + j] = encode_matrix[k * r + j];
backup[k * i + j] = encode_matrix[k * r + j];
}
decode_index[i] = r;
}
incr = 0;
while (gf_invert_matrix(b, invert_matrix, k) < 0) {
if (nerrs == (m - k)) {
return -1;
}
incr++;
memcpy(b, backup, mk);
for (i = nsrcerrs; i < nerrs - nsrcerrs; i++) {
if (src_err_list[i] == (decode_index[k - 1] + incr)) {
// skip the erased parity line
incr++;
continue;
}
}
if (decode_index[k - 1] + incr >= m) {
return -1;
}
decode_index[k - 1] += incr;
for (j = 0; j < k; j++) {
b[k * (k - 1) + j] = encode_matrix[k * decode_index[k - 1] + j];
}
};
for (i = 0; i < nsrcerrs; i++) {
for (j = 0; j < k; j++) {
decode_matrix[k * i + j] = invert_matrix[k * src_err_list[i] + j];
}
}
/* src_err_list from encode_matrix * invert of b for parity decoding */
for (p = nsrcerrs; p < nerrs; p++) {
for (i = 0; i < k; i++) {
s = 0;
for (j = 0; j < k; j++) {
s ^= gf_mul(invert_matrix[j * k + i],
encode_matrix[k * src_err_list[p] + j]);
}
decode_matrix[k * p + i] = s;
}
}
return 0;
}

## isal_crc32()

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

inline static

ISAL crc32 implementation.

Definition at line 26 of file XrdEcObjCfg.hh.

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

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.

{
return OpenOnlyImpl<false>( std::move( zip ), std::move( fn ),
std::move( updt ) ).Timeout( timeout );
}
XrdCl::ConcreteOperation::Timeout
Derived< HasHndl > Timeout(uint16_t timeout)
Set operation timeout.
Definition XrdClOperations.hh:647
XrdEc::OpenOnlyImpl
Definition XrdEcReader.cc:60

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.

{
if( !handler ) return;
XrdCl::ChunkInfo *chunk = new XrdCl::ChunkInfo();
chunk->offset = offset;
chunk->length = size;
chunk->buffer = buffer;
XrdCl::AnyObject *resp = new XrdCl::AnyObject();
resp->Set( chunk );
ResponseJob *job = new ResponseJob( handler, new XrdCl::XRootDStatus(), resp );
XrdCl::DefaultEnv::GetPostMaster()->GetJobManager()->QueueJob( job );
}
XrdCl::AnyObject
Definition XrdClAnyObject.hh:33
XrdCl::AnyObject::Set
void Set(Type object, bool own=true)
Definition XrdClAnyObject.hh:59
XrdCl::DefaultEnv::GetPostMaster
static PostMaster * GetPostMaster()
Get default post master.
Definition XrdClDefaultEnv.cc:453
XrdCl::JobManager::QueueJob
void QueueJob(Job *job, void *arg=0)
Add a job to be run.
Definition XrdClJobManager.hh:92
XrdCl::PostMaster::GetJobManager
JobManager * GetJobManager()
Get the job manager object user by the post master.
Definition XrdClPostMaster.cc:316
XrdCl::XRootDStatus
Request status.
Definition XrdClXRootDResponses.hh:219
XrdEc::ResponseJob
Definition XrdEcUtilities.cc:36
XrdCl::ChunkInfo
Describe a data chunk for vector read.
Definition XrdClXRootDResponses.hh:918
XrdCl::ChunkInfo::buffer
void * buffer
length of the chunk
Definition XrdClXRootDResponses.hh:951
XrdCl::ChunkInfo::length
uint32_t length
offset in the file
Definition XrdClXRootDResponses.hh:950
XrdCl::ChunkInfo::offset
uint64_t offset
Definition XrdClXRootDResponses.hh:949

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.

{
if( !handler ) return;
ResponseJob *job = new ResponseJob( handler, new XrdCl::XRootDStatus( st ), 0 );
XrdCl::DefaultEnv::GetPostMaster()->GetJobManager()->QueueJob( job );
}

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().