Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
XrdProofdNetMgr Class Reference

Definition at line 38 of file XrdProofdNetMgr.h.

Public Member Functions

 XrdProofdNetMgr (XrdProofdManager *mgr, XrdProtocol_Config *pi, XrdOucError *e)
 Constructor.
 
virtual ~XrdProofdNetMgr ()
 Destructor.
 
void BalanceNodesOrder ()
 Indices (this will be used twice).
 
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.
 
int BroadcastCtrlC (const char *usr)
 Broadcast a ctrlc interrupt Return 0 on success, -1 on error.
 
int Config (bool rcf=0)
 Run configuration and parse the entered config directives.
 
int DoDirective (XrdProofdDirective *d, char *val, XrdOucStream *cfg, bool rcf)
 Update the priorities of the active sessions.
 
void Dump ()
 Dump status.
 
std::list< XrdProofWorker * > * GetActiveWorkers ()
 Return the list of workers after having made sure that the info is up-to-date.
 
std::list< XrdProofWorker * > * GetNodes ()
 Return the list of unique nodes after having made sure that the info is up-to-date.
 
XrdProofConnGetProofConn (const char *url)
 Get a XrdProofConn for url; create a new one if not available.
 
bool IsLocal (const char *host, bool checkport=0)
 Check if 'host' is this local host.
 
const char * PROOFcfg () const
 
int ReadBuffer (XrdProofdProtocol *p)
 Process a readbuf request.
 
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.
 
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.
 
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.
 
char * ReadLogPaths (const char *stag, int isess)
 Get log paths from next tier; used in multi-master setups Returns 0 in case of error.
 
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.
 
void RegisterDirectives ()
 Register config directives.
 
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.
 
bool WorkerUsrCfg () const
 
- Public Member Functions inherited from XrdProofdConfig
 XrdProofdConfig (const char *cfg=0, XrdSysError *edest=0)
 Main constructor.
 
virtual ~XrdProofdConfig ()
 
const char * CfgFile () const
 
void SetCfgEDest (const char *cfg, XrdSysError *edest)
 Set config file and error handler.
 

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from XrdProofdConfig
int ParseFile (bool rcf=false)
 Parse config file for the registered directives.
 
bool ReadFile (bool update=true)
 Return true if the file has never been read or did change since last reading, false otherwise.
 
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::XrdProofdNetMgr ( XrdProofdManager mgr,
XrdProtocol_Config *  pi,
XrdOucError *  e 
)

Constructor.

Definition at line 67 of file XrdProofdNetMgr.cxx.

◆ ~XrdProofdNetMgr()

XrdProofdNetMgr::~XrdProofdNetMgr ( )
virtual

Destructor.

Definition at line 103 of file XrdProofdNetMgr.cxx.

Member Function Documentation

◆ BalanceNodesOrder()

void XrdProofdNetMgr::BalanceNodesOrder ( )

Indices (this will be used twice).

Definition at line 232 of file XrdProofdNetMgr.cxx.

◆ Broadcast()

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 552 of file XrdProofdNetMgr.cxx.

◆ BroadcastCtrlC()

int XrdProofdNetMgr::BroadcastCtrlC ( const char *  usr)

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

Definition at line 486 of file XrdProofdNetMgr.cxx.

◆ Config()

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 124 of file XrdProofdNetMgr.cxx.

◆ CreateDefaultPROOFcfg()

void XrdProofdNetMgr::CreateDefaultPROOFcfg ( )
private

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

Definition at line 1357 of file XrdProofdNetMgr.cxx.

◆ DoDirective()

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 207 of file XrdProofdNetMgr.cxx.

◆ DoDirectiveAdminReqTO()

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

Process 'adminreqto' directive.

Definition at line 345 of file XrdProofdNetMgr.cxx.

◆ DoDirectiveResource()

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

Process 'resource' directive.

Definition at line 366 of file XrdProofdNetMgr.cxx.

◆ DoDirectiveWorker()

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

Process 'worker' directive.

Definition at line 414 of file XrdProofdNetMgr.cxx.

◆ Dump()

void XrdProofdNetMgr::Dump ( )

Dump status.

Definition at line 1435 of file XrdProofdNetMgr.cxx.

◆ FindUniqueNodes()

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 1648 of file XrdProofdNetMgr.cxx.

◆ GetActiveWorkers()

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

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

Definition at line 1406 of file XrdProofdNetMgr.cxx.

◆ GetNodes()

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 1459 of file XrdProofdNetMgr.cxx.

◆ GetProofConn()

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

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

Definition at line 609 of file XrdProofdNetMgr.cxx.

◆ IsLocal()

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 738 of file XrdProofdNetMgr.cxx.

◆ LocateLocalFile()

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 901 of file XrdProofdNetMgr.cxx.

◆ PROOFcfg()

const char * XrdProofdNetMgr::PROOFcfg ( ) const
inline

Definition at line 80 of file XrdProofdNetMgr.h.

◆ ReadBuffer()

int XrdProofdNetMgr::ReadBuffer ( XrdProofdProtocol p)

Process a readbuf request.

Definition at line 771 of file XrdProofdNetMgr.cxx.

◆ ReadBufferLocal() [1/2]

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 1059 of file XrdProofdNetMgr.cxx.

◆ ReadBufferLocal() [2/2]

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 956 of file XrdProofdNetMgr.cxx.

◆ ReadBufferRemote()

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 1180 of file XrdProofdNetMgr.cxx.

◆ ReadLogPaths() [1/2]

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

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

Definition at line 1304 of file XrdProofdNetMgr.cxx.

◆ ReadLogPaths() [2/2]

char * XrdProofdNetMgr::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.

Definition at line 1246 of file XrdProofdNetMgr.cxx.

◆ ReadPROOFcfg()

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 1488 of file XrdProofdNetMgr.cxx.

◆ RegisterDirectives()

void XrdProofdNetMgr::RegisterDirectives ( )
virtual

Register config directives.

Reimplemented from XrdProofdConfig.

Definition at line 92 of file XrdProofdNetMgr.cxx.

◆ Send()

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 633 of file XrdProofdNetMgr.cxx.

◆ WorkerUsrCfg()

bool XrdProofdNetMgr::WorkerUsrCfg ( ) const
inline

Definition at line 81 of file XrdProofdNetMgr.h.

Member Data Documentation

◆ fDfltFallback

bool XrdProofdNetMgr::fDfltFallback
private

Definition at line 50 of file XrdProofdNetMgr.h.

◆ fDfltWorkers

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

Definition at line 54 of file XrdProofdNetMgr.h.

◆ fMgr

XrdProofdManager* XrdProofdNetMgr::fMgr
private

Definition at line 44 of file XrdProofdNetMgr.h.

◆ fMutex

XrdOucRecMutex XrdProofdNetMgr::fMutex
private

Definition at line 42 of file XrdProofdNetMgr.h.

◆ fNodes

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

Definition at line 57 of file XrdProofdNetMgr.h.

◆ fNumLocalWrks

int XrdProofdNetMgr::fNumLocalWrks
private

Definition at line 46 of file XrdProofdNetMgr.h.

◆ fPROOFcfg

XrdProofdFile XrdProofdNetMgr::fPROOFcfg
private

Definition at line 48 of file XrdProofdNetMgr.h.

◆ fProofConnHash

XrdOucHash<XrdProofConn> XrdProofdNetMgr::fProofConnHash
private

Definition at line 45 of file XrdProofdNetMgr.h.

◆ fRegWorkers

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

Definition at line 55 of file XrdProofdNetMgr.h.

◆ fReloadPROOFcfg

bool XrdProofdNetMgr::fReloadPROOFcfg
private

Definition at line 49 of file XrdProofdNetMgr.h.

◆ fRequestTO

int XrdProofdNetMgr::fRequestTO
private

Definition at line 52 of file XrdProofdNetMgr.h.

◆ fResourceType

int XrdProofdNetMgr::fResourceType
private

Definition at line 47 of file XrdProofdNetMgr.h.

◆ fWorkers

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

Definition at line 56 of file XrdProofdNetMgr.h.

◆ fWorkerUsrCfg

bool XrdProofdNetMgr::fWorkerUsrCfg
private

Definition at line 51 of file XrdProofdNetMgr.h.

  • proof/proofd/inc/XrdProofdNetMgr.h
  • proof/proofd/src/XrdProofdNetMgr.cxx