You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2019/02/15 20:30:20 UTC
[mesos] 01/03: Fixed variable names in `Master::_doRegistryGC()`.
This is an automated email from the ASF dual-hosted git repository.
vinodkone pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit e10034fb4fede1aaf58b25c7e9fe3e677826350b
Author: Vinod Kone <vi...@gmail.com>
AuthorDate: Sat Feb 2 09:51:09 2019 -0600
Fixed variable names in `Master::_doRegistryGC()`.
Substituted `slave` with `slaveId` to be consistent with the code base.
No functional changes.
Review: https://reviews.apache.org/r/69907
---
src/master/master.cpp | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 8e23785..4870227 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -1796,7 +1796,7 @@ void Master::doRegistryGc()
TimeInfo currentTime = protobuf::getCurrentTime();
hashset<SlaveID> toRemove;
- foreachpair (const SlaveID& slave,
+ foreachpair (const SlaveID& slaveId,
const TimeInfo& removalTime,
slaves) {
// Count-based GC.
@@ -1804,7 +1804,7 @@ void Master::doRegistryGc()
size_t liveCount = count - toRemove.size();
if (liveCount > flags.registry_max_agent_count) {
- toRemove.insert(slave);
+ toRemove.insert(slaveId);
continue;
}
@@ -1813,7 +1813,7 @@ void Master::doRegistryGc()
currentTime.nanoseconds() - removalTime.nanoseconds());
if (age > flags.registry_max_agent_age) {
- toRemove.insert(slave);
+ toRemove.insert(slaveId);
}
}
@@ -1866,29 +1866,29 @@ void Master::_doRegistryGc(
// operation, but there isn't an easy way to do that.
size_t numRemovedUnreachable = 0;
- foreach (const SlaveID& slave, toRemoveUnreachable) {
- if (!slaves.unreachable.contains(slave)) {
- LOG(WARNING) << "Failed to garbage collect " << slave
+ foreach (const SlaveID& slaveId, toRemoveUnreachable) {
+ if (!slaves.unreachable.contains(slaveId)) {
+ LOG(WARNING) << "Failed to garbage collect " << slaveId
<< " from the unreachable list";
continue;
}
- slaves.unreachable.erase(slave);
- slaves.unreachableTasks.erase(slave);
+ slaves.unreachable.erase(slaveId);
+ slaves.unreachableTasks.erase(slaveId);
numRemovedUnreachable++;
}
size_t numRemovedGone = 0;
- foreach (const SlaveID& slave, toRemoveGone) {
- if (!slaves.gone.contains(slave)) {
- LOG(WARNING) << "Failed to garbage collect " << slave
+ foreach (const SlaveID& slaveId, toRemoveGone) {
+ if (!slaves.gone.contains(slaveId)) {
+ LOG(WARNING) << "Failed to garbage collect " << slaveId
<< " from the gone list";
continue;
}
- slaves.gone.erase(slave);
+ slaves.gone.erase(slaveId);
numRemovedGone++;
}