WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
StorageServiceMessage.h
1 
11 #ifndef WRENCH_STORAGESERVICEMESSAGE_H
12 #define WRENCH_STORAGESERVICEMESSAGE_H
13 
14 
15 #include <memory>
16 
17 #include "wrench/services/ServiceMessage.h"
18 #include "wrench/failure_causes/FailureCause.h"
19 #include "wrench/services/file_registry/FileRegistryService.h"
20 #include "wrench/simulation/SimulationTimestampTypes.h"
21 #include "wrench/simulation/Simulation.h"
22 #include "wrench/simulation/SimulationOutput.h"
23 
24 namespace wrench {
25 
26  /***********************/
28  /***********************/
29 
33  class StorageServiceMessage : public ServiceMessage {
34  protected:
35  StorageServiceMessage(double payload);
36  };
37 
38 
42  class StorageServiceFreeSpaceRequestMessage : public StorageServiceMessage {
43  public:
44  StorageServiceFreeSpaceRequestMessage(simgrid::s4u::Mailbox *answer_mailbox, double payload);
45 
47  simgrid::s4u::Mailbox *answer_mailbox;
48  };
49 
53  class StorageServiceFreeSpaceAnswerMessage : public StorageServiceMessage {
54  public:
55  StorageServiceFreeSpaceAnswerMessage(std::map<std::string, double> free_space, double payload);
56 
58  std::map<std::string, double> free_space;
59  };
60 
64  class StorageServiceFileLookupRequestMessage : public StorageServiceMessage {
65  public:
66  StorageServiceFileLookupRequestMessage(simgrid::s4u::Mailbox *answer_mailbox, std::shared_ptr<DataFile>file,
67  std::shared_ptr<FileLocation> location, double payload);
68 
70  simgrid::s4u::Mailbox *answer_mailbox;
72  std::shared_ptr<DataFile>file;
74  std::shared_ptr<FileLocation> location;
75  };
76 
80  class StorageServiceFileLookupAnswerMessage : public StorageServiceMessage {
81  public:
82  StorageServiceFileLookupAnswerMessage(std::shared_ptr<DataFile>file, bool file_is_available, double payload);
83 
85  std::shared_ptr<DataFile>file;
87  bool file_is_available;
88  };
89 
93  class StorageServiceFileDeleteRequestMessage : public StorageServiceMessage {
94  public:
95  StorageServiceFileDeleteRequestMessage(simgrid::s4u::Mailbox *answer_mailbox,
96  std::shared_ptr<DataFile>file,
97  std::shared_ptr<FileLocation> location,
98  double payload);
99 
101  simgrid::s4u::Mailbox *answer_mailbox;
103  std::shared_ptr<DataFile>file;
105  std::shared_ptr<FileLocation> location;
106  };
107 
111  class StorageServiceFileDeleteAnswerMessage : public StorageServiceMessage {
112  public:
113  StorageServiceFileDeleteAnswerMessage(std::shared_ptr<DataFile>file,
114  std::shared_ptr<StorageService> storage_service,
115  bool success,
116  std::shared_ptr<FailureCause> failure_cause,
117  double payload);
118 
120  std::shared_ptr<DataFile>file;
122  std::shared_ptr<StorageService> storage_service;
124  bool success;
126  std::shared_ptr<FailureCause> failure_cause;
127  };
128 
132  class StorageServiceFileCopyRequestMessage : public StorageServiceMessage {
133  public:
134  StorageServiceFileCopyRequestMessage(simgrid::s4u::Mailbox *answer_mailbox,
135  std::shared_ptr<DataFile> file,
136  std::shared_ptr<FileLocation> src,
137  std::shared_ptr<FileLocation> dst,
138  std::shared_ptr<FileRegistryService> file_registry_service,
139  double payload);
140 
142  simgrid::s4u::Mailbox *answer_mailbox;
144  std::shared_ptr<DataFile>file;
146  std::shared_ptr<FileLocation> src;
148  std::shared_ptr<FileLocation> dst;
150  std::shared_ptr<FileRegistryService> file_registry_service;
151  };
152 
156  class StorageServiceFileCopyAnswerMessage : public StorageServiceMessage {
157  public:
158  StorageServiceFileCopyAnswerMessage(std::shared_ptr<DataFile>file,
159  std::shared_ptr<FileLocation> src,
160  std::shared_ptr<FileLocation> dst,
161  std::shared_ptr<FileRegistryService> file_registry_service,
162  bool file_registry_service_updated,
163  bool success, std::shared_ptr<FailureCause> cause,
164  double payload);
165 
167  std::shared_ptr<DataFile>file;
169  std::shared_ptr<FileLocation> src;
171  std::shared_ptr<FileLocation> dst;
173  std::shared_ptr<FileRegistryService> file_registry_service;
175  bool file_registry_service_updated;
177  bool success;
179  std::shared_ptr<FailureCause> failure_cause;
180 
181  };
182 
183 
184 
188  class StorageServiceFileWriteRequestMessage : public StorageServiceMessage {
189  public:
190  StorageServiceFileWriteRequestMessage(simgrid::s4u::Mailbox *answer_mailbox,
191  std::shared_ptr<DataFile>file,
192  std::shared_ptr<FileLocation> location,
193  unsigned long buffer_size,
194  double payload);
195 
197  simgrid::s4u::Mailbox *answer_mailbox;
199  std::shared_ptr<DataFile>file;
201  std::shared_ptr<FileLocation> location;
203  unsigned long buffer_size;
204  };
205 
209  class StorageServiceFileWriteAnswerMessage : public StorageServiceMessage {
210  public:
211  StorageServiceFileWriteAnswerMessage(std::shared_ptr<DataFile>file,
212  std::shared_ptr<FileLocation> location,
213  bool success,
214  std::shared_ptr<FailureCause> failure_cause,
215  simgrid::s4u::Mailbox *data_write_mailbox_name,
216  double payload);
217 
219  std::shared_ptr<DataFile>file;
221  std::shared_ptr<FileLocation> location;
223  bool success;
225  simgrid::s4u::Mailbox *data_write_mailbox;
227  std::shared_ptr<FailureCause> failure_cause;
228  };
229 
233  class StorageServiceFileReadRequestMessage : public StorageServiceMessage {
234  public:
235  StorageServiceFileReadRequestMessage(simgrid::s4u::Mailbox *answer_mailbox,
236  simgrid::s4u::Mailbox *mailbox_to_receive_the_file_content,
237  std::shared_ptr<DataFile>file,
238  std::shared_ptr<FileLocation> location,
239  double num_bytes_to_read,
240  unsigned long buffer_size,
241  double payload);
242 
244  simgrid::s4u::Mailbox *answer_mailbox;
246  simgrid::s4u::Mailbox *mailbox_to_receive_the_file_content;
248  std::shared_ptr<DataFile>file;
250  std::shared_ptr<FileLocation> location;
252  double num_bytes_to_read;
254  unsigned long buffer_size;
255  };
256 
260  class StorageServiceFileReadAnswerMessage : public StorageServiceMessage {
261  public:
262  StorageServiceFileReadAnswerMessage(std::shared_ptr<DataFile>file,
263  std::shared_ptr<FileLocation> location,
264  bool success,
265  std::shared_ptr<FailureCause> failure_cause,
266  double payload);
267 
269  std::shared_ptr<DataFile>file;
271  std::shared_ptr<FileLocation> location;
273  bool success;
275  std::shared_ptr<FailureCause> failure_cause;
276  };
277 
281  class StorageServiceFileContentChunkMessage : public StorageServiceMessage {
282  public:
283  explicit StorageServiceFileContentChunkMessage(std::shared_ptr<DataFile>file,
284  unsigned long chunk_size, bool last_chunk);
285 
287  std::shared_ptr<DataFile>file;
289  bool last_chunk;
290  };
291 
292 
296  class StorageServiceAckMessage : public StorageServiceMessage {
297  public:
298  StorageServiceAckMessage() : StorageServiceMessage(0) {}
299  };
300 
301 
302  /***********************/
304  /***********************/
305 
306 };
307 
308 
309 #endif //WRENCH_STORAGESERVICEMESSAGE_H
wrench
Definition: Action.cpp:28