wrench::NetworkConnection Class Reference
A helper class that implements a network connection abstraction to be used by a service, e.g., when the service needs to limit its number of concurrent connections. More...
#include <NetworkConnection.h>
Public Types | |
enum | NetworkConnectionType { INCOMING_DATA, OUTGOING_DATA, INCOMING_CONTROL } |
An enumerated type that denotes whether a network connection is incoming or outgoing, and whether it's about data or about control. | |
Public Member Functions | |
NetworkConnection (int type, WorkflowFile *file, std::string file_partition, std::string mailbox, std::string ack_mailbox, SimulationTimestampFileCopyStart *start_timestamp=nullptr) | |
Constructor. More... | |
std::unique_ptr< SimulationMessage > | getMessage () |
Retrieve the message for a communication. More... | |
bool | hasFailed () |
Returns true if the connection has failed, false otherwise. More... | |
bool | start () |
star a network connection More... | |
Public Attributes | |
std::string | ack_mailbox |
: the mailbox to which to send an ack when this connection completes/fails | |
std::unique_ptr< S4U_PendingCommunication > | comm |
The low-level pending communication. | |
std::shared_ptr< FailureCause > | failure_cause |
The failure cause, in case the communication fails. | |
WorkflowFile * | file |
: the file (for a DATA connection) | |
std::string | file_partition |
: the file partition inside the storage service where the file will be stored to/read from | |
std::string | mailbox |
: the mailbox for this connection | |
SimulationTimestampFileCopyStart * | start_timestamp |
: if this is a file copy, a start timestamp associated with it | |
int | type |
: the connection type | |
Detailed Description
A helper class that implements a network connection abstraction to be used by a service, e.g., when the service needs to limit its number of concurrent connections.
Constructor & Destructor Documentation
◆ NetworkConnection()
wrench::NetworkConnection::NetworkConnection | ( | int | type, |
WorkflowFile * | file, | ||
std::string | file_partition, | ||
std::string | mailbox, | ||
std::string | ack_mailbox, | ||
SimulationTimestampFileCopyStart * | start_timestamp = nullptr |
||
) |
Constructor.
- Parameters
-
type the type of connection - NetworkConnection::INCOMING_DATA
- NetworkConnection::OUTGOING_DATA
- NetworkConnection::INCOMING_CONTROL
file the file (for DATA connection only) file_partition the file partition inside the storage service where the file will be stored to/read from mailbox the mailbox: the mailbox for this connection ack_mailbox the mailbox to which an ack should be sent when the connection completes/fails start_timestamp a pointer to a SimulationTimestampFileCopyStart if this connection is part of a file copy
Member Function Documentation
◆ getMessage()
std::unique_ptr< SimulationMessage > wrench::NetworkConnection::getMessage | ( | ) |
Retrieve the message for a communication.
- Returns
- the message, or nullptr if the connection has failed
◆ hasFailed()
bool wrench::NetworkConnection::hasFailed | ( | ) |
Returns true if the connection has failed, false otherwise.
- Returns
- true or false
◆ start()
bool wrench::NetworkConnection::start | ( | ) |
star a network connection
- Returns
- true if start was successful, false otherwise
The documentation for this class was generated from the following files:
- /Users/rafsilva/Documents/isi/workspace/wrench/wrench/include/wrench/services/storage/simple/NetworkConnection.h
- /Users/rafsilva/Documents/isi/workspace/wrench/wrench/src/wrench/services/storage/simple/NetworkConnection.cpp