ARC SDK
Public Member Functions | Static Public Member Functions
DataStaging::Scheduler Class Reference

The Scheduler is the control centre of the data staging framework. More...

#include <arc/data-staging/Scheduler.h>

Inheritance diagram for DataStaging::Scheduler:
DataStaging::DTRCallback

Public Member Functions

 Scheduler ()
 Constructor, to be used when only one Generator uses this Scheduler.
 
 ~Scheduler ()
 Destructor calls stop(), which cancels all DTRs and waits for them to complete.
 
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.
 
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.
 
void SetURLMapping (const Arc::URLMap &mapping=Arc::URLMap())
 Replace all URL mapping entries.
 
void SetPreferredPattern (const std::string &pattern)
 Set the preferred pattern for ordering replicas. More...
 
void SetTransferSharesConf (const TransferSharesConf &share_conf)
 Set TransferShares configuration.
 
void SetTransferParameters (const TransferParameters &params)
 Set transfer limits.
 
void SetDeliveryServices (const std::vector< Arc::URL > &endpoints)
 Set the list of delivery services. DTR::LOCAL_DELIVERY means local Delivery.
 
void SetRemoteSizeLimit (unsigned long long int limit)
 Set the remote transfer size limit.
 
void SetDumpLocation (const std::string &location)
 Set location for periodic dump of DTR state (only file paths currently supported)
 
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.
 
bool stop ()
 Tell the Scheduler to shut down all threads and exit. More...
 
- Public Member Functions inherited from DataStaging::DTRCallback
virtual ~DTRCallback ()
 Empty virtual destructor.
 

Static Public Member Functions

static SchedulergetInstance ()
 Get static instance of Scheduler, to use one DTR instance with multiple generators. More...
 

Detailed Description

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.

Member Function Documentation

static Scheduler* DataStaging::Scheduler::getInstance ( )
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 void DataStaging::Scheduler::receiveDTR ( DTR_ptr  dtr)
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::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$"

bool DataStaging::Scheduler::start ( void  )

Start scheduling activity.

This method must be called after all configuration parameters are set properly. Scheduler can be stopped either by calling stop() method or by destroying its instance.

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)


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