4 #include <arc/JobPerfLog.h> 5 #include <arc/Thread.h> 6 #include <arc/Logger.h> 8 #include <arc/data/URLMap.h> 12 #include "Processor.h" 13 #include "DataDelivery.h" 14 #include "TransferShares.h" 38 std::list<std::string> cancelled_jobs;
41 std::list<DTR_ptr> events;
44 std::map<std::string, std::list<DTR_ptr> > staged_queue;
56 std::string preferred_pattern;
71 unsigned int PreProcessorSlots;
73 unsigned int DeliverySlots;
75 unsigned int PostProcessorSlots;
77 unsigned int EmergencySlots;
79 unsigned int StagedPreparedSlots;
82 std::string dumplocation;
88 std::vector<Arc::URL> configured_delivery_services;
92 std::map<Arc::URL, std::vector<std::string> > usable_delivery_services;
98 unsigned long long int remote_size_limit;
101 std::map<std::string, int> delivery_hosts;
107 std::list<Arc::LogDestination*> root_destinations;
122 static Glib::Mutex instance_lock;
132 void ProcessDTRNEW(
DTR_ptr request);
134 void ProcessDTRCACHE_WAIT(
DTR_ptr request);
136 void ProcessDTRCACHE_CHECKED(
DTR_ptr request);
138 void ProcessDTRRESOLVED(
DTR_ptr request);
140 void ProcessDTRREPLICA_QUERIED(
DTR_ptr request);
142 void ProcessDTRPRE_CLEANED(
DTR_ptr request);
144 void ProcessDTRSTAGING_PREPARING_WAIT(
DTR_ptr request);
146 void ProcessDTRSTAGED_PREPARED(
DTR_ptr request);
148 void ProcessDTRTRANSFERRED(
DTR_ptr request);
150 void ProcessDTRREQUEST_RELEASED(
DTR_ptr request);
152 void ProcessDTRREPLICA_REGISTERED(
DTR_ptr request);
154 void ProcessDTRCACHE_PROCESSED(
DTR_ptr request);
158 void ProcessDTRFINAL_STATE(
DTR_ptr request);
163 void log_to_root_logger(
Arc::LogLevel level,
const std::string& message);
166 void map_state_and_process(
DTR_ptr request);
171 void map_cancel_state(
DTR_ptr request);
175 void map_stuck_state(
DTR_ptr request);
180 void choose_delivery_service(
DTR_ptr request);
184 void revise_queues();
190 void process_events(
void);
198 void next_replica(
DTR_ptr request);
209 static void dump_thread(
void* arg);
212 static void main_thread(
void* arg);
214 void main_thread(
void);
238 void SetSlots(
int pre_processor = 0,
int post_processor = 0,
239 int delivery = 0,
int emergency = 0,
int staged_prepared = 0);
DataDelivery transfers data between specified physical locations.
Definition: DataDelivery.h:26
Simple triggered condition.
Definition: Thread.h:150
bool stop()
Tell the Scheduler to shut down all threads and exit.
void SetDeliveryServices(const std::vector< Arc::URL > &endpoints)
Set the list of delivery services. DTR::LOCAL_DELIVERY means local Delivery.
The base class from which all callback-enabled classes should be derived.
Definition: DTR.h:193
void SetPreferredPattern(const std::string &pattern)
Set the preferred pattern for ordering replicas.
A class for storing and manipulating times.
Definition: DateTime.h:125
The Processor performs pre- and post-transfer operations.
Definition: Processor.h:18
Scheduler()
Constructor, to be used when only one Generator uses this Scheduler.
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.
TransferSharesConf describes the configuration of TransferShares.
Definition: TransferShares.h:17
Global list of all active DTRs in the system.
Definition: DTRList.h:17
A logger class.
Definition: Logger.h:493
Represents limits and properties of a DTR transfer. These generally apply to all DTRs.
Definition: DTR.h:91
void SetURLMapping(const Arc::URLMap &mapping=Arc::URLMap())
Replace all URL mapping entries.
static Scheduler * getInstance()
Get static instance of Scheduler, to use one DTR instance with multiple generators.
DataStaging contains all components for data transfer scheduling and execution.
Definition: DataDelivery.h:12
LogLevel
Logging levels for tagging and filtering log messages.
Definition: Logger.h:20
void SetTransferSharesConf(const TransferSharesConf &share_conf)
Set TransferShares configuration.
void SetDumpLocation(const std::string &location)
Set location for periodic dump of DTR state (only file paths currently supported) ...
Class to represent general URLs.
Definition: URL.h:88
URLMap allows mapping certain patterns of URLs to other URLs.
Definition: URLMap.h:22
bool cancelDTRs(const std::string &jobid)
Tell the Scheduler to cancel all the DTRs in the given job description.
virtual void receiveDTR(DTR_ptr dtr)
Callback method implemented from DTRCallback.
bool start(void)
Start scheduling activity.
void SetRemoteSizeLimit(unsigned long long int limit)
Set the remote transfer size limit.
~Scheduler()
Destructor calls stop(), which cancels all DTRs and waits for them to complete.
Definition: Scheduler.h:233
Definition: JobPerfLog.h:9
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 SetTransferParameters(const TransferParameters ¶ms)
Set transfer limits.
The Scheduler is the control centre of the data staging framework.
Definition: Scheduler.h:26
void SetJobPerfLog(const Arc::JobPerfLog &perf_log)
Set JobPerfLog object for performance metrics logging.
ProcessState
Internal state of StagingProcesses.
Definition: DTR.h:79
Wrapper for pointer with automatic destruction and multiple references.
Definition: Thread.h:436