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);
46  std::string answer_mailbox;
47  };
48 
53  public:
54  StorageServiceFreeSpaceAnswerMessage(double free_space, double payload);
55 
57  double free_space;
58  };
59 
64  public:
65  StorageServiceFileLookupRequestMessage(std::string answer_mailbox, WorkflowFile *file, std::string& dst_partition, double payload);
66 
68  std::string answer_mailbox;
72  std::string dst_partition;
73  };
74 
79  public:
80  StorageServiceFileLookupAnswerMessage(WorkflowFile *file, bool file_is_available, double payload);
81 
86  };
87 
92  public:
93  StorageServiceFileDeleteRequestMessage(std::string answer_mailbox,
94  WorkflowFile *file,
95  std::string& dst_partition,
96  double payload);
97 
99  std::string answer_mailbox;
103  std::string dst_partition;
104  };
105 
110  public:
112  StorageService *storage_service,
113  bool success,
114  std::shared_ptr<FailureCause> failure_cause,
115  double payload);
116 
122  bool success;
124  std::shared_ptr<FailureCause> failure_cause;
125  };
126 
131  public:
132  StorageServiceFileCopyRequestMessage(std::string answer_mailbox, WorkflowFile *file, StorageService *src,
133  std::string& src_partition, StorageService * dst, std::string& dst_partition,
134  FileRegistryService *file_registry_service,
135  SimulationTimestampFileCopyStart *start_timestamp,
136  double payload);
137 
139  std::string answer_mailbox;
145  std::string src_partition;
149  std::string dst_partition;
154  };
155 
160  public:
162  std::string dst_partition,
163  FileRegistryService *file_registry_service,
164  bool file_registry_service_updated,
165  bool success, std::shared_ptr<FailureCause> cause,
166  double payload);
167 
173  std::string dst_partition;
179  bool success;
181  std::shared_ptr<FailureCause> failure_cause;
182 
183  };
184 
189  public:
190  StorageServiceFileWriteRequestMessage(std::string answer_mailbox, WorkflowFile *file, std::string& dst_partition, double payload);
191 
193  std::string answer_mailbox;
197  std::string dst_partition;
198  };
199 
204  public:
206  StorageService *storage_service,
207  bool success,
208  std::shared_ptr<FailureCause> failure_cause,
209  std::string data_write_mailbox_name,
210  double payload);
211 
217  bool success;
221  std::shared_ptr<FailureCause> failure_cause;
222  };
223 
228  public:
229  StorageServiceFileReadRequestMessage(std::string answer_mailbox,
230  std::string mailbox_to_receive_the_file_content,
231  WorkflowFile *file, std::string& src_partition, double payload);
232 
234  std::string answer_mailbox;
240  std::string src_partition;
241  };
242 
247  public:
249  StorageService *storage_service,
250  bool success,
251  std::shared_ptr<FailureCause> failure_cause,
252  double payload);
253 
259  bool success;
261  std::shared_ptr<FailureCause> failure_cause;
262  };
263 
268  public:
270 
273  };
274 
275  /***********************/
277  /***********************/
278 
279 };
280 
281 
282 #endif //WRENCH_STORAGESERVICEMESSAGE_H
A message sent to a StorageService to copy a file from another StorageService.
Definition: StorageServiceMessage.h:130
WorkflowFile * file
The file was was copied, or not.
Definition: StorageServiceMessage.h:169
A message sent/received by a StorageService that has a file size as a payload.
Definition: StorageServiceMessage.h:267
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, or nullptr on success.
Definition: StorageServiceMessage.h:261
std::string mailbox_to_receive_the_file_content
The mailbox to which the file content should be sent.
Definition: StorageServiceMessage.h:236
A message sent by a StorageService in answer to a free space enquiry.
Definition: StorageServiceMessage.h:52
WorkflowFile * file
The file to read.
Definition: StorageServiceMessage.h:238
std::string data_write_mailbox_name
The mailbox on which to send the file.
Definition: StorageServiceMessage.h:219
std::string dst_partition
The file partition from where the file will be deleted.
Definition: StorageServiceMessage.h:103
StorageService * src
The storage service that the file will be copied from.
Definition: StorageServiceMessage.h:143
std::string src_partition
The source partition from which to read the file.
Definition: StorageServiceMessage.h:240
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:78
WorkflowFile * file
The file that was looked up.
Definition: StorageServiceMessage.h:83
A message sent by a StorageService in answer to a file copy request.
Definition: StorageServiceMessage.h:159
bool success
Whether the write operation request was accepted or not.
Definition: StorageServiceMessage.h:217
std::string dst_partition
The destination partition.
Definition: StorageServiceMessage.h:173
A message sent by a StorageService in answer to a file read request.
Definition: StorageServiceMessage.h:246
WorkflowFile * file
The file to copy.
Definition: StorageServiceMessage.h:141
double free_space
The amount of free space in bytes.
Definition: StorageServiceMessage.h:57
bool success
Whether the read operation was successful or not.
Definition: StorageServiceMessage.h:259
std::string dst_partition
The file partition inside the storage service where the file will be copied to.
Definition: StorageServiceMessage.h:149
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:193
double payload
The message size in bytes.
Definition: SimulationMessage.h:39
StorageService * storage_service
The storage service on which the file should be written.
Definition: StorageServiceMessage.h:215
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, or nullptr if success.
Definition: StorageServiceMessage.h:124
std::string dst_partition
The file partition to write the file to.
Definition: StorageServiceMessage.h:197
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:153
A message sent to a StorageService to read a file.
Definition: StorageServiceMessage.h:227
bool success
Whether the deletion was successful.
Definition: StorageServiceMessage.h:122
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, if any, or nullptr.
Definition: StorageServiceMessage.h:221
std::string answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:99
WorkflowFile * file
The workflow file that should be written.
Definition: StorageServiceMessage.h:213
WorkflowFile * file
The file.
Definition: StorageServiceMessage.h:272
A message sent to a StorageService to delete a file.
Definition: StorageServiceMessage.h:91
A message sent to a StorageService to write a file.
Definition: StorageServiceMessage.h:188
StorageService * storage_service
The storage service that performed the copy (i.e., which stored the file)
Definition: StorageServiceMessage.h:171
StorageService * storage_service
The storage service on which the deletion happened (or not)
Definition: StorageServiceMessage.h:120
Top-level class for messages received/sent by a Service.
Definition: ServiceMessage.h:27
FileRegistryService * file_registry_service
The file registry service that the user had requested be updated, or nullptr if none.
Definition: StorageServiceMessage.h:175
StorageService * storage_service
The storage service on which the file was read.
Definition: StorageServiceMessage.h:257
A message sent to a StorageService to lookup a file.
Definition: StorageServiceMessage.h:63
A file registry service (a.k.a. replica catalog) that holds a database of which files are available a...
Definition: FileRegistryService.h:33
StorageServiceMessage(std::string name, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:25
A message sent by a StorageService in answer to a file write request.
Definition: StorageServiceMessage.h:203
std::string src_partition
The file partition from where the file will be copied from.
Definition: StorageServiceMessage.h:145
WorkflowFile * file
The file that was deleted (or not)
Definition: StorageServiceMessage.h:118
bool file_is_available
Whether the file was found.
Definition: StorageServiceMessage.h:85
std::string answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:68
WorkflowFile * file
The file that was read.
Definition: StorageServiceMessage.h:255
FileRegistryService * file_registry_service
The file registry service to update, or none if nullptr.
Definition: StorageServiceMessage.h:151
WorkflowFile * file
The file to write.
Definition: StorageServiceMessage.h:195
A simulation timestamp class for file copy start times.
Definition: SimulationTimestampTypes.h:195
Top-level class for messages received/sent by a StorageService.
Definition: StorageServiceMessage.h:33
StorageService * dst
The StorageService where the file will be copied to.
Definition: StorageServiceMessage.h:147
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
WorkflowFile * file
The file to lookup.
Definition: StorageServiceMessage.h:70
std::string answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:46
std::string answer_mailbox
The mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:234
std::string dst_partition
The file partition where to lookup the file for.
Definition: StorageServiceMessage.h:72
std::string answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:139
A message sent by a StorageService in answer to a file deletion request.
Definition: StorageServiceMessage.h:109
The storage service base class.
Definition: StorageService.h:35
WorkflowFile * file
The file to delete.
Definition: StorageServiceMessage.h:101
Definition: TerminalOutput.cpp:15