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

#include <XrdEcWrtBuff.hh>

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

Public Member Functions

 WrtBuff (const ObjCfg &objcfg)
 
 WrtBuff (WrtBuff &&wrtbuff)
 Move constructor.
 
 ~WrtBuff ()
 
uint32_t Write (uint32_t size, const char *buffer)
 
void Pad (uint32_t size)
 
char * GetStrpBuff (uint8_t strpnb)
 
uint32_t GetStrpSize (uint8_t strp)
 
uint32_t GetBlkSize ()
 Get size of the data in the buffer.
 
bool Complete ()
 True if the buffer if full, false otherwise.
 
bool Empty ()
 True if there are no data in the buffer, false otherwise.
 
void Encode ()
 Calculate the parity for the data stripes and the crc32cs.
 
uint32_t GetCrc32c (size_t strpnb)
 

Private Attributes

ObjCfg objcfg
 
XrdCl::Buffer wrtbuff
 
stripes_t stripes
 
std::vector< std::future< uint32_t > > cksums
 

Detailed Description

Write cache, accumulates full block and then calculates parity and all of it to the storage

Constructor & Destructor Documentation

◆ WrtBuff() [1/2]

XrdEc::WrtBuff::WrtBuff ( const ObjCfg objcfg)
inline

Constructor

Parameters
objcfg: data object configuration

References XrdCl::Buffer::GetBuffer(), XrdCl::Buffer::GetSize(), XrdEc::ObjCfg::nbchunks, objcfg, stripes, and wrtbuff.

◆ WrtBuff() [2/2]

XrdEc::WrtBuff::WrtBuff ( WrtBuff &&  wrtbuff)
inline

Move constructor.

◆ ~WrtBuff()

XrdEc::WrtBuff::~WrtBuff ( )
inline

Member Function Documentation

◆ Complete()

bool XrdEc::WrtBuff::Complete ( )
inline

True if the buffer if full, false otherwise.

References XrdEc::ObjCfg::datasize, XrdCl::Buffer::GetCursor(), objcfg, and wrtbuff.

◆ Empty()

bool XrdEc::WrtBuff::Empty ( )
inline

True if there are no data in the buffer, false otherwise.

References XrdCl::Buffer::GetCursor(), XrdCl::Buffer::GetSize(), and wrtbuff.

◆ Encode()

void XrdEc::WrtBuff::Encode ( )
inline

◆ GetBlkSize()

uint32_t XrdEc::WrtBuff::GetBlkSize ( )
inline

Get size of the data in the buffer.

References XrdCl::Buffer::GetCursor(), and wrtbuff.

◆ GetCrc32c()

uint32_t XrdEc::WrtBuff::GetCrc32c ( size_t  strpnb)
inline

Calculate the crc32c for given data stripe

Parameters
strpnb: number of the stripe
Returns
: the crc32c of the data stripe

References cksums.

◆ GetStrpBuff()

char * XrdEc::WrtBuff::GetStrpBuff ( uint8_t  strpnb)
inline

Return buffer corresponding to given stripe

Parameters
strpnb: number of the stripe

References stripes.

◆ GetStrpSize()

uint32_t XrdEc::WrtBuff::GetStrpSize ( uint8_t  strp)
inline

Return size of the data in the given stripe

Parameters
strp: number of the stripe

References XrdEc::ObjCfg::chunksize, XrdCl::Buffer::GetCursor(), GetStrpSize(), XrdEc::ObjCfg::nbdata, objcfg, and wrtbuff.

Referenced by Encode(), and GetStrpSize().

◆ Pad()

void XrdEc::WrtBuff::Pad ( uint32_t  size)
inline

Pad the buffer with zeros.

Parameters
size: number of zeros to be written into the buffer

References XrdCl::Buffer::AdvanceCursor(), XrdCl::Buffer::Allocate(), XrdEc::ObjCfg::datasize, XrdCl::Buffer::GetBuffer(), XrdCl::Buffer::GetSize(), objcfg, XrdCl::Buffer::SetCursor(), and wrtbuff.

◆ Write()

uint32_t XrdEc::WrtBuff::Write ( uint32_t  size,
const char *  buffer 
)
inline

Write data into the buffer

Parameters
size: number of bytes to be written
buffer: buffer with data to be written
Returns
: number of bytes accepted by the buffer

References XrdCl::Buffer::AdvanceCursor(), XrdEc::ObjCfg::datasize, XrdCl::Buffer::GetBufferAtCursor(), XrdCl::Buffer::GetCursor(), objcfg, and wrtbuff.

Member Data Documentation

◆ cksums

std::vector<std::future<uint32_t> > XrdEc::WrtBuff::cksums
private

Referenced by Encode(), and GetCrc32c().

◆ objcfg

ObjCfg XrdEc::WrtBuff::objcfg
private

◆ stripes

stripes_t XrdEc::WrtBuff::stripes
private

Referenced by Encode(), GetStrpBuff(), and WrtBuff().

◆ wrtbuff

XrdCl::Buffer XrdEc::WrtBuff::wrtbuff
private

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