ARC SDK
|
TransferShares is used to implement fair-sharing and priorities. More...
#include <arc/data-staging/TransferShares.h>
Public Member Functions | |
TransferShares () | |
Create a new TransferShares with default configuration. More... | |
TransferShares (const TransferSharesConf &shares_conf) | |
Create a new TransferShares with given configuration. More... | |
~TransferShares () | |
Empty destructor. More... | |
void | set_shares_conf (const TransferSharesConf &share_conf) |
Set a new configuration, if a new reference share gets added for example. More... | |
void | calculate_shares (int TotalNumberOfSlots) |
Calculate how many slots to assign to each active share. More... | |
void | increase_transfer_share (const std::string &ShareToIncrease) |
Increase by one the active count for the given share. Called when a new DTR enters the queue. More... | |
void | decrease_transfer_share (const std::string &ShareToDecrease) |
Decrease by one the active count for the given share. Called when a completed DTR leaves the queue. More... | |
void | decrease_number_of_slots (const std::string &ShareToDecrease) |
Decrease by one the number of slots available to the given share. More... | |
bool | can_start (const std::string &ShareToStart) |
Returns true if there is a slot available for the given share. More... | |
std::map< std::string, int > | active_shares () const |
Returns the map of active shares. More... | |
TransferShares is used to implement fair-sharing and priorities.
TransferShares defines the algorithm used to prioritise and share transfers among different users or groups. Configuration information on the share type and reference shares is held in a TransferSharesConf instance. The Scheduler uses TransferShares to determine which DTRs in the queue for each process go first. The calculation is based on the configuration and the currently active shares (the DTRs already in the process). can_start() is the method called by the Scheduler to determine whether a particular share has an available slot in the process.
|
inline |
Create a new TransferShares with default configuration.
DataStaging::TransferShares::TransferShares | ( | const TransferSharesConf & | shares_conf | ) |
Create a new TransferShares with given configuration.
|
inline |
Empty destructor.
std::map<std::string, int> DataStaging::TransferShares::active_shares | ( | ) | const |
Returns the map of active shares.
void DataStaging::TransferShares::calculate_shares | ( | int | TotalNumberOfSlots | ) |
Calculate how many slots to assign to each active share.
This method is called each time the Scheduler loops to calculate the number of slots to assign to each share, based on the current number of active shares and the shares' relative priorities.
bool DataStaging::TransferShares::can_start | ( | const std::string & | ShareToStart | ) |
Returns true if there is a slot available for the given share.
void DataStaging::TransferShares::decrease_number_of_slots | ( | const std::string & | ShareToDecrease | ) |
Decrease by one the number of slots available to the given share.
Called when there is a slot already used by this share to reduce the number available.
void DataStaging::TransferShares::decrease_transfer_share | ( | const std::string & | ShareToDecrease | ) |
Decrease by one the active count for the given share. Called when a completed DTR leaves the queue.
void DataStaging::TransferShares::increase_transfer_share | ( | const std::string & | ShareToIncrease | ) |
Increase by one the active count for the given share. Called when a new DTR enters the queue.
void DataStaging::TransferShares::set_shares_conf | ( | const TransferSharesConf & | share_conf | ) |
Set a new configuration, if a new reference share gets added for example.