You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2018/09/06 02:00:29 UTC
[mesos] branch master updated (ceda6b9 -> 82dbbc9)
This is an automated email from the ASF dual-hosted git repository.
bmahler pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git.
from ceda6b9 Added MESOS-8568 to the 1.4.3 CHANGELOG.
new 804b4a5 Avoided double-lookup in Master::getFramework.
new 7e7ef60 Avoided triple-lookup of the framework in Master::offer.
new 82dbbc9 Reserved vector capacities within Master::offer.
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/master/master.cpp | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
[mesos] 03/03: Reserved vector capacities within Master::offer.
Posted by bm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 82dbbc9d90079fd5134a28377e21669b2f41980e
Author: Benjamin Mahler <bm...@apache.org>
AuthorDate: Wed Sep 5 14:51:39 2018 -0700
Reserved vector capacities within Master::offer.
Review: https://reviews.apache.org/r/68636
---
src/master/master.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 9179cf3..3277b57 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -9245,13 +9245,20 @@ void Master::offer(
return;
}
+ size_t offersEstimate = 0u;
+ foreachvalue (const auto& agents, resources) {
+ offersEstimate += agents.size();
+ }
// Each offer we create is tied to a single agent
// and a single allocation role.
ResourceOffersMessage message;
+ message.mutable_offers()->Reserve(offersEstimate);
+ message.mutable_pids()->Reserve(offersEstimate);
// We keep track of the offer IDs so that we can log them.
vector<OfferID> offerIds;
+ offerIds.reserve(offersEstimate);
foreachkey (const string& role, resources) {
foreachpair (const SlaveID& slaveId,
[mesos] 01/03: Avoided double-lookup in Master::getFramework.
Posted by bm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 804b4a59b17a0749f80cb2010630d7907a148683
Author: Benjamin Mahler <bm...@apache.org>
AuthorDate: Wed Sep 5 14:49:40 2018 -0700
Avoided double-lookup in Master::getFramework.
Review: https://reviews.apache.org/r/68634
---
src/master/master.cpp | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/master/master.cpp b/src/master/master.cpp
index e307df0..7bc924f 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -11476,9 +11476,7 @@ bool Master::isCompletedFramework(const FrameworkID& frameworkId)
// TODO(bmahler): Consider killing this.
Framework* Master::getFramework(const FrameworkID& frameworkId) const
{
- return frameworks.registered.contains(frameworkId)
- ? frameworks.registered.at(frameworkId)
- : nullptr;
+ return frameworks.registered.get(frameworkId).getOrElse(nullptr);
}
[mesos] 02/03: Avoided triple-lookup of the framework in
Master::offer.
Posted by bm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 7e7ef60d265382e64dab3f93e8d5f101ab223f21
Author: Benjamin Mahler <bm...@apache.org>
AuthorDate: Wed Sep 5 14:50:53 2018 -0700
Avoided triple-lookup of the framework in Master::offer.
Review: https://reviews.apache.org/r/68635
---
src/master/master.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 7bc924f..9179cf3 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -9228,8 +9228,9 @@ void Master::offer(
const FrameworkID& frameworkId,
const hashmap<string, hashmap<SlaveID, Resources>>& resources)
{
- if (!frameworks.registered.contains(frameworkId) ||
- !frameworks.registered[frameworkId]->active()) {
+ Framework* framework = getFramework(frameworkId);
+
+ if (framework == nullptr || !framework->active()) {
LOG(WARNING) << "Master returning resources offered to framework "
<< frameworkId << " because the framework"
<< " has terminated or is inactive";
@@ -9244,7 +9245,6 @@ void Master::offer(
return;
}
- Framework* framework = CHECK_NOTNULL(frameworks.registered.at(frameworkId));
// Each offer we create is tied to a single agent
// and a single allocation role.