XRootD
Loading...
Searching...
No Matches
XrdFrmTransfer Class Reference

#include <XrdFrmTransfer.hh>

+ Collaboration diagram for XrdFrmTransfer:

Public Member Functions

 XrdFrmTransfer ()
 
 ~XrdFrmTransfer ()
 
void Start (int ioqType)
 

Static Public Member Functions

static const char * checkFF (const char *Path)
 
static int Init ()
 

Detailed Description

Definition at line 41 of file XrdFrmTransfer.hh.

Constructor & Destructor Documentation

◆ XrdFrmTransfer()

XrdFrmTransfer::XrdFrmTransfer ( )

Definition at line 107 of file XrdFrmTransfer.cc.

108{
109 int i;
110
111// Construct program objects
112//
113 for (i = 0; i < 4; i++)
114 xfrCmd[i] = (Config.xfrCmd[i].theVec ? new XrdOucProg(&Say) : 0);
115}
XrdOucPup XrdCmsParser::Pup & Say
struct XrdFrmConfig::Cmd xfrCmd[4]
XrdOucMsubs * theVec
XrdFrmConfig Config

References XrdFrm::Config, and Say.

◆ ~XrdFrmTransfer()

XrdFrmTransfer::~XrdFrmTransfer ( )
inline

Definition at line 53 of file XrdFrmTransfer.hh.

53{}

Member Function Documentation

◆ checkFF()

const char * XrdFrmTransfer::checkFF ( const char * Path)
static

Definition at line 121 of file XrdFrmTransfer.cc.

122{
123 EPNAME("checkFF");
124 struct stat buf;
125
126// Check for a fail file
127//
128 if (!stat(Path, &buf))
129 {if (buf.st_ctime+Config.FailHold >= time(0))
130 return "request previously failed";
131 if (Config.Test) {DEBUG("would have removed '" <<Path <<"'");}
132 else {unlink(Path);
133 DEBUG("removed '" <<Path <<"'");
134 }
135 }
136
137// Return all is well
138//
139 return 0;
140}
#define DEBUG(x)
#define EPNAME(x)
#define unlink(a)
Definition XrdPosix.hh:108
#define stat(a, b)
Definition XrdPosix.hh:96
XrdOucString Path

References XrdFrm::Config, DEBUG, EPNAME, Path, stat, and unlink.

◆ Init()

int XrdFrmTransfer::Init ( )
static

Definition at line 408 of file XrdFrmTransfer.cc.

409{
410 static int anyQ = XrdFrmXfrQueue::useAnyQ;
411 static int inpQ = XrdFrmXfrQueue::useInpQ;
412 static int outQ = XrdFrmXfrQueue::useOutQ;
413 void *qWant;
414 pthread_t tid;
415 int retc, n;
416
417// Initialize the cluster identification object first
418//
420
421// Initialize the transfer queue first
422//
423 if (!XrdFrmXfrQueue::Init()) return 0;
424
425// Start the required number of transfer threads. Note we can split these
426// as dedicated in threads and dedicated out threads.
427//
428 n = Config.xfrMax;
429 while(n--)
430 { if (Config.xfrMaxIn)
431 { qWant = (void *)&inpQ; Config.xfrMaxIn--;}
432 else if (Config.xfrMaxOt)
433 { qWant = (void *)&outQ; Config.xfrMaxOt--;}
434 else qWant = (void *)&anyQ;
435
436 if ((retc = XrdSysThread::Run(&tid, InitXfer, qWant,
437 XRDSYSTHREAD_BIND, "transfer")))
438 {Say.Emsg("main", retc, "create xfr thread"); return 0;}
439 }
440
441// All done
442//
443 return 1;
444}
void * InitXfer(void *parg)
#define XRDSYSTHREAD_BIND
int Init(const char *qPath)
Definition XrdFrcCID.cc:159
static const int useInpQ
static int Init()
static const int useOutQ
static const int useAnyQ
static int Run(pthread_t *, void *(*proc)(void *), void *arg, int opts=0, const char *desc=0)
XrdFrcCID CID
Definition XrdFrcCID.cc:56

References XrdFrc::CID, XrdFrm::Config, XrdFrmXfrQueue::Init(), InitXfer(), XrdSysThread::Run(), Say, XrdFrmXfrQueue::useAnyQ, XrdFrmXfrQueue::useInpQ, XrdFrmXfrQueue::useOutQ, and XRDSYSTHREAD_BIND.

Referenced by XrdFrmXfrDaemon::Init().

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

◆ Start()

void XrdFrmTransfer::Start ( int ioqType)

Definition at line 497 of file XrdFrmTransfer.cc.

498{
499 EPNAME("Transfer"); // Wrong but looks better
500 const char *Msg;
501
502// Prime I/O queue selection
503
504// Endless loop looking for transfer jobs
505//
506 while(1)
507 {xfrP = XrdFrmXfrQueue::Get(ioqType);
508
509 DEBUG(xfrP->Type <<" starting " <<xfrP->reqData.LFN
510 <<" for " <<xfrP->reqData.User);
511
512 Msg = (xfrP->qNum & XrdFrcRequest::outQ ? Throw() : Fetch());
513 if (Msg && !(xfrP->RetCode)) xfrP->RetCode = 1;
514 xfrP->PFN[xfrP->pfnEnd] = 0;
515
516 if (xfrP->RetCode || Config.Verbose)
517 {char buff1[280], buff2[80];
518 sprintf(buff1, "%s for %s", xfrP->RetCode ? "failed" : "complete",
519 xfrP->reqData.User);
520 if (xfrP->RetCode == 0) *buff2 = 0;
521 else sprintf(buff2, "; %s", (Msg ? Msg : "reason unknown"));
522 Say.Say(0, xfrP->Type, buff1, xfrP->reqData.LFN,buff2);
523 } else {
524 DEBUG(xfrP->Type
525 <<(xfrP->RetCode ? " failed " : " complete ")
526 << xfrP->reqData.LFN <<" rc=" <<xfrP->RetCode
527 <<' ' <<(Msg ? Msg : ""));
528 }
529
530 XrdFrmXfrQueue::Done(xfrP, Msg);
531 }
532}
if(ec< 0) ec
static const int outQ
static void Done(XrdFrmXfrJob *xP, const char *Msg)
static XrdFrmXfrJob * Get(int ioQType)

References XrdFrm::Config, DEBUG, XrdFrmXfrQueue::Done(), EPNAME, XrdFrmXfrQueue::Get(), XrdFrcRequest::outQ, and Say.

Referenced by InitXfer().

+ 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: