You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2015/02/03 19:06:07 UTC
mesos git commit: Renamed persisted resources to checkpointed
resources.
Repository: mesos
Updated Branches:
refs/heads/master 90c3fde2f -> 74d118f8d
Renamed persisted resources to checkpointed resources.
Review: https://reviews.apache.org/r/30536
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/74d118f8
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/74d118f8
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/74d118f8
Branch: refs/heads/master
Commit: 74d118f8da8875589f27f6547406034dcc88774d
Parents: 90c3fde
Author: Jie Yu <yu...@gmail.com>
Authored: Mon Feb 2 17:05:41 2015 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue Feb 3 10:02:48 2015 -0800
----------------------------------------------------------------------
src/master/allocator.hpp | 8 ++++----
src/master/master.cpp | 39 +++++++++++++++++++--------------------
src/master/master.hpp | 22 +++++++++++-----------
src/messages/messages.proto | 31 +++++++++++++------------------
4 files changed, 47 insertions(+), 53 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/74d118f8/src/master/allocator.hpp
----------------------------------------------------------------------
diff --git a/src/master/allocator.hpp b/src/master/allocator.hpp
index 318a756..44a7695 100644
--- a/src/master/allocator.hpp
+++ b/src/master/allocator.hpp
@@ -91,10 +91,10 @@ public:
const FrameworkID& frameworkId);
// Note that the 'total' resources are passed explicitly because it
- // includes resources that are dynamically "persisted" on the slave
- // (e.g. persistent volumes, dynamic reservations, etc).
- // The slaveInfo resources, on the other hand, correspond directly
- // to the static --resources flag value on the slave.
+ // includes resources that are dynamically "checkpointed" on the
+ // slave (e.g. persistent volumes, dynamic reservations, etc). The
+ // slaveInfo resources, on the other hand, correspond directly to
+ // the static --resources flag value on the slave.
void addSlave(
const SlaveID& slaveId,
const SlaveInfo& slaveInfo,
http://git-wip-us.apache.org/repos/asf/mesos/blob/74d118f8/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 1005686..e737fcb 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -557,13 +557,13 @@ void Master::initialize()
install<RegisterSlaveMessage>(
&Master::registerSlave,
&RegisterSlaveMessage::slave,
- &RegisterSlaveMessage::persisted_resources,
+ &RegisterSlaveMessage::checkpointed_resources,
&RegisterSlaveMessage::version);
install<ReregisterSlaveMessage>(
&Master::reregisterSlave,
&ReregisterSlaveMessage::slave,
- &ReregisterSlaveMessage::persisted_resources,
+ &ReregisterSlaveMessage::checkpointed_resources,
&ReregisterSlaveMessage::executor_infos,
&ReregisterSlaveMessage::tasks,
&ReregisterSlaveMessage::completed_frameworks,
@@ -3253,7 +3253,7 @@ void Master::schedulerMessage(
void Master::registerSlave(
const UPID& from,
const SlaveInfo& slaveInfo,
- const vector<Resource>& persistedResources,
+ const vector<Resource>& checkpointedResources,
const string& version)
{
++metrics.messages_register_slave;
@@ -3267,7 +3267,7 @@ void Master::registerSlave(
&Self::registerSlave,
from,
slaveInfo,
- persistedResources,
+ checkpointedResources,
version));
return;
}
@@ -3333,7 +3333,7 @@ void Master::registerSlave(
&Self::_registerSlave,
slaveInfo_,
from,
- persistedResources,
+ checkpointedResources,
version,
lambda::_1));
}
@@ -3342,7 +3342,7 @@ void Master::registerSlave(
void Master::_registerSlave(
const SlaveInfo& slaveInfo,
const UPID& pid,
- const vector<Resource>& persistedResources,
+ const vector<Resource>& checkpointedResources,
const string& version,
const Future<bool>& admit)
{
@@ -3372,7 +3372,7 @@ void Master::_registerSlave(
pid,
version.empty() ? Option<string>::none() : version,
Clock::now(),
- persistedResources);
+ checkpointedResources);
++metrics.slave_registrations;
@@ -3391,7 +3391,7 @@ void Master::_registerSlave(
void Master::reregisterSlave(
const UPID& from,
const SlaveInfo& slaveInfo,
- const vector<Resource>& persistedResources,
+ const vector<Resource>& checkpointedResources,
const vector<ExecutorInfo>& executorInfos,
const vector<Task>& tasks,
const vector<Archive::Framework>& completedFrameworks,
@@ -3408,7 +3408,7 @@ void Master::reregisterSlave(
&Self::reregisterSlave,
from,
slaveInfo,
- persistedResources,
+ checkpointedResources,
executorInfos,
tasks,
completedFrameworks,
@@ -3520,7 +3520,7 @@ void Master::reregisterSlave(
&Self::_reregisterSlave,
slaveInfo,
from,
- persistedResources,
+ checkpointedResources,
executorInfos,
tasks,
completedFrameworks,
@@ -3532,7 +3532,7 @@ void Master::reregisterSlave(
void Master::_reregisterSlave(
const SlaveInfo& slaveInfo,
const UPID& pid,
- const vector<Resource>& persistedResources,
+ const vector<Resource>& checkpointedResources,
const vector<ExecutorInfo>& executorInfos,
const vector<Task>& tasks,
const vector<Archive::Framework>& completedFrameworks,
@@ -3564,7 +3564,7 @@ void Master::_reregisterSlave(
pid,
version.empty() ? Option<string>::none() : version,
Clock::now(),
- persistedResources,
+ checkpointedResources,
executorInfos,
tasks);
@@ -3606,13 +3606,12 @@ void Master::__reregisterSlave(Slave* slave, const vector<Task>& tasks)
// NOTE: Here we always send the message. Slaves whose version are
// less than 0.22.0 will drop it silently which is OK.
- LOG(INFO) << "Sending updated persisted resources "
- << slave->persistedResources
+ LOG(INFO) << "Sending updated checkpointed resources "
+ << slave->checkpointedResources
<< " to slave " << *slave;
- UpdateResourcesMessage message;
- message.mutable_persisted_resources()->CopyFrom(
- slave->persistedResources);
+ CheckpointResourcesMessage message;
+ message.mutable_resources()->CopyFrom(slave->checkpointedResources);
send(slave->pid, message);
}
@@ -4801,9 +4800,9 @@ void Master::addSlave(
}
}
- // TODO(bmahler): This will need to include resources that
- // are "persisted" on the slave (e.g. persistent volumes,
- // dynamic reservations, etc).
+ // TODO(bmahler): This will need to include resources that are
+ // "checkpointed" on the slave (e.g. persistent volumes, dynamic
+ // reservations, etc).
allocator->addSlave(
slave->id,
slave->info,
http://git-wip-us.apache.org/repos/asf/mesos/blob/74d118f8/src/master/master.hpp
----------------------------------------------------------------------
diff --git a/src/master/master.hpp b/src/master/master.hpp
index 337e00a..aff35f2 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -163,13 +163,13 @@ public:
void registerSlave(
const process::UPID& from,
const SlaveInfo& slaveInfo,
- const std::vector<Resource>& persistedResources,
+ const std::vector<Resource>& checkpointedResources,
const std::string& version);
void reregisterSlave(
const process::UPID& from,
const SlaveInfo& slaveInfo,
- const std::vector<Resource>& persistedResources,
+ const std::vector<Resource>& checkpointedResources,
const std::vector<ExecutorInfo>& executorInfos,
const std::vector<Task>& tasks,
const std::vector<Archive::Framework>& completedFrameworks,
@@ -234,7 +234,7 @@ public:
void _reregisterSlave(
const SlaveInfo& slaveInfo,
const process::UPID& pid,
- const std::vector<Resource>& persistedResources,
+ const std::vector<Resource>& checkpointedResources,
const std::vector<ExecutorInfo>& executorInfos,
const std::vector<Task>& tasks,
const std::vector<Archive::Framework>& completedFrameworks,
@@ -279,7 +279,7 @@ protected:
void _registerSlave(
const SlaveInfo& slaveInfo,
const process::UPID& pid,
- const std::vector<Resource>& persistedResources,
+ const std::vector<Resource>& checkpointedResources,
const std::string& version,
const process::Future<bool>& admit);
@@ -734,7 +734,7 @@ struct Slave
const process::UPID& _pid,
const Option<std::string> _version,
const process::Time& _registeredTime,
- const Resources& _persistedResources,
+ const Resources& _checkpointedResources,
const std::vector<ExecutorInfo> executorInfos =
std::vector<ExecutorInfo>(),
const std::vector<Task> tasks =
@@ -746,7 +746,7 @@ struct Slave
registeredTime(_registeredTime),
connected(true),
active(true),
- persistedResources(_persistedResources),
+ checkpointedResources(_checkpointedResources),
observer(NULL)
{
CHECK(_info.has_id());
@@ -923,11 +923,11 @@ struct Slave
hashmap<FrameworkID, Resources> usedResources; // Active task / executors.
Resources offeredResources; // Offers.
- // Resources that should be persisted by the slave (e.g. persistent
- // volumes, dynamic reservations, etc). These are either in use by a
- // task/executor, or are available for use and will be re-offered to
- // the framework.
- Resources persistedResources;
+ // Resources that should be checkpointed by the slave (e.g.,
+ // persistent volumes, dynamic reservations, etc). These are either
+ // in use by a task/executor, or are available for use and will be
+ // re-offered to the framework.
+ Resources checkpointedResources;
SlaveObserver* observer;
http://git-wip-us.apache.org/repos/asf/mesos/blob/74d118f8/src/messages/messages.proto
----------------------------------------------------------------------
diff --git a/src/messages/messages.proto b/src/messages/messages.proto
index c609f50..8d86517 100644
--- a/src/messages/messages.proto
+++ b/src/messages/messages.proto
@@ -251,11 +251,10 @@ message FrameworkErrorMessage {
message RegisterSlaveMessage {
required SlaveInfo slave = 1;
- // Resources that are persisted by the slave. It includes persistent
- // volumes currently, and may include dynamically reserved resources
- // in the future. Persisted resources need to be explicitly released
- // by the framework.
- repeated Resource persisted_resources = 3;
+ // Resources that are checkpointed by the slave (e.g., persistent
+ // volume or dynamic reservation). Frameworks need to release
+ // checkpointed resources explicitly.
+ repeated Resource checkpointed_resources = 3;
// NOTE: This is a hack for the master to detect the slave's
// version. If unset the slave is < 0.21.0.
@@ -271,11 +270,10 @@ message ReregisterSlaveMessage {
optional SlaveID slave_id = 1;
required SlaveInfo slave = 2;
- // Resources that are persisted by the slave. It includes persistent
- // volumes currently, and may include dynamically reserved resources
- // in the future. Persisted resources need to be explicitly released
- // by the framework.
- repeated Resource persisted_resources = 7;
+ // Resources that are checkpointed by the slave (e.g., persistent
+ // volume or dynamic reservation). Frameworks need to release
+ // checkpointed resources explicitly.
+ repeated Resource checkpointed_resources = 7;
repeated ExecutorInfo executor_infos = 4;
repeated Task tasks = 3;
@@ -334,14 +332,11 @@ message UpdateFrameworkMessage {
}
-// This message is sent to the slave whenever there is an acquisition
-// or release of a persistent resource (e.g., persistent volume or
-// dynamic reservation).
-message UpdateResourcesMessage {
- // Resources that need to be persisted on the slave. It includes
- // persistent volumes, and may include dynamically reserved
- // resources in the future.
- repeated Resource persisted_resources = 1;
+// This message is sent to the slave whenever there is an update of
+// the resources that need to be checkpointed (e.g., persistent volume
+// or dynamic reservation).
+message CheckpointResourcesMessage {
+ repeated Resource resources = 1;
}