ARC SDK
|
The Scheduler is the control centre of the data staging framework. More...
#include <arc/data-staging/Scheduler.h>
Public Member Functions | |
Scheduler () | |
Constructor, to be used when only one Generator uses this Scheduler. More... | |
~Scheduler () | |
Destructor calls stop(), which cancels all DTRs and waits for them to complete. More... | |
void | SetSlots (int pre_processor=0, int post_processor=0, int delivery=0, int emergency=0, int staged_prepared=0) |
Set number of slots for processor and delivery stages. More... | |
void | AddURLMapping (const Arc::URL &template_url, const Arc::URL &replacement_url, const Arc::URL &access_url=Arc::URL()) |
Add URL mapping entry. See Arc::URLMap. More... | |
void | SetURLMapping (const Arc::URLMap &mapping=Arc::URLMap()) |
Replace all URL mapping entries. More... | |
void | SetPreferredPattern (const std::string &pattern) |
Set the preferred pattern for ordering replicas. More... | |
void | SetTransferSharesConf (const TransferSharesConf &share_conf) |
Set TransferShares configuration. More... | |
void | SetTransferParameters (const TransferParameters ¶ms) |
Set transfer limits. More... | |
void | SetDeliveryServices (const std::vector< Arc::URL > &endpoints) |
Set the list of delivery services. DTR::LOCAL_DELIVERY means local Delivery. More... | |
void | SetRemoteSizeLimit (unsigned long long int limit) |
Set the remote transfer size limit. More... | |
void | SetDumpLocation (const std::string &location) |
Set location for periodic dump of DTR state (only file paths currently supported) More... | |
bool | start (void) |
Start scheduling activity. More... | |
virtual void | receiveDTR (DTR_ptr dtr) |
Callback method implemented from DTRCallback. More... | |
bool | cancelDTRs (const std::string &jobid) |
Tell the Scheduler to cancel all the DTRs in the given job description. More... | |
bool | stop () |
Tell the Scheduler to shut down all threads and exit. More... | |
![]() | |
virtual | ~DTRCallback () |
Empty virtual destructor. More... | |
Static Public Member Functions | |
static Scheduler * | getInstance () |
Get static instance of Scheduler, to use one DTR instance with multiple generators. More... | |
The Scheduler is the control centre of the data staging framework.
The Scheduler manages a global list of DTRs and schedules when they should go into the next state or be sent to other processes. The DTR priority is used to decide each DTR's position in a queue.
DataStaging::Scheduler::Scheduler | ( | ) |
Constructor, to be used when only one Generator uses this Scheduler.
|
inline |
Destructor calls stop(), which cancels all DTRs and waits for them to complete.
void DataStaging::Scheduler::AddURLMapping | ( | const Arc::URL & | template_url, |
const Arc::URL & | replacement_url, | ||
const Arc::URL & | access_url = Arc::URL() |
||
) |
Add URL mapping entry. See Arc::URLMap.
bool DataStaging::Scheduler::cancelDTRs | ( | const std::string & | jobid | ) |
Tell the Scheduler to cancel all the DTRs in the given job description.
|
static |
Get static instance of Scheduler, to use one DTR instance with multiple generators.
Configuration of Scheduler by Set* methods can only be done before start() is called, so undetermined behaviour can result from multiple threads simultaneously calling Set* then start(). It is safer to make sure that all threads use the same configuration (calling start() twice is harmless). It is also better to make sure that threads call stop() in a roughly coordinated way, i.e. all generators stop at the same time.
|
virtual |
Callback method implemented from DTRCallback.
This method is called by the generator when it wants to pass a DTR to the scheduler and when other processes send a DTR back to the scheduler after processing.
Implements DataStaging::DTRCallback.
void DataStaging::Scheduler::SetDeliveryServices | ( | const std::vector< Arc::URL > & | endpoints | ) |
Set the list of delivery services. DTR::LOCAL_DELIVERY means local Delivery.
void DataStaging::Scheduler::SetDumpLocation | ( | const std::string & | location | ) |
Set location for periodic dump of DTR state (only file paths currently supported)
void DataStaging::Scheduler::SetPreferredPattern | ( | const std::string & | pattern | ) |
Set the preferred pattern for ordering replicas.
This pattern will be used in the case of an index service URL with multiple physical replicas and allows sorting of those replicas in order of preference. It consists of one or more patterns separated by a pipe character (|) listed in order of preference. If the dollar character ($) is used at the end of a pattern, the pattern will be matched to the end of the hostname of the replica. Example: "srm://myhost.org|.uk$|.ch$"
void DataStaging::Scheduler::SetRemoteSizeLimit | ( | unsigned long long int | limit | ) |
Set the remote transfer size limit.
void DataStaging::Scheduler::SetSlots | ( | int | pre_processor = 0 , |
int | post_processor = 0 , |
||
int | delivery = 0 , |
||
int | emergency = 0 , |
||
int | staged_prepared = 0 |
||
) |
Set number of slots for processor and delivery stages.
void DataStaging::Scheduler::SetTransferParameters | ( | const TransferParameters & | params | ) |
Set transfer limits.
void DataStaging::Scheduler::SetTransferSharesConf | ( | const TransferSharesConf & | share_conf | ) |
Set TransferShares configuration.
void DataStaging::Scheduler::SetURLMapping | ( | const Arc::URLMap & | mapping = Arc::URLMap() | ) |
Replace all URL mapping entries.
bool DataStaging::Scheduler::start | ( | void | ) |
bool DataStaging::Scheduler::stop | ( | ) |
Tell the Scheduler to shut down all threads and exit.
All active DTRs are cancelled and this method waits until they finish (all DTRs go to CANCELLED state)