Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
XrdProofWorker.h
Go to the documentation of this file.
1// @(#)root/proofd:$Id$
2// Author: Gerardo Ganis June 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_XrdProofWorker
13#define ROOT_XrdProofWorker
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// XrdProofWorker //
18// //
19// Authors: G. Ganis, CERN, 2007 //
20// //
21// Class with information about a potential worker. //
22// A list of instances of this class is built using the config file or //
23// or the information collected from the resource discoverers. //
24// //
25//////////////////////////////////////////////////////////////////////////
26#include <list>
27
28#include "XpdSysPthread.h"
29
30#include "XrdOuc/XrdOucString.hh"
31
32
34
36
37public:
38 XrdProofWorker(const char *str = 0);
40 virtual ~XrdProofWorker();
41
42 void Reset(const char *str); // Set from 'str'
43
44 const char *Export(const char *ord = 0);
45
46 bool Matches(const char *host);
47 bool Matches(XrdProofWorker *wrk);
49
50 static void Sort(std::list<XrdProofWorker *> *lst,
51 bool (*f)(XrdProofWorker *&lhs,
52 XrdProofWorker *&rhs));
53
54 inline int Active() const {
55 XrdSysMutexHelper mhp(fMutex);
56 return fProofServs.size();
57 }
58 inline void AddProofServ(XrdProofdProofServ *xps) {
59 XrdSysMutexHelper mhp(fMutex);
60 return fProofServs.push_back(xps);
61 }
63 XrdSysMutexHelper mhp(fMutex);
64 return fProofServs.remove(xps);
65 }
66 // Allows to copy the session objects from other worker.
67 void MergeProofServs(const XrdProofWorker &other);
68
69 std::list<XrdProofdProofServ *> fProofServs; // ProofServ sessions using
70 // this worker
71
72 // Worker definitions
73 XrdOucString fExport; // export string
74 char fType; // type: worker ('W') or submaster ('S')
75 XrdOucString fUser; // user
76 XrdOucString fHost; // host FQDN
77 int fPort; // port
78 int fPerfIdx; // performance index
79 XrdOucString fImage; // image name
80 XrdOucString fWorkDir; // work directory
81 XrdOucString fMsd; // mass storage domain
82 XrdOucString fId; // ID string
83 int fNwrks; // # workers if 'S' and P-Lite
84
85 XrdOucString fOrd; // Used only for temp exports
86
87 bool fActive; // TRUE if available
88
89private:
90 XrdSysRecMutex *fMutex; // Local mutex
91};
92
93#endif
#define f(i)
Definition RSha256.hxx:104
int GetNActiveSessions()
Calculate the number of workers existing on this node which are currently running.
void Reset(const char *str)
Set content from a config file-like string.
void RemoveProofServ(XrdProofdProofServ *xps)
XrdOucString fOrd
XrdOucString fImage
bool Matches(const char *host)
Check compatibility of host with this instance.
int Active() const
XrdSysRecMutex * fMutex
XrdOucString fId
std::list< XrdProofdProofServ * > fProofServs
XrdOucString fWorkDir
XrdOucString fUser
XrdOucString fHost
void MergeProofServs(const XrdProofWorker &other)
Merge session objects from the other worker object in order to merge all the objects in only one.
static void Sort(std::list< XrdProofWorker * > *lst, bool(*f)(XrdProofWorker *&lhs, XrdProofWorker *&rhs))
Sort ascendingly the list according to the comparing algorithm defined by 'f'; 'f' should return 'tru...
virtual ~XrdProofWorker()
Destructor.
XrdOucString fMsd
void AddProofServ(XrdProofdProofServ *xps)
const char * Export(const char *ord=0)
Export current content in a form understood by parsing algorithms inside the PROOF session,...
XrdOucString fExport