XRootD
XrdCmsFinderTRG Class Reference

#include <XrdCmsFinder.hh>

+ Inheritance diagram for XrdCmsFinderTRG:
+ Collaboration diagram for XrdCmsFinderTRG:

Public Member Functions

 XrdCmsFinderTRG (XrdSysLogger *, int, int, XrdOss *theSS=0)
 
 ~XrdCmsFinderTRG ()
 
void Added (const char *path, int Pend=0)
 
int Configure (const char *cfn, char *Args, XrdOucEnv *EnvInfo)
 
int Locate (XrdOucErrInfo &Resp, const char *path, int flags, XrdOucEnv *Info=0)
 
XrdOucTListManagers ()
 
int Prepare (XrdOucErrInfo &Resp, XrdSfsPrep &pargs, XrdOucEnv *Info=0)
 
void PutInfo (XrdCmsPerfMon::PerfInfo &perfInfo, bool alert=false)
 
int Release (int n)
 
void Removed (const char *path)
 
int Reserve (int n)
 
int Resource (int n)
 
void Resume (int Perm=1)
 
int RunAdmin (char *Path, const char *vnid)
 
void * RunPM ()
 
int Space (XrdOucErrInfo &Resp, const char *path, XrdOucEnv *envP=0)
 
void * Start ()
 
void Suspend (int Perm=1)
 
void Utilization (unsigned int util, bool alert=false)
 
- Public Member Functions inherited from XrdCmsClient
 XrdCmsClient (Persona acting)
 
virtual ~XrdCmsClient ()
 Destructor. More...
 
virtual int Forward (XrdOucErrInfo &Resp, const char *cmd, const char *arg1=0, const char *arg2=0, XrdOucEnv *Env1=0, XrdOucEnv *Env2=0)
 
virtual int isRemote ()
 
- Public Member Functions inherited from XrdCmsPerfMon
 XrdCmsPerfMon ()
 Constructor & Destructor. More...
 
virtual ~XrdCmsPerfMon ()
 
virtual bool Configure (const char *cfn, char *Parms, XrdSysLogger &Logger, XrdCmsPerfMon &cmsMon, XrdOucEnv *EnvInfo, bool isCMS)
 
virtual void GetInfo (PerfInfo &info)
 

Static Public Member Functions

static bool VCheck (XrdVersionInfo &urVersion)
 

Additional Inherited Members

- Public Types inherited from XrdCmsClient
enum  Persona {
  amLocal ,
  amRemote ,
  amTarget
}
 
- Protected Attributes inherited from XrdCmsClient
Persona myPersona
 

Detailed Description

Definition at line 122 of file XrdCmsFinder.hh.

Constructor & Destructor Documentation

◆ XrdCmsFinderTRG()

XrdCmsFinderTRG::XrdCmsFinderTRG ( XrdSysLogger lp,
int  whoami,
int  port,
XrdOss theSS = 0 
)

Definition at line 889 of file XrdCmsFinder.cc.

892 {
893  isRedir = whoami & IsRedir;
894  isProxy = whoami & IsProxy;
895  SS = theSS;
896  CMSPath = 0;
897  Login = 0;
898  myManList = 0;
899  CMSp = new XrdOucStream(&Say);
900  Active = 0;
901  myPort = port;
902  resMax = -1;
903  resCur = 0;
904  Say.logger(lp);
905 }
XrdCmsClient(Persona acting)
@ amTarget
Am a server and field redirects.
XrdSysLogger * logger(XrdSysLogger *lp=0)
Definition: XrdSysError.hh:141
@ IsProxy
The role is proxy {plus one or more of the below}.
@ IsRedir
The role is manager and will redirect users.
XrdSysError Say(0, "cms_")

References XrdCms::IsProxy, XrdCms::IsRedir, XrdSysError::logger(), and XrdCms::Say().

+ Here is the call graph for this function:

◆ ~XrdCmsFinderTRG()

XrdCmsFinderTRG::~XrdCmsFinderTRG ( )

Definition at line 911 of file XrdCmsFinder.cc.

912 {
913  XrdOucTList *tp, *tpp = myManList;
914 
915  if (CMSp) delete CMSp;
916  if (Login) free(Login);
917 
918  while((tp = tpp)) {tpp = tp->next; delete tp;}
919 }
XrdOucTList * next
Definition: XrdOucTList.hh:45

References XrdOucTList::next.

Member Function Documentation

◆ Added()

void XrdCmsFinderTRG::Added ( const char *  path,
int  Pend = 0 
)
virtual

Notify the cms of a newly added file or a file whose state has changed on a data server node.

Parameters
pathThe logical file name.
PendWhen true, the file is scheduled to be present in the future (e.g. copied in).

Reimplemented from XrdCmsClient.

Definition at line 925 of file XrdCmsFinder.cc.

926 {
927  char *data[4];
928  int dlen[4];
929 
930 // Set up to notify the cluster that a file has been added
931 //
932  data[0] = (char *)"newfn "; dlen[0] = 6;
933  data[1] = (char *)path; dlen[1] = strlen(path);
934  if (Pend)
935  {data[2] = (char *)" p\n"; dlen[2] = 3;}
936  else
937  {data[2] = (char *)"\n"; dlen[2] = 1;}
938  data[3] = 0; dlen[3] = 0;
939 
940 // Now send the notification
941 //
942  myData.Lock();
943  if (Active && CMSp->Put((const char **)data, (const int *)dlen))
944  {CMSp->Close(); Active = 0;}
945  myData.UnLock();
946 }
int Put(const char *data, const int dlen)
void Close(int hold=0)

References XrdOucStream::Close(), XrdSysMutex::Lock(), XrdOucStream::Put(), and XrdSysMutex::UnLock().

+ Here is the call graph for this function:

◆ Configure()

int XrdCmsFinderTRG::Configure ( const char *  cfn,
char *  Parms,
XrdOucEnv EnvInfo 
)
virtual

Configure the client object.

Parameters
cfnThe configuration file name.
ParmsAny parameters specified in the cmslib directive. If none, the pointer may be null.
EnvInfoEnvironmental information of the caller.
Returns
Success !0 Failure =0

Implements XrdCmsClient.

Definition at line 965 of file XrdCmsFinder.cc.

966 {
967  XrdCmsClientConfig config(this);
969 
970 // Establish what we will be configuring
971 //
972  What = (isRedir ? XrdCmsClientConfig::configSuper
974 
975 // Steal the manlist as we might have to report it
976 //
977  if (isProxy) {myManList = config.PanList; config.PanList = 0;}
978  else {myManList = config.ManList; config.ManList = 0;}
979 
980 // Set the error dest and simply call the configration object and if
981 //
982  if (config.Configure(cfn, What, XrdCmsClientConfig::configNorm)) return 0;
983 
984 // Run the Admin thread. Note that unlike FinderRMT, we do not extract the
985 // security function pointer or the network object pointer from the
986 // environment as we don't need these at all.
987 //
988  if (RunAdmin(config.CMSPath, config.myVNID)
989  && config.perfMon && config.perfInt)
990  {pthread_t tid;
991  perfMon = config.perfMon;
992  perfInt = config.perfInt;
993  if (XrdSysThread::Run(&tid, StartPM, (void *)this, 0, "perfmon"))
994 // if (XrdSysThread::Run(&tid, StartRsp, (void *)this, 0, "cms i/f"))
995  {Say.Emsg("Config", errno, "start performance monitor."); return 0;}
996  }
997 
998 // Record the address of this cms client
999 //
1001  envP->PutPtr("XrdCmsClientT*", (XrdCmsClient*)this);
1002 
1003 // All done
1004 //
1005  return 1;
1006 }
int RunAdmin(char *Path, const char *vnid)
void PutPtr(const char *varname, void *value)
Definition: XrdOucEnv.cc:316
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition: XrdSysError.cc:95
static int Run(pthread_t *, void *(*proc)(void *), void *arg, int opts=0, const char *desc=0)
XrdOucEnv * envP
Definition: XrdPss.cc:109

References XrdCmsClientConfig::CMSPath, XrdCmsClientConfig::configNorm, XrdCmsClientConfig::configServer, XrdCmsClientConfig::configSuper, XrdCmsClientConfig::Configure(), XrdSysError::Emsg(), XrdProxy::envP, XrdCmsClientConfig::ManList, XrdCmsClientConfig::myVNID, XrdCmsClientConfig::PanList, XrdCmsClientConfig::perfInt, XrdCmsClientConfig::perfMon, XrdOucEnv::PutPtr(), XrdSysThread::Run(), RunAdmin(), and XrdCms::Say().

+ Here is the call graph for this function:

◆ Locate()

int XrdCmsFinderTRG::Locate ( XrdOucErrInfo Resp,
const char *  path,
int  flags,
XrdOucEnv Info = 0 
)
virtual

Retrieve file location information.

Parameters
RespObject where message or response is to be returned.
pathThe logical path whise location is wanted.
flagsOne or more of the following:
     SFS_O_LOCATE  - return the list of servers that have the file.
                     Otherwise, redirect to the best server for the file.
     SFS_O_NOWAIT  - w/ SFS_O_LOCATE return readily available info.
                     Otherwise, select online files only.
     SFS_O_CREAT   - file will be created.
     SFS_O_NOWAIT  - select server if file is online.
     SFS_O_REPLICA - a replica of the file will be made.
     SFS_O_STAT    - only stat() information wanted.
     SFS_O_TRUNC   - file will be truncated.

     For any the the above, additional flags are passed:
     SFS_O_META    - data will not change (inode operation only)
     SFS_O_RESET   - reset cached info and recaculate the location(s).
     SFS_O_WRONLY  - file will be only written    (o/w RDWR   or RDONLY).
     SFS_O_RDWR    - file may be read and written (o/w WRONLY or RDONLY).
InfoAssociated environmental information for arg2 (e.g., cgi info which can be retrieved by Env1->Env(<len>)).
Returns
As explained under "return conventions".

Implements XrdCmsClient.

Definition at line 1012 of file XrdCmsFinder.cc.

1014 {
1015  char *mBuff;
1016  int mBlen, n;
1017 
1018 // We only support locate on the local configuration
1019 //
1020  if (!(flags & SFS_O_LOCATE) || !(flags & SFS_O_LOCAL))
1021  {Resp.setErrInfo(EINVAL, "Invalid locate option for target config.");
1022  return SFS_ERROR;
1023  }
1024 
1025 // Get the buffer for the result
1026 //
1027  mBuff = Resp.getMsgBuff(mBlen);
1028 
1029 // Return information
1030 //
1031  n = snprintf(mBuff, mBlen, "localhost:0/%c", (Active ? 'a' : 'd'));
1032  Resp.setErrCode(n);
1033  return SFS_DATA;
1034 }
#define SFS_DATA
#define SFS_ERROR
#define SFS_O_LOCATE
#define SFS_O_LOCAL
int setErrInfo(int code, const char *emsg)
char * getMsgBuff(int &mblen)
int setErrCode(int code)

References XrdOucErrInfo::getMsgBuff(), XrdOucErrInfo::setErrCode(), XrdOucErrInfo::setErrInfo(), SFS_DATA, SFS_ERROR, SFS_O_LOCAL, and SFS_O_LOCATE.

+ Here is the call graph for this function:

◆ Managers()

XrdOucTList* XrdCmsFinderTRG::Managers ( )
inlinevirtual

Obtain the list of cmsd's being used by a manager node along with their associated index numbers, origin 1.

Returns
The list of cmsd's being used. The list is considered permanent and is not deleted.

Reimplemented from XrdCmsClient.

Definition at line 135 of file XrdCmsFinder.hh.

135 {return myManList;}

◆ Prepare()

int XrdCmsFinderTRG::Prepare ( XrdOucErrInfo Resp,
XrdSfsPrep pargs,
XrdOucEnv Info = 0 
)
inlinevirtual

Start the preparation of a file for future processing.

Parameters
RespObject where message or response is to be returned.
pargsInformation on which and how to prepare the file.
InfoAssociated environmental information.
Returns
As explained under "return conventions".

Reimplemented from XrdCmsClient.

Definition at line 132 of file XrdCmsFinder.hh.

133  {return 0;}

◆ PutInfo()

void XrdCmsFinderTRG::PutInfo ( XrdCmsPerfMon::PerfInfo info,
bool  alert = false 
)
virtual

Report performance statistics as load values from 0 to 100. The performance monitor plugin may call this method to asynchronously report performance via the passed XrdCmsPerfMon object during configuration.

Parameters
infoReference to the structure that should be filled out with load values. See the PerfInfo structure.
alertWhen true, load information is forcibly sent to the cluster's manager. Otherwise, it is only sent if it significantly changes. See the cms.sched directive fuzz parameter.

Reimplemented from XrdCmsPerfMon.

Definition at line 1041 of file XrdCmsFinder.cc.

1042 {
1043  char buff[256];
1044  char *data[2] = {buff, 0};
1045  int dlen[2];
1046  uint32_t cpu_load, mem_load, net_load, pag_load, xeq_load;
1047 
1048  cpu_load = (perfInfo.cpu_load <= 100 ? perfInfo.cpu_load : 100);
1049  mem_load = (perfInfo.mem_load <= 100 ? perfInfo.mem_load : 100);
1050  net_load = (perfInfo.net_load <= 100 ? perfInfo.net_load : 100);
1051  pag_load = (perfInfo.pag_load <= 100 ? perfInfo.pag_load : 100);
1052  xeq_load = (perfInfo.xeq_load <= 100 ? perfInfo.xeq_load : 100);
1053 
1054  dlen[0] = snprintf(buff, sizeof(buff), "%s %u %u %u %u %u\n",
1055  (alert ? "PERF" : "perf"),
1056  xeq_load, cpu_load, mem_load, pag_load, net_load);
1057  dlen[1] = 0;
1058 
1059 // Now send the notification
1060 //
1061  myData.Lock();
1062  if (Active && CMSp->Put((const char **)data, (const int *)dlen))
1063  {CMSp->Close(); Active = 0;}
1064  myData.UnLock();
1065 }

References XrdOucStream::Close(), XrdCmsPerfMon::PerfInfo::cpu_load, XrdSysMutex::Lock(), XrdCmsPerfMon::PerfInfo::mem_load, XrdCmsPerfMon::PerfInfo::net_load, XrdCmsPerfMon::PerfInfo::pag_load, XrdOucStream::Put(), XrdSysMutex::UnLock(), and XrdCmsPerfMon::PerfInfo::xeq_load.

Referenced by RunPM(), and Utilization().

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

◆ Release()

int XrdCmsFinderTRG::Release ( int  n)
virtual

Increases the amount of resource available. When transitioning from a a non-positive to a positive resource amount, perform a resume so that additional clients may be dispatched to this data server.

Parameters
nThe value to add to the resources available (default 1). The total amount is capped by the amount specified by Resource().
Returns
The amount of resource left.

Reimplemented from XrdCmsClient.

Definition at line 1071 of file XrdCmsFinder.cc.

1072 {
1073  int resOld;
1074 
1075 // Lock the variables of interest
1076 //
1077  rrMutex.Lock();
1078  resOld = resCur;
1079 
1080 // If reserve/release not enabled or we have a non-positive value, return
1081 //
1082  if (resMax < 0 || rNum <= 0) {rrMutex.UnLock(); return resOld;}
1083 
1084 // Adjust resource and check if we can resume
1085 //
1086  resCur += rNum;
1087  if (resCur > resMax) resCur = resMax;
1088  if (resOld < 1 && resCur > 0) Resume(0);
1089 
1090 // All done
1091 //
1092  resOld = resCur;
1093  rrMutex.UnLock();
1094  return resOld;
1095 }
void Resume(int Perm=1)

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

+ Here is the call graph for this function:

◆ Removed()

void XrdCmsFinderTRG::Removed ( const char *  path)
virtual

Notify the cmsd that a file or directory has been deleted. It is only called called on a data server node.

Parameters
pathThe logical file name that was removed.

Reimplemented from XrdCmsClient.

Definition at line 1101 of file XrdCmsFinder.cc.

1102 {
1103  char *data[4];
1104  int dlen[4];
1105 
1106 // Set up to notify the cluster that a file has been removed
1107 //
1108  data[0] = (char *)"rmdid "; dlen[0] = 6;
1109  data[1] = (char *)path; dlen[1] = strlen(path);
1110  data[2] = (char *)"\n"; dlen[2] = 1;
1111  data[3] = 0; dlen[3] = 0;
1112 
1113 // Now send the notification
1114 //
1115  myData.Lock();
1116  if (Active && CMSp->Put((const char **)data, (const int *)dlen))
1117  {CMSp->Close(); Active = 0;}
1118  myData.UnLock();
1119 }

References XrdOucStream::Close(), XrdSysMutex::Lock(), XrdOucStream::Put(), and XrdSysMutex::UnLock().

+ Here is the call graph for this function:

◆ Reserve()

int XrdCmsFinderTRG::Reserve ( int  n)
virtual

Decreases the amount of resources available. When the available resources becomes non-positive, perform a temporary suspend to prevent additional clients from being dispatched to this data server.

Parameters
nThe value by which resources are decreased (default 1).
Returns
The amount of resource left.

Reimplemented from XrdCmsClient.

Definition at line 1125 of file XrdCmsFinder.cc.

1126 {
1127  int resOld;
1128 
1129 // Lock the variables of interest
1130 //
1131  rrMutex.Lock();
1132  resOld = resCur;
1133 
1134 // If reserve/release not enabled or we have a non-positive value, return
1135 //
1136  if (resMax < 0 || rNum <= 0) {rrMutex.UnLock(); return resOld;}
1137 
1138 // Adjust resource and check if we can suspend
1139 //
1140  resCur -= rNum;
1141  if (resOld > 0 && resCur < 1) Suspend(0);
1142 
1143 // All done
1144 //
1145  resOld = resCur;
1146  rrMutex.UnLock();
1147  return resOld;
1148 }
void Suspend(int Perm=1)

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

+ Here is the call graph for this function:

◆ Resource()

int XrdCmsFinderTRG::Resource ( int  n)
virtual

Enables the Reserve() & Release() methods.

Parameters
na positive integer that specifies the amount of resource units that are available. It may be reset at any time.
Returns
The previous resource value. This first call returns 0.

Reimplemented from XrdCmsClient.

Definition at line 1154 of file XrdCmsFinder.cc.

1155 {
1156  int resOld;
1157 
1158 // Lock the variables of interest
1159 //
1160  rrMutex.Lock();
1161  resOld = (resMax < 0 ? 0 : resMax);
1162 
1163 // If we have a non-positive value, return
1164 //
1165  if (rNum <= 0) {rrMutex.UnLock(); return resOld;}
1166 
1167 // Set the resource and adjust the current value as needed
1168 //
1169  resMax = rNum;
1170  if (resCur > resMax) resCur = resMax;
1171 
1172 // All done
1173 //
1174  rrMutex.UnLock();
1175  return resOld;
1176 }

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

+ Here is the call graph for this function:

◆ Resume()

void XrdCmsFinderTRG::Resume ( int  Perm = 1)
virtual

Resume service after a suspension.

Parameters
PermWhen true the resume persist across server restarts. Otherwise, it is treated as a temporary request.

Reimplemented from XrdCmsClient.

Definition at line 1182 of file XrdCmsFinder.cc.

1183 { // 1234567890
1184  static const char *rPerm[2] = {"resume\n", 0};
1185  static const char *rTemp[2] = {"resume t\n", 0};
1186  static int lPerm[2] = { 7, 0};
1187  static int lTemp[2] = { 9, 0};
1188 
1189 // Now send the notification
1190 //
1191  myData.Lock();
1192  if (Active && CMSp->Put((const char **)(Perm ? rPerm : rTemp),
1193  (const int *) (Perm ? lPerm : lTemp)))
1194  {CMSp->Close(); Active = 0;}
1195  myData.UnLock();
1196 }

References XrdOucStream::Close(), XrdSysMutex::Lock(), XrdOucStream::Put(), and XrdSysMutex::UnLock().

Referenced by Release().

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

◆ RunAdmin()

int XrdCmsFinderTRG::RunAdmin ( char *  Path,
const char *  vnid 
)

Definition at line 1221 of file XrdCmsFinder.cc.

1222 {
1223  const char *lFmt;
1224  pthread_t tid;
1225  char buff [512];
1226 
1227 // Make sure we have a path to the cmsd
1228 //
1229  if (!(CMSPath = Path))
1230  {Say.Emsg("Config", "Unable to determine cms admin path"); return 0;}
1231 
1232 // Construct the login line
1233 //
1234  lFmt = (vnid ? "login %c %d port %d vnid %s\n" : "login %c %d port %d\n");
1235  snprintf(buff, sizeof(buff), lFmt, (isProxy ? 'P' : 'p'),
1236  static_cast<int>(getpid()), myPort, vnid);
1237  Login = strdup(buff);
1238 
1239 // Start a thread to connect with the local cmsd
1240 //
1241  if (XrdSysThread::Run(&tid, StartRsp, (void *)this, 0, "cms i/f"))
1242  {Say.Emsg("Config", errno, "start cmsd interface"); return 0;}
1243 
1244  return 1;
1245 }
XrdOucString Path

References XrdSysError::Emsg(), Path, XrdSysThread::Run(), and XrdCms::Say().

Referenced by XrdCmsFinderRMT::Configure(), and Configure().

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

◆ RunPM()

void * XrdCmsFinderTRG::RunPM ( )

Definition at line 1251 of file XrdCmsFinder.cc.

1252 {
1253  XrdCmsPerfMon::PerfInfo perfInfo;
1254 
1255 // Keep asking the plugin for statistics.
1256 //
1257  while(1)
1258  {perfMon->GetInfo(perfInfo);
1259  PutInfo(perfInfo);
1260  perfInfo.Clear();
1261  XrdSysTimer::Snooze(perfInt);
1262  }
1263  return (void *)0;
1264 }
void PutInfo(XrdCmsPerfMon::PerfInfo &perfInfo, bool alert=false)
virtual void GetInfo(PerfInfo &info)
static void Snooze(int seconds)
Definition: XrdSysTimer.cc:168
Structure used for reporting performance metrics.

References XrdCmsPerfMon::PerfInfo::Clear(), XrdCmsPerfMon::GetInfo(), PutInfo(), and XrdSysTimer::Snooze().

+ Here is the call graph for this function:

◆ Space()

int XrdCmsFinderTRG::Space ( XrdOucErrInfo Resp,
const char *  path,
XrdOucEnv Info = 0 
)
inlinevirtual

Obtain the overall space usage of a cluster. Called only on manager nodes.

Parameters
RespObject to hold response or error message.
pathAssociated logical path for the space request.
InfoAssociated cgi information for path.
Returns
Space information as defined by the response to kYR_statfs. For a typical implementation see XrdCmsNode::do_StatFS().

Implements XrdCmsClient.

Definition at line 152 of file XrdCmsFinder.hh.

153  {return 0;}

◆ Start()

void * XrdCmsFinderTRG::Start ( )

Definition at line 1270 of file XrdCmsFinder.cc.

1271 {
1272  XrdCmsRRData Data;
1273 
1274 // First step is to connect to the local cmsd. We also establish a binary
1275 // read stream (old olbd's never used it) to get requests that can only be
1276 // executed by the xrootd (e.g., rm and mv).
1277 //
1278  while(1)
1279  {do {Hookup();
1280 
1281  // Login to cmsd
1282  //
1283  myData.Lock();
1284  CMSp->Put(Login);
1285  myData.UnLock();
1286 
1287  // Get the FD for this connection
1288  //
1289  Data.Routing = CMSp->FDNum();
1290 
1291  // Put up a read to process local requests. Sould the cmsd die,
1292  // we will notice and try to reconnect.
1293  //
1294  while(recv(Data.Routing, &Data.Request, sizeof(Data.Request),
1295  MSG_WAITALL) > 0 && Process(Data)) {}
1296  break;
1297  } while(1);
1298 
1299  // The cmsd went away
1300  //
1301  myData.Lock();
1302  CMSp->Close();
1303  Active = 0;
1304  myData.UnLock();
1305  Say.Emsg("Finder", "Lost contact with cmsd via", CMSPath);
1306  XrdSysTimer::Wait(10*1000);
1307  }
1308 
1309 // We should never get here
1310 //
1311  return (void *)0;
1312 }
XrdCms::CmsRRHdr Request
Definition: XrdCmsRRData.hh:54
static void Wait(int milliseconds)
Definition: XrdSysTimer.cc:227

References XrdOucStream::Close(), XrdSysError::Emsg(), XrdOucStream::FDNum(), XrdSysMutex::Lock(), XrdOucStream::Put(), XrdCmsRRData::Request, XrdCmsRRData::Routing, XrdCms::Say(), XrdSysMutex::UnLock(), and XrdSysTimer::Wait().

+ Here is the call graph for this function:

◆ Suspend()

void XrdCmsFinderTRG::Suspend ( int  Perm = 1)
virtual

Suspend service.

Parameters
PermWhen true the suspend persist across server restarts. Otherwise, it is treated as a temporary request.

Reimplemented from XrdCmsClient.

Definition at line 1202 of file XrdCmsFinder.cc.

1203 { // 1234567890
1204  static const char *sPerm[2] = {"suspend\n", 0};
1205  static const char *sTemp[2] = {"suspend t\n", 0};
1206  static int lPerm[2] = { 8, 0};
1207  static int lTemp[2] = {10, 0};
1208 
1209 // Now send the notification
1210 //
1211  if (Active && CMSp->Put((const char **)(Perm ? sPerm : sTemp),
1212  (const int *) (Perm ? lPerm : lTemp)))
1213  {CMSp->Close(); Active = 0;}
1214  myData.UnLock();
1215 }

References XrdOucStream::Close(), XrdOucStream::Put(), and XrdSysMutex::UnLock().

Referenced by Reserve().

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

◆ Utilization()

void XrdCmsFinderTRG::Utilization ( unsigned int  util,
bool  alert = false 
)
virtual

Report utilization of this server. This may be used in lieu of general performance metric reporting. For consistent results use only one method.

Parameters
utilA value from 0 to 100 representing utilization. Values greater than 100 are set to be 100.
alertWhen true the utilization is forcibly report to the cluster managers. Otherwise, reporting is done only when it will significantly change server selection.

Reimplemented from XrdCmsClient.

Definition at line 1318 of file XrdCmsFinder.cc.

1319 {
1320  XrdCmsPerfMon::PerfInfo perfInfo;
1321 
1322 // Make sure value is in range
1323 //
1324  if (util > 100) util = 100;
1325 
1326 // Send this out as a performance figure
1327 //
1328  perfInfo.cpu_load = util;
1329  perfInfo.mem_load = util;
1330  perfInfo.net_load = util;
1331  perfInfo.pag_load = util;
1332  perfInfo.xeq_load = util;
1333  PutInfo(perfInfo, alert);
1334 }
unsigned char pag_load
Paging 0 to 100 utilization.
unsigned char xeq_load
Other 0 to 100 utilization (arbitrary)
unsigned char cpu_load
CPU 0 to 100 utilization.
unsigned char mem_load
Memory 0 to 100 utilization.
unsigned char net_load
Network 0 to 100 utilization.

References XrdCmsPerfMon::PerfInfo::cpu_load, XrdCmsPerfMon::PerfInfo::mem_load, XrdCmsPerfMon::PerfInfo::net_load, XrdCmsPerfMon::PerfInfo::pag_load, PutInfo(), and XrdCmsPerfMon::PerfInfo::xeq_load.

+ Here is the call graph for this function:

◆ VCheck()

bool XrdCmsFinderTRG::VCheck ( XrdVersionInfo &  urVersion)
static

Definition at line 1340 of file XrdCmsFinder.cc.

1341 {
1342  return XrdSysPlugin::VerCmp(urVersion, myVersion);
1343 }
static bool VerCmp(XrdVersionInfo &vInf1, XrdVersionInfo &vInf2, bool noMsg=false)
XrdVersionInfo myVersion

References XrdCms::myVersion, and XrdSysPlugin::VerCmp().

+ Here is the call graph for this function:

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