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/workflow/execution_events/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 
34  protected:
35  StorageServiceMessage(std::string name, double payload);
36  };
37 
38 
43  public:
44  StorageServiceFreeSpaceRequestMessage(std::string answer_mailbox, double payload);
45 
47  std::string answer_mailbox;
48  };
49 
54  public:
55  StorageServiceFreeSpaceAnswerMessage(std::map<std::string, double> free_space, double payload);
56 
58  std::map<std::string, double> free_space;
59  };
60 
65  public:
66  StorageServiceFileLookupRequestMessage(std::string answer_mailbox, WorkflowFile *file,
67  std::shared_ptr<FileLocation> location, double payload);
68 
70  std::string answer_mailbox;
74  std::shared_ptr<FileLocation> location;
75  };
76 
81  public:
82  StorageServiceFileLookupAnswerMessage(WorkflowFile *file, bool file_is_available, double payload);
83 
88  };
89 
94  public:
95  StorageServiceFileDeleteRequestMessage(std::string answer_mailbox,
96  WorkflowFile *file,
97  std::shared_ptr<FileLocation> location,
98  double payload);
99 
101  std::string answer_mailbox;
105  std::shared_ptr<FileLocation> location;
106  };
107 
112  public:
114  std::shared_ptr<StorageService> storage_service,
115  bool success,
116  std::shared_ptr<FailureCause> failure_cause,
117  double payload);
118 
122  std::shared_ptr<StorageService> storage_service;
124  bool success;
126  std::shared_ptr<FailureCause> failure_cause;
127  };
128 
133  public:
134  StorageServiceFileCopyRequestMessage(std::string answer_mailbox, WorkflowFile *file,
135  std::shared_ptr<FileLocation> src,
136  std::shared_ptr<FileLocation> dst,
137  std::shared_ptr<FileRegistryService> file_registry_service,
138  SimulationTimestampFileCopyStart *start_timestamp,
139  double payload);
140 
142  std::string answer_mailbox;
146  std::shared_ptr<FileLocation> src;
148  std::shared_ptr<FileLocation> dst;
150  std::shared_ptr<FileRegistryService> file_registry_service;
153  };
154 
159  public:
161  std::shared_ptr<FileLocation> src,
162  std::shared_ptr<FileLocation> dst,
163  std::shared_ptr<FileRegistryService> file_registry_service,
164  bool file_registry_service_updated,
165  bool success, std::shared_ptr<FailureCause> cause,
166  double payload);
167 
171  std::shared_ptr<FileLocation> src;
173  std::shared_ptr<FileLocation> dst;
175  std::shared_ptr<FileRegistryService> file_registry_service;
179  bool success;
181  std::shared_ptr<FailureCause> failure_cause;
182 
183  };
184 
185 
186 
191  public:
192  StorageServiceFileWriteRequestMessage(std::string answer_mailbox,
193  WorkflowFile *file,
194  std::shared_ptr<FileLocation> location,
195  unsigned long buffer_size,
196  double payload);
197 
199  std::string answer_mailbox;
203  std::shared_ptr<FileLocation> location;
205  unsigned long buffer_size;
206  };
207 
212  public:
214  std::shared_ptr<FileLocation> location,
215  bool success,
216  std::shared_ptr<FailureCause> failure_cause,
217  std::string data_write_mailbox_name,
218  double payload);
219 
223  std::shared_ptr<FileLocation> location;
225  bool success;
229  std::shared_ptr<FailureCause> failure_cause;
230  };
231 
236  public:
237  StorageServiceFileReadRequestMessage(std::string answer_mailbox,
238  std::string mailbox_to_receive_the_file_content,
239  WorkflowFile *file,
240  std::shared_ptr<FileLocation> location,
241  unsigned long buffer_size,
242  double payload);
243 
245  std::string answer_mailbox;
251  std::shared_ptr<FileLocation> location;
253  unsigned long buffer_size;
254  };
255 
260  public:
262  std::shared_ptr<FileLocation> location,
263  bool success,
264  std::shared_ptr<FailureCause> failure_cause,
265  double payload);
266 
270  std::shared_ptr<FileLocation> location;
272  bool success;
274  std::shared_ptr<FailureCause> failure_cause;
275  };
276 
281  public:
283  unsigned long chunk_size, bool last_chunk);
284 
289  };
290 
291 
296  public:
298  };
299 
300 
301  /***********************/
303  /***********************/
304 
305 };
306 
307 
308 #endif //WRENCH_STORAGESERVICEMESSAGE_H
A message sent to a StorageService to copy a file from another StorageService.
Definition: StorageServiceMessage.h:132
WorkflowFile * file
The file was was copied, or not.
Definition: StorageServiceMessage.h:169
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, or nullptr on success.
Definition: StorageServiceMessage.h:274
std::string mailbox_to_receive_the_file_content
The mailbox to which the file content should be sent.
Definition: StorageServiceMessage.h:247
A message sent/received by a StorageService that has a file size as a payload.
Definition: StorageServiceMessage.h:280
A message sent by a StorageService in answer to a free space enquiry.
Definition: StorageServiceMessage.h:53
WorkflowFile * file
The file to read.
Definition: StorageServiceMessage.h:249
std::string data_write_mailbox_name
The mailbox on which to send the file.
Definition: StorageServiceMessage.h:227
A message sent to a StorageService to enquire about its free space.
Definition: StorageServiceMessage.h:42
A message sent by a StorageService in answer to a file lookup request.
Definition: StorageServiceMessage.h:80
WorkflowFile * file
The file that was looked up.
Definition: StorageServiceMessage.h:85
A message sent by a StorageService in answer to a file copy request.
Definition: StorageServiceMessage.h:158
bool success
Whether the write operation request was accepted or not.
Definition: StorageServiceMessage.h:225
A message sent by a StorageService in answer to a file read request.
Definition: StorageServiceMessage.h:259
WorkflowFile * file
The file to copy.
Definition: StorageServiceMessage.h:144
bool success
Whether the read operation was successful or not.
Definition: StorageServiceMessage.h:272
bool file_registry_service_updated
Whether a file registry service has been updated or not.
Definition: StorageServiceMessage.h:177
std::string answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:199
double payload
The message size in bytes.
Definition: SimulationMessage.h:39
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, or nullptr if success.
Definition: StorageServiceMessage.h:126
std::shared_ptr< FileLocation > dst
The destination location.
Definition: StorageServiceMessage.h:148
A data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26
std::string name
The message name.
Definition: SimulationMessage.h:37
SimulationTimestampFileCopyStart * start_timestamp
The SimulationTimestampFileCopyStart associated with this file copy request.
Definition: StorageServiceMessage.h:152
A message sent to a StorageService to read a file.
Definition: StorageServiceMessage.h:235
WorkflowFile * file
The file.
Definition: StorageServiceMessage.h:286
std::shared_ptr< FileLocation > location
The file location (hopefully)
Definition: StorageServiceMessage.h:74
bool success
Whether the deletion was successful.
Definition: StorageServiceMessage.h:124
std::shared_ptr< FileLocation > location
The location at which the file should be written.
Definition: StorageServiceMessage.h:223
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, if any, or nullptr.
Definition: StorageServiceMessage.h:229
std::shared_ptr< FileLocation > location
The location from which to read the file.
Definition: StorageServiceMessage.h:251
std::string answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:101
WorkflowFile * file
The workflow file that should be written.
Definition: StorageServiceMessage.h:221
std::shared_ptr< FileLocation > dst
The destination location.
Definition: StorageServiceMessage.h:173
std::shared_ptr< StorageService > storage_service
The storage service on which the deletion happened (or not)
Definition: StorageServiceMessage.h:122
A message sent to a StorageService to delete a file.
Definition: StorageServiceMessage.h:93
std::shared_ptr< FileLocation > src
The source location.
Definition: StorageServiceMessage.h:171
std::shared_ptr< FileLocation > src
The source location.
Definition: StorageServiceMessage.h:146
A message sent to a StorageService to write a file.
Definition: StorageServiceMessage.h:190
Top-level class for messages received/sent by a Service.
Definition: ServiceMessage.h:27
A message sent to a StorageService to lookup a file.
Definition: StorageServiceMessage.h:64
bool last_chunk
Whether this is the last file chunk.
Definition: StorageServiceMessage.h:288
StorageServiceMessage(std::string name, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:27
A message sent by a StorageService in answer to a file write request.
Definition: StorageServiceMessage.h:211
WorkflowFile * file
The file that was deleted (or not)
Definition: StorageServiceMessage.h:120
std::shared_ptr< FileRegistryService > file_registry_service
The file registry service that the user had requested be updated, or nullptr if none.
Definition: StorageServiceMessage.h:175
bool file_is_available
Whether the file was found.
Definition: StorageServiceMessage.h:87
std::string answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:70
WorkflowFile * file
The file that was read.
Definition: StorageServiceMessage.h:268
unsigned long buffer_size
The buffer size to use.
Definition: StorageServiceMessage.h:205
WorkflowFile * file
The file to write.
Definition: StorageServiceMessage.h:201
A simulation timestamp class for file copy start times.
Definition: SimulationTimestampTypes.h:186
Top-level class for messages received/sent by a StorageService.
Definition: StorageServiceMessage.h:33
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, or nullptr if success.
Definition: StorageServiceMessage.h:181
bool success
Whether the copy was successful.
Definition: StorageServiceMessage.h:179
std::shared_ptr< FileLocation > location
The location of the file.
Definition: StorageServiceMessage.h:270
WorkflowFile * file
The file to lookup.
Definition: StorageServiceMessage.h:72
std::string answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:47
unsigned long buffer_size
The requested buffer size.
Definition: StorageServiceMessage.h:253
std::string answer_mailbox
The mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:245
std::string answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:142
A message sent by a StorageService as an ack.
Definition: StorageServiceMessage.h:295
std::map< std::string, double > free_space
The amount of free space in bytes for each mount point, in a map.
Definition: StorageServiceMessage.h:58
A message sent by a StorageService in answer to a file deletion request.
Definition: StorageServiceMessage.h:111
std::shared_ptr< FileLocation > location
The location to write the file to.
Definition: StorageServiceMessage.h:203
std::shared_ptr< FileLocation > location
The location where the file will be deleted.
Definition: StorageServiceMessage.h:105
std::shared_ptr< FileRegistryService > file_registry_service
The file registry service to update, or none if nullptr.
Definition: StorageServiceMessage.h:150
WorkflowFile * file
The file to delete.
Definition: StorageServiceMessage.h:103
Definition: Alarm.cpp:19