wrench::ServerlessStateOfTheSystem

class ServerlessStateOfTheSystem

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

Public Functions

std::map<std::shared_ptr<ServerlessComputeNode>, unsigned int> getAvailableCores() const

Getter for the map of available cores.

Returns:

The core availability map

std::map<std::shared_ptr<ServerlessComputeNode>, sg_size_t> getAvailableDiskSpace() const

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::shared_ptr<ServerlessComputeNode>, sg_size_t> getAvailableRAMSpace() const

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

std::vector<std::shared_ptr<ServerlessComputeNode>> getComputeNodes() const

Getter for the compute hosts.

Returns:

The compute hosts

std::set<std::shared_ptr<ImageLayer>> getImageLayersBeingCopiedToNode(const std::shared_ptr<ServerlessComputeNode> &node) const

Get the current image layers being copied to a node.

Parameters:

node – the compute node

Returns:

a set of image files

std::set<std::shared_ptr<ImageLayer>> getImageLayersBeingLoadedAtNode(const std::shared_ptr<ServerlessComputeNode> &node) const

Get the current image layers being loaded into RAM at a node.

Parameters:

node – the compute node

Returns:

a set of image layers

std::set<std::shared_ptr<ImageLayer>> getImageLayersInRAMAtNode(const std::shared_ptr<ServerlessComputeNode> &node) const

Get the current image layers in RAM at a node.

Parameters:

node – the compute node

Returns:

a set of image files

std::set<std::shared_ptr<ImageLayer>> getImageLayersOnDiskAtNode(const std::shared_ptr<ServerlessComputeNode> &node) const

Get the current image layers on disk at a node.

Parameters:

node – the compute node

Returns:

a set of image files

bool isImageLayerBeingCopiedToNode(const std::shared_ptr<ServerlessComputeNode> &node, const std::shared_ptr<ImageLayer> &layer) const

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

Parameters:
  • node – the compute node

  • layer – an image layer

Returns:

true or false

bool isImageLayerBeingLoadedAtNode(const std::shared_ptr<ServerlessComputeNode> &node, const std::shared_ptr<ImageLayer> &layer) const

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

Parameters:
  • node – the compute node

  • layer – an image layer

Returns:

true or false

bool isImageLayerInRAMAtNode(const std::shared_ptr<ServerlessComputeNode> &node, const std::shared_ptr<ImageLayer> &layer) const

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

Parameters:
  • node – the compute node

  • layer – an image layer

Returns:

true or false

bool isImageLayerOnDiskAtNode(const std::shared_ptr<ServerlessComputeNode> &node, const std::shared_ptr<ImageLayer> &layer) const

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

Parameters:
  • node – the compute node

  • layer – an image layer

Returns:

true or false