File DecisionCache.h

namespace faabric
namespace batch_scheduler
class CachedDecision
#include <DecisionCache.h>

A record of a decision already taken for the given size of batch request for the given function. This doesn’t contain the messages themselves, just the hosts and group ID that was used.

Public Functions

CachedDecision(const std::vector<std::string> &hostsIn, int groupIdIn)
inline std::vector<std::string> getHosts()
inline int getGroupId() const

Private Members

std::vector<std::string> hosts
int groupId = 0
class DecisionCache
#include <DecisionCache.h>

Repository for cached scheduling decisions. Object is not thread safe as we assume only a single executor will be caching decisions for a given function and size of batch request on one host at a time.

Public Functions

std::shared_ptr<CachedDecision> getCachedDecision(std::shared_ptr<faabric::BatchExecuteRequest> req)
void addCachedDecision(std::shared_ptr<BatchExecuteRequest> req, SchedulingDecision &decision)
void clear()

Private Functions

std::string getCacheKey(std::shared_ptr<BatchExecuteRequest> req)

Private Members

std::unordered_map<std::string, std::shared_ptr<CachedDecision>> cachedDecisions