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, StorageService *src, StorageService *dst, FileRegistryService *file_registry_service=nullptr);
41  StorageService *src, std::string src_partition,
42  StorageService *dst, std::string dst_partition,
43  FileRegistryService *file_registry_service=nullptr);
44 
45  void doSynchronousFileCopy(WorkflowFile *file, StorageService *src, StorageService *dst, FileRegistryService *file_registry_service=nullptr);
47  StorageService *src, std::string src_partition,
48  StorageService *dst, std::string dst_partition,
49  FileRegistryService *file_registry_service=nullptr);
50 
51  protected:
52 
53  /***********************/
55  /***********************/
56 
57 
58  friend class WMS;
59 
60  explicit DataMovementManager(WMS *wms);
61 
62  /***********************/
64  /***********************/
65 
66  private:
67 
68  int main();
69 
70  WMS *wms = nullptr;
71 
72  bool processNextMessage();
73 
74  struct CopyRequestSpecs {
75  WorkflowFile *file;
76  StorageService *dst;
77  std::string dst_partition;
78  FileRegistryService *file_registry_service;
79 
80  CopyRequestSpecs(WorkflowFile *file,
81  StorageService *dst, std::string dst_partition,
82  FileRegistryService *file_registry_service) : file(file), dst(dst), dst_partition(dst_partition), file_registry_service(file_registry_service) {}
83 
84  bool operator==(const CopyRequestSpecs &rhs) const {
85  return (file == rhs.file) && (dst == rhs.dst) && (dst_partition == rhs.dst_partition);
86  }
87  };
88 
89  std::list<std::unique_ptr<CopyRequestSpecs>> pending_file_copies;
90  };
91 
92  /***********************/
94  /***********************/
95 
96 
97 };
98 
99 
100 #endif //WRENCH_DATAMOVEMENTMANAGER_H
A service that can be added to the simulation and that can be used by a WMS when executing a workflow...
Definition: Service.h:26
A data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26
void doSynchronousFileCopy(WorkflowFile *file, StorageService *src, StorageService *dst, FileRegistryService *file_registry_service=nullptr)
Ask the data manager to perform a synchronous file copy.
Definition: DataMovementManager.cpp:147
void kill()
Kill the manager (brutally terminate the daemon)
Definition: DataMovementManager.cpp:53
A helper daemon (co-located with a WMS) that handles data movement operations.
Definition: DataMovementManager.h:31
A file registry service (a.k.a. replica catalog) that holds a database of which files are available a...
Definition: FileRegistryService.h:33
void initiateAsynchronousFileCopy(WorkflowFile *file, StorageService *src, StorageService *dst, FileRegistryService *file_registry_service=nullptr)
Ask the data manager to initiate an asynchronous file copy.
Definition: DataMovementManager.cpp:81
void stop()
Stop the manager.
Definition: DataMovementManager.cpp:63
A workflow management system (WMS)
Definition: WMS.h:33
The storage service base class.
Definition: StorageService.h:35
Definition: TerminalOutput.cpp:15