wrench::ServerlessStateOfTheSystem

class ServerlessStateOfTheSystem

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

Public Functions

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

Getter for the compute nodes.

Returns:

The compute nodes

std::map<std::shared_ptr<Image>, std::vector<std::shared_ptr<Invocation>>> getAdmittedInvocations() const

Get the list of admitted invocations (whose image layers are not all downloaded from remote).

Returns:

The list of admitted invocations

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>> getImageLayersBeingStagedToNode(const std::shared_ptr<ServerlessComputeNode> &node) const

Get the current image layers being staged to a node.

Parameters:

node – the compute node

Returns:

a set of image files

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

unsigned long getNumBeingActivatedComputeNodes() const

Get the number of deactivated compute nodes.

Returns:

A number of nodes

unsigned long getNumDeactivatedComputeNodes() const

Get the number of deactivated compute nodes.

Returns:

A number of nodes

std::map<std::shared_ptr<Function>, unsigned long> getOutstandingInvocationCounts() const

Get the current per-function outstanding invocation counts.

Returns:

a function-count map

const std::vector<std::shared_ptr<Invocation>> &getSchedulableInvocations() const

Get the list of schedulable invocations.

Returns:

The list of schedulable invocations

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 isImageLayerBeingStagedToNode(const std::shared_ptr<ServerlessComputeNode> &node, const std::shared_ptr<ImageLayer> &layer) const

Determine whether an image layer is currently being staged to 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