ROOT  6.06/09
Reference Guide
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdProofdPriorityMgr Class Reference

Definition at line 55 of file XrdProofdPriorityMgr.h.

Public Types

enum  PMProtocol { kChangeStatus = 0, kSetGroupPriority = 1 }
 

Public Member Functions

 XrdProofdPriorityMgr (XrdProofdManager *mgr, XrdProtocol_Config *pi, XrdSysError *e)
 Constructor. More...
 
virtual ~XrdProofdPriorityMgr ()
 
int Config (bool rcf=0)
 Run configuration and parse the entered config directives. More...
 
int DoDirective (XrdProofdDirective *d, char *val, XrdOucStream *cfg, bool rcf)
 Update the priorities of the active sessions. More...
 
XrdProofdPipePipe ()
 
int AddSession (const char *u, const char *g, int pid)
 Add to the active list a session with ID pid. More...
 
int RemoveSession (int pid)
 Remove from the active list the session with ID pid. More...
 
void SetGroupPriority (const char *grp, int priority)
 Change group priority. Used when a master pushes a priority to a worker. More...
 
bool IsSchedOn ()
 
int SetNiceValues (int opt=0)
 Recalculate nice values taking into account all active users and their priorities. More...
 
void SetSchedOpt (int opt)
 
int SetProcessPriority (int pid, const char *usr, int &dp)
 Change priority of process pid belonging to user, if needed. More...
 
- Public Member Functions inherited from XrdProofdConfig
 XrdProofdConfig (const char *cfg=0, XrdSysError *edest=0)
 Main constructor. More...
 
virtual ~XrdProofdConfig ()
 
void SetCfgEDest (const char *cfg, XrdSysError *edest)
 Set config file and error handler. More...
 
const char * CfgFile () const
 

Private Member Functions

void RegisterDirectives ()
 Register directives for configuration. More...
 
int DoDirectivePriority (char *, XrdOucStream *, bool)
 Process 'priority' directive. More...
 
int DoDirectiveSchedOpt (char *, XrdOucStream *, bool)
 Process 'schedopt' directive. More...
 

Private Attributes

XrdSysRecMutex fMutex
 
XrdProofdManagerfMgr
 
XrdOucHash< XrdProofdSessionEntryfSessions
 
XrdOucHash< XrdProofdPriorityfPriorities
 
XrdProofdPipe fPipe
 
int fSchedOpt
 
int fPriorityMax
 
int fPriorityMin
 

Additional Inherited Members

- Protected Member Functions inherited from XrdProofdConfig
int ParseFile (bool rcf=false)
 Parse config file for the registered directives. More...
 
bool ReadFile (bool update=true)
 Return true if the file has never been read or did change since last reading, false otherwise. More...
 
void Register (const char *dname, XrdProofdDirective *d)
 
- Protected Attributes inherited from XrdProofdConfig
XrdSysErrorfEDest
 

#include <XrdProofdPriorityMgr.h>

+ Inheritance diagram for XrdProofdPriorityMgr:
+ Collaboration diagram for XrdProofdPriorityMgr:

Member Enumeration Documentation

Enumerator
kChangeStatus 
kSetGroupPriority 

Definition at line 77 of file XrdProofdPriorityMgr.h.

Constructor & Destructor Documentation

XrdProofdPriorityMgr::XrdProofdPriorityMgr ( XrdProofdManager mgr,
XrdProtocol_Config *  pi,
XrdSysError e 
)

Constructor.

Definition at line 120 of file XrdProofdPriorityMgr.cxx.

virtual XrdProofdPriorityMgr::~XrdProofdPriorityMgr ( )
inlinevirtual

Definition at line 75 of file XrdProofdPriorityMgr.h.

Member Function Documentation

int XrdProofdPriorityMgr::AddSession ( const char *  u,
const char *  g,
int  pid 
)

Add to the active list a session with ID pid.

Check for duplications. Returns 1 if the entry existed already and it has been replaced; or 0.

Definition at line 514 of file XrdProofdPriorityMgr.cxx.

Referenced by XrdProofdPriorityCron().

int XrdProofdPriorityMgr::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 167 of file XrdProofdPriorityMgr.cxx.

Referenced by XrdProofdManager::Config().

int XrdProofdPriorityMgr::DoDirective ( XrdProofdDirective d,
char *  val,
XrdOucStream *  cfg,
bool  rcf 
)
virtual

Update the priorities of the active sessions.

Reimplemented from XrdProofdConfig.

Definition at line 222 of file XrdProofdPriorityMgr.cxx.

int XrdProofdPriorityMgr::DoDirectivePriority ( char *  val,
XrdOucStream *  cfg,
bool   
)
private

Process 'priority' directive.

Definition at line 422 of file XrdProofdPriorityMgr.cxx.

Referenced by DoDirective().

int XrdProofdPriorityMgr::DoDirectiveSchedOpt ( char *  val,
XrdOucStream *  cfg,
bool   
)
private

Process 'schedopt' directive.

Definition at line 445 of file XrdProofdPriorityMgr.cxx.

Referenced by DoDirective().

bool XrdProofdPriorityMgr::IsSchedOn ( )
inline

Definition at line 90 of file XrdProofdPriorityMgr.h.

Referenced by SetNiceValues().

XrdProofdPipe* XrdProofdPriorityMgr::Pipe ( )
inline
void XrdProofdPriorityMgr::RegisterDirectives ( )
privatevirtual

Register directives for configuration.

Reimplemented from XrdProofdConfig.

Definition at line 213 of file XrdProofdPriorityMgr.cxx.

Referenced by XrdProofdPriorityMgr().

int XrdProofdPriorityMgr::RemoveSession ( int  pid)

Remove from the active list the session with ID pid.

Return -ENOENT if not found, or 0.

Definition at line 504 of file XrdProofdPriorityMgr.cxx.

Referenced by XrdProofdPriorityCron().

void XrdProofdPriorityMgr::SetGroupPriority ( const char *  grp,
int  priority 
)

Change group priority. Used when a master pushes a priority to a worker.

Definition at line 243 of file XrdProofdPriorityMgr.cxx.

Referenced by XrdProofdPriorityCron().

int XrdProofdPriorityMgr::SetNiceValues ( int  opt = 0)

Recalculate nice values taking into account all active users and their priorities.

The type of sessions considered depend on 'opt': 0 all active sessions 1 master sessions 2 worker sessionsg21 Return 0 on success, -1 otherwise.

Definition at line 334 of file XrdProofdPriorityMgr.cxx.

Referenced by XrdProofdPriorityCron().

int XrdProofdPriorityMgr::SetProcessPriority ( int  pid,
const char *  user,
int &  dp 
)

Change priority of process pid belonging to user, if needed.

Return 0 on success, -errno in case of error

Definition at line 534 of file XrdProofdPriorityMgr.cxx.

Referenced by XrdProofdProofServMgr::Create().

void XrdProofdPriorityMgr::SetSchedOpt ( int  opt)
inline

Definition at line 92 of file XrdProofdPriorityMgr.h.

Referenced by SetGroupPriority().

Member Data Documentation

XrdProofdManager* XrdProofdPriorityMgr::fMgr
private
XrdSysRecMutex XrdProofdPriorityMgr::fMutex
private

Definition at line 57 of file XrdProofdPriorityMgr.h.

Referenced by SetNiceValues().

XrdProofdPipe XrdProofdPriorityMgr::fPipe
private

Definition at line 63 of file XrdProofdPriorityMgr.h.

Referenced by Pipe(), and XrdProofdPriorityMgr().

XrdOucHash<XrdProofdPriority> XrdProofdPriorityMgr::fPriorities
private

Definition at line 61 of file XrdProofdPriorityMgr.h.

Referenced by Config(), DoDirectivePriority(), and SetProcessPriority().

int XrdProofdPriorityMgr::fPriorityMax
private

Definition at line 66 of file XrdProofdPriorityMgr.h.

Referenced by DoDirectiveSchedOpt(), SetNiceValues(), and XrdProofdPriorityMgr().

int XrdProofdPriorityMgr::fPriorityMin
private

Definition at line 67 of file XrdProofdPriorityMgr.h.

Referenced by DoDirectiveSchedOpt(), SetNiceValues(), and XrdProofdPriorityMgr().

int XrdProofdPriorityMgr::fSchedOpt
private

Definition at line 65 of file XrdProofdPriorityMgr.h.

Referenced by Config(), DoDirectiveSchedOpt(), and XrdProofdPriorityMgr().

XrdOucHash<XrdProofdSessionEntry> XrdProofdPriorityMgr::fSessions
private

Definition at line 60 of file XrdProofdPriorityMgr.h.

Referenced by AddSession(), RemoveSession(), and SetNiceValues().


The documentation for this class was generated from the following files: