xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
XrdSsiFileReq Class Reference

#include <XrdSsiFileReq.hh>

Inheritance diagram for XrdSsiFileReq:
Inheritance graph
[legend]
Collaboration diagram for XrdSsiFileReq:
Collaboration graph
[legend]

Public Types

enum  reqState {
  wtReq =0, xqReq, wtRsp, doRsp,
  odRsp, erRsp, rsEnd
}
 
enum  rspState {
  isNew =0, isBegun, isBound, isAbort,
  isDone, isMax
}
 

Public Member Functions

void Activate (XrdOucBuffer *oP, XrdSfsXioHandle bR, int rSz)
 
void Alert (XrdSsiRespInfoMsg &aMsg)
 Send or receive a server generated alert. More...
 
void Finalize ()
 
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 Send (XrdSfsDio *sfDio, XrdSfsXferSize size)
 
bool WantResponse (XrdOucErrInfo &eInfo)
 
void Done (int &Result, XrdOucErrInfo *cbInfo, const char *path=0)
 
int Same (unsigned long long arg1, unsigned long long arg2)
 
void DoIt ()
 
 XrdSsiFileReq (const char *cID=0)
 
virtual ~XrdSsiFileReq ()
 
- Public Member Functions inherited from XrdSsiRequest
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 ()
 
 XrdSsiRequest (const char *reqid=0, uint16_t tmo=0)
 
- Public Member Functions inherited from XrdOucEICB
 XrdOucEICB ()
 Constructor and destructor. More...
 
virtual ~XrdOucEICB ()
 
- Public Member Functions inherited from XrdJob
 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)
 

Private Member Functions

void BindDone ()
 
void Dispose ()
 
int Emsg (const char *pfx, int ecode, const char *op)
 
int Emsg (const char *pfx, XrdSsiErrInfo &eObj, const char *op)
 
void Init (const char *cID=0)
 
XrdSfsXferSize readStrmA (XrdSsiStream *strmP, char *buff, XrdSfsXferSize blen)
 
XrdSfsXferSize readStrmP (XrdSsiStream *strmP, char *buff, XrdSfsXferSize blen)
 
int sendStrmA (XrdSsiStream *strmP, XrdSfsDio *sfDio, XrdSfsXferSize blen)
 
void Recycle ()
 
void WakeUp (XrdSsiAlert *aP=0)
 

Private Attributes

XrdSsiMutex frqMutex
 
XrdSsiFileReq * nextReq
 
XrdSysSemaphore * finWait
 
XrdOucEICB * respCB
 
unsigned long long respCBarg
 
XrdSsiAlert * alrtSent
 
XrdSsiAlert * alrtPend
 
XrdSsiAlert * alrtLast
 
char * tident
 
const char * sessN
 
XrdOucErrInfo * cbInfo
 
XrdSsiFileResource * fileR
 
XrdSsiFileSess * fileP
 
char * respBuf
 
long long respOff
 
union {
   long long   fileSz
 
   int   respLen
 
}; 
 
XrdSfsXioHandle sfsBref
 
XrdOucBuffer * oucBuff
 
XrdSsiStream::Buffer * strBuff
 
reqState myState
 
rspState urState
 
int reqSize
 
unsigned int reqID
 
bool haveResp
 
bool respWait
 
bool strmEOF
 
bool schedDone
 
bool isEnding
 
char rID [8]
 

Static Private Attributes

static XrdSysMutex aqMutex
 
static XrdSsiFileReq * freeReq
 
static int freeCnt
 
static int freeMax
 

Additional Inherited Members

- Public Attributes inherited from XrdJob
XrdJob * NextJob
 
const char * Comment
 
- Protected Member Functions inherited from XrdSsiRequest
void SetDetachTTL (uint32_t dttl)
 Set the detached request time to live value. More...
 
void SetRetry (bool onoff)
 
void SetTimeOut (uint16_t tmo)
 
virtual ~XrdSsiRequest ()
 

Member Enumeration Documentation

Enumerator
wtReq 
xqReq 
wtRsp 
doRsp 
odRsp 
erRsp 
rsEnd 
Enumerator
isNew 
isBegun 
isBound 
isAbort 
isDone 
isMax 

Constructor & Destructor Documentation

XrdSsiFileReq::XrdSsiFileReq ( const char *  cID = 0)
inline

References Init().

virtual XrdSsiFileReq::~XrdSsiFileReq ( )
inlinevirtual

References tident.

Member Function Documentation

void XrdSsiFileReq::Activate ( XrdOucBuffer *  oP,
XrdSfsXioHandle  bR,
int  rSz 
)
void XrdSsiFileReq::Alert ( XrdSsiRespInfoMsg &  aMsg)
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.

Parameters
aMsgReference 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.

static XrdSsiFileReq* XrdSsiFileReq::Alloc ( XrdOucErrInfo *  eP,
XrdSsiFileResource *  rP,
XrdSsiFileSess *  fP,
const char *  sn,
const char *  id,
unsigned int  rnum 
)
static
void XrdSsiFileReq::BindDone ( )
privatevirtual

Reimplemented from XrdSsiRequest.

void XrdSsiFileReq::Dispose ( )
privatevirtual

Reimplemented from XrdSsiRequest.

void XrdSsiFileReq::DoIt ( )
virtual

Implements XrdJob.

