XRootD
XrdCmsPrepArgs Class Reference

#include <XrdCmsPrepArgs.hh>

+ Inheritance diagram for XrdCmsPrepArgs:
+ Collaboration diagram for XrdCmsPrepArgs:

Public Member Functions

 XrdCmsPrepArgs (XrdCmsRRData &Arg)
 
 ~XrdCmsPrepArgs ()
 
void DoIt ()
 
void Queue ()
 
- Public Member Functions inherited from XrdJob
 XrdJob (const char *desc="")
 
virtual ~XrdJob ()
 

Static Public Member Functions

static XrdCmsPrepArgsgetRequest ()
 
static void Process ()
 

Public Attributes

char * clPath
 
char * Ident
 
struct iovec ioV [iovNum]
 
char * mode
 
char * notify
 
char * opaque
 
int options
 
char * path
 
int pathlen
 
char * prty
 
char * reqid
 
XrdCms::CmsRRHdr Request
 
- Public Attributes inherited from XrdJob
const char * Comment
 
XrdJobNextJob
 

Static Public Attributes

static const int iovNum = 2
 

Detailed Description

Definition at line 40 of file XrdCmsPrepArgs.hh.

Constructor & Destructor Documentation

◆ XrdCmsPrepArgs()

XrdCmsPrepArgs::XrdCmsPrepArgs ( XrdCmsRRData Arg)

Definition at line 56 of file XrdCmsPrepArgs.cc.

56  : XrdJob("prepare")
57 {
58 
59 // Copy variable pointers and steal the data buffer behind them
60 //
61  Request = Arg.Request; Request.streamid = 0;
62  Ident = Arg.Ident;
63  reqid = Arg.Reqid;
64  notify = Arg.Notify;
65  prty = Arg.Prty;
66  mode = Arg.Mode;
67  path = Arg.Path;
68  pathlen = Arg.PathLen;
69  opaque = Arg.Opaque;
70  options = Arg.Request.modifier;
71  Data = Arg.Buff; Arg.Buff = 0; Arg.Blen = 0;
72 
73 // Fill out co-location information
74 //
75  if (options & CmsPrepAddRequest::kYR_stage
76  && options & CmsPrepAddRequest::kYR_coloc && prty)
77  {clPath = prty;
78  while(*clPath && *clPath != '/') clPath++;
79  if (*clPath != '/') clPath = 0;
80  } else clPath = 0;
81 
82 // Fill out the iovec
83 //
84  ioV[0].iov_base = (char *)&Request;
85  ioV[0].iov_len = sizeof(Request);
86  ioV[1].iov_base = Data;
87  ioV[1].iov_len = Arg.Dlen;
88 }
struct iovec ioV[iovNum]
XrdCms::CmsRRHdr Request
XrdCms::CmsRRHdr Request
Definition: XrdCmsRRData.hh:54
XrdJob(const char *desc="")
Definition: XrdJob.hh:51
kXR_char modifier
Definition: YProtocol.hh:85
kXR_unt32 streamid
Definition: YProtocol.hh:83

References XrdCmsRRData::Blen, XrdCmsRRData::Buff, clPath, XrdCmsRRData::Dlen, Ident, XrdCmsRRData::Ident, ioV, mode, XrdCmsRRData::Mode, XrdCms::CmsRRHdr::modifier, notify, XrdCmsRRData::Notify, opaque, XrdCmsRRData::Opaque, options, path, XrdCmsRRData::Path, pathlen, XrdCmsRRData::PathLen, prty, XrdCmsRRData::Prty, reqid, XrdCmsRRData::Reqid, Request, XrdCmsRRData::Request, and XrdCms::CmsRRHdr::streamid.

◆ ~XrdCmsPrepArgs()

XrdCmsPrepArgs::~XrdCmsPrepArgs ( )
inline

Definition at line 69 of file XrdCmsPrepArgs.hh.

69 {if (Data) free(Data);}

Member Function Documentation

◆ DoIt()

void XrdCmsPrepArgs::DoIt ( )
inlinevirtual

Implements XrdJob.

Definition at line 59 of file XrdCmsPrepArgs.hh.

59 {if (!XrdCmsNode::do_SelPrep(*this)) delete this;}
static int do_SelPrep(XrdCmsPrepArgs &Arg)
Definition: XrdCmsNode.cc:1191

References XrdCmsNode::do_SelPrep().

Referenced by Process().

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

◆ getRequest()

XrdCmsPrepArgs * XrdCmsPrepArgs::getRequest ( )
static

Definition at line 94 of file XrdCmsPrepArgs.cc.

95 {
96  XrdCmsPrepArgs *parg;
97 
98 // Wait for a request
99 //
100  do {PAQueue.Lock();
101  if ((parg = First))
102  if (parg == Last) First = Last = 0;
103  else First = parg->Next;
104  else {isIdle = 1; PAQueue.UnLock(); PAReady.Wait();}
105  } while(parg == 0);
106  isIdle = 0;
107  PAQueue.UnLock();
108  return parg;
109 }

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

Referenced by Process().

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

◆ Process()

void XrdCmsPrepArgs::Process ( )
static

Definition at line 117 of file XrdCmsPrepArgs.cc.

118 {
119  XrdCmsPrepArgs *aP;
120 
121 // Process all queued prepare arguments. If we have data then we do this
122 // for real. Otherwise, simply do a server selection and, if need be, tell
123 // the server to stage the file.
124 //
125  if (Config.DiskOK)
126  do {aP = getRequest();
127  PrepQ.Prepare(aP);
128  delete aP;
129  } while(1);
130  else
131  do {getRequest()->DoIt();
132  } while(1);
133 }
static XrdCmsPrepArgs * getRequest()
void Prepare(XrdCmsPrepArgs *pargs)
XrdCmsPrepare PrepQ
XrdCmsConfig Config

References XrdCms::Config, XrdCmsConfig::DiskOK, DoIt(), getRequest(), XrdCmsPrepare::Prepare(), and XrdCms::PrepQ.

Referenced by XrdCmsStartPreparing().

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

◆ Queue()

void XrdCmsPrepArgs::Queue ( )

Definition at line 139 of file XrdCmsPrepArgs.cc.

140 {
141 
142 // Lock the queue and add the element and post the waiter
143 //
144  PAQueue.Lock();
145  if (First) Last->Next = this;
146  else First = this;
147  Last = this;
148  if (isIdle) PAReady.Post();
149  PAQueue.UnLock();
150 }

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

+ Here is the call graph for this function:

Member Data Documentation

◆ clPath

char* XrdCmsPrepArgs::clPath

Definition at line 53 of file XrdCmsPrepArgs.hh.

Referenced by XrdCmsPrepArgs(), and XrdCmsNode::do_SelPrep().

◆ Ident

char* XrdCmsPrepArgs::Ident

◆ ioV

struct iovec XrdCmsPrepArgs::ioV[iovNum]

Definition at line 55 of file XrdCmsPrepArgs.hh.

Referenced by XrdCmsPrepArgs(), and XrdCmsNode::do_SelPrep().

◆ iovNum

const int XrdCmsPrepArgs::iovNum = 2
static

Definition at line 43 of file XrdCmsPrepArgs.hh.

Referenced by XrdCmsNode::do_SelPrep().

◆ mode

char* XrdCmsPrepArgs::mode

◆ notify

char* XrdCmsPrepArgs::notify

◆ opaque

char* XrdCmsPrepArgs::opaque

Definition at line 52 of file XrdCmsPrepArgs.hh.

Referenced by XrdCmsPrepArgs(), and XrdCmsPrepare::Add().

◆ options

int XrdCmsPrepArgs::options

Definition at line 54 of file XrdCmsPrepArgs.hh.

Referenced by XrdCmsPrepArgs(), and XrdCmsNode::do_SelPrep().

◆ path

char* XrdCmsPrepArgs::path

◆ pathlen

int XrdCmsPrepArgs::pathlen

Definition at line 55 of file XrdCmsPrepArgs.hh.

Referenced by XrdCmsPrepArgs(), XrdCmsNode::do_SelPrep(), and XrdCmsPrepare::Inform().

◆ prty

char* XrdCmsPrepArgs::prty

Definition at line 49 of file XrdCmsPrepArgs.hh.

Referenced by XrdCmsPrepArgs(), XrdCmsPrepare::Add(), and XrdCmsPrepare::Prepare().

◆ reqid

char* XrdCmsPrepArgs::reqid

◆ Request

XrdCms::CmsRRHdr XrdCmsPrepArgs::Request

Definition at line 45 of file XrdCmsPrepArgs.hh.

Referenced by XrdCmsPrepArgs().


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