Loading...
Searching...
No Matches
XrdOfsPrepGPIReal::PrepGRun Class Reference
Inheritance diagram for XrdOfsPrepGPIReal::PrepGRun:
Collaboration diagram for XrdOfsPrepGPIReal::PrepGRun:

## Public Member Functions

| PrepGRun (XrdOucProg &pgm)
void | DoIt () override
int | Run (PrepRequest &req, char *bP=0, int bL=0)
void | Sched (PrepRequest *rP)
Public Member Functions inherited from XrdJob
| XrdJob (const char *desc="")
virtual | ~XrdJob ()

## Public Attributes

PrepGRun * | next
Public Attributes inherited from XrdJob
const char * | Comment
XrdJob * | NextJob

## Static Public Attributes

static PrepGRun * | Q = 0

## Detailed Description

Definition at line 135 of file XrdOfsPrepGPI.cc.

## Constructor & Destructor Documentation

## PrepGRun()

XrdOfsPrepGPIReal::PrepGRun::PrepGRun | ( | XrdOucProg & | pgm | ) |

inline

Definition at line 147 of file XrdOfsPrepGPI.cc.

: prepProg(pgm) {}

## Member Function Documentation

## DoIt()

void XrdOfsPrepGPIReal::PrepGRun::DoIt | ( |  | ) |

override virtual

Implements XrdJob.

Definition at line 229 of file XrdOfsPrepGPI.cc.

{
// Run as many requests as we can
//
do{Run(*reqP);
delete reqP;
gpiMutex.Lock();
if ((reqP = PrepRequest::First))
{if (PrepRequest::First == PrepRequest::Last)
PrepRequest::First = PrepRequest::Last = 0;
else PrepRequest::First = PrepRequest::First->next;
} else {
next = Q;
Q = this;
}
gpiMutex.UnLock();
} while(reqP);
}
XrdOfsPrepGPIReal::PrepGRun::Q
static PrepGRun * Q
Definition XrdOfsPrepGPI.cc:150
XrdOfsPrepGPIReal::PrepGRun::Run
int Run(PrepRequest &req, char *bP=0, int bL=0)
Definition XrdOfsPrepGPI.cc:277
XrdOfsPrepGPIReal::PrepGRun::next
PrepGRun * next
Definition XrdOfsPrepGPI.cc:149
XrdSysMutex::Lock
void Lock()
Definition XrdSysPthread.hh:222
XrdSysMutex::UnLock
void UnLock()
Definition XrdSysPthread.hh:224
XrdOfsPrepGPIReal::gpiMutex
XrdSysMutex gpiMutex
Definition XrdOfsPrepGPI.cc:53
XrdOfsPrepGPIReal::PrepRequest::First
static PrepRequest * First
Definition XrdOfsPrepGPI.cc:95
XrdOfsPrepGPIReal::PrepRequest::Last
static PrepRequest * Last
Definition XrdOfsPrepGPI.cc:96
XrdOfsPrepGPIReal::PrepRequest::next
PrepRequest * next
Definition XrdOfsPrepGPI.cc:94

References XrdOfsPrepGPIReal::PrepRequest::First, XrdOfsPrepGPIReal::gpiMutex, XrdOfsPrepGPIReal::PrepRequest::Last, next, Q, and Run().

Here is the call graph for this function:

## Run()

int XrdOfsPrepGPIReal::PrepGRun::Run | ( | PrepRequest & | req,
|  | char * | bP = 0,
|  | int | bL = 0 )

Definition at line 277 of file XrdOfsPrepGPI.cc.

{
EPNAME("Run");
XrdOucStream cmd;
char *lp;
int rc, bytes = 0;
// Allocate a arg vector of appropriate size
//
int n = req.argCnt + req.argMem.size();
const char **argVec = (const char **)alloca((n+2) * sizeof(char*));
// Fill the vector
//
makeArgs(req, argVec);
// Do some debugging
//
DEBUG(req.tID,"Starting prep for "<<req.reqName<<' '<<req.reqID);
// Invoke the program
//
rc = prepProg.Run(&cmd, argVec, n, req.envVec);
// Drain or capture any output
//
if (!rc)
{if (Debug)
{DEBUG(req.tID, req.reqName<<' '<<req.reqID<<" output:");}
if (!bP) while((lp = cmd.GetLine())) {DEBUG(req.tID," ==> "<<lp);}
else bytes = Capture(req, cmd, bP, bL);
rc = prepProg.RunDone(cmd);
}
// Document unsuccessful end
//
if (rc)
{char ib[512];
eLog->Emsg("PrepGRun","Prep exec for",req.Info(ib,sizeof(ib)),"failed.");
}
// Return the error, success or number of bytes
//
if (bP) return bytes;
return (rc ? -1 : 0);
}
DEBUG
#define DEBUG(x)
Definition XrdBwmTrace.hh:54
EPNAME
#define EPNAME(x)
Definition XrdBwmTrace.hh:56
XrdOucStream::GetLine
char * GetLine()
Definition XrdOucStream.cc:554
XrdSysError::Emsg
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition XrdSysError.cc:95
XrdOfsPrepGPIReal::Debug
bool Debug
Definition XrdOfsPrepGPI.cc:71
XrdOfsPrepGPIReal::eLog
XrdSysError * eLog
Definition XrdOfsPrepGPI.cc:59
XrdOfsPrepGPIReal::PrepRequest::Info
const char * Info(char *bP, int bL)
Definition XrdOfsPrepGPI.cc:114
XrdOfsPrepGPIReal::PrepRequest::reqName
const char * reqName
Definition XrdOfsPrepGPI.cc:108
XrdOfsPrepGPIReal::PrepRequest::tID
const char * tID
Definition XrdOfsPrepGPI.cc:109
XrdOfsPrepGPIReal::PrepRequest::argMem
std::vector< std::string > argMem
Definition XrdOfsPrepGPI.cc:111
XrdOfsPrepGPIReal::PrepRequest::argCnt
int argCnt
Definition XrdOfsPrepGPI.cc:103
XrdOfsPrepGPIReal::PrepRequest::reqID
char * reqID
Definition XrdOfsPrepGPI.cc:107
XrdOfsPrepGPIReal::PrepRequest::envVec
const char * envVec[envSZ]
Definition XrdOfsPrepGPI.cc:105

References XrdOfsPrepGPIReal::PrepRequest::argCnt, XrdOfsPrepGPIReal::PrepRequest::argMem, DEBUG, XrdOfsPrepGPIReal::Debug, XrdOfsPrepGPIReal::eLog, XrdOfsPrepGPIReal::PrepRequest::envVec, EPNAME, XrdOucStream::GetLine(), XrdOfsPrepGPIReal::PrepRequest::Info(), XrdOfsPrepGPIReal::PrepRequest::reqID, XrdOfsPrepGPIReal::PrepRequest::reqName, and XrdOfsPrepGPIReal::PrepRequest::tID.

Referenced by DoIt().

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

## Sched()

void XrdOfsPrepGPIReal::PrepGRun::Sched | ( | PrepRequest * | rP | ) |

inline

Definition at line 143 of file XrdOfsPrepGPI.cc.

{reqP = rP;
schedP->Schedule(this);
}
XrdScheduler::Schedule
void Schedule(XrdJob *jp)
Definition XrdScheduler.cc:373
XrdOfsPrepGPIReal::schedP
XrdScheduler * schedP
Definition XrdOfsPrepGPI.cc:58

References XrdOfsPrepGPIReal::schedP.

## Member Data Documentation

## next

PrepGRun* XrdOfsPrepGPIReal::PrepGRun::next

Definition at line 149 of file XrdOfsPrepGPI.cc.

Referenced by DoIt(), and XrdOfsgetPrepare().

## Q

PrepGRun * XrdOfsPrepGPIReal::PrepGRun::Q = 0

static

Definition at line 150 of file XrdOfsPrepGPI.cc.

Referenced by DoIt(), and XrdOfsgetPrepare().

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

- XrdOfsPrepGPI.cc