WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
Public Member Functions | List of all members
wrench::SimpleStorageService Class Reference

A storage service that provides direct access to some storage resources (e.g., one or more disks). An important (configurable) property of the storage service is SimpleStorageServiceProperty::BUFFER_SIZE (see documentation thereof), which defines the buffer size that the storage service uses. Specifically, when the storage service receives/sends data from/to the network, it does so in a loop over data "chunks", with pipelined network and disk I/O operations. The smaller the buffer size the more "fluid" the model, but the more time-consuming the simulation. A large buffer size, however, may lead to less realistic simulations. At the extreme, an infinite buffer size would correspond to fully sequential executions (first a network receive/send, and then a disk write/read). Setting the buffer size to "0" corresponds to a fully fluid model in which individual data chunk operations are not simulated, thus achieving both accuracy (unless one specifically wishes to study the effects of buffering) and quick simulation times. For now, setting the buffer size to "0" is not implemented. The default buffer size is 10 MiB (note that the user can always declare a disk with arbitrary bandwidth in the platform description XML). More...

#include <SimpleStorageService.h>

Inheritance diagram for wrench::SimpleStorageService:
wrench::StorageService wrench::Service

Public Member Functions

 SimpleStorageService (std::string hostname, std::set< std::string > mount_points, WRENCH_PROPERTY_COLLECTION_TYPE property_list={}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list={})
 Public constructor. More...
 
- Public Member Functions inherited from wrench::StorageService
virtual std::map< std::string, double > getFreeSpace ()
 Synchronously asks the storage service for its capacity at all its mount points. More...
 
std::string getMountPoint ()
 Get the mount point (will throw is more than one) More...
 
std::set< std::string > getMountPoints ()
 Get the set of mount points. More...
 
virtual std::map< std::string, double > getTotalSpace ()
 Get the total static capacity of the storage service (in zero simulation time) More...
 
bool hasMountPoint (std::string mp)
 Checked whether the storage service has a particular mount point. More...
 
bool hasMultipleMountPoints ()
 Checked whether the storage service has multiple mount points. More...
 
void stop () override
 Stop the service.
 
- Public Member Functions inherited from wrench::Service
void assertServiceIsUp ()
 Throws an exception if the service is not up. More...
 
std::string getHostname ()
 Get the name of the host on which the service is / will be running. More...
 
double getNetworkTimeoutValue ()
 Returns the service's network timeout value. More...
 
std::string getPhysicalHostname ()
 Get the physical name of the host on which the service is / will be running. More...
 
bool getPropertyValueAsBoolean (WRENCH_PROPERTY_TYPE)
 Get a property of the Service as a boolean. More...
 
double getPropertyValueAsDouble (WRENCH_PROPERTY_TYPE)
 Get a property of the Service as a double. More...
 
std::string getPropertyValueAsString (WRENCH_PROPERTY_TYPE)
 Get a property of the Service as a string. More...
 
unsigned long getPropertyValueAsUnsignedLong (WRENCH_PROPERTY_TYPE)
 Get a property of the Service as an unsigned long. More...
 
bool isUp ()
 Returns true if the service is UP, false otherwise. More...
 
void resume ()
 Resume the service. More...
 
void setNetworkTimeoutValue (double value)
 Sets the service's network timeout value. More...
 
void start (std::shared_ptr< Service > this_service, bool daemonize, bool auto_restart)
 Start the service. More...
 
void suspend ()
 Suspend the service.
 

Additional Inherited Members

- Static Public Member Functions inherited from wrench::StorageService
static void createFile (std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location)
 Store a file at a particular mount point ex nihilo (this instantly creates the file at the storage service - zero simulation time). Will do nothing (and won't complain) if the file already exists at that location. More...
 
static void deleteFile (std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location, std::shared_ptr< FileRegistryService > file_registry_service=nullptr)
 Synchronously delete a file at a location. More...
 
static bool lookupFile (std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location)
 Synchronously asks the storage service whether it holds a file. More...
 
static void readFile (std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location)
 Synchronously read a file from the storage service. More...
 
static void readFile (std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location, double num_bytes)
 Synchronously read a file from the storage service. More...
 
static void writeFile (std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location)
 Synchronously write a file to the storage service. More...
 

Detailed Description

A storage service that provides direct access to some storage resources (e.g., one or more disks). An important (configurable) property of the storage service is SimpleStorageServiceProperty::BUFFER_SIZE (see documentation thereof), which defines the buffer size that the storage service uses. Specifically, when the storage service receives/sends data from/to the network, it does so in a loop over data "chunks", with pipelined network and disk I/O operations. The smaller the buffer size the more "fluid" the model, but the more time-consuming the simulation. A large buffer size, however, may lead to less realistic simulations. At the extreme, an infinite buffer size would correspond to fully sequential executions (first a network receive/send, and then a disk write/read). Setting the buffer size to "0" corresponds to a fully fluid model in which individual data chunk operations are not simulated, thus achieving both accuracy (unless one specifically wishes to study the effects of buffering) and quick simulation times. For now, setting the buffer size to "0" is not implemented. The default buffer size is 10 MiB (note that the user can always declare a disk with arbitrary bandwidth in the platform description XML).

Constructor & Destructor Documentation

◆ SimpleStorageService()

wrench::SimpleStorageService::SimpleStorageService ( std::string  hostname,
std::set< std::string >  mount_points,
WRENCH_PROPERTY_COLLECTION_TYPE  property_list = {},
WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE  messagepayload_list = {} 
)

Public constructor.

Parameters
hostnamethe name of the host on which to start the service
mount_pointsthe set of mount points
property_lista property list ({} means "use all defaults")
messagepayload_lista message payload list ({} means "use all defaults")

The documentation for this class was generated from the following files: