Several interactions with a storage service are done simple by calling static methods of the wrench::StorageService
class. These make it possible to lookup, delete, read, and write files. For instance:
Note that the file registry service is passed to the wrench::StorageService::deleteFile()
method since the file deletion should cause the file registry to remove one of its entries.
Reading and writing files is something a WMS typically does not do directly (instead, workflow tasks read and write files as they execute). But, if for some reason a WMS needs to spend time doing file I/O, it is easily done:
An operation commonly performed by a WMS is copying files between storage services (e.g., to enforce some data locality). This is typically done by specifying file copy operations as part of standard jobs. But it can also be done manually by the WMS via the data movement manager's methods wrench::DataMovementManager::doSynchronousFileCopy()
and wrench::DataMovementManager::initiateAsynchronousFileCopy()
. Here is an example in which a file is copied between storage services:
See the WMS implementation in examples/basic-examples/bare-metal-data-movement/DataMovementWMS.cpp
for a more complete example.