Loading...
Searching...
No Matches
XrdFrmMigrate Class Reference

`#include <XrdFrmMigrate.hh>`

Collaboration diagram for XrdFrmMigrate:

## Public Member Functions

| XrdFrmMigrate ()
| ~XrdFrmMigrate ()

## Static Public Member Functions

static void | Display ()
static void | Migrate (int doinit=1)
static void | Queue (XrdFrmFileset *sP)

## Detailed Description

Definition at line 40 of file XrdFrmMigrate.hh.

## Constructor & Destructor Documentation

## XrdFrmMigrate()

XrdFrmMigrate::XrdFrmMigrate | ( |  | ) |

inline

Definition at line 50 of file XrdFrmMigrate.hh.

{}

## ~XrdFrmMigrate()

XrdFrmMigrate::~XrdFrmMigrate | ( |  | ) |

inline

Definition at line 51 of file XrdFrmMigrate.hh.

{}

## Member Function Documentation

## Display()

void XrdFrmMigrate::Display | ( |  | ) |

static

Definition at line 137 of file XrdFrmMigrate.cc.

{
XrdFrmConfig::VPInfo *vP = Config.pathList;
XrdOucTList *tP;
// Type header
//
Say.Say("=====> ", "Migrate configuration:");
// Display what we will scan
//
while(vP)
{Say.Say("=====> ", "Scanning ", (vP->Val?"r/w: ":"r/o: "), vP->Name);
tP = vP->Dir;
while(tP) {Say.Say("=====> ", "Excluded ", tP->text); tP = tP->next;}
vP = vP->Next;
}
}
Say
XrdOucPup XrdCmsParser::Pup & Say
Definition XrdCmsParser.cc:124
XrdFrmConfig::pathList
VPInfo * pathList
Definition XrdFrmConfig.hh:130
XrdOucTList::next
XrdOucTList * next
Definition XrdOucTList.hh:45
XrdOucTList::text
char * text
Definition XrdOucTList.hh:46
XrdFrm::Config
XrdFrmConfig Config
XrdFrmConfig::VPInfo::Val
int Val
Definition XrdFrmConfig.hh:125
XrdFrmConfig::VPInfo::Name
char * Name
Definition XrdFrmConfig.hh:123
XrdFrmConfig::VPInfo::Next
VPInfo * Next
Definition XrdFrmConfig.hh:122
XrdFrmConfig::VPInfo::Dir
XrdOucTList * Dir
Definition XrdFrmConfig.hh:124

References XrdFrm::Config, XrdFrmConfig::VPInfo::Dir, XrdFrmConfig::VPInfo::Name, XrdFrmConfig::VPInfo::Next, XrdOucTList::next, Say, XrdOucTList::text, and XrdFrmConfig::VPInfo::Val.

## Migrate()

void XrdFrmMigrate::Migrate | ( | int | doinit = 1 | ) |

static

Definition at line 202 of file XrdFrmMigrate.cc.

{
XrdFrmFileset *fP;
char buff[80];
int migWait, wTime;
// If we have not initialized yet, start a thread to handle this
//
if (doinit)
{pthread_t tid;
int retc;
if ((retc = XrdSysThread::Run(&tid, XrdMigrateStart, (void *)0,
XRDSYSTHREAD_BIND, "migration scan")))
Say.Emsg("Migrate", retc, "create migrtion thread");
return;
}
// Start the migration sequence, first do a name space scan which will trigger
// all eligible migrations and defer any that need to wait. We then drain the
// defer queue and wait for the next period to start.
//
do{migWait = Config.WaitMigr; numMig = 0;
Scan();
while((wTime = Advance()))
{if ((migWait -= wTime) <= 0) break;
else XrdSysTimer::Snooze(wTime);
}
while(fsDefer) {fP = fsDefer; fsDefer = fsDefer->Next; delete fP;}
sprintf(buff, "%d file%s selected for transfer.",numMig,(numMig==1?"":"s"));
Say.Emsg("Migrate", buff);
if (migWait > 0) XrdSysTimer::Snooze(migWait);
} while(1);
}
XrdMigrateStart
void * XrdMigrateStart(void *parg)
Definition XrdFrmMigrate.cc:195
XRDSYSTHREAD_BIND
#define XRDSYSTHREAD_BIND
Definition XrdSysPthread.hh:543
XrdFrmConfig::WaitMigr
int WaitMigr
Definition XrdFrmConfig.hh:106
XrdFrmFileset::Next
XrdFrmFileset * Next
Definition XrdFrmFiles.hh:90
XrdSysThread::Run
static int Run(pthread_t *, void *(*proc)(void *), void *arg, int opts=0, const char *desc=0)
Definition XrdSysPthread.cc:307
XrdSysTimer::Snooze
static void Snooze(int seconds)
Definition XrdSysTimer.cc:168

