![]() |
XRootD
|
#include <XrdSsiFileReq.hh>
Public Types | |
enum | reqState { wtReq =0 , xqReq , wtRsp , doRsp , odRsp , erRsp , rsEnd } |
enum | rspState { isNew =0 , isBegun , isBound , isAbort , isDone , isMax } |
Public Member Functions | |
XrdSsiFileReq (const char *cID=0) | |
virtual | ~XrdSsiFileReq () |
void | Activate (XrdOucBuffer *oP, XrdSfsXioHandle bR, int rSz) |
void | Alert (XrdSsiRespInfoMsg &aMsg) |
Send or receive a server generated alert. More... | |
void | DoIt () |
void | Done (int &Result, XrdOucErrInfo *cbInfo, const char *path=0) |
void | Finalize () |
bool | Finished (bool cancel=false) |
void | Finished (XrdSsiRequest &rqstR, const XrdSsiRespInfo &rInfo, bool cancel=false) |
char * | GetRequest (int &rLen) |
bool | ProcessResponse (const XrdSsiErrInfo &eInfo, const XrdSsiRespInfo &resp) |
XrdSfsXferSize | Read (bool &done, char *buffer, XrdSfsXferSize blen) |
void | RelRequestBuffer () |
int | Same (unsigned long long arg1, unsigned long long arg2) |
int | Send (XrdSfsDio *sfDio, XrdSfsXferSize size) |
bool | WantResponse (XrdOucErrInfo &eInfo) |
![]() | |
XrdSsiRequest (const char *reqid=0, uint16_t tmo=0) | |
bool | Finished (bool cancel=false) |
uint32_t | GetDetachTTL () |
std::string | GetEndPoint () |
const char * | GetMetadata (int &dlen) |
const char * | GetRequestID () |
void | GetResponseData (char *buff, int blen) |
uint16_t | GetTimeOut () |
virtual void | ProcessResponseData (const XrdSsiErrInfo &eInfo, char *buff, int blen, bool last) |
void | ReleaseRequestBuffer () |
![]() | |
XrdOucEICB () | |
Constructor and destructor. More... | |
virtual | ~XrdOucEICB () |
![]() | |
XrdJob (const char *desc="") | |
virtual | ~XrdJob () |
Static Public Member Functions | |
static XrdSsiFileReq * | Alloc (XrdOucErrInfo *eP, XrdSsiFileResource *rP, XrdSsiFileSess *fP, const char *sn, const char *id, unsigned int rnum) |
static void | SetMax (int mVal) |
Additional Inherited Members | |
![]() | |
const char * | Comment |
XrdJob * | NextJob |
![]() | |
virtual | ~XrdSsiRequest () |
void | SetDetachTTL (uint32_t dttl) |
Set the detached request time to live value. More... | |
void | SetRetry (bool onoff) |
void | SetTimeOut (uint16_t tmo) |
Definition at line 53 of file XrdSsiFileReq.hh.
Enumerator | |
---|---|
wtReq | |
xqReq | |
wtRsp | |
doRsp | |
odRsp | |
erRsp | |
rsEnd |
Definition at line 112 of file XrdSsiFileReq.hh.
Enumerator | |
---|---|
isNew | |
isBegun | |
isBound | |
isAbort | |
isDone | |
isMax |
Definition at line 113 of file XrdSsiFileReq.hh.
|
inline |
Definition at line 106 of file XrdSsiFileReq.hh.
|
inlinevirtual |
Definition at line 110 of file XrdSsiFileReq.hh.
void XrdSsiFileReq::Activate | ( | XrdOucBuffer * | oP, |
XrdSfsXioHandle | bR, | ||
int | rSz | ||
) |
Definition at line 104 of file XrdSsiFileReq.cc.
References DEBUGXQ, EPNAME, XrdSysMutex::Lock(), XrdSsiStats::ReqBytes, XrdSsiStats::ReqCount, XrdSsiStats::ReqMaxsz, XrdSsi::Sched, XrdScheduler::Schedule(), XrdSsi::Stats, XrdOucStats::statsMutex, and XrdSysMutex::UnLock().
|
virtual |
Send or receive a server generated alert.
The Alert() method is used server-side to send one or more alerts before a response is posted (alerts afterwards are ignored). To avoid race conditions, server-side alerts should be sent via the Responder's Alert() method. Clients must implement this method in order to receive alerts.
aMsg | Reference to the message object containing the alert message. Non-positive alert lengths cause the alert call to be ignored. You should call the message RecycleMsg() method once you have consumed the message to release its resources. |
Reimplemented from XrdSsiRequest.
Definition at line 135 of file XrdSsiFileReq.cc.
References XrdSsiAlert::Alloc(), XrdOucStats::Bump(), DEBUGXQ, EPNAME, XrdSsiRespInfoMsg::GetMsg(), XrdSsiAlert::next, XrdSsiRespInfoMsg::RecycleMsg(), XrdSsiStats::ReqAlerts, and XrdSsi::Stats.
|
static |
Definition at line 193 of file XrdSsiFileReq.cc.
|
virtual |
Implements XrdJob.
Definition at line 297 of file XrdSsiFileReq.cc.
References XrdOucStats::Bump(), DEBUGXQ, XrdSysError::Emsg(), EPNAME, XrdSsi::Log, XrdSsiService::ProcessRequest(), XrdSsiStats::ReqAborts, XrdSsiStats::ReqCancels, XrdSsiStats::ReqFinished, XrdSsiStats::ReqProcs, XrdSsi::Service, XrdSsi::Stats, and tident.
|
virtual |
Invoke a callback after an operation completes.
Result | - the original function's result (may be changed). |
eInfo | - Associated error information. The eInfo object may not be modified until it's own callback Done() method is called, if supplied. If the callback function in eInfo is zero, then the eInfo object is deleted by the invoked callback. Otherwise, that method must be invoked by this callback function after the actual callback message is sent. This allows the callback requestor to do post-processing and be asynchronous being assured that the callback completed. |
Path | - Optionally, the path related to thid request. It is used for tracing and detailed monitoring purposes. |
Implements XrdOucEICB.
Definition at line 347 of file XrdSsiFileReq.cc.
void XrdSsiFileReq::Finalize | ( | ) |
Definition at line 449 of file XrdSsiFileReq.cc.
References XrdOucStats::Bump(), DEBUGXQ, XrdSysError::Emsg(), EPNAME, XrdSsiMutexMon::Lock(), XrdSsi::Log, XrdSsiAlert::next, XrdSsiAlert::Recycle(), XrdSsiStats::ReqAborts, XrdSsiStats::ReqCancels, XrdSsiStats::ReqFinished, XrdSsi::Stats, tident, XrdSsiMutexMon::UnLock(), and XrdSysSemaphore::Wait().
Referenced by XrdSsiFileSess::read(), XrdSsiFileSess::SendData(), and XrdSsiFileSess::truncate().
bool XrdSsiRequest::Finished |
Indicate that request processing has been finished. This method calls XrdSsiResponder::Finished() on the associated responder object.
Note: This method locks the object's recursive mutex.
cancel | False -> the request/response sequence completed normally. True -> the request/response sequence aborted because of an error or the client cancelled the request. |
Definition at line 91 of file XrdSsiRequest.cc.
|
inline |
Definition at line 72 of file XrdSsiFileReq.hh.
|
virtual |
Obtain the request data sent by a client.
This method is duplicated in XrdSsiResponder to allow calling consistency.
dlen | holds the length of the request after the call. |
Implements XrdSsiRequest.
Definition at line 525 of file XrdSsiFileReq.cc.
References XrdSfsXio::Buffer(), XrdOucStats::Bump(), DEBUGXQ, EPNAME, XrdSsiStats::ReqGets, and XrdSsi::Stats.
|
virtual |
Notify request that a response is ready to be processed. This method must be supplied by the request object's implementation.
eInfo | Error information. You can check if an error occurred using eInfo.hasError() or eInfo.isOK(). |
rInfo | Raw response information. |
Implements XrdSsiRequest.
Definition at line 582 of file XrdSsiFileReq.cc.
References XrdOucStats::Bump(), DEBUGXQ, EPNAME, XrdSsiRespInfo::isData, XrdSsiRespInfo::isError, XrdSsiRespInfo::isFile, XrdSsiRespInfo::isStream, XrdSsiStats::RspBad, XrdSsiStats::RspData, XrdSsiStats::RspErrs, XrdSsiStats::RspFile, XrdSsiStats::RspStrm, XrdSsiRespInfo::rType, and XrdSsi::Stats.
XrdSfsXferSize XrdSsiFileReq::Read | ( | bool & | done, |
char * | buffer, | ||
XrdSfsXferSize | blen | ||
) |
Definition at line 639 of file XrdSsiFileReq.cc.
References XrdSsiStream::isActive, XrdSsiRespInfo::isData, XrdSsiRespInfo::isError, XrdSsiRespInfo::isFile, XrdSsiRespInfo::isStream, pread(), XrdSsiRRAgent::RespP(), XrdSsiRespInfo::rType, and SFS_ERROR.
Referenced by XrdSsiFileSess::read().
|
virtual |
Release the request buffer. Use this method to optimize storage use; this is especially relevant for long-running requests. If the request buffer has been consumed and is no longer needed, early return of the buffer will minimize memory usage. This method is also invoked via XrdSsiResponder.
Note: This method is called with the object's recursive mutex locked when it is invoked via XrdSsiResponder's ReleaseRequestBuffer().
Reimplemented from XrdSsiRequest.
Definition at line 818 of file XrdSsiFileReq.cc.
References XrdOucStats::Bump(), DEBUGXQ, EPNAME, XrdSfsXio::Reclaim(), XrdSsiStats::ReqRelBuf, and XrdSsi::Stats.
|
inlinevirtual |
Determine if two callback arguments refer to the same client.
arg1 | - The first callback argument. |
arg2 | - The second callback argument. |
Implements XrdOucEICB.
Definition at line 98 of file XrdSsiFileReq.hh.
int XrdSsiFileReq::Send | ( | XrdSfsDio * | sfDio, |
XrdSfsXferSize | size | ||
) |
Definition at line 839 of file XrdSsiFileReq.cc.
References XrdOucSFVec::fdnum, if(), XrdSsiRespInfo::isData, XrdSsiRespInfo::isError, XrdSsiRespInfo::isFile, XrdSsiStream::isPassive, XrdSsiRespInfo::isStream, XrdSsiRRAgent::RespP(), XrdSsiRespInfo::rType, XrdSfsDio::SendFile(), and XrdOucSFVec::sendsz.
Referenced by XrdSsiFileSess::SendData().
|
inlinestatic |
Definition at line 89 of file XrdSsiFileReq.hh.
bool XrdSsiFileReq::WantResponse | ( | XrdOucErrInfo & | eInfo | ) |
Definition at line 961 of file XrdSsiFileReq.cc.
References DEBUGXQ, DUMPIT, EPNAME, XrdOucErrInfo::getErrCB(), XrdSsiMutexMon::Lock(), XrdSsiRRAgent::RespP(), and XrdOucErrInfo::setErrCB().
Referenced by XrdSsiFileSess::fctl().