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; }
161 int SendData(
int cid,
void *buff,
int len);
199 inline XrdOucHash<XrdProofWorker> *
Workers()
const
XrdProofdResponse * Response() 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.
~XrdProofdProofServ()
Destructor.
int Enqueue(XrdProofQuery *q)
void SetAlias(const char *a)
void AddWorker(const char *o, XrdProofWorker *w)
Add a worker assigned to this session with label 'o'.
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...
bool Match(short int id) const
XrdOucHash< XrdProofWorker > fWorkers
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.
std::list< XrdProofQuery * > fQueries
int SendDataN(void *buff, int len)
Send data over the open client links of this session.
XrdClientID * Parent() 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
std::list< XrdProofQuery * > * Queries() const
void SetProtocol(XrdProofdProtocol *p)
XrdProofQuery(const char *t, const char *n="", long s=0)
const char * Client() const
void DeleteUNIXSock()
Delete the current UNIX socket.
void SetUNIXSockPath(const char *s)
void ExportWorkers(XrdOucString &wrks)
Export the assigned workers in the format understood by proofserv.
void SetGroup(const char *g)
XrdProofdProtocol * Protocol() const
void SetFileout(const char *f)
XrdSrvBuffer * StartMsg() const
const char * Ordinal() const
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.
const char * AdminPath() const
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 * UserEnvs() const
void SetConnection(XrdProofdResponse *r)
int SetAdminPath(const char *a, bool assert, bool setown)
Set the admin path and make sure the file exists.
XrdNet * UNIXSock() const
int SendData(int cid, void *buff, int len)
Send data to client cid.
const char * Alias() const
void RemoveQuery(const char *tag)
remove query with tag form the list of queries
void SetValid(bool valid=1)
void SetUserEnvs(const char *t)
XrdOucHash< XrdProofWorker > * Workers() const
XrdProofdProtocol * fProtocol
int DisconnectTime()
Return the time (in secs) all clients have been disconnected.
int IdleTime()
Return the time (in secs) the session has been idle.
const char * Fileout() 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.
Vc_ALWAYS_INLINE_L T *Vc_ALWAYS_INLINE_R malloc(size_t n)
Allocates memory on the Heap with alignment and padding suitable for vectorized access.
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...
const char * Group() const
XrdProofQuery * CurrentQuery()