wrench::ServerlessStateOfTheSystem

class ServerlessStateOfTheSystem

A class that stores the current state of a serverless compute service.

Public Functions

std::map<std::string, unsigned long> getAvailableCores()

Getter for the map of available cores.

Returns:

The core availability map

std::map<std::string, sg_size_t> getAvailableDiskSpace()

Getter for the map of available disk space. Note that Disk space is managed in an LRU fashion, so it’s not because a disk is full that nothing can be done, perhaps.

Returns:

The RAM availability map

std::map<std::string, sg_size_t> getAvailableRAM()

Getter for the map of available RAM. Note that RAM is managed in an LRU fashion, so it’s not because RAM is full that nothing can be done, perhaps.

Returns:

The RAM availability map

const std::vector<std::string> &getComputeHosts()

Getter for the compute hosts.

Returns:

The compute hosts

std::set<std::shared_ptr<DataFile>> getImagesBeingCopiedToNode(const std::string &node)

Get the current images being copied to a node.

Parameters:

node – the compute node

Returns:

a set of image files

std::set<std::shared_ptr<DataFile>> getImagesBeingLoadedAtNode(const std::string &node)

Get the current images being loaded into RAM at a node.

Parameters:

node – the compute node

Returns:

a set of image files

bool isImageBeingCopiedToNode(const std::string &node, const std::shared_ptr<DataFile> &image)

Determine whether an image is currently being copied to a node.

Parameters:
  • node – the compute node

  • image – an image file

Returns:

true or false

bool isImageBeingLoadedAtNode(const std::string &node, const std::shared_ptr<DataFile> &image)

Determine whether an image is currently being loading into RAM at a node.

Parameters:
  • node – the compute node

  • image – an image file

Returns:

true or false

bool isImageInRAMAtNode(const std::string &node, const std::shared_ptr<DataFile> &image)

Determine whether an image is currently in RAM at a node.

Parameters:
  • node – the compute node

  • image – an image file

Returns:

true or false

bool isImageOnNode(const std::string &node, const std::shared_ptr<DataFile> &image)

Determine whether an image is currently on disk at a node.

Parameters:
  • node – the compute node

  • image – an image file

Returns:

true or false