xrootd
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
XrdEc::Reader Class Reference

#include <XrdEcReader.hh>

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

Public Member Functions

 Reader (ObjCfg &objcfg)
 
virtual ~Reader ()
 
void Open (XrdCl::ResponseHandler *handler, uint16_t timeout=0)
 
void Read (uint64_t offset, uint32_t length, void *buffer, XrdCl::ResponseHandler *handler, uint16_t timeout)
 
void VectorRead (const XrdCl::ChunkList &chunks, void *buffer, XrdCl::ResponseHandler *handler, uint16_t timeout)
 
void Close (XrdCl::ResponseHandler *handler, uint16_t timeout=0)
 Close the data object.
 
uint64_t GetSize ()
 

Private Types

typedef std::unordered_map< std::string, std::shared_ptr< XrdCl::ZipArchive > > dataarchs_t
 
typedef std::unordered_map< std::string, buffer_tmetadata_t
 
typedef std::unordered_map< std::string, std::string > urlmap_t
 
typedef std::unordered_set< std::string > missing_t
 

Private Member Functions

void Read (size_t blknb, size_t strpnb, buffer_t &buffer, callback_t cb, uint16_t timeout=0)
 
XrdCl::Pipeline ReadMetadata (size_t index)
 
XrdCl::Pipeline ReadSize (size_t index)
 
bool ParseMetadata (XrdCl::ChunkInfo &ch)
 
void AddMissing (const buffer_t &cdbuff)
 
bool IsMissing (const std::string &fn)
 Check if chunk file name is missing.
 
void MissingVectorRead (std::shared_ptr< block_t > &block, size_t blkid, size_t strpid, uint16_t timeout=0)
 

Static Private Member Functions

static callback_t ErrorCorrected (Reader *reader, std::shared_ptr< block_t > &self, size_t blkid, size_t strpid)
 

Private Attributes

ObjCfgobjcfg
 
dataarchs_t dataarchs
 
metadata_t metadata
 
urlmap_t urlmap
 
missing_t missing
 
std::shared_ptr< block_tblock
 
std::mutex blkmtx
 
size_t lstblk
 
uint64_t filesize
 
std::map< std::string, size_t > archiveIndices
 
std::mutex missingChunksMutex
 
std::vector< std::tuple< size_t, size_t > > missingChunksVectorRead
 
std::condition_variable waitMissing
 

Friends

class ::MicroTest
 
class ::XrdEcTests
 
struct block_t
 

Member Typedef Documentation

◆ dataarchs_t

typedef std::unordered_map<std::string, std::shared_ptr<XrdCl::ZipArchive> > XrdEc::Reader::dataarchs_t
private

◆ metadata_t

typedef std::unordered_map<std::string, buffer_t> XrdEc::Reader::metadata_t
private

◆ missing_t

typedef std::unordered_set<std::string> XrdEc::Reader::missing_t
private

◆ urlmap_t

typedef std::unordered_map<std::string, std::string> XrdEc::Reader::urlmap_t
private

Constructor & Destructor Documentation

◆ Reader()

XrdEc::Reader::Reader ( ObjCfg objcfg)
inline

Constructor

Parameters
objcfg: configuration for the data object (e.g. number of data and parity stripes)

◆ ~Reader()

virtual XrdEc::Reader::~Reader ( )
virtual

Member Function Documentation

◆ AddMissing()

void XrdEc::Reader::AddMissing ( const buffer_t cdbuff)
private

Add all the entries from given Central Directory to missing

Parameters
cdbuff: buffer containing central directory

◆ Close()

void XrdEc::Reader::Close ( XrdCl::ResponseHandler handler,
uint16_t  timeout = 0 
)

Close the data object.

◆ ErrorCorrected()

static callback_t XrdEc::Reader::ErrorCorrected ( Reader reader,
std::shared_ptr< block_t > &  self,
size_t  blkid,
size_t  strpid 
)
inlinestaticprivate

◆ GetSize()

uint64_t XrdEc::Reader::GetSize ( )
inline
Returns
: get file size

References filesize.

◆ IsMissing()

bool XrdEc::Reader::IsMissing ( const std::string &  fn)
private

Check if chunk file name is missing.

◆ MissingVectorRead()

void XrdEc::Reader::MissingVectorRead ( std::shared_ptr< block_t > &  block,
size_t  blkid,
size_t  strpid,
uint16_t  timeout = 0 
)
private

◆ Open()

void XrdEc::Reader::Open ( XrdCl::ResponseHandler handler,
uint16_t  timeout = 0 
)

Open the erasure coded / striped object

Parameters
handler: user callback

◆ ParseMetadata()

bool XrdEc::Reader::ParseMetadata ( XrdCl::ChunkInfo ch)
private

Parse metadata from chunk info object

Parameters
ch: chunk info object returned by a read operation

◆ Read() [1/2]

void XrdEc::Reader::Read ( size_t  blknb,
size_t  strpnb,
buffer_t buffer,
callback_t  cb,
uint16_t  timeout = 0 
)
private

Read data from given stripes from given block

Parameters
blknb: number of the block
strpnb: number of stripe in the block
buffer: buffer for the data
cb: callback
timeout: operation timeout

◆ Read() [2/2]

void XrdEc::Reader::Read ( uint64_t  offset,
uint32_t  length,
void *  buffer,
XrdCl::ResponseHandler handler,
uint16_t  timeout 
)

Read data from the data object

Parameters
offset: offset of the data to be read
length: length of the data to be read
buffer: buffer for the data to be read
handler: user callback

◆ ReadMetadata()

XrdCl::Pipeline XrdEc::Reader::ReadMetadata ( size_t  index)
private

Read metadata for the object

Parameters
index: placement's index

◆ ReadSize()

XrdCl::Pipeline XrdEc::Reader::ReadSize ( size_t  index)
private

Read size from xattr

Parameters
index: placement's index

◆ VectorRead()

void XrdEc::Reader::VectorRead ( const XrdCl::ChunkList chunks,
void *  buffer,
XrdCl::ResponseHandler handler,
uint16_t  timeout 
)

Friends And Related Symbol Documentation

◆ ::MicroTest

friend class ::MicroTest
friend

◆ ::XrdEcTests

friend class ::XrdEcTests
friend

◆ block_t

friend struct block_t
friend

Member Data Documentation

◆ archiveIndices

std::map<std::string, size_t> XrdEc::Reader::archiveIndices
private

◆ blkmtx

std::mutex XrdEc::Reader::blkmtx
private

◆ block

std::shared_ptr<block_t> XrdEc::Reader::block
private

◆ dataarchs

dataarchs_t XrdEc::Reader::dataarchs
private

◆ filesize

uint64_t XrdEc::Reader::filesize
private

Referenced by GetSize().

◆ lstblk

size_t XrdEc::Reader::lstblk
private

◆ metadata

metadata_t XrdEc::Reader::metadata
private

◆ missing

missing_t XrdEc::Reader::missing
private

◆ missingChunksMutex

std::mutex XrdEc::Reader::missingChunksMutex
private

◆ missingChunksVectorRead

std::vector<std::tuple<size_t, size_t> > XrdEc::Reader::missingChunksVectorRead
private

◆ objcfg

ObjCfg& XrdEc::Reader::objcfg
private

◆ urlmap

urlmap_t XrdEc::Reader::urlmap
private

◆ waitMissing

std::condition_variable XrdEc::Reader::waitMissing
private

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