1 #ifndef TRANSFERSHARES_H_ 2 #define TRANSFERSHARES_H_ 39 std::map<std::string, int> ReferenceShares;
47 TransferSharesConf(
const std::string& type,
const std::map<std::string, int>& ref_shares);
68 std::string
conf()
const;
96 std::map<std::string, int> ActiveShares;
99 std::map<std::string, int> ActiveSharesSlots;
136 bool can_start(
const std::string& ShareToStart);
Shares are defined per VOMS role of the user's proxy.
Definition: TransferShares.h:30
ShareType
The criterion for assigning a share to a DTR.
Definition: TransferShares.h:22
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...
TransferShares is used to implement fair-sharing and priorities.
Definition: TransferShares.h:88
TransferSharesConf()
Construct a new TransferSharesConf with no defined shares or policy.
TransferSharesConf describes the configuration of TransferShares.
Definition: TransferShares.h:17
void set_share_type(const std::string &type)
Set the share type.
Shares are defined per VOMS group of the user's proxy.
Definition: TransferShares.h:28
std::string conf() const
Return human-readable configuration of shares.
void set_reference_share(const std::string &RefShare, int Priority)
Add a reference share.
No share criterion - all DTRs will be assigned to a single share.
Definition: TransferShares.h:32
bool is_configured(const std::string &ShareToCheck)
Returns true if the given share is a reference share.
~TransferShares()
Empty destructor.
Definition: TransferShares.h:110
DataStaging contains all components for data transfer scheduling and execution.
Definition: DataDelivery.h:12
void set_reference_shares(const std::map< std::string, int > &shares)
Set reference shares.
Shares are defined per DN of the user's proxy.
Definition: TransferShares.h:24
int get_basic_priority(const std::string &ShareToCheck)
Get the priority of this share.
std::string extract_share_info(DTR_ptr DTRToExtract)
Get the name of the share the DTR should be assigned to and the proxy type.
void decrease_number_of_slots(const std::string &ShareToDecrease)
Decrease by one the number of slots available to the given share.
void set_shares_conf(const TransferSharesConf &share_conf)
Set a new configuration, if a new reference share gets added for example.
bool can_start(const std::string &ShareToStart)
Returns true if there is a slot available for the given share.
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...
Shares are defined per VOMS VO of the user's proxy.
Definition: TransferShares.h:26
void calculate_shares(int TotalNumberOfSlots)
Calculate how many slots to assign to each active share.
TransferShares()
Create a new TransferShares with default configuration.
Definition: TransferShares.h:104
std::map< std::string, int > active_shares() const
Returns the map of active shares.