xrootd
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
XrdCl::AsyncPageReader Class Reference

Object for reading out data from the PgRead response. More...

#include <XrdClAsyncPageReader.hh>

Classes

struct  iovmax_t
 Helper class for retrieving the maximum size of the I/O vector. More...
 

Public Member Functions

 AsyncPageReader (ChunkList &chunks, std::vector< uint32_t > &digests)
 
virtual ~AsyncPageReader ()
 Destructor.
 
void SetRsp (ServerResponseV2 *rsp)
 Sets message data size.
 
XRootDStatus Read (Socket &socket, uint32_t &btsread)
 

Private Member Functions

void addiov (char *&buf, size_t len)
 Add I/O buffer to the vector.
 
void addiov (char *&buf, uint32_t len, uint32_t &dleft)
 Add I/O buffer to the vector and update number of bytes left to be read.
 
uint32_t CalcRdSize ()
 Calculate the size of the data to be read.
 
void InitIOV ()
 Initialize the I/O vector.
 
void shift (void *&buffer, size_t nbbts)
 Shift buffer by a number of bytes.
 
void shiftdgbuf (uint32_t &btsread)
 
void shiftpgbuf (uint32_t &btsread)
 
void ShiftIOV (uint32_t btsread)
 shift the I/O vector by the number of bytes read
 

Static Private Member Functions

static int max_iovcnt ()
 
static uint32_t CalcIOVSize (uint32_t dleft)
 

Private Attributes

ChunkListchunks
 
std::vector< uint32_t > & digests
 
uint32_t dlen
 
uint64_t rspoff
 
size_t chindex
 
size_t choff
 
size_t dgindex
 
size_t dgoff
 
std::vector< iovec > iov
 
int iovcnt
 
size_t iovindex
 

Static Private Attributes

static const int PageWithDigest = XrdSys::PageSize + sizeof( uint32_t )
 

Detailed Description

Object for reading out data from the PgRead response.

Constructor & Destructor Documentation

◆ AsyncPageReader()

XrdCl::AsyncPageReader::AsyncPageReader ( ChunkList chunks,
std::vector< uint32_t > &  digests 
)
inline

Constructor

Parameters
chunks: list of buffer for the data
digests: a vector that will be filled with crc32c digest data

References chunks, XrdOucPgrwUtils::csNum(), and digests.

◆ ~AsyncPageReader()

virtual XrdCl::AsyncPageReader::~AsyncPageReader ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ addiov() [1/2]

void XrdCl::AsyncPageReader::addiov ( char *&  buf,
size_t  len 
)
inlineprivate

Add I/O buffer to the vector.

References iovcnt.

Referenced by addiov(), and InitIOV().

◆ addiov() [2/2]

void XrdCl::AsyncPageReader::addiov ( char *&  buf,
uint32_t  len,
uint32_t &  dleft 
)
inlineprivate

Add I/O buffer to the vector and update number of bytes left to be read.

References addiov().

◆ CalcIOVSize()

static uint32_t XrdCl::AsyncPageReader::CalcIOVSize ( uint32_t  dleft)
inlinestaticprivate

Calculate the size of the I/O vector

Parameters
dleft: data to be accomodated by the I/O vector

References max_iovcnt(), and PageWithDigest.

Referenced by InitIOV().

◆ CalcRdSize()

uint32_t XrdCl::AsyncPageReader::CalcRdSize ( )
inlineprivate

Calculate the size of the data to be read.

References chindex, choff, chunks, dgindex, dgoff, digests, and dlen.

Referenced by InitIOV().

◆ InitIOV()

void XrdCl::AsyncPageReader::InitIOV ( )
inlineprivate

◆ max_iovcnt()

static int XrdCl::AsyncPageReader::max_iovcnt ( )
inlinestaticprivate
Returns
: maximum size of I/O vector

References XrdCl::AsyncPageReader::iovmax_t::value.

Referenced by CalcIOVSize(), and InitIOV().

◆ Read()

XRootDStatus XrdCl::AsyncPageReader::Read ( Socket socket,
uint32_t &  btsread 
)
inline

Readout data from the socket

Parameters
socket: the socket with the data
btsread: number of user data read from the socket
Returns
: operation status

References chindex, chunks, XrdOucIOVec::data, dlen, InitIOV(), iovcnt, iovindex, XrdCl::Socket::ReadV(), ShiftIOV(), and XrdCl::suRetry.

◆ SetRsp()

void XrdCl::AsyncPageReader::SetRsp ( ServerResponseV2 rsp)
inline

◆ shift()

void XrdCl::AsyncPageReader::shift ( void *&  buffer,
size_t  nbbts 
)
inlineprivate

Shift buffer by a number of bytes.

Referenced by shiftdgbuf(), and shiftpgbuf().

◆ shiftdgbuf()

void XrdCl::AsyncPageReader::shiftdgbuf ( uint32_t &  btsread)
inlineprivate

shift digest buffer by btsread

Parameters
btsread: total number of bytes read (will be decremented by bytes shifted in buffer)

References dgindex, dgoff, digests, iovcnt, iovindex, and shift().

Referenced by ShiftIOV().

◆ ShiftIOV()

void XrdCl::AsyncPageReader::ShiftIOV ( uint32_t  btsread)
inlineprivate

shift the I/O vector by the number of bytes read

References chindex, choff, chunks, iovcnt, iovindex, shiftdgbuf(), and shiftpgbuf().

Referenced by Read().

◆ shiftpgbuf()

void XrdCl::AsyncPageReader::shiftpgbuf ( uint32_t &  btsread)
inlineprivate

shift page buffer by btsread

Parameters
btsread: total number of bytes read (will be decremented by bytes shifted in buffer)

References choff, iovcnt, iovindex, and shift().

Referenced by ShiftIOV().

Member Data Documentation

◆ chindex

size_t XrdCl::AsyncPageReader::chindex
private

◆ choff

size_t XrdCl::AsyncPageReader::choff
private

◆ chunks

ChunkList& XrdCl::AsyncPageReader::chunks
private

◆ dgindex

size_t XrdCl::AsyncPageReader::dgindex
private

Referenced by CalcRdSize(), InitIOV(), and shiftdgbuf().

◆ dgoff

size_t XrdCl::AsyncPageReader::dgoff
private

Referenced by CalcRdSize(), InitIOV(), and shiftdgbuf().

◆ digests

std::vector<uint32_t>& XrdCl::AsyncPageReader::digests
private

◆ dlen

uint32_t XrdCl::AsyncPageReader::dlen
private

Referenced by CalcRdSize(), Read(), and SetRsp().

◆ iov

std::vector<iovec> XrdCl::AsyncPageReader::iov
private

◆ iovcnt

int XrdCl::AsyncPageReader::iovcnt
private

◆ iovindex

size_t XrdCl::AsyncPageReader::iovindex
private

◆ PageWithDigest

const int XrdCl::AsyncPageReader::PageWithDigest = XrdSys::PageSize + sizeof( uint32_t )
staticprivate

Referenced by CalcIOVSize(), and InitIOV().

◆ rspoff

uint64_t XrdCl::AsyncPageReader::rspoff
private

Referenced by SetRsp().


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