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().
◆ ~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 105 of file XrdClAsyncPageReader.hh.
106 {
107 if( dlen == 0 || chindex >= chunks.size() )
108 return XRootDStatus();
109 btsread = 0;
110 int nbbts = 0;
111 do
112 {
113
114 if( iov.empty() )
115 InitIOV();
116
117 nbbts = 0;
118 auto st = socket.ReadV( iov.data() + iovindex, iovcnt, nbbts );
119 if( !st.IsOK() )
120 return st;
121 btsread += nbbts;
122 dlen -= nbbts;
123 ShiftIOV( nbbts );
125 return st;
126 }
127 while( nbbts > 0 && dlen > 0 && chindex < chunks.size() );
128
129 return XRootDStatus();
130 }
References 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;
97 }
ServerResponseStatus status
struct ServerResponseBody_Status bdy
union ServerResponseV2::@207342300141235315373173036347114307032363217365 info
References ServerResponseStatus::bdy, ServerResponseBody_Status::dlen, ServerResponseV2::info, and ServerResponseV2::status.
The documentation for this class was generated from the following file: