Loading...
Searching...
No Matches
XrdCmsNode Class Reference

`#include <XrdCmsNode.hh>`

Collaboration diagram for XrdCmsNode:

## Public Member Functions

| XrdCmsNode (XrdLink *lnkp, const char *theIF=0, const char *sid=0, int port=0, int lvl=0, int id=-1)
| ~XrdCmsNode ()
void | Delete (XrdSysFusedMutex &gMutex)
void | Delete (XrdSysMutex &gMutex)
void | Delete (XrdSysRWLock &gMutex)
void | Disc (const char *reason=0, int needLock=1)
const char * | do_Avail (XrdCmsRRData &Arg)
const char * | do_Chmod (XrdCmsRRData &Arg)
const char * | do_Disc (XrdCmsRRData &Arg)
const char * | do_Gone (XrdCmsRRData &Arg)
const char * | do_Have (XrdCmsRRData &Arg)
const char * | do_Load (XrdCmsRRData &Arg)
const char * | do_Locate (XrdCmsRRData &Arg)
const char * | do_Mkdir (XrdCmsRRData &Arg)
const char * | do_Mkpath (XrdCmsRRData &Arg)
const char * | do_Mv (XrdCmsRRData &Arg)
const char * | do_Ping (XrdCmsRRData &Arg)
const char * | do_Pong (XrdCmsRRData &Arg)
const char * | do_PrepAdd (XrdCmsRRData &Arg)
const char * | do_PrepDel (XrdCmsRRData &Arg)
const char * | do_Rm (XrdCmsRRData &Arg)
const char * | do_Rmdir (XrdCmsRRData &Arg)
int | do_SelAvoid (XrdCmsRRData &Arg, XrdCmsSelect &Sel, char *Avoid, bool &doRedir)
const char * | do_Select (XrdCmsRRData &Arg)
const char * | do_Space (XrdCmsRRData &Arg)
const char * | do_State (XrdCmsRRData &Arg)
int | do_StateFWD (XrdCmsRRData &Arg)
const char * | do_StatFS (XrdCmsRRData &Arg)
const char * | do_Stats (XrdCmsRRData &Arg)
const char * | do_Status (XrdCmsRRData &Arg)
const char * | do_Trunc (XrdCmsRRData &Arg)
const char * | do_Try (XrdCmsRRData &Arg)
const char * | do_Update (XrdCmsRRData &Arg)
const char * | do_Usage (XrdCmsRRData &Arg)
void | g2nLock (XrdSysRWLock &gMutex)
short | getSlot ()
int | ID (int &INum)
bool | inDomain ()
int | Inst ()
int | isNode (const XrdNetAddr *addr)
int | isNode (SMask_t smask)
int | isNode (XrdLink *lp, const char *nid, int port)
void | Lock ()
SMask_t | Mask ()
void | n2gLock (XrdSysRWLock &gMutex, bool rdlock=false)
char * | Name ()
void | Ref ()
int | Send (const char *buff, int blen=0)
int | Send (const struct iovec *iov, int iovcnt, int iotot=0)
void | setManager (XrdCmsManager *mP)
void | setName (XrdLink *lnkp, const char *theIF, int port)
void | setShare (int shrval)
void | setSlot (short rslot)
int | setTZone (int tZone)
void | setVersion (unsigned short vnum)
void | ShowIF ()
void | SyncSpace ()
void | UnLock ()
void | unRef ()

## Static Public Member Functions

static int | do_LocFmt (char *buff, XrdCmsSelected *sP, SMask_t pf, SMask_t wf, bool lsall=false, bool lsuniq=false)
static int | do_SelPrep (XrdCmsPrepArgs &Arg)
static void | do_StateDFS (XrdCmsBaseFR *rP, int rc)
static void | Report_Usage (XrdLink *lp)

## Public Attributes

unsigned int | ConfigID = 0
int | DiskFree = 0
int | DiskMinF = 0
int | DiskNums = 0
unsigned int | DiskTotal = 0
int | DiskUtil = 0
char | hasNet = 0
char * | Ident = 0
char | isBad = 0
char | isBound = 0
char | isConn = 0
char | isGone = 0
char | isKnown = 0
char | isMan = 0
char | isNoStage = 0
char | isOffline
char | isPeer = 0
char | isPerm = 0
char | isRW = 0
char | RoleID = 0
char | rsvd = 0
char | TimeZone = 0
char | TZValid = 0

## Static Public Attributes

static const char | allowsRW = 0x01
static const char | allowsSS = 0x02
static const char | isBlisted = 0x01
static const char | isDisabled = 0x02
static const char | isDoomed = 0x08
static const char | isSuspend = 0x04

## Friends

class | XrdCmsCluster

## Detailed Description

Definition at line 57 of file XrdCmsNode.hh.

## Constructor & Destructor Documentation

## XrdCmsNode()

XrdCmsNode::XrdCmsNode | ( | XrdLink * | lnkp,
|  | const char * | theIF = 0,
|  | const char * | sid = 0,
|  | int | port = 0,
|  | int | lvl = 0,
|  | int | id = -1 )

Definition at line 98 of file XrdCmsNode.cc.

{
static XrdSysMutex iMutex;
static const SMask_t smask_1(1);
static int iNum = 1;
Link = lnkp;
NodeMask = (id < 0 ? 0 : smask_1 << id);
NodeID = id;
isOffline= (lnkp == 0);
logload = Config.LogPerf;
myNID = strdup(nid ? nid : "?");
if ((myCID = index(myNID, ' '))) myCID++;
else myCID = myNID;
myLevel = lvl;
myVersion= kYR_Version;
// setName() will set the node identification information
//
setName(lnkp, theIF, (nid ? port : 0));
iMutex.Lock();
Instance = iNum++;
iMutex.UnLock();
}
SMask_t
unsigned long long SMask_t
Definition XrdCmsTypes.hh:33
XrdCmsConfig::LogPerf
int LogPerf
Definition XrdCmsConfig.hh:95
XrdCmsNode::isOffline
char isOffline
Definition XrdCmsNode.hh:64
XrdCmsNode::setName
void setName(XrdLink *lnkp, const char *theIF, int port)
Definition XrdCmsNode.cc:145
XrdSysMutex::Lock
void Lock()
Definition XrdSysPthread.hh:222
XrdSysMutex::UnLock
void UnLock()
Definition XrdSysPthread.hh:224
XrdCms::kYR_Version
static const unsigned char kYR_Version
Definition YProtocol.hh:80
XrdCms::Config
XrdCmsConfig Config
Definition XrdCmsConfig.cc:108

References XrdCms::Config, isOffline, XrdCms::kYR_Version, XrdSysMutex::Lock(), setName(), and XrdSysMutex::UnLock().

Here is the call graph for this function:

## ~XrdCmsNode()

XrdCmsNode::~XrdCmsNode | ( |  | ) |

Definition at line 129 of file XrdCmsNode.cc.

{
isOffline = 1; // STMutex not needed here
// Delete other appendages
//
if (cidP) {cidP->RemNode(this); cidP = 0;}
if (Ident) free(Ident);
if (myNID) free(myNID);
if (myName)free(myName);
}
XrdCmsNode::Ident
char * Ident
Definition XrdCmsNode.hh:61

References Ident, and isOffline.

## Member Function Documentation

## Delete() [1/3]

void XrdCmsNode::Delete | ( | XrdSysFusedMutex & | gMutex | ) |

Definition at line 184 of file XrdCmsNode.cc.

{
EPNAME("Delete");
static const int warnIntvl = 60;
int totWait = 0, tmoWarn = 60;
int tmoWait (Config.DELDelay < 3 ? Config.DELDelay : 3);
bool doDel = true;
// We need to make sure there are no references to this object. This is true
// when the refCnt is zero but only when we hold a global write lock that has
// been passed to us. As this node has been removed from all global tables
// at this point, we just need to make sure than no threads are poised to
// increase it. That can't happen if we obrtain a write lock. To start,
// get the node lock and do some debugging. Set the isGone flag even though it
// should be set. Note that we need to serialize with the refCnt as some
// threads may still be holding a reference to the node.
//
nodeMutex.Lock();
isGone = 1;
nodeMutex.UnLock();
DEBUG(Ident <<" refs=" <<refCnt);
// Now wait for things to simmer down. We wait for an appropriate time because
// we don't want to occupy this thread forever.
//
gMutex.WriteLock();
while(refCnt)
{if (totWait >= Config.DELDelay) {doDel = false; break;}
gMutex.UnLock();
if (totWait >= tmoWarn)
{unsigned int theCnt = refCnt;
DeleteWarn(theCnt);
tmoWarn += warnIntvl;
}
XrdSysTimer::Snooze(tmoWait);
totWait += tmoWait;
gMutex.WriteLock();
}
gMutex.UnLock();
// We can now safely delete this node
//
if (doDel) delete this;
else {char eBuff[256];
snprintf(eBuff, sizeof(eBuff),
" (%p) delete timeout; node object lost!", (void*)this);
Say.Emsg("Delete", Ident, eBuff);
}
}
DEBUG
#define DEBUG(x)
Definition XrdBwmTrace.hh:54
EPNAME
#define EPNAME(x)
Definition XrdBwmTrace.hh:56
XrdCmsConfig::DELDelay
int DELDelay
Definition XrdCmsConfig.hh:75
XrdCmsNode::isGone
char isGone
Definition XrdCmsNode.hh:72
XrdSysError::Emsg
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition XrdSysError.cc:95
XrdSysFusedMutex::UnLock
void UnLock()
Definition XrdSysPthread.hh:443
XrdSysFusedMutex::WriteLock
void WriteLock()
Definition XrdSysPthread.hh:441
XrdSysTimer::Snooze
static void Snooze(int seconds)
Definition XrdSysTimer.cc:168
XrdCms::Say
XrdSysError Say
Definition XrdCmsManager.cc:62

References XrdCms::Config, DEBUG, EPNAME, Ident, isGone, XrdCms::Say, XrdSysTimer::Snooze(), XrdSysFusedMutex::UnLock(), and XrdSysFusedMutex::WriteLock().

Here is the call graph for this function:

## Delete() [2/3]

void XrdCmsNode::Delete | ( | XrdSysMutex & | gMutex | ) |

inline

Definition at line 132 of file XrdCmsNode.hh.

{XrdSysFusedMutex gMeld(gMutex); Delete(gMeld);}
XrdCmsNode::Delete
void Delete(XrdSysRWLock &gMutex)
Definition XrdCmsNode.hh:129

References Delete().

Here is the call graph for this function:

## Delete() [3/3]

void XrdCmsNode::Delete | ( | XrdSysRWLock & | gMutex | ) |

inline

Definition at line 129 of file XrdCmsNode.hh.

{XrdSysFusedMutex gMeld(gMutex); Delete(gMeld);}

References Delete().

Referenced by Delete(), and Delete().

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

## Disc()

void XrdCmsNode::Disc | ( | const char * | reason = 0,
|  | int | needLock = 1 )

Definition at line 254 of file XrdCmsNode.cc.

{
// Indicate we are offline. If a lock is not need then we only need to set the
// offline flag as it's already properly protected. Otherwise, set the flag
// after we get the lock. This is indeed messy.
//
if (needLock) nodeMutex.Lock();
isOffline = 1; // STMutex is already held if needed
// If we are still connected, initiate a teardown. This may be done async as
// we are asking for a deferred close which will be followed by a full close.
//
if (isConn)
{Link->setEtext(reason);
Link->Close(1);
isConn = 0;
}
// Unlock ourselves if we locked ourselves
//
if (needLock) nodeMutex.UnLock();
}
XrdCmsNode::isConn
char isConn
Definition XrdCmsNode.hh:71

References isConn, and isOffline.

Referenced by XrdCmsCluster::Remove().

Here is the caller graph for this function:

## do_Avail()

const char * XrdCmsNode::do_Avail | ( | XrdCmsRRData & | Arg | ) |

Definition at line 284 of file XrdCmsNode.cc.

{
EPNAME("do_Avail")
// Process: avail <fsdsk> <util>
//
DiskFree = Arg.dskFree;
DiskUtil = static_cast<int>(Arg.dskUtil);
// Do some debugging
//
DEBUGR(DiskFree <<"MB free; " <<DiskUtil <<"% util");
return 0;
}
DEBUGR
#define DEBUGR(y)
Definition XrdCmsTrace.hh:51
XrdCmsNode::DiskFree
int DiskFree
Definition XrdCmsNode.hh:90
XrdCmsNode::DiskUtil
int DiskUtil
Definition XrdCmsNode.hh:91

References DEBUGR, DiskFree, DiskUtil, XrdCmsRRData::dskFree, and EPNAME.

## do_Chmod()

const char * XrdCmsNode::do_Chmod | ( | XrdCmsRRData & | Arg | ) |

Definition at line 305 of file XrdCmsNode.cc.

{
EPNAME("do_Chmod")
mode_t mode = 0;
int rc;
// Do some debugging
//
DEBUGR("mode " <<Arg.Mode <<' ' <<Arg.Path);
// We are don here if we have no data; otherwise convert the mode if we
// haven't done so already.
//
if (!Config.DiskOK) return 0;
if (!mode && !getMode(Arg.Mode, mode)) return "invalid mode";
// Attempt to change the mode either via call-out or the oss plug-in
//
if (Config.ProgCH) rc = fsExec(Config.ProgCH, Arg.Mode, Arg.Path);
else rc = Config.ossFS->Chmod(Arg.Path, mode);
// Return appropriate result
//
return (rc ? fsFail(Arg.Ident, "chmod", Arg.Path, rc) : 0);
}
Mode
int Mode
Definition XrdSecgsiProxy.cc:94
Path
XrdOucString Path
Definition XrdSecpwdSrvAdmin.cc:160
else
else
Definition XrdSysFAttrSun.icc:99
if
if(ec< 0) ec

References XrdCms::Config, DEBUGR, EPNAME, XrdCmsRRData::Ident, XrdCmsRRData::Mode, and XrdCmsRRData::Path.

## do_Disc()

const char * XrdCmsNode::do_Disc | ( | XrdCmsRRData & | Arg | ) |

Definition at line 339 of file XrdCmsNode.cc.

{
// Indicate we have received a disconnect
//
Say.Emsg("Node", Link->Name(), "requested a disconnect");
// If we must send a disc request, do so now
//
if (Config.asManager()) Link->Send((char *)&Arg.Request,sizeof(Arg.Request));
// Close the link and return an error
//
isOffline = 1; // STMutex not needed here
Link->Close(1);
return "."; // Signal disconnect
}
XrdCmsConfig::asManager
int asManager()
Definition XrdCmsConfig.hh:66
XrdCmsRRData::Request
XrdCms::CmsRRHdr Request
Definition XrdCmsRRData.hh:54

References XrdCms::Config, isOffline, XrdCmsRRData::Request, and XrdCms::Say.

## do_Gone()

const char * XrdCmsNode::do_Gone | ( | XrdCmsRRData & | Arg | ) |

Definition at line 364 of file XrdCmsNode.cc.

{
EPNAME("do_Gone")
static const SMask_t allNodes(~0);
int newgone;
// Do some debugging
//
TRACER(Files,Arg.Path);
// Update path information and delete this from the prep queue if we are a
// staging node. We can also be called via the admin end-point interface
// In this case, we have no cache and simply forward up the request.
//
if (Config.asManager())
{XrdCmsSelect Sel(XrdCmsSelect::Advisory, Arg.Path, Arg.PathLen-1);
newgone = Cache.DelFile(Sel, baseFS.isDFS() ? allNodes : NodeMask);
} else {
newgone = 1;
if (Config.DiskSS) PrepQ.Gone(Arg.Path);
}
// If we have no managers and we still have the file or never had it, return
//
if (!XrdCmsManager::Present() || !newgone) return 0;
// Back-propogate the gone to all of our managers
//
XrdCmsManager::Inform(Arg.Request, Arg.Buff, Arg.Dlen);
// All done
//
return 0;
}
TRACER
#define TRACER(x, y)
Definition XrdCmsTrace.hh:58
XrdCmsBaseFS::isDFS
int isDFS()
Definition XrdCmsBaseFS.hh:119
XrdCmsCache::DelFile
int DelFile(XrdCmsSelect &Sel, SMask_t mask)
Definition XrdCmsCache.cc:191
XrdCmsConfig::DiskSS
bool DiskSS
Definition XrdCmsConfig.hh:123
XrdCmsManager::Inform
static void Inform(const char *What, const char *Data, int Dlen)
Definition XrdCmsManager.cc:233
XrdCmsManager::Present
static bool Present()
Definition XrdCmsManager.hh:76
XrdCmsPrepare::Gone
void Gone(char *path)
Definition XrdCmsPrepare.cc:238
XrdCmsRRData::Dlen
int Dlen
Definition XrdCmsRRData.hh:73
XrdCmsRRData::Buff
char * Buff
Definition XrdCmsRRData.hh:71
XrdCmsRRData::Path
char * Path
Definition XrdCmsRRData.hh:55
XrdCmsRRData::PathLen
int PathLen
Definition XrdCmsRRData.hh:66
XrdCmsSelect::Advisory
@ Advisory
Definition XrdCmsSelect.hh:71
XrdCms::Cache
XrdCmsCache Cache
Definition XrdPfcFile.hh:204
XrdCms::baseFS
XrdCmsBaseFS baseFS
XrdCms::PrepQ
XrdCmsPrepare PrepQ
Definition XrdCmsPrepare.cc:54

References XrdCmsSelect::Advisory, XrdCms::baseFS, XrdCmsRRData::Buff, XrdCms::Cache, XrdCms::Config, XrdCmsRRData::Dlen, EPNAME, XrdCmsManager::Inform(), XrdCmsRRData::Path, XrdCmsRRData::PathLen, XrdCms::PrepQ, XrdCmsManager::Present(), XrdCmsRRData::Request, and TRACER.

Here is the call graph for this function:

## do_Have()

const char * XrdCmsNode::do_Have | ( | XrdCmsRRData & | Arg | ) |

Definition at line 406 of file XrdCmsNode.cc.

{
EPNAME("do_Have")
static const SMask_t allNodes(~0);
XrdCmsPInfo pinfo;
int isnew, Opts;
// Do some debugging
//
TRACER(Files, (Arg.Request.modifier&CmsHaveRequest::Pending ? "P ":"")
<<Arg.Path);
// Find if we can handle the file in r/w mode and if staging is present
//
Opts = (Cache.Paths.Find(Arg.Path, pinfo) && (pinfo.rwvec & NodeMask)
? XrdCmsSelect::Write : 0);
if (Arg.Request.modifier & CmsHaveRequest::Pending)
Opts |= XrdCmsSelect::Pending;
// Update path information. If we are exporting a shared-everything file system
// then we need to also provide the cache the current list of nodes and how
// they export the path in question for fast redispatch processing.
//
if (!Config.asManager()) isnew = 1;
else {XrdCmsSelect Sel(XrdCmsSelect::Advisory|Opts,Arg.Path,Arg.PathLen-1);
Sel.Path.Hash = Arg.Request.streamid;
if (baseFS.isDFS())
{Sel.Vec.hf = pinfo.rovec; Sel.Vec.wf = pinfo.rwvec;
isnew = Cache.AddFile(Sel, allNodes);
} else isnew = Cache.AddFile(Sel, NodeMask);
}
// Return if we have no managers or we already informed the managers
//
if (!XrdCmsManager::Present() || !isnew) return 0;
// Back-propogate the have to all of our managers
//
XrdCmsManager::Inform(Arg.Request, Arg.Buff, Arg.Dlen);
// All done
//
return 0;
}
XrdCmsCache::AddFile
int AddFile(XrdCmsSelect &Sel, SMask_t mask)
Definition XrdCmsCache.cc:117
XrdCmsPInfo::rovec
SMask_t rovec
Definition XrdCmsPList.hh:47
XrdCmsPInfo::rwvec
SMask_t rwvec
Definition XrdCmsPList.hh:48
XrdCms::CmsRRHdr::streamid
kXR_unt32 streamid
Definition YProtocol.hh:83

References XrdCmsSelect::Advisory, XrdCms::baseFS, XrdCmsRRData::Buff, XrdCms::Cache, XrdCms::Config, XrdCmsRRData::Dlen, EPNAME, XrdCmsKey::Hash, XrdCmsManager::Inform(), XrdCms::CmsRRHdr::modifier, XrdCmsRRData::Path, XrdCmsSelect::Path, XrdCmsRRData::PathLen, XrdCms::CmsHaveRequest::Pending, XrdCmsSelect::Pending, XrdCmsManager::Present(), XrdCmsRRData::Request, XrdCmsPInfo::rovec, XrdCmsPInfo::rwvec, XrdCms::CmsRRHdr::streamid, TRACER, XrdCmsSelect::Vec, and XrdCmsSelect::Write.

Here is the call graph for this function:

## do_Load()

const char * XrdCmsNode::do_Load | ( | XrdCmsRRData & | Arg | ) |

Definition at line 457 of file XrdCmsNode.cc.

{
EPNAME("do_Load")
uint32_t pcpu, pnet, pxeq, pmem, ppag, pdsk;
int temp;
// Process: load <cpu> <io> <load> <mem> <pag> <util> <rsvd> <dskFree>
// 0 1 2 3 4 5 6
pcpu = static_cast<uint32_t>(Arg.Opaque[CmsLoadRequest::cpuLoad]);
pnet = static_cast<uint32_t>(Arg.Opaque[CmsLoadRequest::netLoad]);
pxeq = static_cast<uint32_t>(Arg.Opaque[CmsLoadRequest::xeqLoad]);
pmem = static_cast<uint32_t>(Arg.Opaque[CmsLoadRequest::memLoad]);
ppag = static_cast<uint32_t>(Arg.Opaque[CmsLoadRequest::pagLoad]);
pdsk = static_cast<uint32_t>(Arg.Opaque[CmsLoadRequest::dskLoad]);
// Compute actual load value. Note that the update is not thread-kosher as we
// do not obtain a write lock. However, the values below use the single writer
// principal so other threads will eventually see a coherent picture. This is
// good enough for what these values are used for.
//
myLoad = Meter.calcLoad(pcpu, pnet, pxeq, pmem, ppag);
myMass = Meter.calcLoad(myLoad, pdsk);
DiskFree = Arg.dskFree;
DiskUtil = pdsk;
// Do some debugging
//
DEBUGR("cpu=" <<pcpu <<" net=" <<pnet <<" xeq=" <<pxeq
<<" mem=" <<pmem <<" pag=" <<ppag <<" dsk=" <<pdsk
<<"% " <<DiskFree <<"MB load=" <<myLoad <<" mass=" <<myMass);
// If we are also a manager then use this load figure to come up with
// an overall load to report when asked. If we get free space, then we
// must report that now so that we can be selected for allocation.
//
if (Config.asManager())
{Meter.Record(pcpu, pnet, pxeq, pmem, ppag, pdsk);
if (isRW && DiskFree != LastFree)
{mlMutex.Lock();
temp = LastFree; LastFree = DiskFree; Meter.setVirtUpdt();
if (!temp && DiskFree >= Config.DiskMin) do_Space(Arg);
mlMutex.UnLock();
}
}
// Report new load if need be
//
if (Config.LogPerf && !logload)
{char buff[1024];
long long tRefs = Cluster.Refs();
long long nRefs = static_cast<long long>(RefTotW + RefTotR)*100;
long long sRefs = static_cast<long long>(Share) * Shrin * 100;
int myShr = (Share ? Share : 100);
if (tRefs) {nRefs /= tRefs; sRefs /= tRefs;}
else nRefs = sRefs = 0;
snprintf(buff, sizeof(buff)-1,
"load=%d; cpu=%d net=%d inq=%d mem=%d pag=%d dsk=%d utl=%d "
"shr=[%d %lld %lld] ref=[%d %d]",
myLoad, pcpu, pnet, pxeq, pmem, ppag, Arg.dskFree, pdsk,
myShr, nRefs, sRefs, RefTotR+RefR, RefTotW+RefW);
Say.Emsg("Node", Name(), buff);
logload = Config.LogPerf;
} else logload--;
// Return as if we had gotten a pong
//
return do_Pong(Arg);
}
XrdCmsCluster::Refs
long long Refs()
Definition XrdCmsCluster.hh:174
XrdCmsConfig::DiskMin
int DiskMin
Definition XrdCmsConfig.hh:116
XrdCmsMeter::Record
void Record(int pcpu, int pnet, int pxeq, int pmem, int ppag, int pdsk)
Definition XrdCmsMeter.cc:351
XrdCmsMeter::setVirtUpdt
void setVirtUpdt()
Definition XrdCmsMeter.hh:78
XrdCmsNode::do_Space
const char * do_Space(XrdCmsRRData &Arg)
Definition XrdCmsNode.cc:1256
XrdCmsNode::Name
char * Name()
Definition XrdCmsNode.hh:158
XrdCmsNode::do_Pong
const char * do_Pong(XrdCmsRRData &Arg)
Definition XrdCmsNode.cc:860
XrdCmsNode::isRW
char isRW
Definition XrdCmsNode.hh:65
XrdCmsRRData::dskFree
unsigned int dskFree
Definition XrdCmsRRData.hh:67
XrdCms::Meter
XrdCmsMeter Meter
Definition XrdCmsMeter.hh:131
XrdCms::Cluster
XrdCmsCluster Cluster
Definition XrdCmsCluster.cc:72

References XrdCms::Cluster, XrdCms::Config, XrdCms::CmsLoadRequest::cpuLoad, DEBUGR, DiskFree, DiskUtil, do_Pong(), do_Space(), XrdCmsRRData::dskFree, XrdCms::CmsLoadRequest::dskLoad, EPNAME, isRW, XrdCms::CmsLoadRequest::memLoad, XrdCms::Meter, Name(), XrdCms::CmsLoadRequest::netLoad, XrdCmsRRData::Opaque, XrdCms::CmsLoadRequest::pagLoad, XrdCms::Say, and XrdCms::CmsLoadRequest::xeqLoad.

Here is the call graph for this function:

## do_Locate()

const char * XrdCmsNode::do_Locate | ( | XrdCmsRRData & | Arg | ) |

Definition at line 531 of file XrdCmsNode.cc.

{
EPNAME("do_Locate";)
XrdCmsRRQInfo reqInfo(Instance,RSlot,Arg.Request.streamid,Config.QryMinum);
XrdCmsSelect Sel(0, Arg.Path, Arg.PathLen-1);
XrdCmsSelected *sP = 0;
struct {kXR_unt32 Val;
char outbuff[CmsLocateRequest::RHLen*STMax];} Resp;
struct iovec ioV[2] = {{(char *)&Arg.Request, sizeof(Arg.Request)},
{(char *)&Resp, 0}};
const char *Why;
char eBuff[128], theopts[8], *toP = theopts;
XrdCmsCluster::CmsLSOpts lsopts = XrdCmsCluster::LS_NULL;
XrdNetIF::ifType ifType;
int rc, bytes;
bool lsuniq = false, oksel = false, lsall = (*Arg.Path == '*');
// Get the right interface selection options
//
ifType = ifVec[(Arg.Opts & CmsLocateRequest::kYR_retipmsk)
>> CmsLocateRequest::kYR_retipsft];
// Indicate whether we want a name or an actual address
//
lsopts = (Arg.Opts & CmsLocateRequest::kYR_retname
? XrdCmsCluster::LS_IDNT : XrdCmsCluster::LS_IPO);
// Indicate if only a single server entry should be listed
//
if (Arg.Opts & CmsLocateRequest::kYR_retuniq && baseFS.isDFS())
{lsuniq = true; *toP++='u';}
// Indicate whether we can ignore network restrictions
//
if (Arg.Opts & CmsLocateRequest::kYR_listall)
lsopts |= XrdCmsCluster::LS_ANY;
// Indicate whether we ony want to list a single entry
//
// Handle private networks here
//
if (Arg.Opts & CmsLocateRequest::kYR_prvtnet)
{XrdNetIF::Privatize(ifType);
*toP++='P';
}
// Encode if type into the options
//
Sel.Opts = static_cast<int>(ifType) & XrdCmsSelect::ifWant;
lsopts = lsopts | static_cast<XrdCmsCluster::CmsLSOpts>(ifType);
// Grab various options
//
if (Arg.Opts & CmsLocateRequest::kYR_refresh)
{Sel.Opts = XrdCmsSelect::Refresh; *toP++='s';}
if (Arg.Opts & CmsLocateRequest::kYR_asap)
{Sel.Opts |= XrdCmsSelect::Asap; *toP++='i'; Sel.InfoP = &reqInfo;
reqInfo.lsLU = static_cast<char>(lsopts);
}
else Sel.InfoP = 0;
// Do some debugging
//
*toP = '\0';
DEBUGR(theopts <<' ' <<Arg.Path);
// Perform location
//
if ((rc = Cluster.Locate(Sel)))
{if (rc > 0)
{Arg.Request.rrCode = kYR_wait;
bytes = sizeof(Resp.Val); Why = "delay ";
} else {
if (rc == XrdCmsCluster::Wait4CBk) return 0;
Arg.Request.rrCode = kYR_error;
rc = kYR_ENOENT; Why = "miss ";
bytes = strlcpy(Resp.outbuff, "No servers have access to the file",
sizeof(Resp.outbuff)) + sizeof(Resp.Val) + 1;
}
} else {Why = "?"; bytes = 0;}
// List the servers
//
if (!rc)
{if (!Sel.Vec.hf || !(sP=Cluster.List(Sel.Vec.hf, lsopts, oksel)))
{const char *eTxt;
Arg.Request.rrCode = kYR_error;
if (oksel)
{rc = kYR_ENETUNREACH; Why = "unreachable ";
sprintf(eBuff, "No servers are reachable via %s network",
XrdNetIF::Name(ifType));
eTxt = eBuff;
} else {
rc = kYR_ENOENT; Why = "none ";
eTxt = "No servers have the file";
}
bytes = strlcpy(Resp.outbuff, eTxt,
sizeof(Resp.outbuff)) + sizeof(Resp.Val) + 1;
} else rc = 0;
}
// Either prepare to send an error or format the result
//
if (rc)
{Resp.Val = htonl(rc);
DEBUGR(Why <<Arg.Path);
} else {
bytes = do_LocFmt(Resp.outbuff, sP, Sel.Vec.pf, Sel.Vec.wf, lsall,lsuniq)
+ sizeof(Resp.Val) + 1;
Resp.Val = 0;
Arg.Request.rrCode = kYR_data;
}
// Send off the response
//
Arg.Request.datalen = htons(bytes);
ioV[1].iov_len = bytes;
Link->Send(ioV, 2, bytes+sizeof(Arg.Request));
return 0;
}
kXR_unt32
unsigned int kXR_unt32
Definition XPtypes.hh:90
STMax
#define STMax
Definition XrdCmsTypes.hh:39
strlcpy
size_t strlcpy(char *dst, const char *src, size_t sz)
Definition XrdSysPlatform.cc:60
XrdCmsCluster::Locate
int Locate(XrdCmsSelect &Sel)
Definition XrdCmsCluster.cc:596
XrdCmsCluster::List
XrdCmsSelected * List(SMask_t mask, CmsLSOpts opts, bool &oksel)
Definition XrdCmsCluster.cc:533
XrdCmsCluster::Wait4CBk
static const int Wait4CBk
Definition XrdCmsCluster.hh:189
XrdCmsCluster::CmsLSOpts
CmsLSOpts
Definition XrdCmsCluster.hh:155
XrdCmsCluster::LS_IDNT
@ LS_IDNT
Definition XrdCmsCluster.hh:155
XrdCmsCluster::LS_ANY
@ LS_ANY
Definition XrdCmsCluster.hh:156
XrdCmsCluster::LS_NULL
@ LS_NULL
Definition XrdCmsCluster.hh:155
XrdCmsCluster::LS_IPO
@ LS_IPO
Definition XrdCmsCluster.hh:155
XrdCmsConfig::QryMinum
int QryMinum
Definition XrdCmsConfig.hh:80
XrdCmsNode::do_LocFmt
static int do_LocFmt(char *buff, XrdCmsSelected *sP, SMask_t pf, SMask_t wf, bool lsall=false, bool lsuniq=false)
Definition XrdCmsNode.cc:657
XrdCmsRRData::Opts
unsigned int Opts
Definition XrdCmsRRData.hh:65
XrdCmsSelect::ifWant
@ ifWant
Definition XrdCmsSelect.hh:73
XrdCmsSelect::Refresh
@ Refresh
Definition XrdCmsSelect.hh:63
XrdCmsSelect::Asap
@ Asap
Definition XrdCmsSelect.hh:64
XrdNetIF::Name
static const char * Name(ifType ifT)
Definition XrdNetIF.hh:266
XrdNetIF::ifType
ifType
The enum that is used to index into ifData to get appropriate interface.
Definition XrdNetIF.hh:64
XrdNetIF::Privatize
static void Privatize(ifType &x)
Definition XrdNetIF.hh:284
XrdCms::CmsRRHdr::datalen
kXR_unt16 datalen
Definition YProtocol.hh:86
XrdCms::kYR_ENETUNREACH
@ kYR_ENETUNREACH
Definition YProtocol.hh:158
XrdCms::kYR_ENOENT
@ kYR_ENOENT
Definition YProtocol.hh:150
XrdCms::kYR_data
@ kYR_data
Definition YProtocol.hh:141
XrdCms::kYR_wait
@ kYR_wait
Definition YProtocol.hh:144
XrdCms::kYR_error
@ kYR_error
Definition YProtocol.hh:142
XrdCms::CmsRRHdr::rrCode
kXR_char rrCode
Definition YProtocol.hh:84
XrdCms::CmsLocateRequest::kYR_retuniq
@ kYR_retuniq
Definition YProtocol.hh:251
XrdCms::CmsLocateRequest::kYR_retipsft
@ kYR_retipsft
Definition YProtocol.hh:258
XrdCms::CmsLocateRequest::kYR_prvtnet
@ kYR_prvtnet
Definition YProtocol.hh:260
XrdCms::CmsLocateRequest::kYR_retname
@ kYR_retname
Definition YProtocol.hh:250
XrdCms::CmsLocateRequest::kYR_refresh
@ kYR_refresh
Definition YProtocol.hh:249
XrdCms::CmsLocateRequest::kYR_retipmsk
@ kYR_retipmsk
Definition YProtocol.hh:257
XrdCms::CmsLocateRequest::kYR_asap
@ kYR_asap
Definition YProtocol.hh:252
XrdCms::CmsLocateRequest::kYR_listall
@ kYR_listall
Definition YProtocol.hh:259
XrdCms::CmsLocateRequest::RHLen
static const int RHLen
Definition YProtocol.hh:264

References XrdCmsSelect::Asap, XrdCms::baseFS, XrdCms::Cluster, XrdCms::Config, XrdCms::CmsRRHdr::datalen, DEBUGR, do_LocFmt(), EPNAME, XrdCmsSelect::ifWant, XrdCmsSelect::InfoP, XrdCms::CmsLocateRequest::kYR_asap, XrdCms::kYR_data, XrdCms::kYR_ENETUNREACH, XrdCms::kYR_ENOENT, XrdCms::kYR_error, XrdCms::CmsLocateRequest::kYR_listall, XrdCms::CmsLocateRequest::kYR_prvtnet, XrdCms::CmsLocateRequest::kYR_refresh, XrdCms::CmsLocateRequest::kYR_retipmsk, XrdCms::CmsLocateRequest::kYR_retipsft, XrdCms::CmsLocateRequest::kYR_retname, XrdCms::CmsLocateRequest::kYR_retuniq, XrdCms::kYR_wait, XrdCmsCluster::LS_ANY, XrdCmsCluster::LS_IDNT, XrdCmsCluster::LS_IPO, XrdCmsCluster::LS_NULL, XrdCmsRRQInfo::lsLU, XrdNetIF::Name(), XrdCmsRRData::Opts, XrdCmsSelect::Opts, XrdCmsRRData::Path, XrdCmsRRData::PathLen, XrdNetIF::Privatize(), XrdCmsSelect::Refresh, XrdCmsRRData::Request, XrdCms::CmsLocateRequest::RHLen, XrdCms::CmsRRHdr::rrCode, STMax, XrdCms::CmsRRHdr::streamid, strlcpy(), XrdCmsSelect::Vec, and XrdCmsCluster::Wait4CBk.

Here is the call graph for this function:

## do_LocFmt()

int XrdCmsNode::do_LocFmt | ( | char * | buff,
|  | XrdCmsSelected * | sP,
|  | SMask_t | pf,
|  | SMask_t | wf,
|  | bool | lsall = false,
|  | bool | lsuniq = false )

static

Definition at line 657 of file XrdCmsNode.cc.

{
static const int Skip = (XrdCmsSelected::Disable | XrdCmsSelected::Offline);
static const int Hung = (XrdCmsSelected::Disable | XrdCmsSelected::Offline
| XrdCmsSelected::Suspend);
XrdCmsSelected *pP;
char *oP = buff;
// If only unique entries are wanted then we need to only let through
// all non-servers and one server (prefereably a r/w one)
//
if (!lsall && lsuniq)
{XrdCmsSelected *xP = 0;
bool haverw = false;
pP = sP;
while(pP)
{if (!(pP->Status & (XrdCmsSelected::isMangr | Skip)))
{if (haverw) pP->Status |= Skip;
else {if (xP) xP->Status |= Skip;
xP = pP;
haverw = (pP->Mask & wfVec) != 0;
}
}
pP = pP->next;
}
}
// format out the request as follows:
// 01234567810123456789212345678
// xy[::123.123.123.123]:123456
//
if (lsall)
while(sP)
{*oP = (sP->Status & XrdCmsSelected::isMangr ? 'M' : 'S');
if (sP->Status & Hung) *oP = tolower(*oP);
*(oP+1) = (sP->Mask & wfVec ? 'w' : 'r');
strcpy(oP+2, sP->Ident); oP += sP->IdentLen + 2;
if (sP->next) *oP++ = ' ';
pP = sP; sP = sP->next; delete pP;
}
else
while(sP)
{if (!(sP->Status & Skip))
{*oP = (sP->Status & XrdCmsSelected::isMangr ? 'M' : 'S');
if (sP->Mask & pfVec) *oP = tolower(*oP);
*(oP+1) = (sP->Mask & wfVec ? 'w' : 'r');
strcpy(oP+2, sP->Ident); oP += sP->IdentLen + 2;
if (sP->next) *oP++ = ' ';
}
pP = sP; sP = sP->next; delete pP;
}
// Send of the result
//
*oP = '\0';
return (oP - buff);
}
XrdCmsSelected::IdentLen
int IdentLen
Definition XrdCmsSelect.hh:113
XrdCmsSelected::Mask
SMask_t Mask
Definition XrdCmsSelect.hh:111
XrdCmsSelected::Status
int Status
Definition XrdCmsSelect.hh:122
XrdCmsSelected::Ident
char Ident[IdentSize]
Definition XrdCmsSelect.hh:114
XrdCmsSelected::next
XrdCmsSelected * next
Definition XrdCmsSelect.hh:110
XrdCmsSelected::Disable
@ Disable
Definition XrdCmsSelect.hh:124
XrdCmsSelected::Suspend
@ Suspend
Definition XrdCmsSelect.hh:127
XrdCmsSelected::Offline
@ Offline
Definition XrdCmsSelect.hh:126
XrdCmsSelected::isMangr
@ isMangr
Definition XrdCmsSelect.hh:129

References XrdCmsSelected::Disable, XrdCmsSelected::Ident, XrdCmsSelected::IdentLen, XrdCmsSelected::isMangr, XrdCmsSelected::Mask, XrdCmsSelected::next, XrdCmsSelected::Offline, XrdCmsSelected::Status, and XrdCmsSelected::Suspend.

Referenced by do_Locate().

Here is the caller graph for this function:

## do_Mkdir()

const char * XrdCmsNode::do_Mkdir | ( | XrdCmsRRData & | Arg | ) |

Definition at line 722 of file XrdCmsNode.cc.

{
EPNAME("do_Mkdir")
mode_t mode = 0;
int rc;
// Do some debugging
//
DEBUGR("mode " <<Arg.Mode <<' ' <<Arg.Path);
// We are don here if we have no data; otherwise convert the mode if we
// haven't done so already.
//
if (!Config.DiskOK) return 0;
if (!mode && !getMode(Arg.Mode, mode)) return "invalid mode";
// Attempt to create the directory either via call-out of oss plug-in
//
if (Config.ProgMD) rc = fsExec(Config.ProgMD, Arg.Mode, Arg.Path);
else rc = Config.ossFS->Mkdir(Arg.Path, mode);
// Return appropriate result
//
return (rc ? fsFail(Arg.Ident, "mkdir", Arg.Path, rc) : 0);
}

References XrdCms::Config, DEBUGR, EPNAME, XrdCmsRRData::Ident, XrdCmsRRData::Mode, and XrdCmsRRData::Path.

## do_Mkpath()

const char * XrdCmsNode::do_Mkpath | ( | XrdCmsRRData & | Arg | ) |

Definition at line 754 of file XrdCmsNode.cc.

{
EPNAME("do_Mkpath")
mode_t mode = 0;
int rc;
// Do some debugging
//
DEBUGR("mode " <<Arg.Mode <<' ' <<Arg.Path);
// We are don here if we have no data; otherwise convert the mode if we
// haven't done so already.
//
if (!Config.DiskOK) return 0;
if (!mode && !getMode(Arg.Mode, mode)) return "invalid mode";
// Attempt to create the directory path via call-out or oss plugin
//
if (Config.ProgMP) rc = fsExec(Config.ProgMP, Arg.Mode, Arg.Path);
else rc = Config.ossFS->Mkdir(Arg.Path, mode, 1);
// Return appropriate result
//
return (rc ? fsFail(Arg.Ident, "mkpath", Arg.Path, rc) : 0);
}

References XrdCms::Config, DEBUGR, EPNAME, XrdCmsRRData::Ident, XrdCmsRRData::Mode, and XrdCmsRRData::Path.

## do_Mv()

const char * XrdCmsNode::do_Mv | ( | XrdCmsRRData & | Arg | ) |

Definition at line 786 of file XrdCmsNode.cc.

{
EPNAME("do_Mv")
static const SMask_t allNodes(~0);
int rc;
// Do some debugging
//
DEBUGR(Arg.Path <<" to " <<Arg.Path2);
// If we are not a server, if must remove references to the old and new names
// from our cache. This is independent of how the raname is handled. We need
// not back percolate the mv since it was hanled top down in the first place.
// Note that we will scuttle the mv if the target file exists somewhere.
//
if (!Config.DiskOK)
{XrdCmsSelect Sel1(XrdCmsSelect::Defer, Arg.Path, strlen(Arg.Path ));
XrdCmsSelect Sel2(XrdCmsSelect::Defer, Arg.Path2,strlen(Arg.Path2));
// Setup select data (note that mv does not allow fast redirect)
//
Sel2.iovP = 0; Sel2.iovN = 0;
Sel2.InfoP = 0; // No fast redirects
Sel2.nmask = SMask_t(0);
// Perform selection
//
if ((rc = Cluster.Select(Sel2)))
{if (rc > 0) {Arg.waitVal = rc; return "!mv";}
else if (Sel2.Vec.hf)
{Say.Emsg("do_Mv",Arg.Path2,"exists; mv failed for",Arg.Path);
return "target file exists";
}
}
Cache.DelFile(Sel2, allNodes);
Cache.DelFile(Sel1, allNodes);
return 0;
}
// Rename the file via call-out or oss plug-in (we used to do this via a requeue
// to the local xrootd but it's no longer necessary).
//
if (Config.ProgMV) rc = fsExec(Config.ProgMV, Arg.Path, Arg.Path2);
else rc = Config.ossFS->Rename(Arg.Path, Arg.Path2);
// Return appropriate result
//
return (rc ? fsFail(Arg.Ident, "mv", Arg.Path, rc) : 0);
}
XrdCmsCluster::Select
int Select(XrdCmsSelect &Sel)
Definition XrdCmsCluster.cc:931
XrdCmsConfig::ossFS
XrdOss * ossFS
Definition XrdCmsConfig.hh:186
XrdCmsConfig::ProgMV
XrdOucProg * ProgMV
Definition XrdCmsConfig.hh:190
XrdCmsRRData::Ident
char * Ident
Definition XrdCmsRRData.hh:64
XrdCmsRRData::Path2
char * Path2
Definition XrdCmsRRData.hh:57
XrdCmsSelect::Defer
@ Defer
Definition XrdCmsSelect.hh:61
XrdOss::Rename
virtual int Rename(const char *oPath, const char *nPath, XrdOucEnv *oEnvP=0, XrdOucEnv *nEnvP=0)=0

References XrdCms::Cache, XrdCms::Cluster, XrdCms::Config, DEBUGR, XrdCmsSelect::Defer, EPNAME, XrdCmsRRData::Ident, XrdCmsSelect::InfoP, XrdCmsSelect::iovN, XrdCmsSelect::iovP, XrdCmsSelect::nmask, XrdCmsRRData::Path, XrdCmsRRData::Path2, XrdCms::Say, and XrdCmsSelect::Vec.

## do_Ping()

const char * XrdCmsNode::do_Ping | ( | XrdCmsRRData & | Arg | ) |

Definition at line 842 of file XrdCmsNode.cc.

{
static CmsPongRequest pongIt = {{0, kYR_pong, 0, 0}};
// Process: ping
// Respond: pong
//
if (isBad & isDoomed) return ".redirected";
Link->Send((char *)&pongIt, sizeof(pongIt));
return 0;
}
XrdCmsNode::isBad
char isBad
Definition XrdCmsNode.hh:63
XrdCmsNode::isDoomed
static const char isDoomed
Definition XrdCmsNode.hh:82
XrdCms::kYR_pong
@ kYR_pong
Definition YProtocol.hh:108

References isBad, isDoomed, and XrdCms::kYR_pong.

## do_Pong()

const char * XrdCmsNode::do_Pong | ( | XrdCmsRRData & | Arg | ) |

Definition at line 860 of file XrdCmsNode.cc.

{
// Process: pong
// Reponds: n/a
return 0;
}

Referenced by do_Load().

Here is the caller graph for this function:

## do_PrepAdd()

const char * XrdCmsNode::do_PrepAdd | ( | XrdCmsRRData & | Arg | ) |

Definition at line 872 of file XrdCmsNode.cc.

{
EPNAME("do_PrepAdd")
// Do some debugging
//
DEBUGR("parms: " <<Arg.Reqid <<' ' <<Arg.Notify <<' ' <<Arg.Prty <<' '
<<Arg.Mode <<' ' <<Arg.Path);
// Queue this request for async processing
//
(new XrdCmsPrepArgs(Arg))->Queue();
return 0;
}

References DEBUGR, EPNAME, XrdCmsRRData::Mode, XrdCmsRRData::Notify, XrdCmsRRData::Path, XrdCmsRRData::Prty, and XrdCmsRRData::Reqid.

## do_PrepDel()

const char * XrdCmsNode::do_PrepDel | ( | XrdCmsRRData & | Arg | ) |

Definition at line 891 of file XrdCmsNode.cc.

{
EPNAME("do_PrepDel")
// Do some debugging
//
DEBUGR("reqid " <<Arg.Reqid);
// Cancel the request if applicable.
//
if (Config.DiskOK)
{if (!Config.DiskSS) {DEBUGR("ignoring cancel prepare " <<Arg.Reqid);}
else {DEBUGR("canceling prepare " <<Arg.Reqid);
PrepQ.Del(Arg.Reqid);
}
}
return 0;
}

References XrdCms::Config, DEBUGR, EPNAME, XrdCms::PrepQ, and XrdCmsRRData::Reqid.

## do_Rm()

const char * XrdCmsNode::do_Rm | ( | XrdCmsRRData & | Arg | ) |

Definition at line 916 of file XrdCmsNode.cc.

{
EPNAME("do_Rm")
static const SMask_t allNodes(~0);
int rc;
// Do some debugging
//
DEBUGR(Arg.Path);
// If we have no data then we should remove this file from our cache
//
if (!Config.DiskOK)
{XrdCmsSelect Sel(0, Arg.Path, strlen(Arg.Path));
Cache.DelFile(Sel, allNodes);
return 0;
}
// Remove the file either via call-out or the oss plugin. We used to requeue
// the request to the local xrootd but this is no longer needed.
//
if (Config.ProgRM) rc = fsExec(Config.ProgRM, Arg.Path);
else rc = Config.ossFS->Unlink(Arg.Path);
// Return appropriate result
//
return (rc ? fsFail(Arg.Ident, "rm", Arg.Path, rc) : 0);
}
XrdCmsConfig::ProgRM
XrdOucProg * ProgRM
Definition XrdCmsConfig.hh:192
XrdOss::Unlink
virtual int Unlink(const char *path, int Opts=0, XrdOucEnv *envP=0)=0

References XrdCms::Cache, XrdCms::Config, DEBUGR, EPNAME, XrdCmsRRData::Ident, and XrdCmsRRData::Path.

## do_Rmdir()

const char * XrdCmsNode::do_Rmdir | ( | XrdCmsRRData & | Arg | ) |

Definition at line 951 of file XrdCmsNode.cc.

{
EPNAME("do_Rmdir")
static const SMask_t allNodes(~0);
int rc;
// Do some debugging
//
DEBUGR(Arg.Path);
// If we have no data then we should remove this directory from our cache
//
if (!Config.DiskOK)
{XrdCmsSelect Sel(0, Arg.Path, strlen(Arg.Path));
Cache.DelFile(Sel, allNodes);
return 0;
}
// Remove the directory either via call-out or the oss plug-in (we used to
// do this by requeing the request to the local xrootd; no longer needed).
//
if (Config.ProgRD) rc = fsExec(Config.ProgRD, Arg.Path);
else rc = Config.ossFS->Remdir(Arg.Path);
// Return appropriate result
//
return (rc ? fsFail(Arg.Ident, "rmdir", Arg.Path, rc) : 0);
}
XrdCmsConfig::ProgRD
XrdOucProg * ProgRD
Definition XrdCmsConfig.hh:191
XrdOss::Remdir
virtual int Remdir(const char *path, int Opts=0, XrdOucEnv *envP=0)=0

References XrdCms::Cache, XrdCms::Config, DEBUGR, EPNAME, XrdCmsRRData::Ident, and XrdCmsRRData::Path.

## do_SelAvoid()

int XrdCmsNode::do_SelAvoid | ( | XrdCmsRRData & | Arg,
|  | XrdCmsSelect & | Sel,
|  | char * | Avoid,
|  | bool & | doRedir )

Definition at line 984 of file XrdCmsNode.cc.

{
XrdNetAddr avoidAddr;
char *Comma;
int avNum = 0;
// Process the avoid list
//
Sel.InfoP = 0;
do {if ((Comma = index(Avoid,','))) *Comma = '\0';
if (*Avoid == '+') Sel.nmask |= Cluster.getMask(Avoid+1);
else if (!avoidAddr.Set(Avoid,0))
Sel.nmask |= Cluster.getMask(&avoidAddr);
Avoid = Comma+1; avNum++;
} while(Comma && *Avoid);
// Check why we have an avoid list. For dfs style clusters, the limits on
// selections are handled by the basefs object.
//
if (baseFS.isDFS())
{if (Arg.Opts & CmsSelectRequest::kYR_tryRSEL)
Sel.Opts |= XrdCmsSelect::NoTryLim;
return 0;
}
// This is a standard cluster, check if client is expanding the server base
// and whether or not this is allowed in this cluster.
//
if ((Arg.Opts & CmsSelectRequest::kYR_tryMSRC) && !Config.MultiSrc)
{if (Config.msRdrHost)
{strcpy(Sel.Resp.Data, Config.msRdrHost); // Gauranteed to fit!
Sel.Resp.DLen = Config.msRdrHLen;
Sel.Resp.Port = Config.msRdrPort;
doRedir = true;
return -1;
}
strncpy(Sel.Resp.Data, msrcmsg, sizeof(Sel.Resp.Data));
Sel.Resp.DLen = msrclen;
if (Arg.Opts & CmsSelectRequest::kYR_tryRSEL) Sel.Resp.Port = kYR_EPERM;
else Sel.Resp.Port = kYR_ENOENT;
return XrdCmsCluster::EReplete;
}
// Check if we exceeded the retry count
//
if (avNum > Config.MaxRetries)
{if (Config.mrRdrHost)
{strcpy(Sel.Resp.Data, Config.mrRdrHost); // Gauranteed to fit!
Sel.Resp.DLen = Config.mrRdrHLen;
Sel.Resp.Port = Config.mrRdrPort;
doRedir = true;
} else {
strncpy(Sel.Resp.Data, mtrymsg, sizeof(Sel.Resp.Data));
Sel.Resp.DLen = mtrylen;
}
return -1;
}
// We succeeded, indicate selection can proceed.
//
return 0;
}
XrdCmsCluster::getMask
SMask_t getMask(const XrdNetAddr *addr)
Definition XrdCmsCluster.cc:500
XrdCmsCluster::EReplete
static const int EReplete
Definition XrdCmsCluster.hh:191
XrdCmsConfig::MultiSrc
char MultiSrc
Definition XrdCmsConfig.hh:114
XrdCmsConfig::msRdrPort
int msRdrPort
Definition XrdCmsConfig.hh:147
XrdCmsConfig::mrRdrHLen
int mrRdrHLen
Definition XrdCmsConfig.hh:143
XrdCmsConfig::MaxRetries
int MaxRetries
Definition XrdCmsConfig.hh:88
XrdCmsConfig::mrRdrPort
int mrRdrPort
Definition XrdCmsConfig.hh:144
XrdCmsConfig::mrRdrHost
char * mrRdrHost
Definition XrdCmsConfig.hh:142
XrdCmsConfig::msRdrHLen
int msRdrHLen
Definition XrdCmsConfig.hh:146
XrdCmsConfig::msRdrHost
char * msRdrHost
Definition XrdCmsConfig.hh:145
XrdCmsSelect::NoTryLim
@ NoTryLim
Definition XrdCmsSelect.hh:69
XrdCmsSelect::Opts
int Opts
Definition XrdCmsSelect.hh:52
XrdCmsSelect::Resp
struct XrdCmsSelect::@372246154012353073336061155127145056202367365025 Resp
XrdCmsSelect::InfoP
XrdCmsRRQInfo * InfoP
Definition XrdCmsSelect.hh:47
XrdCmsSelect::nmask
SMask_t nmask
Definition XrdCmsSelect.hh:48
XrdNetAddr::Set
const char * Set(const char *hSpec, int pNum=PortInSpec)
Definition XrdNetAddr.cc:216
XrdCms::kYR_EPERM
@ kYR_EPERM
Definition YProtocol.hh:151
XrdCms::CmsSelectRequest::kYR_tryMSRC
@ kYR_tryMSRC
Definition YProtocol.hh:516
XrdCms::CmsSelectRequest::kYR_tryRSEL
@ kYR_tryRSEL
Definition YProtocol.hh:514

References XrdCms::baseFS, XrdCms::Cluster, XrdCms::Config, XrdCmsCluster::EReplete, XrdCmsSelect::InfoP, XrdCms::kYR_ENOENT, XrdCms::kYR_EPERM, XrdCms::CmsSelectRequest::kYR_tryMSRC, XrdCms::CmsSelectRequest::kYR_tryRSEL, XrdCmsSelect::nmask, XrdCmsSelect::NoTryLim, XrdCmsRRData::Opts, XrdCmsSelect::Opts, XrdCmsSelect::Resp, and XrdNetAddr::Set().

Referenced by do_Select().

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

## do_Select()

const char * XrdCmsNode::do_Select | ( | XrdCmsRRData & | Arg | ) |

Definition at line 1055 of file XrdCmsNode.cc.

{
EPNAME("do_Select")
// kXR_NotFound kXR_IOError kXR_FSError kXR_ServerError
static int rtEC[] = {kYR_ENOENT, kYR_EIO, kYR_FSError, kYR_SrvError};
XrdCmsRRQInfo reqInfo(Instance,RSlot,Arg.Request.streamid,Config.QryMinum);
XrdCmsSelect Sel(XrdCmsSelect::Peers, Arg.Path, Arg.PathLen-1);
struct iovec ioV[2];
char theopts[16], *toP = theopts;
XrdNetIF::ifType ifType;
int rc, bytes;
// Init select data (note that refresh supresses fast redirects)
//
Sel.iovP = 0; Sel.iovN = 0; Sel.InfoP = &reqInfo;
// Determine what interface to return to the client
//
ifType = ifVec[(Arg.Opts & CmsSelectRequest::kYR_retipmsk)
>> CmsSelectRequest::kYR_retipsft];
if (Arg.Opts & CmsSelectRequest::kYR_prvtnet)
{XrdNetIF::Privatize(ifType); *toP++='P';}
Sel.Opts |= static_cast<int>(ifType) & XrdCmsSelect::ifWant;
// Complete the arguments to select
//
if (Arg.Opts & CmsSelectRequest::kYR_refresh)
{Sel.Opts |= XrdCmsSelect::Refresh; *toP++='s';}
if (Arg.Opts & CmsSelectRequest::kYR_online)
{Sel.Opts |= XrdCmsSelect::Online; *toP++='o';}
if (Arg.Opts & CmsSelectRequest::kYR_stat)
{Sel.Opts |= XrdCmsSelect::noBind; *toP++='x';}
else {if (Arg.Opts & CmsSelectRequest::kYR_trunc)
{Sel.Opts |= XrdCmsSelect::Write | XrdCmsSelect::Trunc; *toP++='t';}
if (Arg.Opts & CmsSelectRequest::kYR_write)
{Sel.Opts |= XrdCmsSelect::Write; *toP++='w';
if (Arg.Opts & CmsSelectRequest::kYR_mwfiles || !Config.DoMWChk)
{Sel.Opts |= XrdCmsSelect::MWFiles; *(toP-1)='W';}
}
if (Arg.Opts & CmsSelectRequest::kYR_metaop)
{Sel.Opts |= XrdCmsSelect::isMeta; *toP++='m';
if (!(Arg.Opts & CmsSelectRequest::kYR_write))
{Sel.Opts |= XrdCmsSelect::isDir; *toP++='D';}
}
if (Arg.Opts & CmsSelectRequest::kYR_create)
{Sel.Opts |= XrdCmsSelect::Write|XrdCmsSelect::NewFile; *toP++='c';
if (Arg.Opts & CmsSelectRequest::kYR_replica)
{Sel.Opts |= XrdCmsSelect::Replica; *toP++='+';}
}
}
*toP = '\0';
// If the client can override selection mode, check if this has been done. Note
// that true packed selection turns off fast redirect.
//
if (Config.sched_Force || !(Arg.Opts & CmsSelectRequest::kYR_aSpec))
{if (Config.sched_Pack)
{Sel.Opts |= XrdCmsSelect::Pack;
if (Config.sched_Pack > 1) Sel.InfoP = 0;
if (!Config.sched_Level) Sel.Opts |= XrdCmsSelect::UseRef;
}
} else {
if (Arg.Opts & CmsSelectRequest::kYR_aPack)
{Sel.Opts |= XrdCmsSelect::Pack;
if (Arg.Opts & CmsSelectRequest::kYR_aWait) Sel.InfoP = 0;
if ((Arg.Opts & CmsSelectRequest::kYR_aPack) ==
CmsSelectRequest::kYR_aStrict)
Sel.Opts |= XrdCmsSelect::UseRef;
}
}
// Compute alternate hash.
//
if (Sel.Opts & XrdCmsSelect::Pack && Config.sched_AffPC
&& Sel.Path.Len > 3) setHash(Sel, Config.sched_AffPC);
// Check if an avoid node present. If so, this is ineligible for fast redirect.
//
bool doRedir = false;
Sel.nmask = SMask_t(0);
if (Arg.Avoid) rc = do_SelAvoid(Arg, Sel, Arg.Avoid, doRedir);
else rc = 0;
// Perform selection
//
if (!doRedir && (rc || (rc = Cluster.Select(Sel))))
{if (rc > 0)
{Arg.Request.rrCode = kYR_wait;
Sel.Resp.Port = rc;
Sel.Resp.DLen = 0;
DEBUGR("delay " <<rc <<' ' <<Arg.Path);
} else {
Arg.Request.rrCode = kYR_error;
if (rc != XrdCmsCluster::EReplete) // if error info has not been set
{if (rc == XrdCmsCluster::RetryErr)
{int rtRC = (Arg.Opts & CmsSelectRequest::kYR_tryMASK)
>> CmsSelectRequest::kYR_trySHFT;
Sel.Resp.Port = rtEC[rtRC];
} else {
Sel.Resp.Port = kYR_ENOENT; // This should never happen!
Sel.Resp.DLen = sprintf(Sel.Resp.Data,"%s","Item not found.")+1;
}
}
DEBUGR("failed; " <<Sel.Resp.Data << ' ' <<Arg.Path);
}
} else if (!Sel.Resp.DLen) return 0;
else {Arg.Request.rrCode = kYR_redirect;
DEBUGR("Redirect -> " <<Sel.Resp.Data <<':'
<<Sel.Resp.Port <<" for " <<Arg.Path);
}
// Format the response
//
bytes = Sel.Resp.DLen+sizeof(Sel.Resp.Port);
Arg.Request.datalen = htons(bytes);
Sel.Resp.Port = htonl(Sel.Resp.Port);
// Fill out the I/O vector
//
ioV[0].iov_base = (char *)&Arg.Request;
ioV[0].iov_len = sizeof(Arg.Request);
ioV[1].iov_base = (char *)&Sel.Resp;
ioV[1].iov_len = bytes;
// Send back the response
//
Link->Send(ioV, 2, bytes+sizeof(Arg.Request));
return 0;
}
XrdCmsCluster::RetryErr
static const int RetryErr
Definition XrdCmsCluster.hh:190
XrdCmsConfig::sched_Force
char sched_Force
Definition XrdCmsConfig.hh:134
XrdCmsConfig::sched_Level
char sched_Level
Definition XrdCmsConfig.hh:133
XrdCmsConfig::sched_AffPC
char sched_AffPC
Definition XrdCmsConfig.hh:132
XrdCmsConfig::DoMWChk
char DoMWChk
Definition XrdCmsConfig.hh:111
XrdCmsConfig::sched_Pack
char sched_Pack
Definition XrdCmsConfig.hh:131
XrdCmsNode::do_SelAvoid
int do_SelAvoid(XrdCmsRRData &Arg, XrdCmsSelect &Sel, char *Avoid, bool &doRedir)
Definition XrdCmsNode.cc:984
XrdCmsRRData::Avoid
char * Avoid
Definition XrdCmsRRData.hh:59
XrdCmsSelect::Pack
@ Pack
Definition XrdCmsSelect.hh:75
XrdCmsSelect::noBind
@ noBind
Definition XrdCmsSelect.hh:65
XrdCmsSelect::isDir
@ isDir
Definition XrdCmsSelect.hh:77
XrdCmsSelect::Write
@ Write
Definition XrdCmsSelect.hh:56
XrdCmsSelect::Online
@ Online
Definition XrdCmsSelect.hh:58
XrdCmsSelect::Replica
@ Replica
Definition XrdCmsSelect.hh:68
XrdCmsSelect::MWFiles
@ MWFiles
Definition XrdCmsSelect.hh:70
XrdCmsSelect::NewFile
@ NewFile
Definition XrdCmsSelect.hh:57
XrdCmsSelect::Trunc
@ Trunc
Definition XrdCmsSelect.hh:59
XrdCmsSelect::Peers
@ Peers
Definition XrdCmsSelect.hh:62
XrdCmsSelect::isMeta
@ isMeta
Definition XrdCmsSelect.hh:66
XrdCmsSelect::UseRef
@ UseRef
Definition XrdCmsSelect.hh:76
XrdCms::kYR_FSError
@ kYR_FSError
Definition YProtocol.hh:161
XrdCms::kYR_EIO
@ kYR_EIO
Definition YProtocol.hh:154
XrdCms::kYR_SrvError
@ kYR_SrvError
Definition YProtocol.hh:162
XrdCms::kYR_redirect
@ kYR_redirect
Definition YProtocol.hh:143
XrdCms::CmsSelectRequest::kYR_aPack
@ kYR_aPack
Definition YProtocol.hh:522
XrdCms::CmsSelectRequest::kYR_prvtnet
@ kYR_prvtnet
Definition YProtocol.hh:506
XrdCms::CmsSelectRequest::kYR_write
@ kYR_write
Definition YProtocol.hh:495
XrdCms::CmsSelectRequest::kYR_create
@ kYR_create
Definition YProtocol.hh:491
XrdCms::CmsSelectRequest::kYR_replica
@ kYR_replica
Definition YProtocol.hh:498
XrdCms::CmsSelectRequest::kYR_metaop
@ kYR_metaop
Definition YProtocol.hh:497
XrdCms::CmsSelectRequest::kYR_stat
@ kYR_stat
Definition YProtocol.hh:496
XrdCms::CmsSelectRequest::kYR_aSpec
@ kYR_aSpec
Definition YProtocol.hh:521
XrdCms::CmsSelectRequest::kYR_aStrict
@ kYR_aStrict
Definition YProtocol.hh:519
XrdCms::CmsSelectRequest::kYR_online
@ kYR_online
Definition YProtocol.hh:492
XrdCms::CmsSelectRequest::kYR_mwfiles
@ kYR_mwfiles
Definition YProtocol.hh:499
XrdCms::CmsSelectRequest::kYR_aWait
@ kYR_aWait
Definition YProtocol.hh:523
XrdCms::CmsSelectRequest::kYR_retipmsk
@ kYR_retipmsk
Definition YProtocol.hh:504
XrdCms::CmsSelectRequest::kYR_retipsft
@ kYR_retipsft
Definition YProtocol.hh:505
XrdCms::CmsSelectRequest::kYR_tryMASK
@ kYR_tryMASK
Definition YProtocol.hh:512
XrdCms::CmsSelectRequest::kYR_trySHFT
@ kYR_trySHFT
Definition YProtocol.hh:513
XrdCms::CmsSelectRequest::kYR_trunc
@ kYR_trunc
Definition YProtocol.hh:494
XrdCms::CmsSelectRequest::kYR_refresh
@ kYR_refresh
Definition YProtocol.hh:490

References XrdCmsRRData::Avoid, XrdCms::Cluster, XrdCms::Config, XrdCms::CmsRRHdr::datalen, DEBUGR, do_SelAvoid(), EPNAME, XrdCmsCluster::EReplete, XrdCmsSelect::ifWant, XrdCmsSelect::InfoP, XrdCmsSelect::iovN, XrdCmsSelect::iovP, XrdCmsSelect::isDir, XrdCmsSelect::isMeta, XrdCms::CmsSelectRequest::kYR_aPack, XrdCms::CmsSelectRequest::kYR_aSpec, XrdCms::CmsSelectRequest::kYR_aStrict, XrdCms::CmsSelectRequest::kYR_aWait, XrdCms::CmsSelectRequest::kYR_create, XrdCms::kYR_EIO, XrdCms::kYR_ENOENT, XrdCms::kYR_error, XrdCms::kYR_FSError, XrdCms::CmsSelectRequest::kYR_metaop, XrdCms::CmsSelectRequest::kYR_mwfiles, XrdCms::CmsSelectRequest::kYR_online, XrdCms::CmsSelectRequest::kYR_prvtnet, XrdCms::kYR_redirect, XrdCms::CmsSelectRequest::kYR_refresh, XrdCms::CmsSelectRequest::kYR_replica, XrdCms::CmsSelectRequest::kYR_retipmsk, XrdCms::CmsSelectRequest::kYR_retipsft, XrdCms::kYR_SrvError, XrdCms::CmsSelectRequest::kYR_stat, XrdCms::CmsSelectRequest::kYR_trunc, XrdCms::CmsSelectRequest::kYR_tryMASK, XrdCms::CmsSelectRequest::kYR_trySHFT, XrdCms::kYR_wait, XrdCms::CmsSelectRequest::kYR_write, XrdCmsKey::Len, XrdCmsSelect::MWFiles, XrdCmsSelect::NewFile, XrdCmsSelect::nmask, XrdCmsSelect::noBind, XrdCmsSelect::Online, XrdCmsRRData::Opts, XrdCmsSelect::Opts, XrdCmsSelect::Pack, XrdCmsRRData::Path, XrdCmsSelect::Path, XrdCmsRRData::PathLen, XrdCmsSelect::Peers, XrdNetIF::Privatize(), XrdCmsSelect::Refresh, XrdCmsSelect::Replica, XrdCmsRRData::Request, XrdCmsSelect::Resp, XrdCmsCluster::RetryErr, XrdCms::CmsRRHdr::rrCode, XrdCms::CmsRRHdr::streamid, XrdCmsSelect::Trunc, XrdCmsSelect::UseRef, and XrdCmsSelect::Write.

Here is the call graph for this function:

## do_SelPrep()

int XrdCmsNode::do_SelPrep | ( | XrdCmsPrepArgs & | Arg | ) |

static

Definition at line 1189 of file XrdCmsNode.cc.

{
EPNAME("do_SelPrep")
XrdCmsSelect Sel(XrdCmsSelect::Peers, Arg.path, Arg.pathlen-1);
int rc;
// Complete the arguments to select
//
if ( Arg.options & CmsPrepAddRequest::kYR_fresh)
Sel.Opts |= XrdCmsSelect::Freshen;
if ( Arg.options & CmsPrepAddRequest::kYR_write)
Sel.Opts |= XrdCmsSelect::Write;
if (Arg.options & CmsPrepAddRequest::kYR_stage)
{Sel.iovP = Arg.ioV; Sel.iovN = Arg.iovNum;}
else {Sel.iovP = 0; Sel.iovN = 0;
Sel.Opts |= XrdCmsSelect::Defer;
}
// Setup select data (note that prepare does not allow fast redirect)
//
Sel.InfoP = 0; // No fast redirects
Sel.nmask = SMask_t(0);
// We do not care what interface is being used. This may conflict with a
// staging prepare but it's too complicated to handle at this point.
//
Sel.Opts |= static_cast<char>(XrdNetIF::ifAny);
// Check if co-location wanted relevant only when staging wanted
//
if (Arg.clPath && Sel.iovP)
{XrdCmsSelect Scl(XrdCmsSelect::Peers, Arg.clPath, strlen(Arg.clPath));
Scl.iovP = 0; Scl.iovN = 0; Scl.InfoP = 0; Scl.nmask = SMask_t(0);
DEBUGR("colocating " <<Arg.path <<" w.r.t. " <<Arg.clPath);
rc = Cluster.Select(Scl);
if (rc > 0) {Sched->Schedule((XrdJob *)&Arg, rc+time(0));
DEBUGR("coloc to " <<Arg.clPath <<" delayed " <<rc <<" seconds");
return 1;
}
if (rc < 0) Say.Emsg("SelPrep", Arg.path, "failed;", Sel.Resp.Data);
else Sel.nmask = ~Scl.smask;
}
// Perform selection
//
if ((rc = Cluster.Select(Sel)))
{if (rc > 0)
{if (!(Arg.options & CmsPrepAddRequest::kYR_stage)) return 0;
Sched->Schedule((XrdJob *)&Arg, rc+time(0));
DEBUGR("prep delayed " <<rc <<" seconds");
return 1;
}
Say.Emsg("SelPrep", Arg.path, "failed;", Sel.Resp.Data);
PrepQ.Inform("unavail", &Arg);
}
// All done
//
return 0;
}
XrdCmsPrepArgs::ioV
struct iovec ioV[iovNum]
Definition XrdCmsPrepArgs.hh:57
XrdCmsPrepArgs::path
char * path
Definition XrdCmsPrepArgs.hh:51
XrdCmsPrepArgs::iovNum
static const int iovNum
Definition XrdCmsPrepArgs.hh:43
XrdCmsPrepArgs::clPath
char * clPath
Definition XrdCmsPrepArgs.hh:53
XrdCmsPrepare::Inform
void Inform(const char *cmd, XrdCmsPrepArgs *pargs)
Definition XrdCmsPrepare.cc:258
XrdNetIF::ifAny
@ ifAny
Definition XrdNetIF.hh:75
XrdScheduler::Schedule
void Schedule(XrdJob *jp)
Definition XrdScheduler.cc:373
XrdCms::Sched
XrdScheduler * Sched
Definition XrdCmsConfig.cc:114
XrdCms::CmsPrepAddRequest::kYR_stage
@ kYR_stage
Definition YProtocol.hh:411

References XrdCmsPrepArgs::clPath, XrdCms::Cluster, DEBUGR, XrdCmsSelect::Defer, EPNAME, XrdCmsSelect::Freshen, XrdNetIF::ifAny, XrdCmsSelect::InfoP, XrdCmsPrepArgs::ioV, XrdCmsSelect::iovN, XrdCmsPrepArgs::iovNum, XrdCmsSelect::iovP, XrdCms::CmsPrepAddRequest::kYR_fresh, XrdCms::CmsPrepAddRequest::kYR_stage, XrdCms::CmsPrepAddRequest::kYR_write, XrdCmsSelect::nmask, XrdCmsPrepArgs::options, XrdCmsSelect::Opts, XrdCmsPrepArgs::path, XrdCmsPrepArgs::pathlen, XrdCmsSelect::Peers, XrdCms::PrepQ, XrdCmsSelect::Resp, XrdCms::Say, XrdCms::Sched, and XrdCmsSelect::Write.

Referenced by XrdCmsPrepArgs::DoIt().

Here is the caller graph for this function:

## do_Space()

const char * XrdCmsNode::do_Space | ( | XrdCmsRRData & | Arg | ) |

Definition at line 1256 of file XrdCmsNode.cc.

{
EPNAME("do_Space")
struct iovec xmsg[2];
CmsAvailRequest mySpace = {{0, kYR_avail, 0, 0}};
char buff[sizeof(int)*2+2], *bp = buff;
int blen, maxfr, tutil;
// Process: <id> space
// Respond: <id> avail <numkb> <dskutil>
//
maxfr = Meter.FreeSpace(tutil);
// Do some debugging
//
DEBUGR(maxfr <<"MB free; " <<tutil <<"% util");
// Construct a message to be sent to the manager.
//
blen = XrdOucPup::Pack(&bp, maxfr);
blen += XrdOucPup::Pack(&bp, tutil);
mySpace.Hdr.datalen = htons(static_cast<unsigned short>(blen));
// Send the response
//
if (Arg.Request.rrCode != kYR_space)
XrdCmsManager::Inform(mySpace.Hdr, buff, blen);
else {xmsg[0].iov_base = (char *)&mySpace;
xmsg[0].iov_len = sizeof(mySpace);
xmsg[1].iov_base = buff;
xmsg[1].iov_len = blen;
mySpace.Hdr.datalen = htons(static_cast<unsigned short>(blen));
Link->Send(xmsg, 2);
}
return 0;
}
XrdCmsMeter::FreeSpace
int FreeSpace(int &tutil)
Definition XrdCmsMeter.cc:158
XrdOucPup::Pack
static int Pack(struct iovec **, const char *, unsigned short &buff)
Definition XrdOucPup.cc:52
XrdCms::kYR_space
@ kYR_space
Definition YProtocol.hh:109
XrdCms::kYR_avail
@ kYR_avail
Definition YProtocol.hh:102

References DEBUGR, EPNAME, XrdCmsManager::Inform(), XrdCms::kYR_avail, XrdCms::kYR_space, XrdCms::Meter, XrdOucPup::Pack(), XrdCmsRRData::Request, and XrdCms::CmsRRHdr::rrCode.

Referenced by do_Load(), and SyncSpace().

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

## do_State()

const char * XrdCmsNode::do_State | ( | XrdCmsRRData & | Arg | ) |

Definition at line 1299 of file XrdCmsNode.cc.

{
EPNAME("do_State")
struct iovec xmsg[2];
int rc, noResp = Arg.Request.modifier & CmsStateRequest::kYR_noresp;
// Do some debugging
//
TRACER(Files,Arg.Path);
// Process: state <path>
// Respond: have <path>
//
isKnown = 1;
// If we are a manager then check for the file in the local cache. Otherwise,
// ask the underlying filesystem whether it has the file.
//
if (isMan) {if(!(Arg.Request.modifier = do_StateFWD(Arg))) return 0;}
else if (!Config.DiskOK && !Config.asProxy()) return 0;
else if (baseFS.Limit() && Arg.Request.modifier&CmsStateRequest::kYR_metaman)
{XrdCmsPInfo pinfo;
pinfo.rovec = NodeMask;
if ((rc = baseFS.Exists(Arg,pinfo)) > 0) Arg.Request.modifier = rc;
else return 0;
}
else if ((rc = baseFS.Exists(Arg.Path, -(Arg.PathLen-1))) > 0)
Arg.Request.modifier = rc;
else return 0;
// Respond appropriately
//
if (Arg.Request.modifier && !noResp)
{TRACER(Files,Arg.Path <<" responding have!");
xmsg[0].iov_base = (char *)&Arg.Request;
xmsg[0].iov_len = sizeof(Arg.Request);
xmsg[1].iov_base = Arg.Buff;
xmsg[1].iov_len = Arg.Dlen;
Arg.Request.rrCode = kYR_have;
Arg.Request.modifier |= kYR_raw;
Link->Send(xmsg, 2);
}
return 0;
}
XrdCmsBaseFS::Limit
int Limit()
Definition XrdCmsBaseFS.hh:121
XrdCmsBaseFS::Exists
int Exists(XrdCmsRRData &Arg, XrdCmsPInfo &Who, int noLim=0)
Definition XrdCmsBaseFS.cc:115
XrdCmsConfig::DiskOK
bool DiskOK
Definition XrdCmsConfig.hh:124
XrdCmsConfig::asProxy
int asProxy()
Definition XrdCmsConfig.hh:69
XrdCmsNode::do_StateFWD
int do_StateFWD(XrdCmsRRData &Arg)
Definition XrdCmsNode.cc:1401
XrdCmsNode::isKnown
char isKnown
Definition XrdCmsNode.hh:70
XrdCmsNode::isMan
char isMan
Definition XrdCmsNode.hh:67
XrdCms::CmsRRHdr::modifier
kXR_char modifier
Definition YProtocol.hh:85
XrdCms::kYR_raw
@ kYR_raw
Definition YProtocol.hh:132
XrdCms::kYR_have
@ kYR_have
Definition YProtocol.hh:105
XrdCms::CmsStateRequest::kYR_metaman
@ kYR_metaman
Definition YProtocol.hh:554

References XrdCms::baseFS, XrdCmsRRData::Buff, XrdCms::Config, XrdCmsRRData::Dlen, do_StateFWD(), EPNAME, isKnown, isMan, XrdCms::kYR_have, XrdCms::CmsStateRequest::kYR_metaman, XrdCms::CmsStateRequest::kYR_noresp, XrdCms::kYR_raw, XrdCms::CmsRRHdr::modifier, XrdCmsRRData::Path, XrdCmsRRData::PathLen, XrdCmsRRData::Request, XrdCmsPInfo::rovec, XrdCms::CmsRRHdr::rrCode, and TRACER.

Here is the call graph for this function:

## do_StateDFS()

void XrdCmsNode::do_StateDFS | ( | XrdCmsBaseFR * | rP,
|  | int | rc )

static

Definition at line 106 of file XrdCmsConfig.cc.

References do_StateDFS().

Referenced by do_StateDFS().

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

## do_StateFWD()

int XrdCmsNode::do_StateFWD | ( | XrdCmsRRData & | Arg | ) |

Definition at line 1401 of file XrdCmsNode.cc.

{
EPNAME("do_StateFWD");
static const SMask_t allNodes(~0);
XrdCmsSelect Sel(0, Arg.Path, Arg.PathLen-1);
XrdCmsPInfo pinfo;
int retc;
// Find out who could serve this file
//
if (!Cache.Paths.Find(Arg.Path, pinfo) || pinfo.rovec == 0)
{DEBUGR("Path find failed for state " <<Arg.Path);
return 0;
}
// Get the primary locations for this file
//
Sel.Vec.hf = Sel.Vec.pf = Sel.Vec.bf = 0;
if (Arg.Request.modifier & CmsStateRequest::kYR_refresh) retc = 0;
else retc = Cache.GetFile(Sel, pinfo.rovec);
// If we will possibly be forwarding this request we indicate here whether this
// is a request from a meta-manager. Making the decision in the manager node
// prevents the requestor from lying about its status.
//
if (!retc && !Config.asServer())
Arg.Request.modifier |= CmsStateRequest::kYR_metaman;
// Here we process the case where we need to discover whether the file exists.
// For distributed file systems, we either ask the underlying file system here
// or forward the request to some arbitrary node in a callback via the baseFS.
// If cached information exists, pending status takes precedence (more below).
// Additionally, if a query is alrady in progress, deep-six this attempt.
//
if (baseFS.isDFS())
{if (retc < 0) return 0;
if (!retc)
{if (baseFS.Traverse())
{Cache.AddFile(Sel, 0);
Cluster.Broadsend(pinfo.rovec, Arg.Request, Arg.Buff, Arg.Dlen);
return 0;
}
if ((retc = baseFS.Exists(Arg, pinfo)) <= 0)
{if (retc < 0) Cache.AddFile(Sel, 0);
return 0;
}
Sel.Opts=(retc == CmsHaveRequest::Pending ? XrdCmsSelect::Pending:0);
Sel.Vec.hf = pinfo.rovec; Sel.Vec.wf = pinfo.rwvec;
Cache.AddFile(Sel, allNodes);
return retc;
}
if (Sel.Vec.pf != 0) return CmsHaveRequest::Pending;
if (Sel.Vec.hf != 0) return CmsHaveRequest::Online;
return 0;
}
// For shared-nothing setups, first check if we need to ask any unasked nodes
// whether they have the file.
//
if (!retc || Sel.Vec.bf != 0)
{if (!retc) Cache.AddFile(Sel, 0);
Cluster.Broadcast((retc ? Sel.Vec.bf : pinfo.rovec), Arg.Request,
(void *)Arg.Buff, Arg.Dlen);
}
// Return true if anyone has the file at this point. In shared-nothing systems
// we are interested in some node has the file in non-pending status. This
// differs from shared-everything because pending status applies to all nodes.
//
if (Sel.Vec.hf != 0) return CmsHaveRequest::Online;
if (Sel.Vec.pf != 0){return CmsHaveRequest::Pending;}
return 0;
}
XrdCmsBaseFS::Traverse
int Traverse()
Definition XrdCmsBaseFS.hh:147
XrdCmsCache::GetFile
int GetFile(XrdCmsSelect &Sel, SMask_t mask)
Definition XrdCmsCache.cc:232
XrdCmsCache::Paths
XrdCmsPList_Anchor Paths
Definition XrdCmsCache.hh:49
XrdCmsCluster::Broadsend
int Broadsend(SMask_t smask, XrdCms::CmsRRHdr &Hdr, void *Data, int Dlen)
Definition XrdCmsCluster.cc:450
XrdCmsCluster::Broadcast
SMask_t Broadcast(SMask_t, const struct iovec *, int, int tot=0)
Definition XrdCmsCluster.cc:374
XrdCmsConfig::asServer
int asServer()
Definition XrdCmsConfig.hh:70
XrdCmsPList_Anchor::Find
int Find(const char *pname, XrdCmsPInfo &masks)
Definition XrdCmsPList.cc:77
XrdCmsSelect::Pending
@ Pending
Definition XrdCmsSelect.hh:72
XrdCms::CmsHaveRequest::Pending
@ Pending
Definition YProtocol.hh:236
XrdCms::CmsHaveRequest::Online
@ Online
Definition YProtocol.hh:236
XrdCms::CmsStateRequest::kYR_refresh
@ kYR_refresh
Definition YProtocol.hh:552

References XrdCms::baseFS, XrdCmsRRData::Buff, XrdCms::Cache, XrdCms::Cluster, XrdCms::Config, DEBUGR, XrdCmsRRData::Dlen, EPNAME, XrdCms::CmsStateRequest::kYR_metaman, XrdCms::CmsStateRequest::kYR_refresh, XrdCms::CmsRRHdr::modifier, XrdCms::CmsHaveRequest::Online, XrdCmsSelect::Opts, XrdCmsRRData::Path, XrdCmsRRData::PathLen, XrdCms::CmsHaveRequest::Pending, XrdCmsSelect::Pending, XrdCmsRRData::Request, XrdCmsPInfo::rovec, XrdCmsPInfo::rwvec, and XrdCmsSelect::Vec.

Referenced by do_State().

Here is the caller graph for this function:

## do_StatFS()

const char * XrdCmsNode::do_StatFS | ( | XrdCmsRRData & | Arg | ) |

Definition at line 1479 of file XrdCmsNode.cc.

{
static kXR_unt32 Zero = 0;
char buff[256];
struct iovec ioV[3] = {{(char *)&Arg.Request, sizeof(Arg.Request)},
{(char *)&Zero, sizeof(Zero)},
{(char *)&buff, 0}};
XrdCmsPInfo pinfo;
int bytes;
SpaceData theSpace;
// Find out who serves this path and get space relative to it
//
if (Cache.Paths.Find(Arg.Path, pinfo) && pinfo.rovec)
{Cluster.Space(theSpace, pinfo.rovec);
if (Arg.Request.modifier & CmsStatfsRequest::kYR_qvfs)
{bytes = sprintf(buff, "A %lld %lld %d",
theSpace.Total, theSpace.TotFr,
(theSpace.wFree < theSpace.sFree ? theSpace.sFree
: theSpace.wFree)) + 1;
} else {
bytes = sprintf(buff, "%d %d %d %d %d %d",
theSpace.wNum, theSpace.wFree, theSpace.wUtil,
theSpace.sNum, theSpace.sFree, theSpace.sUtil) + 1;
}
} else bytes = strlcpy(buff, "-1 -1 -1 -1 -1 -1", sizeof(buff)) + 1;
// Send the response
//
ioV[2].iov_len = bytes;
bytes += sizeof(Zero);
Arg.Request.rrCode = kYR_data;
Arg.Request.datalen = htons(bytes);
Link->Send(ioV, 3, bytes+sizeof(Arg.Request));
return 0;
}
XrdCmsCluster::Space
void Space(XrdCms::SpaceData &sData, SMask_t smask)
Definition XrdCmsCluster.cc:1216
XrdCms::SpaceData::wNum
int wNum
Definition XrdCmsCluster.hh:90
XrdCms::SpaceData::wFree
int wFree
Definition XrdCmsCluster.hh:89
XrdCms::SpaceData::sNum
int sNum
Definition XrdCmsCluster.hh:93
XrdCms::SpaceData::wUtil
int wUtil
Definition XrdCmsCluster.hh:91
XrdCms::SpaceData::sFree
int sFree
Definition XrdCmsCluster.hh:92
XrdCms::SpaceData::sUtil
int sUtil
Definition XrdCmsCluster.hh:94
XrdCms::SpaceData::Total
long long Total
Definition XrdCmsCluster.hh:86
XrdCms::SpaceData::TotFr
long long TotFr
Definition XrdCmsCluster.hh:87
XrdCms::CmsStatfsRequest::kYR_qvfs
@ kYR_qvfs
Definition YProtocol.hh:569

References XrdCms::Cache, XrdCms::Cluster, XrdCms::CmsRRHdr::datalen, XrdCms::kYR_data, XrdCms::CmsStatfsRequest::kYR_qvfs, XrdCms::CmsRRHdr::modifier, XrdCmsRRData::Path, XrdCmsRRData::Request, XrdCmsPInfo::rovec, XrdCms::CmsRRHdr::rrCode, XrdCms::SpaceData::sFree, XrdCms::SpaceData::sNum, strlcpy(), XrdCms::SpaceData::sUtil, XrdCms::SpaceData::Total, XrdCms::SpaceData::TotFr, XrdCms::SpaceData::wFree, XrdCms::SpaceData::wNum, and XrdCms::SpaceData::wUtil.

Here is the call graph for this function:

## do_Stats()

const char * XrdCmsNode::do_Stats | ( | XrdCmsRRData & | Arg | ) |

Definition at line 1522 of file XrdCmsNode.cc.

{
static const unsigned short szLen = sizeof(kXR_unt32);
static XrdSysMutex StatsData;
static int statsz = 0;
static int statln = 0;
static char *statbuff = 0;
static time_t statlast = 0;
static kXR_unt32 theSize;
struct iovec ioV[3] = {{(char *)&Arg.Request, sizeof(Arg.Request)},
{(char *)&theSize, sizeof(theSize)},
{0, 0}
};
time_t tNow;
// Allocate buffer if we do not have one
//
StatsData.Lock();
if (!statsz || !statbuff)
{statsz = Cluster.Stats(0,0);
statbuff = (char *)malloc(statsz);
theSize = htonl(statsz);
}
// Check if only the size is wanted
//
if (Arg.Request.modifier & CmsStatsRequest::kYR_size)
{ioV[1].iov_len = sizeof(theSize);
Arg.Request.datalen = htons(szLen);
Arg.Request.rrCode = kYR_data;
Link->Send(ioV, 2);
StatsData.UnLock();
return 0;
}
// Get full statistics if enough time has passed
//
tNow = time(0);
if (statlast+9 >= tNow)
{statln = Cluster.Stats(statbuff, statsz); statlast = tNow;}
// Format result and send response
//
ioV[2].iov_base = statbuff;
ioV[2].iov_len = statln;
Arg.Request.datalen = htons(static_cast<unsigned short>(szLen+statln));
Arg.Request.rrCode = kYR_data;
Link->Send(ioV, 3);
// All done
//
StatsData.UnLock();
return 0;
}
XrdCmsCluster::Stats
int Stats(char *bfr, int bln)
Definition XrdCmsCluster.cc:1256
XrdCms::CmsStatsRequest::kYR_size
@ kYR_size
Definition YProtocol.hh:583

References XrdCms::Cluster, XrdCms::CmsRRHdr::datalen, XrdCms::kYR_data, XrdCms::CmsStatsRequest::kYR_size, XrdSysMutex::Lock(), XrdCms::CmsRRHdr::modifier, XrdCmsRRData::Request, XrdCms::CmsRRHdr::rrCode, and XrdSysMutex::UnLock().

Here is the call graph for this function:

## do_Status()

const char * XrdCmsNode::do_Status | ( | XrdCmsRRData & | Arg | ) |

Definition at line 1587 of file XrdCmsNode.cc.

{
EPNAME("do_Status")
const char *srvMsg, *stgMsg;
int Stage = Arg.Request.modifier & CmsStatusRequest::kYR_Stage;
int noStage = Arg.Request.modifier & CmsStatusRequest::kYR_noStage;
int Resume = Arg.Request.modifier & CmsStatusRequest::kYR_Resume;
int Suspend = Arg.Request.modifier & CmsStatusRequest::kYR_Suspend;
int Reset = Arg.Request.modifier & CmsStatusRequest::kYR_Reset;
int add2Activ, add2Stage, port;
// Do some debugging
//
DEBUGR( (Reset ? "reset " : "")
<<(Resume ? "resume " : (Suspend ? "suspend " : ""))
<<(Stage ? "stage " : (noStage ? "nostage " : "")));
// Process reset requests. These are exclsuive to any other request
//
if (Reset)
{XrdCmsManager::Reset(); // Propagate the reset to our managers
Cache.Bounce(NodeMask, NodeID); // Now invalidate our cache lines
}
// Process stage/nostage
//
if ((Stage && isNoStage) || (noStage && !isNoStage))
if (noStage) {add2Stage = -1; isNoStage = 1; stgMsg="staging suspended";}
else {add2Stage = 1; isNoStage = 0; stgMsg="staging resumed";}
else {add2Stage = 0; stgMsg = 0;}
// Process suspend/resume. We mmerely need a read lock to alter isBad here.
//
if ((Resume && (isBad & isSuspend)) || (Suspend && !(isBad & isSuspend)))
if (Suspend) {add2Activ = -1;
Cluster.SLock(true, false);
isBad |= isSuspend; // Keep coherency with black listing
Cluster.SLock(false);
srvMsg="service suspended";
stgMsg = 0;
}
else {add2Activ = 1;
Cluster.SLock(true, false);
isBad &= ~isSuspend; // Keep coherency with black listing
Cluster.SLock(false);
srvMsg="service resumed";
stgMsg = (isNoStage ? "(no staging)" : "(staging)");
port = ntohl(Arg.Request.streamid);
if (port && port != netIF.Port())
{Lock(); netIF.Port(port); UnLock();
DEBUGR("set data port to " <<port);
}
}
else {add2Activ = 0; srvMsg = 0;}
// Get the most important message out (advisory isOffline doen't need STMutex)
//
if (isOffline) {srvMsg = "service offline"; stgMsg = 0;}
else if (isBad & isDisabled) {srvMsg = "service disabled"; stgMsg = 0;}
else if (isBad & isBlisted ) {srvMsg = "service blacklisted"; stgMsg = 0;}
// Now see if we need to change anything
//
if (add2Activ || add2Stage)
{CmsState.Update(XrdCmsState::Counts, add2Activ, add2Stage);
Say.Emsg("Node", Name(), srvMsg, stgMsg);
}
return 0;
}
XrdCmsCache::Bounce
void Bounce(SMask_t smask, int SNum)
Definition XrdCmsCache.cc:343
XrdCmsCluster::SLock
void SLock(bool dolock, bool wrmode=true)
Definition XrdCmsCluster.hh:200
XrdCmsManager::Reset
static void Reset()
Definition XrdCmsManager.cc:426
XrdCmsNode::Lock
void Lock()
Definition XrdCmsNode.hh:175
XrdCmsNode::isDisabled
static const char isDisabled
Definition XrdCmsNode.hh:80
XrdCmsNode::isSuspend
static const char isSuspend
Definition XrdCmsNode.hh:81
XrdCmsNode::isNoStage
char isNoStage
Definition XrdCmsNode.hh:66
XrdCmsNode::UnLock
void UnLock()
Definition XrdCmsNode.hh:177
XrdCmsNode::isBlisted
static const char isBlisted
Definition XrdCmsNode.hh:79
XrdCmsState::Update
void Update(StateType StateT, int ActivVal, int StageVal=0)
Definition XrdCmsState.cc:258
XrdCmsState::Counts
@ Counts
Definition XrdCmsState.hh:56
XrdCms::CmsState
XrdCmsState CmsState
Definition XrdCmsState.cc:55

References XrdCms::Cache, XrdCms::Cluster, XrdCms::CmsState, XrdCmsState::Counts, DEBUGR, EPNAME, isBad, isBlisted, isDisabled, isNoStage, isOffline, isSuspend, XrdCms::CmsStatusRequest::kYR_noStage, XrdCms::CmsStatusRequest::kYR_Reset, XrdCms::CmsStatusRequest::kYR_Resume, XrdCms::CmsStatusRequest::kYR_Stage, XrdCms::CmsStatusRequest::kYR_Suspend, Lock(), XrdCms::CmsRRHdr::modifier, Name(), XrdCmsRRData::Request, XrdCmsManager::Reset(), XrdCms::Say, XrdCms::CmsRRHdr::streamid, and UnLock().

Here is the call graph for this function:

## do_Trunc()

const char * XrdCmsNode::do_Trunc | ( | XrdCmsRRData & | Arg | ) |

Definition at line 1664 of file XrdCmsNode.cc.

{
EPNAME("do_Trunc")
long long Size = -1;
int rc;
// Do some debugging
//
DEBUGR("size " <<Arg.Mode <<' ' <<Arg.Path);
// We are don here if we have no data; otherwise convert the mode if we
// haven't done so already.
//
if (!Config.DiskOK) return 0;
if (Size < 0 && !getSize(Arg.Mode, Size)) return "invalid size";
// Attempt to change the size either via call-out or the oss plug-in
//
if (Config.ProgTR) rc = fsExec(Config.ProgTR, Arg.Mode, Arg.Path);
else rc = Config.ossFS->Truncate(Arg.Path, Size);
// Return appropriate result
//
return (rc ? fsFail(Arg.Ident, "trunc", Arg.Path, rc) : 0);
}

References XrdCms::Config, DEBUGR, EPNAME, XrdCmsRRData::Ident, XrdCmsRRData::Mode, and XrdCmsRRData::Path.

## do_Try()

const char * XrdCmsNode::do_Try | ( | XrdCmsRRData & | Arg | ) |

Definition at line 1698 of file XrdCmsNode.cc.

{
EPNAME("do_Try")
// Do somde debugging
//
DEBUGR(Arg.Path);
// Add all the alternates to our alternate list
//
if (Manager) Manager->myMans->Add(&netID, Arg.Path, Config.PortTCP, myLevel);
// Close the link and return an error
//
// Disc("redirected.");
return ".redirected";
}

References XrdCms::Config, DEBUGR, EPNAME, and XrdCmsRRData::Path.

## do_Update()

const char * XrdCmsNode::do_Update | ( | XrdCmsRRData & | Arg | ) |

Definition at line 1720 of file XrdCmsNode.cc.

{
// Process: <id> update
// Respond: <id> status
//
CmsState.sendState(Link);
return 0;
}
XrdCmsState::sendState
void sendState(XrdLink *Link)
Definition XrdCmsState.cc:161

References XrdCms::CmsState.

## do_Usage()

const char * XrdCmsNode::do_Usage | ( | XrdCmsRRData & | Arg | ) |

Definition at line 1736 of file XrdCmsNode.cc.

{
// Process: <id> usage
// Respond: <id> load <cpu> <io> <load> <mem> <pag> <dskfree> <dskutil>
//
Report_Usage(Link);
return 0;
}
XrdCmsNode::Report_Usage
static void Report_Usage(XrdLink *lp)
Definition XrdCmsNode.cc:1750

References Report_Usage().

Here is the call graph for this function:

## g2nLock()

void XrdCmsNode::g2nLock | ( | XrdSysRWLock & | gMutex | ) |

inline

Definition at line 162 of file XrdCmsNode.hh.

{refCnt++; // Keep node alive during transition
gMutex.UnLock(); // The lock must have ben held
nodeMutex.Lock(); // Downgrade to node lock
}
XrdSysRWLock::UnLock
void UnLock()
Definition XrdSysPthread.hh:348

References XrdSysRWLock::UnLock().

Referenced by XrdCmsCluster::BlackList().

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

## getSlot()

short XrdCmsNode::getSlot | ( |  | ) |

inline

Definition at line 208 of file XrdCmsNode.hh.

{return RSlot;}

## ID()

int XrdCmsNode::ID | ( | int & | INum | ) |

inline

Definition at line 139 of file XrdCmsNode.hh.

{INum = Instance; return NodeID;}

Referenced by XrdCmsClustID::AddNode(), XrdCmsCluster::Remove(), and XrdCmsManager::Remove().

Here is the caller graph for this function:

## inDomain()

bool XrdCmsNode::inDomain | ( |  | ) |

inline

Definition at line 143 of file XrdCmsNode.hh.

{return netIF.InDomain(&netID);}

## Inst()

int XrdCmsNode::Inst | ( |  | ) |

inline

Definition at line 141 of file XrdCmsNode.hh.

{return Instance;}

## isNode() [1/3]

int XrdCmsNode::isNode | ( | const XrdNetAddr * | addr | ) |

inline

Definition at line 147 of file XrdCmsNode.hh.

{return netID.Same(addr);}

## isNode() [2/3]

int XrdCmsNode::isNode | ( | SMask_t | smask | ) |

inline

Definition at line 145 of file XrdCmsNode.hh.

{return (smask & NodeMask) != 0;}

Referenced by XrdCmsCluster::Broadcast(), XrdCmsCluster::Broadsend(), XrdCmsCluster::getMask(), XrdCmsCluster::ResetRef(), and XrdCmsCluster::Space().

Here is the caller graph for this function:

## isNode() [3/3]

int XrdCmsNode::isNode | ( | XrdLink * | lp,
|  | const char * | nid,
|  | int | port )

inline

Definition at line 150 of file XrdCmsNode.hh.

{if (nid)
{if (strcmp(myNID, nid)) return 0;
if (*nid == '*') return 1;
}
return netID.Same(lp->NetAddr()) && port == netIF.Port();
}
XrdLink::NetAddr
const XrdNetAddr * NetAddr() const
Definition XrdLink.cc:268

References XrdLink::NetAddr().

Here is the call graph for this function:

## Lock()

void XrdCmsNode::Lock | ( |  | ) |

inline

Definition at line 175 of file XrdCmsNode.hh.

{refCnt++; nodeMutex.Lock();}

Referenced by XrdCmsCluster::Add(), XrdCmsManager::Add(), do_Status(), XrdCmsManager::Inform(), XrdCmsManager::Inform(), XrdCmsCluster::Remove(), and XrdCmsManager::Reset().

Here is the caller graph for this function:

## Mask()

SMask_t XrdCmsNode::Mask | ( |  | ) |

inline

Definition at line 160 of file XrdCmsNode.hh.

{return NodeMask;}

Referenced by XrdCmsClustID::AddNode(), XrdCmsCluster::Broadcast(), and XrdCmsClustID::RemNode().

Here is the caller graph for this function:

## n2gLock()

void XrdCmsNode::n2gLock | ( | XrdSysRWLock & | gMutex,
|  | bool | rdlock = false )

inline

Definition at line 168 of file XrdCmsNode.hh.

{nodeMutex.UnLock(); // Release this node
refCnt--; // OK for node to go away
if (rdlock) gMutex.ReadLock();
else gMutex.WriteLock();
}
XrdSysRWLock::ReadLock
void ReadLock()
Definition XrdSysPthread.hh:342
XrdSysRWLock::WriteLock
void WriteLock()
Definition XrdSysPthread.hh:343

References XrdSysRWLock::ReadLock(), and XrdSysRWLock::WriteLock().

Referenced by XrdCmsCluster::BlackList().

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

## Name()

char * XrdCmsNode::Name | ( |  | ) |

inline

Definition at line 158 of file XrdCmsNode.hh.

{return (myName ? myName : (char *)"?");}

Referenced by XrdCmsManager::Add(), XrdCmsClustID::AddNode(), XrdCmsCluster::BlackList(), do_Load(), do_Status(), XrdCmsManager::Inform(), XrdCmsManager::Inform(), XrdCmsManager::Remove(), and XrdCmsManager::Reset().

Here is the caller graph for this function:

## Ref()

void XrdCmsNode::Ref | ( |  | ) |

inline

Definition at line 179 of file XrdCmsNode.hh.

{refCnt++;} // Must have global or node locked!

Referenced by XrdCmsCluster::Broadcast(), XrdCmsCluster::Broadsend(), and XrdCmsCluster::Remove().

Here is the caller graph for this function:

## Report_Usage()

void XrdCmsNode::Report_Usage | ( | XrdLink * | lp | ) |

static

Definition at line 1750 of file XrdCmsNode.cc.

{
EPNAME("Report_Usage")
CmsLoadRequest myLoad = {{0, kYR_load, 0, 0}};
struct iovec xmsg[2];
char loadbuff[CmsLoadRequest::numLoad];
char respbuff[sizeof(loadbuff)+2+sizeof(int)+2], *bp = respbuff;
int blen, maxfr, pcpu, pnet, pxeq, pmem, ppag, pdsk;
// Respond: <id> load <cpu> <io> <load> <mem> <pag> <dskfree> <dskutil>
//
maxfr = Meter.Report(pcpu, pnet, pxeq, pmem, ppag, pdsk);
loadbuff[CmsLoadRequest::cpuLoad] = static_cast<char>(pcpu);
loadbuff[CmsLoadRequest::netLoad] = static_cast<char>(pnet);
loadbuff[CmsLoadRequest::xeqLoad] = static_cast<char>(pxeq);
loadbuff[CmsLoadRequest::memLoad] = static_cast<char>(pmem);
loadbuff[CmsLoadRequest::pagLoad] = static_cast<char>(ppag);
loadbuff[CmsLoadRequest::dskLoad] = static_cast<char>(pdsk);
blen = XrdOucPup::Pack(&bp, loadbuff, sizeof(loadbuff));
blen += XrdOucPup::Pack(&bp, maxfr);
myLoad.Hdr.datalen = htons(static_cast<unsigned short>(blen));
xmsg[0].iov_base = (char *)&myLoad;
xmsg[0].iov_len = sizeof(myLoad);
xmsg[1].iov_base = respbuff;
xmsg[1].iov_len = blen;
if (lp) lp->Send(xmsg, 2);
else XrdCmsManager::Inform("usage", xmsg, 2);
// Do some debugging
//
DEBUG("cpu=" <<pcpu <<" net=" <<pnet <<" xeq=" <<pxeq
<<" mem=" <<pmem <<" pag=" <<ppag <<" dsk=" <<pdsk <<' ' <<maxfr);
}
XrdCmsMeter::Report
int Report(int &pcpu, int &pnet, int &pxeq, int &pmem, int &ppag, int &pdsk)
Definition XrdCmsMeter.cc:374
XrdLink::Send
int Send(const char *buff, int blen)
Definition XrdLink.cc:331
XrdCms::kYR_load
@ kYR_load
Definition YProtocol.hh:106
XrdCms::CmsLoadRequest::cpuLoad
@ cpuLoad
Definition YProtocol.hh:331
XrdCms::CmsLoadRequest::netLoad
@ netLoad
Definition YProtocol.hh:331
XrdCms::CmsLoadRequest::dskLoad
@ dskLoad
Definition YProtocol.hh:331
XrdCms::CmsLoadRequest::numLoad
@ numLoad
Definition YProtocol.hh:332
XrdCms::CmsLoadRequest::pagLoad
@ pagLoad
Definition YProtocol.hh:331
XrdCms::CmsLoadRequest::xeqLoad
@ xeqLoad
Definition YProtocol.hh:331
XrdCms::CmsLoadRequest::memLoad
@ memLoad
Definition YProtocol.hh:331

References XrdCms::CmsLoadRequest::cpuLoad, DEBUG, XrdCms::CmsLoadRequest::dskLoad, EPNAME, XrdCmsManager::Inform(), XrdCms::kYR_load, XrdCms::CmsLoadRequest::memLoad, XrdCms::Meter, XrdCms::CmsLoadRequest::netLoad, XrdCms::CmsLoadRequest::numLoad, XrdOucPup::Pack(), XrdCms::CmsLoadRequest::pagLoad, XrdLink::Send(), and XrdCms::CmsLoadRequest::xeqLoad.

Referenced by do_Usage(), XrdCmsMeter::PutInfo(), and XrdCmsMeter::Update().

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

## Send() [1/2]

int XrdCmsNode::Send | ( | const char * | buff,
|  | int | blen = 0 )

inline

Definition at line 184 of file XrdCmsNode.hh.

{return (isOffline ? -1 : Link->Send(buff, blen));}

References isOffline.

Referenced by XrdCmsCluster::BlackList(), XrdCmsCluster::Broadcast(), XrdCmsCluster::Broadsend(), XrdCmsManager::Inform(), XrdCmsManager::Inform(), and XrdCmsManager::Reset().

Here is the caller graph for this function:

## Send() [2/2]

int XrdCmsNode::Send | ( | const struct iovec * | iov,
|  | int | iovcnt,
|  | int | iotot = 0 )

inline

Definition at line 186 of file XrdCmsNode.hh.

{return (isOffline ? -1 : Link->Send(iov, iovcnt, iotot));}

References isOffline.

## setManager()

void XrdCmsNode::setManager | ( | XrdCmsManager * | mP | ) |

inline

Definition at line 189 of file XrdCmsNode.hh.

{Manager = mP;}

Referenced by XrdCmsManager::Add().

Here is the caller graph for this function:

## setName()

void XrdCmsNode::setName | ( | XrdLink * | lnkp,
|  | const char * | theIF,
|  | int | port )

Definition at line 145 of file XrdCmsNode.cc.

{
char buff[512];
const char *hname = lnkp->Host();
// Check if this is a duplicate. Note that we check for strict equivalence.
//
if (myName)
{if (!strcmp(myName,hname) && port == netIF.Port()
&& netID.Same(lnkp->NetAddr())) return;
free(myName);
}
// Get our address information but substitute data port for actual port
//
netID = *(lnkp->NetAddr());
// Set the network interface. Note that out of domain nodes are not allowed
// to specify interface addresses as this does not make global sense.
//
if (theIF && !netIF.InDomain(&netID)) theIF = 0;
netIF.SetIF(&netID, theIF, port);
hasNet = netIF.Mask();
// Construct our identification
//
myName = strdup(hname);
myNlen = strlen(hname);
if (!port) strcpy(buff, lnkp->ID);
else sprintf(buff, "%s:%d", lnkp->ID, port);
if (Ident) free(Ident);
Ident = strdup(buff);
}
XrdCmsNode::hasNet
char hasNet
Definition XrdCmsNode.hh:62
XrdLink::ID
char * ID
Pointer to the client's link identity.
Definition XrdLink.hh:210
XrdLink::Host
const char * Host() const
Definition XrdLink.hh:204

References hasNet, XrdLink::Host(), XrdLink::ID, Ident, and XrdLink::NetAddr().

Referenced by XrdCmsNode(), and XrdCmsCluster::Add().

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

## setShare()

void XrdCmsNode::setShare | ( | int | shrval | ) |

inline

Definition at line 193 of file XrdCmsNode.hh.

{if (shrval > 99) Shrem = Shrip = Share = 0;
else {Shrem = Share = shrval; Shrip = 100 - shrval;}
}

## setSlot()

void XrdCmsNode::setSlot | ( | short | rslot | ) |

inline

Definition at line 207 of file XrdCmsNode.hh.

{RSlot = rslot;}

## setTZone()

int XrdCmsNode::setTZone | ( | int | tZone | ) |

inline

Definition at line 198 of file XrdCmsNode.hh.

{TimeZone = tZone & 0x0f;
if (tZone & 0x10) TimeZone = -TimeZone;
TZValid = (tZone != 0);
return TimeZone;
}
XrdCmsNode::TZValid
char TZValid
Definition XrdCmsNode.hh:77
XrdCmsNode::TimeZone
char TimeZone
Definition XrdCmsNode.hh:76

References TimeZone, and TZValid.

## setVersion()

void XrdCmsNode::setVersion | ( | unsigned short | vnum | ) |

inline

Definition at line 205 of file XrdCmsNode.hh.

{myVersion = vnum;}

## ShowIF()

void XrdCmsNode::ShowIF | ( |  | ) |

inline

Definition at line 210 of file XrdCmsNode.hh.

{netIF.Display("=====> ");}

## SyncSpace()

void XrdCmsNode::SyncSpace | ( |  | ) |

Definition at line 1791 of file XrdCmsNode.cc.

{
XrdCmsRRData Arg;
int old_free = 0;
// For newly logged in nodes, we need to sync the free space stats
//
mlMutex.Lock();
if (isRW && DiskFree > LastFree)
{old_free = LastFree; LastFree = DiskFree;}
mlMutex.UnLock();
// Tell our manager if we now have more space, if need be.
//
if (!old_free)
{Arg.Request.rrCode = kYR_login;
Arg.Ident = Ident;
Arg.dskFree = DiskFree;
Arg.dskUtil = DiskUtil;
do_Space(Arg);
}
}
XrdCms::kYR_login
@ kYR_login
Definition YProtocol.hh:90

References DiskFree, DiskUtil, do_Space(), XrdCmsRRData::dskFree, Ident, XrdCmsRRData::Ident, isRW, XrdCms::kYR_login, XrdCmsRRData::Request, and XrdCms::CmsRRHdr::rrCode.

Here is the call graph for this function:

## UnLock()

void XrdCmsNode::UnLock | ( |  | ) |

inline

Definition at line 177 of file XrdCmsNode.hh.

{nodeMutex.UnLock(); refCnt--;}

Referenced by XrdCmsCluster::BlackList(), do_Status(), XrdCmsManager::Inform(), XrdCmsManager::Inform(), XrdCmsCluster::Remove(), and XrdCmsManager::Reset().

Here is the caller graph for this function:

## unRef()

void XrdCmsNode::unRef | ( |  | ) |

inline

Definition at line 180 of file XrdCmsNode.hh.

{refCnt--;}

Referenced by XrdCmsCluster::Broadcast(), XrdCmsCluster::Broadsend(), and XrdCmsCluster::Remove().

Here is the caller graph for this function:

## Friends And Related Symbol Documentation

## XrdCmsCluster

friend class XrdCmsCluster

friend

Definition at line 59 of file XrdCmsNode.hh.

References XrdCmsCluster.

Referenced by XrdCmsCluster.

## Member Data Documentation

## allowsRW

const char XrdCmsNode::allowsRW = 0x01

static

Definition at line 84 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::Space().

## allowsSS

const char XrdCmsNode::allowsSS = 0x02

static

Definition at line 85 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::Space().

## ConfigID

unsigned int XrdCmsNode::ConfigID = 0

Definition at line 92 of file XrdCmsNode.hh.

## DiskFree

int XrdCmsNode::DiskFree = 0

Definition at line 90 of file XrdCmsNode.hh.

Referenced by do_Avail(), do_Load(), XrdCmsCluster::Select(), XrdCmsCluster::Space(), and SyncSpace().

## DiskMinF

int XrdCmsNode::DiskMinF = 0

Definition at line 89 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::Select(), and XrdCmsCluster::Space().

## DiskNums

int XrdCmsNode::DiskNums = 0

Definition at line 88 of file XrdCmsNode.hh.

## DiskTotal

unsigned int XrdCmsNode::DiskTotal = 0

Definition at line 87 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::Space().

## DiskUtil

int XrdCmsNode::DiskUtil = 0

Definition at line 91 of file XrdCmsNode.hh.

Referenced by do_Avail(), do_Load(), XrdCmsCluster::Space(), and SyncSpace().

## hasNet

char XrdCmsNode::hasNet = 0

Definition at line 62 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::Select(), and setName().

## Ident

char* XrdCmsNode::Ident = 0

Definition at line 61 of file XrdCmsNode.hh.

Referenced by ~XrdCmsNode(), XrdCmsCluster::Add(), XrdCmsClustID::AddNode(), XrdCmsCluster::Broadcast(), XrdCmsCluster::Broadsend(), Delete(), XrdCmsClustID::RemNode(), XrdCmsCluster::Remove(), XrdCmsManager::Remove(), setName(), and SyncSpace().

## isBad

char XrdCmsNode::isBad = 0

Definition at line 63 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::Add(), XrdCmsManager::Add(), XrdCmsCluster::BlackList(), do_Ping(), do_Status(), XrdCmsCluster::List(), XrdCmsCluster::Remove(), and XrdCmsCluster::Select().

## isBlisted

const char XrdCmsNode::isBlisted = 0x01

static

Definition at line 79 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::BlackList(), do_Status(), XrdCmsCluster::List(), and XrdCmsManager::Rerun().

## isBound

char XrdCmsNode::isBound = 0

Definition at line 69 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::Add(), XrdCmsManager::Add(), and XrdCmsCluster::Remove().

## isConn

char XrdCmsNode::isConn = 0

Definition at line 71 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::Add(), XrdCmsManager::Add(), Disc(), and XrdCmsCluster::Remove().

## isDisabled

const char XrdCmsNode::isDisabled = 0x02

static

Definition at line 80 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::Add(), do_Status(), and XrdCmsCluster::List().

## isDoomed

const char XrdCmsNode::isDoomed = 0x08

static

Definition at line 82 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::BlackList(), do_Ping(), XrdCmsCluster::Remove(), and XrdCmsManager::Rerun().

## isGone

char XrdCmsNode::isGone = 0

Definition at line 72 of file XrdCmsNode.hh.

Referenced by Delete(), and XrdCmsCluster::Remove().

## isKnown

char XrdCmsNode::isKnown = 0

Definition at line 70 of file XrdCmsNode.hh.

Referenced by do_State(), and XrdCmsManager::Reset().

## isMan

char XrdCmsNode::isMan = 0

Definition at line 67 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::Add(), XrdCmsManager::Add(), do_State(), XrdCmsCluster::List(), XrdCmsClustID::RemNode(), and XrdCmsCluster::Remove().

## isNoStage

char XrdCmsNode::isNoStage = 0

Definition at line 66 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::Add(), XrdCmsManager::Add(), do_Status(), XrdCmsCluster::List(), XrdCmsCluster::Remove(), and XrdCmsCluster::Select().

## isOffline

char XrdCmsNode::isOffline

Definition at line 64 of file XrdCmsNode.hh.

Referenced by XrdCmsNode(), ~XrdCmsNode(), XrdCmsCluster::Add(), XrdCmsManager::Add(), XrdCmsCluster::Broadcast(), XrdCmsCluster::Broadsend(), Disc(), do_Disc(), do_Status(), XrdCmsManager::Inform(), XrdCmsManager::Inform(), XrdCmsCluster::List(), XrdCmsCluster::Remove(), XrdCmsManager::Remove(), XrdCmsManager::Reset(), Send(), Send(), and XrdCmsCluster::Space().

## isPeer

char XrdCmsNode::isPeer = 0

Definition at line 68 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::Add(), and XrdCmsClustID::RemNode().

## isPerm

char XrdCmsNode::isPerm = 0

Definition at line 73 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::Add().

## isRW

char XrdCmsNode::isRW = 0

Definition at line 65 of file XrdCmsNode.hh.

Referenced by do_Load(), XrdCmsCluster::List(), XrdCmsCluster::Space(), and SyncSpace().

## isSuspend

const char XrdCmsNode::isSuspend = 0x04

static

Definition at line 81 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::Add(), do_Status(), XrdCmsCluster::List(), and XrdCmsCluster::Remove().

## RoleID

char XrdCmsNode::RoleID = 0

Definition at line 75 of file XrdCmsNode.hh.

Referenced by XrdCmsCluster::List().

## rsvd

char XrdCmsNode::rsvd = 0

Definition at line 74 of file XrdCmsNode.hh.

## TimeZone

char XrdCmsNode::TimeZone = 0

Definition at line 76 of file XrdCmsNode.hh.

Referenced by setTZone().

## TZValid

char XrdCmsNode::TZValid = 0

Definition at line 77 of file XrdCmsNode.hh.

Referenced by setTZone().

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

- XrdCmsNode.hh
- XrdCmsConfig.cc
- XrdCmsNode.cc