Namespace faabric::scheduler

namespace scheduler

Typedefs

typedef faabric::util::Queue<faabric::Message> InMemoryMessageQueue
typedef std::pair<std::string, InMemoryMessageQueue*> InMemoryMessageQueuePair

Enums

enum FunctionCalls

Values:

enumerator NoFunctionCall
enumerator ExecuteFunctions
enumerator Flush
enumerator SetMessageResult

Functions

std::vector<std::pair<std::string, faabric::Message>> getFunctionCalls()
std::vector<std::pair<std::string, faabric::EmptyRequest>> getFlushCalls()
std::vector<std::pair<std::string, std::shared_ptr<faabric::BatchExecuteRequest>>> getBatchRequests()
std::vector<std::pair<std::string, std::shared_ptr<faabric::Message>>> getMessageResults()
void clearMockRequests()
std::shared_ptr<FunctionCallClient> getFunctionCallClient(const std::string &otherHost)
void clearFunctionCallClients()
Scheduler &getScheduler()
std::string getChainedKey(unsigned int msgId)

Variables

static std::mutex mockMutex
static std::vector<std::pair<std::string, faabric::Message>> functionCalls
static std::vector<std::pair<std::string, faabric::EmptyRequest>> flushCalls
static std::vector<std::pair<std::string, std::shared_ptr<faabric::BatchExecuteRequest>>> batchMessages
static std::vector<std::pair<std::string, std::shared_ptr<faabric::Message>>> messageResults
static faabric::util::ConcurrentMap<std::string, std::shared_ptr<faabric::scheduler::FunctionCallClient>> functionCallClients
class FunctionCallClient : public faabric::transport::MessageEndpointClient

Public Functions

explicit FunctionCallClient(const std::string &hostIn)
void sendFlush()
void executeFunctions(std::shared_ptr<faabric::BatchExecuteRequest> req)
void setMessageResult(std::shared_ptr<faabric::Message> msg)
class FunctionCallServer : public faabric::transport::MessageEndpointServer

Public Functions

FunctionCallServer()
class Scheduler

Public Functions

Scheduler()
~Scheduler()
void executeBatch(std::shared_ptr<faabric::BatchExecuteRequest> req)
void reset()
void resetThreadLocalCache()
void shutdown()
inline bool isShutdown()
void broadcastSnapshotDelete(const faabric::Message &msg, const std::string &snapshotKey)
int reapStaleExecutors()
long getFunctionExecutorCount(const faabric::Message &msg)
void setThreadResultLocally(uint32_t appId, uint32_t msgId, int32_t returnValue, faabric::transport::Message &message)

Caches a message along with the thread result, to allow the thread result to refer to data held in that message (i.e. snapshot diffs). The message will be destroyed once the thread result is consumed.

std::vector<std::pair<uint32_t, int32_t>> awaitThreadResults(std::shared_ptr<faabric::BatchExecuteRequest> req, int timeoutMs = DEFAULT_THREAD_RESULT_TIMEOUT_MS)
size_t getCachedMessageCount()
std::string getThisHost()
void addHostToGlobalSet()
void addHostToGlobalSet(const std::string &host, std::shared_ptr<faabric::HostResources> overwriteResources = nullptr)
void removeHostFromGlobalSet(const std::string &host)
void setThisHostResources(faabric::HostResources &res)
std::vector<faabric::Message> getRecordedMessages()
void clearRecordedMessages()
std::shared_ptr<faabric::PendingMigration> checkForMigrationOpportunities(faabric::Message &msg, int overwriteNewGroupId = 0)
class SchedulerReaperThread : public faabric::util::PeriodicBackgroundThread
#include <Scheduler.h>

Background thread that periodically checks to see if any executors have become stale (i.e. not handled any requests in a given timeout). If any are found, they are removed.

Public Functions

virtual void doWork() override