WRENCH  1.10
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
DataMovementManager.h
1 
11 #ifndef WRENCH_DATAMOVEMENTMANAGER_H
12 #define WRENCH_DATAMOVEMENTMANAGER_H
13 
14 
15 #include "wrench/simgrid_S4U_util/S4U_Daemon.h"
16 
17 namespace wrench {
18 
19  class Workflow;
20  class WorkflowFile;
21  class StorageService;
22  class WMS;
23 
24  /***********************/
26  /***********************/
27 
31  class DataMovementManager : public Service {
32 
33  public:
34 
35  void stop();
36 
37  void kill();
38 
39  void initiateAsynchronousFileCopy(WorkflowFile *file,
40  std::shared_ptr<FileLocation> src,
41  std::shared_ptr<FileLocation> dst,
42  std::shared_ptr<FileRegistryService> file_registry_service=nullptr);
43 
44  void doSynchronousFileCopy(WorkflowFile *file,
45  std::shared_ptr<FileLocation> src,
46  std::shared_ptr<FileLocation> dst,
47  std::shared_ptr<FileRegistryService> file_registry_service=nullptr);
48 
49  protected:
50 
51  /***********************/
53  /***********************/
54 
55 
56  friend class WMS;
57 
58  explicit DataMovementManager(std::shared_ptr<WMS> wms);
59 
60  /***********************/
62  /***********************/
63 
64  private:
65 
66  int main();
67 
68  std::shared_ptr<WMS> wms = nullptr;
69 
70  bool processNextMessage();
71 
72  struct CopyRequestSpecs {
73  WorkflowFile *file;
74  std::shared_ptr<FileLocation> src;
75  std::shared_ptr<FileLocation> dst;
76  std::shared_ptr<FileRegistryService> file_registry_service;
77 
78  CopyRequestSpecs(WorkflowFile *file,
79  std::shared_ptr<FileLocation> src,
80  std::shared_ptr<FileLocation> dst,
81  std::shared_ptr<FileRegistryService> file_registry_service) :
82  file(file), src(src), dst(dst), file_registry_service(file_registry_service) {}
83 
84  bool operator==(const CopyRequestSpecs &rhs) const {
85  return (file == rhs.file) &&
86  (dst->getStorageService() == rhs.dst->getStorageService()) &&
87  (dst->getAbsolutePathAtMountPoint() == rhs.dst->getAbsolutePathAtMountPoint());
88  }
89  };
90 
91  std::list<std::unique_ptr<CopyRequestSpecs>> pending_file_copies;
92  };
93 
94  /***********************/
96  /***********************/
97 
98 
99 };
100 
101 
102 #endif //WRENCH_DATAMOVEMENTMANAGER_H
wrench::operator==
bool operator==(const BatchJobSet &left, const BatchJobSet &right)
Overloaded operator.
Definition: NodeAvailabilityTimeLine.cpp:24
wrench
Definition: Alarm.cpp:20