Added a resource providers total resources to the subscribe call. Since resource provider resources are dynamic (as opposed to how e.g., agent total resources are implemented), they are not part of the 'ResourceProviderInfo'. Instead they are communicated explicitly.
This commit adds total resources the resource provider 'SUBSCRIBE' call which can be used to communicate the total capacity in both subscription and resubscription scenarios. Review: https://reviews.apache.org/r/61180/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f19cc636 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f19cc636 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f19cc636 Branch: refs/heads/master Commit: f19cc636305f2542e260b908e55dcffcf03ab228 Parents: f6d6ef4 Author: Benjamin Bannier <[email protected]> Authored: Fri Aug 18 10:00:06 2017 -0700 Committer: Jie Yu <[email protected]> Committed: Fri Aug 18 11:43:56 2017 -0700 ---------------------------------------------------------------------- include/mesos/resource_provider/resource_provider.proto | 6 ++++++ include/mesos/v1/resource_provider/resource_provider.proto | 1 + 2 files changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/f19cc636/include/mesos/resource_provider/resource_provider.proto ---------------------------------------------------------------------- diff --git a/include/mesos/resource_provider/resource_provider.proto b/include/mesos/resource_provider/resource_provider.proto index 498d848..f5a9073 100644 --- a/include/mesos/resource_provider/resource_provider.proto +++ b/include/mesos/resource_provider/resource_provider.proto @@ -67,8 +67,14 @@ message Call { } // Request to subscribe with the master. + // + // TODO(bbannier): Once we have implemented a call to update a + // resource provider, consider removing resources here and instead + // moving to a protocol where a resource provider first subscribes + // and then updates its resources. message Subscribe { required ResourceProviderInfo resource_provider_info = 1; + repeated Resource resources = 2; } // Notify the master about the status of an operation. http://git-wip-us.apache.org/repos/asf/mesos/blob/f19cc636/include/mesos/v1/resource_provider/resource_provider.proto ---------------------------------------------------------------------- diff --git a/include/mesos/v1/resource_provider/resource_provider.proto b/include/mesos/v1/resource_provider/resource_provider.proto index 59adbc4..e5cbede 100644 --- a/include/mesos/v1/resource_provider/resource_provider.proto +++ b/include/mesos/v1/resource_provider/resource_provider.proto @@ -69,6 +69,7 @@ message Call { // Request to subscribe with the master. message Subscribe { required ResourceProviderInfo resource_provider_info = 1; + repeated Resource resources = 2; } // Notify the master about the status of an operation.
