forked from faasm/faabric
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add load balancing policies and handle exceptions in FaabricEndpointH…
…andler
- Loading branch information
Showing
7 changed files
with
92 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
|
||
#include <set> | ||
#include <string> | ||
|
||
class LoadBalancePolicy | ||
{ | ||
public: | ||
virtual std::string dispatch(const std::set<std::string>& warm_faaslets) = 0; | ||
}; | ||
|
||
class FaasmDefaultPolicy : public LoadBalancePolicy | ||
{ | ||
public: | ||
std::string dispatch(const std::set<std::string>& warm_faaslets) override; | ||
}; | ||
|
||
class LeastLoadAveragePolicy : public LoadBalancePolicy | ||
{ | ||
public: | ||
std::string dispatch(const std::set<std::string>& warm_faaslets) override; | ||
}; | ||
|
||
class MostSlotsPolicy : public LoadBalancePolicy | ||
{ | ||
public: | ||
std::string dispatch(const std::set<std::string>& warm_faaslets) override; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <faabric/loadbalance/LoadBalancePolicy.h> | ||
#include <stdexcept> | ||
|
||
std::string FaasmDefaultPolicy::dispatch(const std::set<std::string>& warm_faaslets) | ||
{ | ||
throw std::runtime_error("FaasmDefaultPolicy::dispatch not implemented"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <faabric/loadbalance/LoadBalancePolicy.h> | ||
#include <stdexcept> | ||
|
||
std::string LeastLoadAveragePolicy::dispatch(const std::set<std::string>& warm_faaslets) | ||
{ | ||
throw std::runtime_error("LeastLoadAveragePolicy::dispatch not implemented"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <faabric/loadbalance/LoadBalancePolicy.h> | ||
#include <stdexcept> | ||
|
||
std::string MostSlotsPolicy::dispatch(const std::set<std::string>& warm_faaslets) | ||
{ | ||
throw std::runtime_error("MostSlotsPolicy::dispatch not implemented"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters