Loading...
Searching...
No Matches
XrdFrmReqBoss Class Reference

`#include <XrdFrmReqBoss.hh>`

Collaboration diagram for XrdFrmReqBoss:

## Public Member Functions

| XrdFrmReqBoss (const char *Me, int qVal)
| ~XrdFrmReqBoss ()
void | Add (XrdFrcRequest &Request)
void | Del (XrdFrcRequest &Request)
void | Process ()
int | Server ()
int | Start (char *aPath, int aMode)
void | Wakeup (int PushIt=1)

## Detailed Description

Definition at line 37 of file XrdFrmReqBoss.hh.

## Constructor & Destructor Documentation

## XrdFrmReqBoss()

XrdFrmReqBoss::XrdFrmReqBoss | ( | const char * | Me,
|  | int | qVal )

inline

Definition at line 53 of file XrdFrmReqBoss.hh.

: rqReady(0),Persona(Me),theQ(qVal),isPosted(0) {}

## ~XrdFrmReqBoss()

XrdFrmReqBoss::~XrdFrmReqBoss | ( |  | ) |

inline

Definition at line 55 of file XrdFrmReqBoss.hh.

{}

## Member Function Documentation

## Add()

void XrdFrmReqBoss::Add | ( | XrdFrcRequest & | Request | ) |

Definition at line 66 of file XrdFrmReqBoss.cc.

{
// Complete the request including verifying the priority
//
if (Request.Prty > XrdFrcRequest::maxPrty)
Request.Prty = XrdFrcRequest::maxPrty;
else if (Request.Prty < 0)Request.Prty = 0;
Request.addTOD = time(0);
// Now add it to the queue
//
rQueue[static_cast<int>(Request.Prty)]->Add(&Request);
// Now wake ourselves up
//
Wakeup(1);
}
XrdFrcRequest::Prty
signed char Prty
Definition XrdFrcRequest.hh:54
XrdFrcRequest::maxPrty
static const int maxPrty
Definition XrdFrcRequest.hh:77
XrdFrcRequest::addTOD
long long addTOD
Definition XrdFrcRequest.hh:44
XrdFrmReqBoss::Add
void Add(XrdFrcRequest &Request)
Definition XrdFrmReqBoss.cc:66
XrdFrmReqBoss::Wakeup
void Wakeup(int PushIt=1)
Definition XrdFrmReqBoss.cc:191

References Add(), XrdFrcRequest::addTOD, XrdFrcRequest::maxPrty, XrdFrcRequest::Prty, and Wakeup().

Referenced by Add().

Here is the call graph for this function:
Here is the caller graph for this function:

## Del()

void XrdFrmReqBoss::Del | ( | XrdFrcRequest & | Request | ) |

Definition at line 89 of file XrdFrmReqBoss.cc.

{
int i;
// Remove all pending requests for this id
//
for (i = 0; i <= XrdFrcRequest::maxPrty; i++) rQueue[i]->Can(&Request);
}

References XrdFrcRequest::maxPrty.

## Process()

void XrdFrmReqBoss::Process | ( |  | ) |

Definition at line 102 of file XrdFrmReqBoss.cc.

{
EPNAME("Process");
XrdFrcRequest myReq;
int i, rc, numXfr, numPull;;
// Perform staging in an endless loop
//
do{Wakeup(0);
do{numXfr = 0;
for (i = XrdFrcRequest::maxPrty; i >= 0; i--)
{numPull = i+1;
while(numPull && (rc = rQueue[i]->Get(&myReq)))
{if (myReq.Options & XrdFrcRequest::Register) Register(myReq,i);
else {numPull -= XrdFrmXfrQueue::Add(&myReq,rQueue[i],theQ);
numXfr++;
DEBUG(Persona <<" from Q " << i <<' ' <<numPull <<" left");
if (rc < 0) break;
}
}
}
} while(numXfr);
} while(1);
}
DEBUG
#define DEBUG(x)
Definition XrdBwmTrace.hh:54
EPNAME
#define EPNAME(x)
Definition XrdBwmTrace.hh:56
XrdFrcRequest::Options
int Options
Definition XrdFrcRequest.hh:47
XrdFrcRequest::Register
static const int Register
Definition XrdFrcRequest.hh:63
XrdFrmXfrQueue::Add
static int Add(XrdFrcRequest *rP, XrdFrcReqFile *reqF, int theQ)
Definition XrdFrmXfrQueue.cc:73

References XrdFrmXfrQueue::Add(), DEBUG, EPNAME, XrdFrcRequest::maxPrty, XrdFrcRequest::Options, XrdFrcRequest::Register, and Wakeup().

Referenced by mainServerXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

## Server()

int XrdFrmReqBoss::Server | ( |  | ) |

## Start()

int XrdFrmReqBoss::Start | ( | char * | aPath,
|  | int | aMode )

Definition at line 154 of file XrdFrmReqBoss.cc.

{
pthread_t tid;
char buff[2048], *qPath;
int retc, i;
// Generate the queue directory path
//
if (!(qPath = XrdFrcUtils::makeQDir(aPath, aMode))) return 0;
// Initialize the request queues if all went well
//
for (i = 0; i <= XrdFrcRequest::maxPrty; i++)
{sprintf(buff, "%s%sQ.%d", qPath, Persona, i);
rQueue[i] = new XrdFrcReqFile(buff, 0);
if (!rQueue[i]->Init()) {free(qPath); return 0;}
}
free(qPath);
// Start the request processing thread
//
if ((retc = XrdSysThread::Run(&tid, mainServerXeq, (void *)this,
XRDSYSTHREAD_BIND, Persona)))
{sprintf(buff, "create %s request thread", Persona);
Say.Emsg("Start", retc, buff);
return 0;
}
// All done
//
return 1;
}
Say
XrdOucPup XrdCmsParser::Pup & Say
Definition XrdCmsParser.cc:124
mainServerXeq
void * mainServerXeq(void *parg)
Definition XrdFrmReqBoss.cc:55
XRDSYSTHREAD_BIND
#define XRDSYSTHREAD_BIND
Definition XrdSysPthread.hh:543
XrdFrcUtils::makeQDir
static char * makeQDir(const char *Path, int Mode)
Definition XrdFrcUtils.cc:127
XrdSysThread::Run
static int Run(pthread_t *, void *(*proc)(void *), void *arg, int opts=0, const char *desc=0)
Definition XrdSysPthread.cc:307

References mainServerXeq(), XrdFrcUtils::makeQDir(), XrdFrcRequest::maxPrty, XrdSysThread::Run(), Say, and XRDSYSTHREAD_BIND.

Here is the call graph for this function:

## Wakeup()

void XrdFrmReqBoss::Wakeup | ( | int | PushIt = 1 | ) |

Definition at line 191 of file XrdFrmReqBoss.cc.

{
static XrdSysMutex rqMutex;
// If this is a PushIt then see if we need to push the binary semaphore
//
if (PushIt) {rqMutex.Lock();
if (!isPosted) {rqReady.Post(); isPosted = 1;}
rqMutex.UnLock();
}
else {rqReady.Wait();
rqMutex.Lock(); isPosted = 0; rqMutex.UnLock();
}
}
XrdSysMutex::Lock
void Lock()
Definition XrdSysPthread.hh:222
XrdSysMutex::UnLock
void UnLock()
Definition XrdSysPthread.hh:224

References XrdSysMutex::Lock(), and XrdSysMutex::UnLock().

Referenced by Add(), XrdFrmXfrDaemon::Pong(), and Process().

Here is the call graph for this function:
Here is the caller graph for this function:

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

- XrdFrmReqBoss.hh
- XrdFrmReqBoss.cc