treqs::Activator Class Reference

Class responsible for activation of the staging queues. More...

#include <Activator.h>

Inheritance diagram for treqs::Activator:
Inheritance graph
[legend]
Collaboration diagram for treqs::Activator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Activator ()
 ~Activator ()
unsigned int getMaxStagers ()
 Getter.
unsigned int getMaxQueueStagers ()
 Getter.
int getMetadataTimeout ()
 Getter.
void setMaxStagers (unsigned int)
 Setter.
void setMaxQueueStagers (unsigned int)
 Setter.
void setMetadataTimeout (int t)
 Setter.

Private Member Functions

std::string selectBestUser (list< Resource >::iterator iterator)
QueueselectBestQueue (list< Resource >::iterator rit, std::string u)
void activateQueue (Queue *q)
int cleanWorkers ()
void refreshAllocations ()
int countUsedResources ()
int countWaitingQueues (unsigned int id)
bool OnTask ()

Private Attributes

unsigned int MaxQueueStagers
 Max number of stages process per active queue.
unsigned int MaxStagers
 Max number of stagers for overall activity.
std::list< ResourceAllocations
 List of drives allocations per PVR.
std::list< Stager * > Workers
 Workers army.
int metadataTimeout
 Maximum age of the resources metadata.
unsigned int activeWorkers
 Count active workers.

Static Private Attributes

static LoggerPtr logger

Detailed Description

Class responsible for activation of the staging queues.

This class runs as a thread and periodically scans the waiting queues to activate them.


Constructor & Destructor Documentation

treqs::Activator::Activator (  ) 
treqs::Activator::~Activator (  ) 

Member Function Documentation

void treqs::Activator::activateQueue ( Queue q  )  [private]

Activate a queue. This function will also trigger the stagers.

Parameters:
q the queue to activate.

Here is the call graph for this function:

Here is the caller graph for this function:

int treqs::Activator::cleanWorkers (  )  [private]

Browse the workers list and erase the finished ones

Returns:
number of workers cleaned

Here is the call graph for this function:

Here is the caller graph for this function:

int treqs::Activator::countUsedResources (  )  [private]

Browse the queues and count the activated queues into the corresponding PVR resource

Returns:
the number of queues in QS_ACTIVATED state

Here is the call graph for this function:

Here is the caller graph for this function:

int treqs::Activator::countWaitingQueues ( unsigned int  id  )  [private]

Count waiting queues on a given PVR

Parameters:
id pvr id
Returns:
number of waiting queues

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int treqs::Activator::getMaxQueueStagers (  ) 

Getter.

unsigned int treqs::Activator::getMaxStagers (  ) 

Getter.

int treqs::Activator::getMetadataTimeout (  ) 

Getter.

bool treqs::Activator::OnTask (  )  [private, virtual]

Overrides the CThread OnTask function Just browse periodically the list of users and queues to activate the best queue

Returns:

Reimplemented from CThread.

Here is the call graph for this function:

void treqs::Activator::refreshAllocations (  )  [private]

Get the allocation information from configuration database Puts data into Allocations list

Here is the call graph for this function:

Here is the caller graph for this function:

Queue * treqs::Activator::selectBestQueue ( list< Resource >::iterator  rit,
std::string  u 
) [private]

Choose the best queue candidate for activation for a given user
Also taking the opportunity to unsuspend the suspended queues

Parameters:
rit iterator to the concerned resource
u the user candidate
Returns:
a pointer to the best queue

Here is the call graph for this function:

Here is the caller graph for this function:

string treqs::Activator::selectBestUser ( list< Resource >::iterator  iterator  )  [private]

Choose the best user candidate for activation

Parameters:
iterator iterator pointing the concerned resource
Returns:
the user's name

Here is the call graph for this function:

Here is the caller graph for this function:

void treqs::Activator::setMaxQueueStagers ( unsigned int  n  ) 

Setter.

void treqs::Activator::setMaxStagers ( unsigned int  n  ) 

Setter.

void treqs::Activator::setMetadataTimeout ( int  t  ) 

Setter.


Member Data Documentation

unsigned int treqs::Activator::activeWorkers [private]

Count active workers.

List of drives allocations per PVR.

LoggerPtr treqs::Activator::logger [static, private]
unsigned int treqs::Activator::MaxQueueStagers [private]

Max number of stages process per active queue.

unsigned int treqs::Activator::MaxStagers [private]

Max number of stagers for overall activity.

Maximum age of the resources metadata.

std::list<Stager*> treqs::Activator::Workers [private]

Workers army.


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

Generated on 4 Mar 2010 for TReqS by  doxygen 1.6.1