XRootD
XrdCmsSupervisor Class Reference

#include <XrdCmsSupervisor.hh>

+ Collaboration diagram for XrdCmsSupervisor:

Public Member Functions

 XrdCmsSupervisor ()
 
 ~XrdCmsSupervisor ()
 

Static Public Member Functions

static int Init (const char *AdminPath, int AdminMode)
 
static void Start ()
 

Static Public Attributes

static int superOK = 0
 

Detailed Description

Definition at line 36 of file XrdCmsSupervisor.hh.

Constructor & Destructor Documentation

◆ XrdCmsSupervisor()

XrdCmsSupervisor::XrdCmsSupervisor ( )
inline

Definition at line 46 of file XrdCmsSupervisor.hh.

46 {}

◆ ~XrdCmsSupervisor()

XrdCmsSupervisor::~XrdCmsSupervisor ( )
inline

Definition at line 47 of file XrdCmsSupervisor.hh.

47 {}

Member Function Documentation

◆ Init()

int XrdCmsSupervisor::Init ( const char *  AdminPath,
int  AdminMode 
)
static

Definition at line 58 of file XrdCmsSupervisor.cc.

59 {
60  char spbuff[1024];
61 
62 // Create the supervisor unix domain socket. We use this for the redirector
63 // assigned to this supervisor node (one one redirector allowed)
64 //
65  if (!XrdNetSocket::socketPath(&Say, spbuff, AdminPath,
66  "olbd.super", AdminMode | S_IFSOCK)) return 1;
67 
68 // Create a new network suitable for use with XrdLink objects
69 //
70  if (!(NetTCPr = new XrdInet(&Say)))
71  {Say.Emsg("Supervisor","Unable to create supervisor interface.");
72  return 0;
73  }
74 
75 // Set out domain name for this network
76 //
77  if (Config.myDomain) NetTCPr->setDomain(Config.myDomain);
78 
79 // Bind the unix domain path to the network
80 //
81  if (NetTCPr->Bind(spbuff, "tcp")) return 0;
82 
83 // We need to force the minimum number of subscribers to be one and never a
84 // percentage, regardless of what was specified in the config file. This is
85 // because supervisors may loose their subscribers in unusual ways. We also
86 // set the drop delay to zero to immediately drop servers from the config to
87 // avoid stalling clients at a supervisor node.
88 //
89  Config.SUPCount = 1;
90  Config.SUPLevel = 0;
91  Config.DRPDelay = 0;
92 
93 // All done
94 //
95  superOK = 1;
96  return 1;
97 }
const char * myDomain
static char * socketPath(XrdSysError *Say, char *inbuff, const char *path, const char *fn, mode_t mode)
int Bind(int port, const char *contype="tcp")
Definition: XrdNet.cc:164
void setDomain(const char *dname)
Definition: XrdNet.hh:233
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition: XrdSysError.cc:95
XrdSysError Say
XrdCmsConfig Config

References XrdCms::Config, XrdCmsConfig::DRPDelay, XrdSysError::Emsg(), XrdCmsConfig::myDomain, XrdCms::Say, XrdNetSocket::socketPath(), XrdCmsConfig::SUPCount, and XrdCmsConfig::SUPLevel.

+ Here is the call graph for this function:

◆ Start()

void XrdCmsSupervisor::Start ( )
static

Definition at line 103 of file XrdCmsSupervisor.cc.

104 {
105  XrdCmsProtocol *pP;
106  XrdLink *lP;
107 
108 // Accept single connections and dispatch the supervisor data interface
109 //
110  while(1)
111  if ((lP = NetTCPr->Accept(XRDNET_NODNTRIM)))
112  {if ((pP = XrdCmsProtocol::Alloc("redirector")))
113  {lP->setProtocol((XrdProtocol *)pP);
114  pP->Process(lP);
115  lP->Close();
116  }
117  }
118 }
#define XRDNET_NODNTRIM
Definition: XrdNetOpts.hh:51
static XrdCmsProtocol * Alloc(const char *theRole="", XrdCmsManager *mP=0, const char *theMan=0, int thePort=0)
XrdLink * Accept(int opts=0, int timeout=-1, XrdSysSemaphore *theSem=0)
Definition: XrdInet.cc:72
virtual int Process(XrdLink *lp)=0

References XrdCmsProtocol::Alloc(), XrdLink::Close(), XrdProtocol::Process(), XrdLink::setProtocol(), and XRDNET_NODNTRIM.

Referenced by XrdCmsStartSupervising().

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

Member Data Documentation

◆ superOK

int XrdCmsSupervisor::superOK = 0
static

Definition at line 40 of file XrdCmsSupervisor.hh.

Referenced by XrdCmsConfig::DoIt().


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