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 
34  protected:
36  };
37 
38 
43  public:
44  StorageServiceFreeSpaceRequestMessage(simgrid::s4u::Mailbox *answer_mailbox, double payload);
45 
47  simgrid::s4u::Mailbox *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(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 
81  public:
82  StorageServiceFileLookupAnswerMessage(std::shared_ptr<DataFile>file, bool file_is_available, double payload);
83 
85  std::shared_ptr<DataFile>file;
88  };
89 
94  public:
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 
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 
133  public:
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 
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,
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;
177  bool success;
179  std::shared_ptr<FailureCause> failure_cause;
180 
181  };
182 
183 
184 
189  public:
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 
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 
234  public:
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;
254  unsigned long buffer_size;
255  };
256 
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 
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;
290  };
291 
292 
297  public:
299  };
300 
301 
302  /***********************/
304  /***********************/
305 
306 };
307 
308 
309 #endif //WRENCH_STORAGESERVICEMESSAGE_H
wrench::StorageServiceFileReadRequestMessage::location
std::shared_ptr< FileLocation > location
The location from which to read the file.
Definition: StorageServiceMessage.h:250
wrench::StorageServiceFileDeleteAnswerMessage::failure_cause
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, or nullptr if success.
Definition: StorageServiceMessage.h:126
wrench::StorageServiceFileCopyAnswerMessage::src
std::shared_ptr< FileLocation > src
The source location.
Definition: StorageServiceMessage.h:169
wrench::StorageServiceFileCopyAnswerMessage::success
bool success
Whether the copy was successful.
Definition: StorageServiceMessage.h:177
wrench::StorageServiceFreeSpaceRequestMessage::answer_mailbox
simgrid::s4u::Mailbox * answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:47
wrench::StorageServiceFileCopyRequestMessage::src
std::shared_ptr< FileLocation > src
The source location.
Definition: StorageServiceMessage.h:146
wrench::StorageServiceFreeSpaceAnswerMessage
A message sent by a StorageService in answer to a free space enquiry.
Definition: StorageServiceMessage.h:53
wrench::StorageServiceFileReadRequestMessage::answer_mailbox
simgrid::s4u::Mailbox * answer_mailbox
The mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:244
wrench::StorageServiceMessage::StorageServiceMessage
StorageServiceMessage(double payload)
Constructor.
Definition: StorageServiceMessage.cpp:27
wrench::StorageServiceFileLookupAnswerMessage
A message sent by a StorageService in answer to a file lookup request.
Definition: StorageServiceMessage.h:80
wrench::StorageServiceFileWriteRequestMessage
A message sent to a StorageService to write a file.
Definition: StorageServiceMessage.h:188
wrench::StorageServiceFileWriteRequestMessage::answer_mailbox
simgrid::s4u::Mailbox * answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:197
wrench::StorageServiceFileWriteAnswerMessage::failure_cause
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, if any, or nullptr.
Definition: StorageServiceMessage.h:227
wrench::StorageServiceFileCopyRequestMessage::StorageServiceFileCopyRequestMessage
StorageServiceFileCopyRequestMessage(simgrid::s4u::Mailbox *answer_mailbox, std::shared_ptr< DataFile > file, std::shared_ptr< FileLocation > src, std::shared_ptr< FileLocation > dst, std::shared_ptr< FileRegistryService > file_registry_service, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:169
wrench::StorageServiceFreeSpaceAnswerMessage::free_space
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
wrench::StorageServiceFileContentChunkMessage::StorageServiceFileContentChunkMessage
StorageServiceFileContentChunkMessage(std::shared_ptr< DataFile >file, unsigned long chunk_size, bool last_chunk)
Constructor.
Definition: StorageServiceMessage.cpp:334
wrench::StorageServiceMessage
Top-level class for messages received/sent by a StorageService.
Definition: StorageServiceMessage.h:33
wrench::StorageServiceFileCopyRequestMessage::answer_mailbox
simgrid::s4u::Mailbox * answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:142
wrench::StorageServiceFreeSpaceRequestMessage::StorageServiceFreeSpaceRequestMessage
StorageServiceFreeSpaceRequestMessage(simgrid::s4u::Mailbox *answer_mailbox, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:39
wrench::StorageServiceFileDeleteRequestMessage::file
std::shared_ptr< DataFile > file
The file to delete.
Definition: StorageServiceMessage.h:103
wrench::StorageServiceFileWriteRequestMessage::file
std::shared_ptr< DataFile > file
The file to write.
Definition: StorageServiceMessage.h:199
wrench::StorageServiceFileCopyRequestMessage::file_registry_service
std::shared_ptr< FileRegistryService > file_registry_service
The file registry service to update, or none if nullptr.
Definition: StorageServiceMessage.h:150
wrench::StorageServiceFreeSpaceRequestMessage
A message sent to a StorageService to enquire about its free space.
Definition: StorageServiceMessage.h:42
wrench::StorageServiceFileLookupRequestMessage::StorageServiceFileLookupRequestMessage
StorageServiceFileLookupRequestMessage(simgrid::s4u::Mailbox *answer_mailbox, std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:76
wrench::StorageServiceFileLookupRequestMessage::file
std::shared_ptr< DataFile > file
The file to lookup.
Definition: StorageServiceMessage.h:72
wrench::StorageServiceFileCopyRequestMessage::file
std::shared_ptr< DataFile > file
The file to copy.
Definition: StorageServiceMessage.h:144
wrench::ServiceMessage
Top-level class for messages received/sent by a Service.
Definition: ServiceMessage.h:27
wrench::StorageServiceFileLookupRequestMessage::answer_mailbox
simgrid::s4u::Mailbox * answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:70
wrench::StorageServiceFileReadAnswerMessage::failure_cause
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, or nullptr on success.
Definition: StorageServiceMessage.h:275
wrench::StorageServiceFileDeleteAnswerMessage::file
std::shared_ptr< DataFile > file
The file that was deleted (or not)
Definition: StorageServiceMessage.h:120
wrench::StorageServiceFileContentChunkMessage::last_chunk
bool last_chunk
Whether this is the last file chunk.
Definition: StorageServiceMessage.h:289
wrench::StorageServiceFileDeleteAnswerMessage::storage_service
std::shared_ptr< StorageService > storage_service
The storage service on which the deletion happened (or not)
Definition: StorageServiceMessage.h:122
wrench::StorageServiceFileLookupAnswerMessage::StorageServiceFileLookupAnswerMessage
StorageServiceFileLookupAnswerMessage(std::shared_ptr< DataFile >file, bool file_is_available, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:95
wrench::StorageServiceFileLookupAnswerMessage::file
std::shared_ptr< DataFile > file
The file that was looked up.
Definition: StorageServiceMessage.h:85
wrench::StorageServiceFileWriteAnswerMessage::data_write_mailbox
simgrid::s4u::Mailbox * data_write_mailbox
The mailbox on which to send the file.
Definition: StorageServiceMessage.h:225
wrench::StorageServiceFileReadAnswerMessage
A message sent by a StorageService in answer to a file read request.
Definition: StorageServiceMessage.h:260
wrench::StorageServiceFileCopyRequestMessage
A message sent to a StorageService to copy a file from another StorageService.
Definition: StorageServiceMessage.h:132
wrench::StorageServiceFileCopyAnswerMessage::failure_cause
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, or nullptr if success.
Definition: StorageServiceMessage.h:179
wrench::StorageServiceFileDeleteRequestMessage::answer_mailbox
simgrid::s4u::Mailbox * answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:101
wrench
Definition: Action.cpp:28
wrench::StorageServiceFileCopyAnswerMessage
A message sent by a StorageService in answer to a file copy request.
Definition: StorageServiceMessage.h:156
wrench::StorageServiceFileReadRequestMessage::buffer_size
unsigned long buffer_size
The requested buffer size.
Definition: StorageServiceMessage.h:254
wrench::StorageServiceFileDeleteRequestMessage::StorageServiceFileDeleteRequestMessage
StorageServiceFileDeleteRequestMessage(simgrid::s4u::Mailbox *answer_mailbox, std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:117
wrench::StorageServiceFileContentChunkMessage
A message sent/received by a StorageService that has a file size as a payload.
Definition: StorageServiceMessage.h:281
wrench::StorageServiceFileWriteRequestMessage::buffer_size
unsigned long buffer_size
The buffer size to use.
Definition: StorageServiceMessage.h:203
wrench::StorageServiceFreeSpaceAnswerMessage::StorageServiceFreeSpaceAnswerMessage
StorageServiceFreeSpaceAnswerMessage(std::map< std::string, double > free_space, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:55
wrench::StorageServiceAckMessage
A message sent by a StorageService as an ack.
Definition: StorageServiceMessage.h:296
wrench::StorageServiceFileCopyAnswerMessage::dst
std::shared_ptr< FileLocation > dst
The destination location.
Definition: StorageServiceMessage.h:171
wrench::SimulationMessage::payload
double payload
The message name.
Definition: SimulationMessage.h:40
wrench::StorageServiceFileReadRequestMessage::mailbox_to_receive_the_file_content
simgrid::s4u::Mailbox * mailbox_to_receive_the_file_content
The mailbox to which the file content should be sent.
Definition: StorageServiceMessage.h:246
wrench::StorageServiceFileWriteAnswerMessage::location
std::shared_ptr< FileLocation > location
The location at which the file should be written.
Definition: StorageServiceMessage.h:221
wrench::StorageServiceFileWriteAnswerMessage::success
bool success
Whether the write operation request was accepted or not.
Definition: StorageServiceMessage.h:223
wrench::StorageServiceFileDeleteAnswerMessage::success
bool success
Whether the deletion was successful.
Definition: StorageServiceMessage.h:124
wrench::StorageServiceFileLookupRequestMessage
A message sent to a StorageService to lookup a file.
Definition: StorageServiceMessage.h:64
wrench::StorageServiceFileDeleteAnswerMessage
A message sent by a StorageService in answer to a file deletion request.
Definition: StorageServiceMessage.h:111
wrench::StorageServiceFileWriteAnswerMessage
A message sent by a StorageService in answer to a file write request.
Definition: StorageServiceMessage.h:209
wrench::StorageServiceFileDeleteRequestMessage::location
std::shared_ptr< FileLocation > location
The location where the file will be deleted.
Definition: StorageServiceMessage.h:105
wrench::StorageServiceFileDeleteAnswerMessage::StorageServiceFileDeleteAnswerMessage
StorageServiceFileDeleteAnswerMessage(std::shared_ptr< DataFile >file, std::shared_ptr< StorageService > storage_service, bool success, std::shared_ptr< FailureCause > failure_cause, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:139
wrench::StorageServiceFileReadRequestMessage::file
std::shared_ptr< DataFile > file
The file to read.
Definition: StorageServiceMessage.h:248
wrench::StorageServiceFileCopyAnswerMessage::file_registry_service_updated
bool file_registry_service_updated
Whether a file registry service has been updated or not.
Definition: StorageServiceMessage.h:175
wrench::StorageServiceFileDeleteRequestMessage
A message sent to a StorageService to delete a file.
Definition: StorageServiceMessage.h:93
wrench::StorageServiceFileWriteAnswerMessage::file
std::shared_ptr< DataFile > file
The workflow file that should be written.
Definition: StorageServiceMessage.h:219
wrench::StorageServiceFileReadAnswerMessage::StorageServiceFileReadAnswerMessage
StorageServiceFileReadAnswerMessage(std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location, bool success, std::shared_ptr< FailureCause > failure_cause, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:312
wrench::StorageServiceFileReadRequestMessage::num_bytes_to_read
double num_bytes_to_read
The number of bytes to read.
Definition: StorageServiceMessage.h:252
wrench::StorageServiceFileWriteRequestMessage::location
std::shared_ptr< FileLocation > location
The location to write the file to.
Definition: StorageServiceMessage.h:201
wrench::StorageServiceFileCopyAnswerMessage::StorageServiceFileCopyAnswerMessage
StorageServiceFileCopyAnswerMessage(std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > src, std::shared_ptr< FileLocation > dst, std::shared_ptr< FileRegistryService > file_registry_service, bool file_registry_service_updated, bool success, std::shared_ptr< FailureCause > cause, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:195
wrench::StorageServiceFileReadRequestMessage::StorageServiceFileReadRequestMessage
StorageServiceFileReadRequestMessage(simgrid::s4u::Mailbox *answer_mailbox, simgrid::s4u::Mailbox *mailbox_to_receive_the_file_content, std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location, double num_bytes_to_read, unsigned long buffer_size, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:288
wrench::StorageServiceFileLookupRequestMessage::location
std::shared_ptr< FileLocation > location
The file location (hopefully)
Definition: StorageServiceMessage.h:74
wrench::StorageServiceFileCopyAnswerMessage::file
std::shared_ptr< DataFile > file
The file was was copied, or not.
Definition: StorageServiceMessage.h:167
wrench::StorageServiceFileWriteRequestMessage::StorageServiceFileWriteRequestMessage
StorageServiceFileWriteRequestMessage(simgrid::s4u::Mailbox *answer_mailbox, std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location, unsigned long buffer_size, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:231
wrench::StorageServiceFileReadAnswerMessage::location
std::shared_ptr< FileLocation > location
The location of the file.
Definition: StorageServiceMessage.h:271
wrench::StorageServiceFileReadRequestMessage
A message sent to a StorageService to read a file.
Definition: StorageServiceMessage.h:233
wrench::StorageServiceFileWriteAnswerMessage::StorageServiceFileWriteAnswerMessage
StorageServiceFileWriteAnswerMessage(std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location, bool success, std::shared_ptr< FailureCause > failure_cause, simgrid::s4u::Mailbox *data_write_mailbox_name, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:255
wrench::StorageServiceFileCopyAnswerMessage::file_registry_service
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:173
wrench::StorageServiceFileLookupAnswerMessage::file_is_available
bool file_is_available
Whether the file was found.
Definition: StorageServiceMessage.h:87
wrench::StorageServiceFileCopyRequestMessage::dst
std::shared_ptr< FileLocation > dst
The destination location.
Definition: StorageServiceMessage.h:148
wrench::StorageServiceFileReadAnswerMessage::file
std::shared_ptr< DataFile > file
The file that was read.
Definition: StorageServiceMessage.h:269
wrench::StorageServiceFileReadAnswerMessage::success
bool success
Whether the read operation was successful or not.
Definition: StorageServiceMessage.h:273
wrench::StorageServiceFileContentChunkMessage::file
std::shared_ptr< DataFile > file
The file.
Definition: StorageServiceMessage.h:287