References XrdFrm::Config, XrdFrmFileset::Next, XrdSysThread::Run(), Say, XrdSysTimer::Snooze(), XrdMigrateStart(), and XRDSYSTHREAD_BIND.

Referenced by XrdFrmXfrDaemon::Init(), and XrdMigrateStart().

Here is the call graph for this function:
Here is the caller graph for this function:

## Queue()

void XrdFrmMigrate::Queue | ( | XrdFrmFileset * | sP | ) |

static

Definition at line 240 of file XrdFrmMigrate.cc.

{
static int reqID = 0;
XrdFrcRequest myReq;
// Convert the fileset to a request element
//
memset(&myReq, 0, sizeof(myReq));
strlcpy(myReq.User, Config.myProg, sizeof(myReq.User));
sprintf(myReq.ID, "Internal%d", reqID++);
myReq.Options = XrdFrcRequest::Migrate;
myReq.addTOD = static_cast<long long>(time(0));
if (Config.LogicalPath(sP->basePath(), myReq.LFN, sizeof(myReq.LFN)))
{XrdFrmXfrQueue::Add(&myReq, 0, XrdFrcRequest::migQ); numMig++;}
// All done
//
delete sP;
}
strlcpy
size_t strlcpy(char *dst, const char *src, size_t sz)
Definition XrdSysPlatform.cc:60
XrdFrcRequest::LFN
char LFN[3072]
Definition XrdFrcRequest.hh:37
XrdFrcRequest::migQ
static const int migQ
Definition XrdFrcRequest.hh:88
XrdFrcRequest::Options
int Options
Definition XrdFrcRequest.hh:47
XrdFrcRequest::User
char User[256]
Definition XrdFrcRequest.hh:38
XrdFrcRequest::Migrate
static const int Migrate
Definition XrdFrcRequest.hh:61
XrdFrcRequest::ID
char ID[40]
Definition XrdFrcRequest.hh:39
XrdFrcRequest::addTOD
long long addTOD
Definition XrdFrcRequest.hh:44
XrdFrmConfig::LogicalPath
int LogicalPath(const char *oldp, char *newp, int newpsz)
Definition XrdFrmConfig.cc:495
XrdFrmConfig::myProg
const char * myProg
Definition XrdFrmConfig.hh:57
XrdFrmFileset::basePath
const char * basePath()
Definition XrdFrmFiles.hh:61
XrdFrmXfrQueue::Add
static int Add(XrdFrcRequest *rP, XrdFrcReqFile *reqF, int theQ)
Definition XrdFrmXfrQueue.cc:73

References XrdFrmXfrQueue::Add(), XrdFrcRequest::addTOD, XrdFrmFileset::basePath(), XrdFrm::Config, XrdFrcRequest::ID, XrdFrcRequest::LFN, XrdFrcRequest::migQ, XrdFrcRequest::Migrate, XrdFrcRequest::Options, strlcpy(), and XrdFrcRequest::User.

Here is the call graph for this function:

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

- XrdFrmMigrate.hh
- XrdFrmMigrate.cc