wrench::XRootD::Node

class Node : public wrench::StorageService

An XRootD node, this can be either a supervisor or a storage server. All nodes are classified as storage services even though not all have physical storage Unless a node is also has an internal storage service, some normal storage service messages will error out. Only File Read, locate, and delete are supported at this time, anything else requires talking directly to a specific file server with physical storage. Nodes not directly be created, instead an XRootD Metavisor should create them.

Public Functions

Node(Deployment *deployment, const std::string &hostname, WRENCH_PROPERTY_COLLECTION_TYPE storage_property_list, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE storage_messagepayload_list)

Constructor, should not be used directly except by XRootD createNode.

Parameters
  • deployment – the XRootD deployment this node belongs to

  • hostname – the name of the host on which the service and its storage service should run

  • property_list – A property list

  • messagepayload_list – A Message Payload list

std::shared_ptr<Node> addChildStorageServer(const std::string &hostname, const std::string &mount_point, WRENCH_PROPERTY_COLLECTION_TYPE storage_property_list = {}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE storage_messagepayload_list = {}, WRENCH_PROPERTY_COLLECTION_TYPE node_property_list = {}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE node_messagepayload_list = {})

Adds a child, which will be a storage server, to a node.

Parameters
  • hostname – the name of the host on which the child will run

  • mount_point – the mount point at that host

  • storage_property_list – the storage server’s property list

  • storage_messagepayload_list – the storage server’s message payload list

  • node_property_list – the XRootD node’s property list

  • node_messagepayload_list – the XRootD node’s message payload list

Returns

The child

std::shared_ptr<Node> addChildSupervisor(const std::string &hostname)

Adds a child, which will be a supervisor, to a node.

Parameters

hostname – the name of the host on which the child will run

Returns

The child

bool cached(shared_ptr<DataFile> file)

Check the cache for a file.

Parameters

file – The file to check the cache for

Returns

true if the file is cached, false otherwise

virtual void createFile(const std::shared_ptr<DataFile> &file) override

create a new file in the federation on this node. Use instead of wrench::Simulation::createFile when adding files to XRootD

Parameters

file – A shared pointer to a file

Throws

std::invalid_argument

virtual void createFile(const std::shared_ptr<DataFile> &file, const std::shared_ptr<FileLocation> &location) override

create a new file in the federation on this node. Use instead of wrench::Simulation::createFile when adding files to XRootD

Parameters
  • file – A shared pointer to a file

  • location – a file location, must be the same object as the function is envoked on

Throws

std::invalid_argument

void createFile(const std::shared_ptr<DataFile> &file, const string &path) override

create a new file in the federation on this node. Use instead of wrench::Simulation::createFile when adding files to XRootD

Parameters
  • file – A shared pointer to a file

  • path – a path at the node’s mount point

Throws

std::invalid_argument

std::set<std::shared_ptr<FileLocation>> getCached(shared_ptr<DataFile> file)

Get all cached locations of the file.

Parameters

file – The file to check the cache for

Returns

A set of valid cached files. Empty set if none are cached

std::shared_ptr<Node> getChild(unsigned int n)

A meta tree traversal operation to get the nth child of this node.

Parameters

n – The index of the child to receive. Nodes are in order added

Returns

the Child Nodes shared pointer, or nullptr if this node is a leaf

virtual double getLoad() override

Get the load of the underlying storage service.

Returns

the load on the service

Node *getParent()

A Meta tree traversal to get the parent of this node.

Returns

pointer supervisor. Will be nullptr if root

std::shared_ptr<SimpleStorageService> getStorageServer()

Gets the underlying storage server.

Returns

A pointer to the simple storage server for this file server

virtual int main() override

Main method of the daemon.

Returns

0 on termination

bool processNextMessage()

Process a received control message.

Returns

false if the daemon should terminate

virtual void writeFile(const std::shared_ptr<DataFile> &file) override

write a file on this node.

Parameters

file – A shared pointer to a file

Throws

std::invalid_argument