33 const char *
usr = (
const char *)
u;
48 XrdOucString *
msg = (XrdOucString *)
u;
50 if (
msg->length() > 0)
56 *
msg +=
", members(s): ";
78 XrdOucString *opt = (XrdOucString *)s;
80 if (!opt || opt->length() <= 0 || (*opt) ==
"getfirst")
84 if (opt->beginswith(
"getnextgrp:")) {
85 XrdOucString
grp(
"||");
86 grp.insert(
g->Name(),1);
101 : fName(
n), fMembers(
m)
128 if (
fName !=
"default") {
161 if (
m->Active() <= 0) {
181 if (
m)
na =
m->Active();
193 XrdOucString
u(
usr);
u +=
",";
294 if (
g && (!
strncmp(
g->Name(),
"default",7) ||
g->HasMember(
usr)))
304 return ((!
g) ?
fGroups.Find(
"default") :
g);
356 TRACE(
DBG,
"enter: time of last modification: " <<
st.st_mtime);
421 if (
tok.length() > 0) {
439 if (key ==
"include") {
451 if (key ==
"priorityfile") {
463 if (key ==
"group") {
468 if (
tok.length() > 0)
470 g->AddMember(
tok.c_str());
472 }
else if (key ==
"property") {
479 if (
tok.length() > 0) {
498 if (
name ==
"priority")
499 g->SetPriority((
float)
nom);
500 if (
name ==
"fraction")
523 TRACE(
DBG,
"time of last modification: " <<
st.st_mtime);
527 TRACE(
DBG,
"file unchanged since last reading - do nothing ");
560 TRACE(
XERR,
"found info for unknown group: "<<
group<<
" - ignoring");
564 if (
value.length() <= 0) {
565 TRACE(
XERR,
"value missing: read line is: '"<<
gl<<
"'");
590 if (
g->Active() > 0) {
592 if (glo->
prmin == -1 ||
g->Priority() < glo->
prmin)
593 glo->
prmin =
g->Priority();
594 if (glo->
prmax == -1 ||
g->Priority() > glo->
prmax)
595 glo->
prmax =
g->Priority();
597 if (
g->Fraction() > 0) {
598 g->SetFracEff((
float)(
g->Fraction()));
599 glo->
totfrac += (float)(
g->Fraction());
622 if (
g->Active() > 0) {
624 float ef =
g->Priority() / glo->
prmin;
626 }
else if (
eff->opt == 1) {
627 if (
g->Fraction() < 0) {
631 }
else if (
eff->opt == 2) {
632 if (
g->FracEff() < 0) {
638 float ef =
g->FracEff() *
eff->norm;
680 }
else if (glo.
totfrac > 100) {
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define TRACE(Flag, Args)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
static int CheckUser(const char *, XrdProofGroup *g, void *u)
Check if user 'u' is memmebr of group 'grp'.
static int AuxFunc(const char *, XrdProofGroup *g, void *s)
Generic function used for auxiliary purpose.
static int SetGroupFracEff(const char *, XrdProofGroup *g, void *s)
Check if user 'u' is memmebr of group 'grp'.
static int GetGroupsInfo(const char *, XrdProofGroup *g, void *s)
Fill the global group structure.
static int PrintGroup(const char *, XrdProofGroup *g, void *)
Print info describing group 'g' to stdout.
static int ExportGroup(const char *, XrdProofGroup *g, void *u)
Add a string describing group 'g' to a global string.
#define XrdSysMutexHelper
XrdProofGroupMgr(const char *fn=0)
Constructor.
XrdProofGroup * Next()
Returns the instance of next group in the pseudo-iterator functionality.
XrdProofGroup * Apply(int(*f)(const char *, XrdProofGroup *, void *), void *arg)
Apply function 'f' to the hash table of groups; 'arg' is passed to 'f' in the last argument.
XrdOucHash< XrdProofGroup > fGroups
void Print(const char *grp)
Return a string describing the group.
int Config(const char *fn)
(Re-)configure the group info using the file 'fn'.
XrdProofGroup * GetGroup(const char *grp)
Returns the instance of for group 'grp.
int ParseInfoFrom(const char *fn)
Parse config information from the open file 'fin'.
XrdOucString Export(const char *grp)
Return a string describing the group.
int SetEffectiveFractions(bool optprio)
Go through the list of active groups (those having at least a non-idle member) and determine the effe...
int ReadPriorities()
Read update priorities from the file defined at configuration time.
XrdProofGroup * GetUserGroup(const char *usr, const char *grp=0)
Returns the instance of the first group to which this user belongs; if grp != 0, return the instance ...
XrdProofdFile fPriorityFile
~XrdProofGroup()
Destructor.
int Active(const char *usr=0)
Return the number of active groups (usr = 0) or the number of active sessions for user 'usr'.
bool HasMember(const char *usr)
Check if 'usr' is member of this group.
void Count(const char *usr, int n=1)
Modify the active count.
XrdProofGroup(const char *n, const char *m=0)
Constructor.
XrdOucHash< XrdProofGroupMember > fActives
void Print()
Dump group content.
static char * Expand(char *p)
Expand path 'p' relative to: $HOME if begins with ~/ <user>'s $HOME if begins with ~<user>/ $PWD if d...