ARC SDK
DTRList.h
1 #ifndef DTRLIST_H_
2 #define DTRLIST_H_
3 
4 #include <arc/Thread.h>
5 
6 #include "DTR.h"
7 
8 namespace DataStaging {
9 
11 
17  class DTRList {
18 
19  private:
20 
22  std::list<DTR_ptr> DTRs;
23 
26 
28 
32  std::map<std::string, int> CachingSources;
33 
35  Arc::SimpleCondition CachingLock;
36 
37  public:
38 
40  bool add_dtr(DTR_ptr DTRToAdd);
41 
43  bool delete_dtr(DTR_ptr DTRToDelete);
44 
46 
50  bool filter_dtrs_by_owner(StagingProcesses OwnerToFilter, std::list<DTR_ptr>& FilteredList);
51 
53  int number_of_dtrs_by_owner(StagingProcesses OwnerToFilter);
54 
56 
63  bool filter_dtrs_by_status(DTRStatus::DTRStatusType StatusToFilter, std::list<DTR_ptr>& FilteredList);
64 
66 
70  bool filter_dtrs_by_statuses(const std::vector<DTRStatus::DTRStatusType>& StatusesToFilter,
71  std::list<DTR_ptr>& FilteredList);
72 
74 
79  bool filter_dtrs_by_statuses(const std::vector<DTRStatus::DTRStatusType>& StatusesToFilter,
80  std::map<DTRStatus::DTRStatusType, std::list<DTR_ptr> >& FilteredList);
81 
83 
89  bool filter_dtrs_by_next_receiver(StagingProcesses NextReceiver, std::list<DTR_ptr>& FilteredList);
90 
92 
97  bool filter_pending_dtrs(std::list<DTR_ptr>& FilteredList);
98 
100 
104  bool filter_dtrs_by_job(const std::string& jobid, std::list<DTR_ptr>& FilteredList);
105 
107 
110  void check_priority_changes(const std::string& filename);
111 
113  void caching_started(DTR_ptr request);
114 
116  void caching_finished(DTR_ptr request);
117 
119  bool is_being_cached(DTR_ptr DTRToCheck);
120 
122  bool empty();
123 
125  std::list<std::string> all_jobs();
126 
128  unsigned int size();
129 
131 
135  void dumpState(const std::string& path);
136 
137  };
138 
139 } // namespace DataStaging
140 
141 #endif /*DTRLIST_H_*/
void dumpState(const std::string &path)
Dump state of all current DTRs to a destination, eg file, database, url...
unsigned int size()
Return the size of the DTR list.
bool add_dtr(DTR_ptr DTRToAdd)
Put a new DTR into the list.
DTRStatusType
Possible state values.
Definition: DTRStatus.h:21
Simple triggered condition.
Definition: Thread.h:150
int number_of_dtrs_by_owner(StagingProcesses OwnerToFilter)
Returns the number of DTRs owned by a particular process.
StagingProcesses
Components of the data staging framework.
Definition: DTR.h:69
bool delete_dtr(DTR_ptr DTRToDelete)
Remove a DTR from the list.
bool filter_dtrs_by_next_receiver(StagingProcesses NextReceiver, std::list< DTR_ptr > &FilteredList)
Select DTRs that are about to go to the specified process.
Global list of all active DTRs in the system.
Definition: DTRList.h:17
void caching_started(DTR_ptr request)
Update the caching set, add a DTR (only if it is CACHEABLE).
bool filter_dtrs_by_statuses(const std::vector< DTRStatus::DTRStatusType > &StatusesToFilter, std::list< DTR_ptr > &FilteredList)
Filter the queue to select DTRs with particular statuses.
void caching_finished(DTR_ptr request)
Update the caching set, removing a DTR.
DataStaging contains all components for data transfer scheduling and execution.
Definition: DataDelivery.h:12
bool is_being_cached(DTR_ptr DTRToCheck)
Returns true if the DTR&#39;s source is currently in the caching set.
bool filter_pending_dtrs(std::list< DTR_ptr > &FilteredList)
Select DTRs that have just arrived from pre-, post-processor, delivery or generator.
bool filter_dtrs_by_job(const std::string &jobid, std::list< DTR_ptr > &FilteredList)
Get the list of DTRs corresponding to the given job ID.
bool filter_dtrs_by_status(DTRStatus::DTRStatusType StatusToFilter, std::list< DTR_ptr > &FilteredList)
Filter the queue to select DTRs with particular status.
bool filter_dtrs_by_owner(StagingProcesses OwnerToFilter, std::list< DTR_ptr > &FilteredList)
Filter the queue to select DTRs owned by a specified process.
void check_priority_changes(const std::string &filename)
Check for requested changes in priority in filename.
bool empty()
Returns true if there are no DTRs in the list.
std::list< std::string > all_jobs()
Get the list of all job IDs.