12 #ifndef ROOT_XrdProofdProofServ 13 #define ROOT_XrdProofdProofServ 18 #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__APPLE__) 29 #include "Xrd/XrdLink.hh" 30 #include "XrdOuc/XrdOucHash.hh" 54 if (dup && bp && sz > 0) {
104 #define kXPROOFSRVTAGMAX 64 105 #define kXPROOFSRVALIASMAX 256 124 int shutopt,
int shutdel,
bool changeown,
int &nc);
151 inline std::list<XrdProofQuery *> *
Queries()
const 152 {
return (std::list<XrdProofQuery *> *)&
fQueries; }
156 int Reset(
const char *msg,
int type);
161 int SendData(
int cid,
void *buff,
int len);
199 inline XrdOucHash<XrdProofWorker> *
Workers()
const
void ExportBuf(XrdOucString &buf)
Fill buf with relevant info about this session.
int FreeClientID(int pid)
Free instance corresponding to protocol connecting process 'pid'.
XrdOucString fUNIXSockPath
XrdProofQuery * GetQuery(const char *tag)
Get query with tag form the list of queries.
void SetParent(XrdClientID *cid)
int Resume()
Send a resume message to the this session.
void RemoveWorker(const char *o)
Release worker assigned to this session with label 'o'.
void DumpQueries()
Export the assigned workers in the format understood by proofserv.
const char * Group() const
~XrdProofdProofServ()
Destructor.
int Enqueue(XrdProofQuery *q)
XrdOucHash< XrdProofWorker > * Workers() const
void SetAlias(const char *a)
void AddWorker(const char *o, XrdProofWorker *w)
Add a worker assigned to this session with label 'o'.
const char * Client() const
void SetIdle()
Set status to idle and update the related time stamp.
int CheckSession(bool oldvers, bool isrec, int shutopt, int shutdel, bool changeown, int &nc)
Calculate the effective number of users on this session nodes and communicate it to the master togeth...
XrdOucHash< XrdProofWorker > fWorkers
const char * Alias() const
void SetPLiteNWrks(int n)
void Reset()
Reset this instance.
void Broadcast(const char *msg, int type=kXPD_srvmsg)
Broadcast message 'msg' at 'type' to the attached clients.
XrdNet * UNIXSock() const
bool Match(short int id) const
std::list< XrdProofQuery * > fQueries
int SendDataN(void *buff, int len)
Send data over the open client links of this session.
std::list< XrdProofQuery * > * Queries() const
XrdSrvBuffer * StartMsg() const
void SetOrdinal(const char *o)
XrdProofdResponse * fResponse
void ClearWorkers()
Decrease worker counters and clean-up the list.
XrdSrvBuffer(char *bp=0, int sz=0, bool dup=0)
XrdClientID * GetClientID(int cid)
Get instance corresponding to cid.
int CreateUNIXSock(XrdSysError *edest)
Create UNIX socket for internal connections.
const char * UNIXSockPath() const
void SetProtocol(XrdProofdProtocol *p)
XrdProofQuery(const char *t, const char *n="", long s=0)
void DeleteUNIXSock()
Delete the current UNIX socket.
const char * Ordinal() const
void SetUNIXSockPath(const char *s)
void ExportWorkers(XrdOucString &wrks)
Export the assigned workers in the format understood by proofserv.
void SetGroup(const char *g)
void SetFileout(const char *f)
int GetNClients(bool check)
Get the number of connected clients.
int changeown(const std::string &path, uid_t u, gid_t g)
Change the ownership of 'path' to the entity described by {u,g}.
#define XrdSysMutexHelper
bool SkipCheck()
Return the value of fSkipCheck and reset it to false.
int TerminateProofServ(bool changeown)
Terminate the associated process.
void SetTag(const char *t)
int BroadcastPriority(int priority)
Broadcast a new group priority value to the worker servers.
const char * AdminPath() const
void SetConnection(XrdProofdResponse *r)
const char * Fileout() const
int SetAdminPath(const char *a, bool assert, bool setown)
Set the admin path and make sure the file exists.
XrdProofdProtocol * Protocol() const
int SendData(int cid, void *buff, int len)
Send data to client cid.
void RemoveQuery(const char *tag)
remove query with tag form the list of queries
static constexpr double s
void SetValid(bool valid=1)
void SetUserEnvs(const char *t)
XrdProofdProtocol * fProtocol
XrdProofdResponse * Response() const
int DisconnectTime()
Return the time (in secs) all clients have been disconnected.
int IdleTime()
Return the time (in secs) the session has been idle.
XrdClientID * Parent() const
void SetRunning()
Set status to running and reset the related time stamp.
XrdProofdProofServ()
Constructor.
std::vector< XrdClientID * > fClients
int VerifyProofServ(bool fw)
Check if the associated proofserv process is alive.
const char * UserEnvs() const
void SetStartMsg(XrdSrvBuffer *sm)
void SetClient(const char *c)
void SendClusterInfo(int nsess, int nacti)
Calculate the effective number of users on this session nodes and communicate it to the master togeth...
XrdProofQuery * CurrentQuery()
static constexpr double g