void XrdSsiFileReq::Done ( int &  Result,
XrdOucErrInfo *  eInfo,
const char *  Path = 0 
)
virtual

Invoke a callback after an operation completes.

Parameters
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.

int XrdSsiFileReq::Emsg ( const char *  pfx,
int  ecode,
const char *  op 
)
private
int XrdSsiFileReq::Emsg ( const char *  pfx,
XrdSsiErrInfo &  eObj,
const char *  op 
)
private
void XrdSsiFileReq::Finalize ( )
void XrdSsiFileReq::Finished ( XrdSsiRequest &  rqstR,
const XrdSsiRespInfo &  rInfo,
bool  cancel = false 
)
inline
char* XrdSsiFileReq::GetRequest ( int &  dlen)
virtual

Obtain the request data sent by a client.

This method is duplicated in XrdSsiResponder to allow calling consistency.

Parameters
dlenholds the length of the request after the call.
Returns
=0 No request data available, dlen has been set to zero.
!0 Pointer to the buffer holding the request, dlen has the length

Implements XrdSsiRequest.

void XrdSsiFileReq::Init ( const char *  cID = 0)
private

Referenced by XrdSsiFileReq().

bool XrdSsiFileReq::ProcessResponse ( const XrdSsiErrInfo &  eInfo,
const XrdSsiRespInfo &  rInfo 
)
virtual

Notify request that a response is ready to be processed. This method must be supplied by the request object's implementation.

Parameters
eInfoError information. You can check if an error occurred using eInfo.hasError() or eInfo.isOK().
rInfoRaw response information.
Returns
true Response processed.
false Response could not be processed, the request is not active.

Implements XrdSsiRequest.

XrdSfsXferSize XrdSsiFileReq::Read ( bool &  done,
char *  buffer,
XrdSfsXferSize  blen 
)
XrdSfsXferSize XrdSsiFileReq::readStrmA ( XrdSsiStream *  strmP,
char *  buff,
XrdSfsXferSize  blen 
)
private
XrdSfsXferSize XrdSsiFileReq::readStrmP ( XrdSsiStream *  strmP,
char *  buff,
XrdSfsXferSize  blen 
)
private
void XrdSsiFileReq::Recycle ( )
private
void XrdSsiFileReq::RelRequestBuffer ( )
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.

int XrdSsiFileReq::Same ( unsigned long long  arg1,
unsigned long long  arg2 
)
inlinevirtual

Determine if two callback arguments refer to the same client.

Parameters
arg1- The first callback argument.
arg2- The second callback argument.
Returns
!0 - The arguments refer to the same client.
=0 - The arguments refer to the different clients.

Implements XrdOucEICB.

int XrdSsiFileReq::Send ( XrdSfsDio *  sfDio,
XrdSfsXferSize  size 
)
int XrdSsiFileReq::sendStrmA ( XrdSsiStream *  strmP,
XrdSfsDio *  sfDio,
XrdSfsXferSize  blen 
)
private
static void XrdSsiFileReq::SetMax ( int  mVal)
inlinestatic

References freeMax.

void XrdSsiFileReq::WakeUp ( XrdSsiAlert *  aP = 0)
private
bool XrdSsiFileReq::WantResponse ( XrdOucErrInfo &  eInfo)

Member Data Documentation

union { ... }
XrdSsiAlert* XrdSsiFileReq::alrtLast
private
XrdSsiAlert* XrdSsiFileReq::alrtPend
private
XrdSsiAlert* XrdSsiFileReq::alrtSent
private
XrdSysMutex XrdSsiFileReq::aqMutex
staticprivate
XrdOucErrInfo* XrdSsiFileReq::cbInfo
private
XrdSsiFileSess* XrdSsiFileReq::fileP
private
XrdSsiFileResource* XrdSsiFileReq::fileR
private
long long XrdSsiFileReq::fileSz
XrdSysSemaphore* XrdSsiFileReq::finWait
private
int XrdSsiFileReq::freeCnt
staticprivate
int XrdSsiFileReq::freeMax
staticprivate

Referenced by SetMax().

XrdSsiFileReq* XrdSsiFileReq::freeReq
staticprivate
XrdSsiMutex XrdSsiFileReq::frqMutex
private
bool XrdSsiFileReq::haveResp
private
bool XrdSsiFileReq::isEnding
private
reqState XrdSsiFileReq::myState
private
XrdSsiFileReq* XrdSsiFileReq::nextReq
private
XrdOucBuffer* XrdSsiFileReq::oucBuff
private
unsigned int XrdSsiFileReq::reqID
private
int XrdSsiFileReq::reqSize
private
char* XrdSsiFileReq::respBuf
private
XrdOucEICB* XrdSsiFileReq::respCB
private
unsigned long long XrdSsiFileReq::respCBarg
private
int XrdSsiFileReq::respLen
long long XrdSsiFileReq::respOff
private
bool XrdSsiFileReq::respWait
private
char XrdSsiFileReq::rID[8]
private
bool XrdSsiFileReq::schedDone
private
const char* XrdSsiFileReq::sessN
private
XrdSfsXioHandle XrdSsiFileReq::sfsBref
private
XrdSsiStream::Buffer* XrdSsiFileReq::strBuff
private
bool XrdSsiFileReq::strmEOF
private
char* XrdSsiFileReq::tident
private

Referenced by ~XrdSsiFileReq().

rspState XrdSsiFileReq::urState
private

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