-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
planner: implement compaction planner policy
- Loading branch information
1 parent
5b65b3e
commit 3ed5230
Showing
7 changed files
with
78 additions
and
2 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,31 @@ | ||
#pragma once | ||
|
||
#include <faabric/batch-scheduler/BatchScheduler.h> | ||
#include <faabric/batch-scheduler/SchedulingDecision.h> | ||
#include <faabric/util/batch.h> | ||
|
||
namespace faabric::batch_scheduler { | ||
|
||
// This batch scheduler behaves in the same way than BinPack for NEW and | ||
// SCALE_CHANGE requests, but for DIST_CHANGE requests it tries to compact | ||
// to the fewest number of VMs. | ||
class CompactScheduler final : public BatchScheduler | ||
{ | ||
public: | ||
std::shared_ptr<SchedulingDecision> makeSchedulingDecision( | ||
HostMap& hostMap, | ||
const InFlightReqs& inFlightReqs, | ||
std::shared_ptr<faabric::BatchExecuteRequest> req) override; | ||
|
||
private: | ||
bool isFirstDecisionBetter( | ||
std::shared_ptr<SchedulingDecision> decisionA, | ||
std::shared_ptr<SchedulingDecision> decisionB) override; | ||
|
||
std::vector<Host> getSortedHosts( | ||
HostMap& hostMap, | ||
const InFlightReqs& inFlightReqs, | ||
std::shared_ptr<faabric::BatchExecuteRequest> req, | ||
const DecisionType& decisionType) 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
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
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