You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2018/01/03 07:17:26 UTC

[2/5] mesos git commit: Renamed "normalize" to "upgrade" in resources adjustment operations.

Renamed "normalize" to "upgrade" in resources adjustment operations.

We have introduced the notion of "downgrading" resources in order to
support downgrades of various components. The opposite operation used
to be called "normalize", but it seems "upgrade" would be simpler.

Review: https://reviews.apache.org/r/64895


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7b1a10a7
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7b1a10a7
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7b1a10a7

Branch: refs/heads/1.5.x
Commit: 7b1a10a7888f947f3976b299172a178c6d0d505e
Parents: 12e3d7f
Author: Michael Park <mp...@apache.org>
Authored: Tue Jan 2 11:20:45 2018 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Tue Jan 2 23:04:32 2018 -0800

----------------------------------------------------------------------
 src/common/resources_utils.cpp | 2 +-
 src/common/resources_utils.hpp | 2 +-
 src/master/http.cpp            | 8 ++++----
 src/master/master.cpp          | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/7b1a10a7/src/common/resources_utils.cpp
----------------------------------------------------------------------
diff --git a/src/common/resources_utils.cpp b/src/common/resources_utils.cpp
index 47ba885..465bd54 100644
--- a/src/common/resources_utils.cpp
+++ b/src/common/resources_utils.cpp
@@ -497,7 +497,7 @@ void upgradeResources(Offer::Operation* operation)
 }
 
 
-Option<Error> validateAndNormalizeResources(Offer::Operation* operation)
+Option<Error> validateAndUpgradeResources(Offer::Operation* operation)
 {
   CHECK_NOTNULL(operation);
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/7b1a10a7/src/common/resources_utils.hpp
----------------------------------------------------------------------
diff --git a/src/common/resources_utils.hpp b/src/common/resources_utils.hpp
index 5b74ff2..a946f0a 100644
--- a/src/common/resources_utils.hpp
+++ b/src/common/resources_utils.hpp
@@ -166,7 +166,7 @@ void convertResourceFormat(
 // NOTE: The validate and upgrade steps are bundled because currently
 // it would be an error to validate but not upgrade or to upgrade
 // without validating.
-Option<Error> validateAndNormalizeResources(Offer::Operation* operation);
+Option<Error> validateAndUpgradeResources(Offer::Operation* operation);
 
 
 // Convert the given resources to the "pre-reservation-refinement" format

http://git-wip-us.apache.org/repos/asf/mesos/blob/7b1a10a7/src/master/http.cpp
----------------------------------------------------------------------
diff --git a/src/master/http.cpp b/src/master/http.cpp
index d7276e4..bc29faf 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -1311,7 +1311,7 @@ Future<Response> Master::Http::_createVolumes(
   operation.set_type(Offer::Operation::CREATE);
   operation.mutable_create()->mutable_volumes()->CopyFrom(volumes);
 
-  Option<Error> error = validateAndNormalizeResources(&operation);
+  Option<Error> error = validateAndUpgradeResources(&operation);
   if (error.isSome()) {
     return BadRequest(error->message);
   }
@@ -1485,7 +1485,7 @@ Future<Response> Master::Http::_destroyVolumes(
   operation.set_type(Offer::Operation::DESTROY);
   operation.mutable_destroy()->mutable_volumes()->CopyFrom(volumes);
 
-  Option<Error> error = validateAndNormalizeResources(&operation);
+  Option<Error> error = validateAndUpgradeResources(&operation);
   if (error.isSome()) {
     return BadRequest(error->message);
   }
@@ -2473,7 +2473,7 @@ Future<Response> Master::Http::_reserve(
   operation.set_type(Offer::Operation::RESERVE);
   operation.mutable_reserve()->mutable_resources()->CopyFrom(resources);
 
-  Option<Error> error = validateAndNormalizeResources(&operation);
+  Option<Error> error = validateAndUpgradeResources(&operation);
   if (error.isSome()) {
     return BadRequest(error->message);
   }
@@ -5245,7 +5245,7 @@ Future<Response> Master::Http::_unreserve(
   operation.set_type(Offer::Operation::UNRESERVE);
   operation.mutable_unreserve()->mutable_resources()->CopyFrom(resources);
 
-  Option<Error> error = validateAndNormalizeResources(&operation);
+  Option<Error> error = validateAndUpgradeResources(&operation);
   if (error.isSome()) {
     return BadRequest(error->message);
   }

http://git-wip-us.apache.org/repos/asf/mesos/blob/7b1a10a7/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 03eb178..bba70c3 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -4094,7 +4094,7 @@ void Master::accept(
     accept.clear_operations();
 
     foreach (Offer::Operation& operation, operations) {
-      Option<Error> error = validateAndNormalizeResources(&operation);
+      Option<Error> error = validateAndUpgradeResources(&operation);
       if (error.isSome()) {
         switch (operation.type()) {
           case Offer::Operation::RESERVE: