ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdProofdNetMgr Class Reference

Definition at line 38 of file XrdProofdNetMgr.h.

Public Member Functions

 XrdProofdNetMgr (XrdProofdManager *mgr, XrdProtocol_Config *pi, XrdSysError *e)
 Constructor. More...
 
virtual ~XrdProofdNetMgr ()
 Destructor. More...
 
int Config (bool rcf=0)
 Run configuration and parse the entered config directives. More...
 
int DoDirective (XrdProofdDirective *d, char *val, XrdOucStream *cfg, bool rcf)
 Update the priorities of the active sessions. More...
 
void RegisterDirectives ()
 Register config directives. More...
 
void Dump ()
 Dump status. More...
 
const char * PROOFcfg () const
 
bool WorkerUsrCfg () const
 
int Broadcast (int type, const char *msg, const char *usr=0, XrdProofdResponse *r=0, bool notify=0, int subtype=-1)
 Broadcast request to known potential sub-nodes. More...
 
int BroadcastCtrlC (const char *usr)
 Broadcast a ctrlc interrupt Return 0 on success, -1 on error. More...
 
XrdProofConnGetProofConn (const char *url)
 Get a XrdProofConn for url; create a new one if not available. More...
 
bool IsLocal (const char *host, bool checkport=0)
 Check if 'host' is this local host. More...
 
XrdClientMessageSend (const char *url, int type, const char *msg, int srvtype, XrdProofdResponse *r, bool notify=0, int subtype=-1)
 Broadcast request to known potential sub-nodes. More...
 
int ReadBuffer (XrdProofdProtocol *p)
 Process a readbuf request. More...
 
char * ReadBufferLocal (const char *file, kXR_int64 ofs, int &len)
 Read a buffer of length 'len' at offset 'ofs' of local file 'path'; the returned buffer must be freed by the caller. More...
 
char * ReadBufferLocal (const char *file, const char *pat, int &len, int opt)
 Grep lines matching 'pat' form 'path'; the returned buffer (length in 'len') must be freed by the caller. More...
 
char * ReadBufferRemote (const char *url, const char *file, kXR_int64 ofs, int &len, int grep)
 Send a read buffer request of length 'len' at offset 'ofs' for remote file defined by 'url'; the returned buffer must be freed by the caller. More...
 
char * ReadLogPaths (const char *url, const char *stag, int isess)
 Get log paths from next tier; used in multi-master setups Returns 0 in case of error. More...
 
char * ReadLogPaths (const char *stag, int isess)
 Get log paths from next tier; used in multi-master setups Returns 0 in case of error. More...
 
std::list< XrdProofWorker * > * GetActiveWorkers ()
 Return the list of workers after having made sure that the info is up-to-date. More...
 
std::list< XrdProofWorker * > * GetNodes ()
 Return the list of unique nodes after having made sure that the info is up-to-date. More...
 
void BalanceNodesOrder ()
 Indices (this will be used twice). More...
 
- Public Member Functions inherited from XrdProofdConfig
 XrdProofdConfig (const char *cfg=0, XrdSysError *edest=0)
 Main constructor. More...
 
virtual ~XrdProofdConfig ()
 
void SetCfgEDest (const char *cfg, XrdSysError *edest)
 Set config file and error handler. More...
 
const char * CfgFile () const
 

Private Member Functions

void CreateDefaultPROOFcfg ()
 Fill-in fWorkers for a localhost based on the number of workers fNumLocalWrks. More...
 
int ReadPROOFcfg (bool reset=1)
 Read PROOF config file and load the information in fWorkers. More...
 
int FindUniqueNodes ()
 Scan fWorkers for unique nodes (stored in fNodes). More...
 
int LocateLocalFile (XrdOucString &file)
 Locate the exact file path allowing for wildcards '*' in the file name. More...
 
int DoDirectiveBonjour (char *val, XrdOucStream *cfg, bool)
 
int DoDirectiveAdminReqTO (char *, XrdOucStream *, bool)
 Process 'adminreqto' directive. More...
 
int DoDirectiveResource (char *, XrdOucStream *, bool)
 Process 'resource' directive. More...
 
int DoDirectiveWorker (char *, XrdOucStream *, bool)
 Process 'worker' directive. More...
 

Private Attributes

XrdSysRecMutex fMutex
 
XrdProofdManagerfMgr
 
XrdOucHash< XrdProofConnfProofConnHash
 
int fNumLocalWrks
 
int fResourceType
 
XrdProofdFile fPROOFcfg
 
bool fReloadPROOFcfg
 
bool fDfltFallback
 
bool fWorkerUsrCfg
 
int fRequestTO
 
std::list< XrdProofWorker * > fDfltWorkers
 
std::list< XrdProofWorker * > fRegWorkers
 
std::list< XrdProofWorker * > fWorkers
 
std::list< XrdProofWorker * > fNodes
 
bool fBonjourEnabled
 

Additional Inherited Members

- Protected Member Functions inherited from XrdProofdConfig
int ParseFile (bool rcf=false)
 Parse config file for the registered directives. More...
 
bool ReadFile (bool update=true)
 Return true if the file has never been read or did change since last reading, false otherwise. More...
 
void Register (const char *dname, XrdProofdDirective *d)
 
- Protected Attributes inherited from XrdProofdConfig
XrdSysErrorfEDest
 

#include <XrdProofdNetMgr.h>

Inheritance diagram for XrdProofdNetMgr:
[legend]

Constructor & Destructor Documentation

XrdProofdNetMgr::XrdProofdNetMgr ( XrdProofdManager mgr,
XrdProtocol_Config *  pi,
XrdSysError e 
)

Constructor.

Definition at line 67 of file XrdProofdNetMgr.cxx.

XrdProofdNetMgr::~XrdProofdNetMgr ( )
virtual

Destructor.

Definition at line 105 of file XrdProofdNetMgr.cxx.

Member Function Documentation

void XrdProofdNetMgr::BalanceNodesOrder ( )

Indices (this will be used twice).

Definition at line 253 of file XrdProofdNetMgr.cxx.

int XrdProofdNetMgr::Broadcast ( int  type,
const char *  msg,
const char *  usr = 0,
XrdProofdResponse r = 0,
bool  notify = 0,
int  subtype = -1 
)

Broadcast request to known potential sub-nodes.

Return 0 on success, -1 on error

Definition at line 573 of file XrdProofdNetMgr.cxx.

Referenced by XrdProofdAdmin::CleanupSessions(), XrdProofdAdmin::Exec(), and XrdProofdAdmin::SetROOTVersion().

int XrdProofdNetMgr::BroadcastCtrlC ( const char *  usr)

Broadcast a ctrlc interrupt Return 0 on success, -1 on error.

Definition at line 507 of file XrdProofdNetMgr.cxx.

Referenced by XrdProofdProtocol::CtrlC().

int XrdProofdNetMgr::Config ( bool  rcf = 0)
virtual

Run configuration and parse the entered config directives.

Return 0 on success, -1 on error

Reimplemented from XrdProofdConfig.

Definition at line 126 of file XrdProofdNetMgr.cxx.

Referenced by XrdProofdManager::Config().

void XrdProofdNetMgr::CreateDefaultPROOFcfg ( )
private

Fill-in fWorkers for a localhost based on the number of workers fNumLocalWrks.

Definition at line 1378 of file XrdProofdNetMgr.cxx.

Referenced by Config(), GetActiveWorkers(), and GetNodes().

int XrdProofdNetMgr::DoDirective ( XrdProofdDirective d,
char *  val,
XrdOucStream *  cfg,
bool  rcf 
)
virtual

Update the priorities of the active sessions.

Reimplemented from XrdProofdConfig.

Definition at line 209 of file XrdProofdNetMgr.cxx.

int XrdProofdNetMgr::DoDirectiveAdminReqTO ( char *  val,
XrdOucStream *  cfg,
bool   
)
private

Process 'adminreqto' directive.

Definition at line 366 of file XrdProofdNetMgr.cxx.

Referenced by DoDirective().

int XrdProofdNetMgr::DoDirectiveBonjour ( char *  val,
XrdOucStream *  cfg,
bool   
)
private

Definition at line 235 of file XrdProofdNetMgr.cxx.

Referenced by DoDirective().

int XrdProofdNetMgr::DoDirectiveResource ( char *  val,
XrdOucStream *  cfg,
bool   
)
private

Process 'resource' directive.

Definition at line 387 of file XrdProofdNetMgr.cxx.

Referenced by DoDirective().

int XrdProofdNetMgr::DoDirectiveWorker ( char *  val,
XrdOucStream *  cfg,
bool   
)
private

Process 'worker' directive.

Definition at line 435 of file XrdProofdNetMgr.cxx.

Referenced by DoDirective().

void XrdProofdNetMgr::Dump ( )

Dump status.

Definition at line 1456 of file XrdProofdNetMgr.cxx.

Referenced by GetActiveWorkers(), XrdProofdManager::GetWorkers(), and XrdProofdAdmin::ReleaseWorker().

int XrdProofdNetMgr::FindUniqueNodes ( )
private

Scan fWorkers for unique nodes (stored in fNodes).

Return the number of unque nodes. NB: 'master' information here is ignored, because it is passed via the 'xpd.workdir' and 'xpd.image' config directives

Definition at line 1669 of file XrdProofdNetMgr.cxx.

Referenced by Config(), CreateDefaultPROOFcfg(), DoDirectiveWorker(), and ReadPROOFcfg().

std::list< XrdProofWorker * > * XrdProofdNetMgr::GetActiveWorkers ( )

Return the list of workers after having made sure that the info is up-to-date.

Definition at line 1427 of file XrdProofdNetMgr.cxx.

Referenced by XrdProofSched::ExportInfo(), XrdProofSched::GetNumWorkers(), and XrdProofSched::GetWorkers().

std::list< XrdProofWorker * > * XrdProofdNetMgr::GetNodes ( )

Return the list of unique nodes after having made sure that the info is up-to-date.

Definition at line 1480 of file XrdProofdNetMgr.cxx.

XrdProofConn * XrdProofdNetMgr::GetProofConn ( const char *  url)

Get a XrdProofConn for url; create a new one if not available.

Definition at line 630 of file XrdProofdNetMgr.cxx.

Referenced by BroadcastCtrlC(), ReadBufferRemote(), ReadLogPaths(), and Send().

bool XrdProofdNetMgr::IsLocal ( const char *  host,
bool  checkport = 0 
)

Check if 'host' is this local host.

If checkport is true, matching of the local port with the one implied by host is also checked. Return 1 if 'local', 0 otherwise

Definition at line 759 of file XrdProofdNetMgr.cxx.

Referenced by XrdProofdAdmin::Exec(), and ReadBuffer().

int XrdProofdNetMgr::LocateLocalFile ( XrdOucString &  file)
private

Locate the exact file path allowing for wildcards '*' in the file name.

In case of success, returns 0 and fills file wity the first matching instance. Return -1 if no matching pat is found.

Definition at line 922 of file XrdProofdNetMgr.cxx.

Referenced by ReadBufferLocal().

const char* XrdProofdNetMgr::PROOFcfg ( ) const
inline

Definition at line 83 of file XrdProofdNetMgr.h.

int XrdProofdNetMgr::ReadBuffer ( XrdProofdProtocol p)

Process a readbuf request.

Definition at line 792 of file XrdProofdNetMgr.cxx.

Referenced by XrdProofdManager::Process().

char * XrdProofdNetMgr::ReadBufferLocal ( const char *  path,
kXR_int64  ofs,
int &  len 
)

Read a buffer of length 'len' at offset 'ofs' of local file 'path'; the returned buffer must be freed by the caller.

Wild cards '*' are allowed in the file name of 'path'; the first matching instance is taken. Returns 0 in case of error.

Definition at line 977 of file XrdProofdNetMgr.cxx.

Referenced by ReadBuffer().

char * XrdProofdNetMgr::ReadBufferLocal ( const char *  path,
const char *  pat,
int &  len,
int  opt 
)

Grep lines matching 'pat' form 'path'; the returned buffer (length in 'len') must be freed by the caller.

Wild cards '*' are allowed in the file name of 'path'; the first matching instance is taken. Returns 0 in case of error.

Definition at line 1080 of file XrdProofdNetMgr.cxx.

char * XrdProofdNetMgr::ReadBufferRemote ( const char *  url,
const char *  file,
kXR_int64  ofs,
int &  len,
int  grep 
)

Send a read buffer request of length 'len' at offset 'ofs' for remote file defined by 'url'; the returned buffer must be freed by the caller.

Returns 0 in case of error.

Definition at line 1201 of file XrdProofdNetMgr.cxx.

Referenced by ReadBuffer().

char * XrdProofdNetMgr::ReadLogPaths ( const char *  url,
const char *  msg,
int  isess 
)

Get log paths from next tier; used in multi-master setups Returns 0 in case of error.

Definition at line 1267 of file XrdProofdNetMgr.cxx.

Referenced by XrdProofdAdmin::QueryLogPaths(), and ReadLogPaths().

char * XrdProofdNetMgr::ReadLogPaths ( const char *  msg,
int  isess 
)

Get log paths from next tier; used in multi-master setups Returns 0 in case of error.

Definition at line 1325 of file XrdProofdNetMgr.cxx.

int XrdProofdNetMgr::ReadPROOFcfg ( bool  reset = 1)
private

Read PROOF config file and load the information in fWorkers.

NB: 'master' information here is ignored, because it is passed via the 'xpd.workdir' and 'xpd.image' config directives

Definition at line 1509 of file XrdProofdNetMgr.cxx.

Referenced by Config(), GetActiveWorkers(), and GetNodes().

void XrdProofdNetMgr::RegisterDirectives ( )
virtual

Register config directives.

Reimplemented from XrdProofdConfig.

Definition at line 93 of file XrdProofdNetMgr.cxx.

Referenced by XrdProofdNetMgr().

XrdClientMessage * XrdProofdNetMgr::Send ( const char *  url,
int  type,
const char *  msg,
int  srvtype,
XrdProofdResponse r,
bool  notify = 0,
int  subtype = -1 
)

Broadcast request to known potential sub-nodes.

Return 0 on success, -1 on error

Definition at line 654 of file XrdProofdNetMgr.cxx.

Referenced by Broadcast(), and XrdProofdAdmin::Exec().

bool XrdProofdNetMgr::WorkerUsrCfg ( ) const
inline

Member Data Documentation

bool XrdProofdNetMgr::fBonjourEnabled
private

Definition at line 70 of file XrdProofdNetMgr.h.

Referenced by Config(), and XrdProofdNetMgr().

bool XrdProofdNetMgr::fDfltFallback
private
std::list<XrdProofWorker *> XrdProofdNetMgr::fDfltWorkers
private

Definition at line 54 of file XrdProofdNetMgr.h.

Referenced by CreateDefaultPROOFcfg(), XrdProofdNetMgr(), and ~XrdProofdNetMgr().

XrdProofdManager* XrdProofdNetMgr::fMgr
private
XrdSysRecMutex XrdProofdNetMgr::fMutex
private
std::list<XrdProofWorker *> XrdProofdNetMgr::fNodes
private
int XrdProofdNetMgr::fNumLocalWrks
private

Definition at line 46 of file XrdProofdNetMgr.h.

Referenced by CreateDefaultPROOFcfg(), RegisterDirectives(), and XrdProofdNetMgr().

XrdProofdFile XrdProofdNetMgr::fPROOFcfg
private
XrdOucHash<XrdProofConn> XrdProofdNetMgr::fProofConnHash
private

Definition at line 45 of file XrdProofdNetMgr.h.

std::list<XrdProofWorker *> XrdProofdNetMgr::fRegWorkers
private

Definition at line 55 of file XrdProofdNetMgr.h.

Referenced by ReadPROOFcfg(), XrdProofdNetMgr(), and ~XrdProofdNetMgr().

bool XrdProofdNetMgr::fReloadPROOFcfg
private
int XrdProofdNetMgr::fRequestTO
private

Definition at line 52 of file XrdProofdNetMgr.h.

Referenced by Config(), DoDirectiveAdminReqTO(), and XrdProofdNetMgr().

int XrdProofdNetMgr::fResourceType
private
std::list<XrdProofWorker *> XrdProofdNetMgr::fWorkers
private
bool XrdProofdNetMgr::fWorkerUsrCfg
private

Definition at line 51 of file XrdProofdNetMgr.h.

Referenced by DoDirectiveResource(), WorkerUsrCfg(), and XrdProofdNetMgr().

Collaboration diagram for XrdProofdNetMgr:
[legend]

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