Object for reading out data from the PgRead response.
More...
#include <XrdClAsyncPageReader.hh>
Object for reading out data from the PgRead response.
Definition at line 37 of file XrdClAsyncPageReader.hh.
◆ 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 |
Definition at line 47 of file XrdClAsyncPageReader.hh.
48 :
49 chunks( chunks ),
50 digests( digests ),
51 dlen( 0 ),
52 rspoff( 0 ),
53 chindex( 0 ),
54 choff( 0 ),
55 dgindex( 0 ),
56 dgoff( 0 ),
57 iovcnt( 0 ),
58 iovindex( 0 )
59 {
60 uint64_t rdoff = chunks.front().offset;
61 uint32_t rdlen = 0;
62 for( auto &ch : chunks )
63 rdlen += ch.length;
64 int fpglen, lpglen;
66 digests.resize( pgcnt );
67 }
static int csNum(off_t offs, int count)
Compute the required size of a checksum vector based on offset & length.
References XrdOucPgrwUtils::csNum().
Referenced by XrdCl::XRootDMsgHandler::InspectStatusRsp().
◆ ~AsyncPageReader()
| virtual XrdCl::AsyncPageReader::~AsyncPageReader |
( |
| ) |
|
|
inlinevirtual |
◆ Read()
Readout data from the socket
- Parameters
-
| socket | : the socket with the data |
| btsread | : number of user data read from the socket |
- Returns
- : operation status
Definition at line 106 of file XrdClAsyncPageReader.hh.
107 {
108 if( dlen == 0 || chindex >= chunks.size() )
110 btsread = 0;
111 int nbbts = 0;
112 do
113 {
114
115 if( iov.empty() )
116 InitIOV();
117
118 nbbts = 0;
119 auto st = socket.ReadV( iov.data() + iovindex, iovcnt, nbbts );
120 if( !st.IsOK() )
121 return st;
122 btsread += nbbts;
123 dlen -= nbbts;
124 ShiftIOV( nbbts );
126 return st;
127 }
128 while( nbbts > 0 && dlen > 0 && chindex < chunks.size() );
129
131 }
XRootDStatus(uint16_t st=0, uint16_t code=0, uint32_t errN=0, const std::string &message="")
Constructor.
References XrdCl::XRootDStatus::XRootDStatus(), XrdCl::Socket::ReadV(), and XrdCl::suRetry.
◆ SetRsp()
Sets message data size.
Definition at line 79 of file XrdClAsyncPageReader.hh.
80 {
82 rspoff = rsp->
info.pgread.offset;
83
84 uint64_t bufoff = rspoff - chunks[0].offset;
85 chindex = 0;
86
87 for( chindex = 0; chindex < chunks.size(); ++chindex )
88 {
89 if( chunks[chindex].length < bufoff )
90 {
91 bufoff -= chunks[chindex].length;
92 continue;
93 }
94 break;
95 }
96 choff = bufoff;
98 }
ServerResponseStatus status
struct ServerResponseBody_Status bdy
union ServerResponseV2::@207342300141235315373173036347114307032363217365 info
static const int PageSize
References ServerResponseStatus::bdy, ServerResponseBody_Status::dlen, ServerResponseV2::info, and ServerResponseV2::status.
The documentation for this class was generated from the following file: