12 #ifndef ROOT_XrdProofdNetMgr
13 #define ROOT_XrdProofdNetMgr
27 #include "XrdOuc/XrdOucHash.hh"
32 class XrdProofdDirective;
33 class XrdProofdManager;
34 class XrdProofdProtocol;
35 class XrdProofdResponse;
38 class XrdProofdNetMgr :
public XrdProofdConfig {
42 XrdSysRecMutex fMutex;
44 XrdProofdManager *fMgr;
45 XrdOucHash<XrdProofConn> fProofConnHash;
48 XrdProofdFile fPROOFcfg;
54 std::list<XrdProofWorker *> fDfltWorkers;
55 std::list<XrdProofWorker *> fRegWorkers;
56 std::list<XrdProofWorker *> fWorkers;
57 std::list<XrdProofWorker *> fNodes;
59 void CreateDefaultPROOFcfg();
60 int ReadPROOFcfg(
bool reset = 1);
61 int FindUniqueNodes();
63 int LocateLocalFile(XrdOucString &file);
65 int DoDirectiveAdminReqTO(
char *, XrdOucStream *,
bool);
66 int DoDirectiveResource(
char *, XrdOucStream *,
bool);
67 int DoDirectiveWorker(
char *, XrdOucStream *,
bool);
70 XrdProofdNetMgr(XrdProofdManager *mgr, XrdProtocol_Config *pi, XrdSysError *e);
71 virtual ~XrdProofdNetMgr();
73 int Config(
bool rcf = 0);
74 int DoDirective(XrdProofdDirective *d,
75 char *val, XrdOucStream *cfg,
bool rcf);
76 void RegisterDirectives();
80 const char *PROOFcfg()
const {
return fPROOFcfg.fName.c_str(); }
81 bool WorkerUsrCfg()
const {
return fWorkerUsrCfg; }
83 int Broadcast(
int type,
const char *msg,
const char *usr = 0,
84 XrdProofdResponse *r = 0,
bool notify = 0,
int subtype = -1);
85 int BroadcastCtrlC(
const char *usr);
86 XrdProofConn *GetProofConn(
const char *url);
87 bool IsLocal(
const char *host,
bool checkport = 0);
88 XrdClientMessage *Send(
const char *url,
int type,
89 const char *msg,
int srvtype, XrdProofdResponse *r,
90 bool notify = 0,
int subtype = -1);
92 int ReadBuffer(XrdProofdProtocol *p);
93 char *ReadBufferLocal(
const char *file, kXR_int64 ofs,
int &len);
94 char *ReadBufferLocal(
const char *file,
const char *pat,
int &len,
int opt);
95 char *ReadBufferRemote(
const char *url,
const char *file,
96 kXR_int64 ofs,
int &len,
int grep);
97 char *ReadLogPaths(
const char *url,
const char *stag,
int isess);
98 char *ReadLogPaths(
const char *stag,
int isess);
101 std::list<XrdProofWorker *> *GetActiveWorkers();
102 std::list<XrdProofWorker *> *GetNodes();
104 void BalanceNodesOrder();
108 typedef struct BalancerInfo {
109 unsigned int available;
110 unsigned int per_iteration;