Repository: mesos Updated Branches: refs/heads/master b9f6bbab0 -> 30b02a8e4
Added QuotaInfo Protobuf. Review: https://reviews.apache.org/r/36908 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/30b02a8e Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/30b02a8e Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/30b02a8e Branch: refs/heads/master Commit: 30b02a8e4c1ae89e440abcda4c0612f5b4370872 Parents: b9f6bba Author: Joerg Schad <[email protected]> Authored: Fri Oct 2 15:04:09 2015 +0200 Committer: Bernd Mathiske <[email protected]> Committed: Fri Oct 2 15:04:09 2015 +0200 ---------------------------------------------------------------------- include/mesos/master/quota.hpp | 25 ++++++++++++++++++++++ include/mesos/master/quota.proto | 39 +++++++++++++++++++++++++++++++++++ src/Makefile.am | 20 +++++++++++++----- 3 files changed, 79 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/30b02a8e/include/mesos/master/quota.hpp ---------------------------------------------------------------------- diff --git a/include/mesos/master/quota.hpp b/include/mesos/master/quota.hpp new file mode 100644 index 0000000..5f7822f --- /dev/null +++ b/include/mesos/master/quota.hpp @@ -0,0 +1,25 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __MESOS_MASTER_QUOTA_PROTO_HPP__ +#define __MESOS_MASTER_QUOTA_PROTO_HPP__ + +// ONLY USEFUL AFTER RUNNING PROTOC. +#include <mesos/master/quota.pb.h> + +#endif // __MESOS_MASTER_QUOTA_PROTO_HPP__ http://git-wip-us.apache.org/repos/asf/mesos/blob/30b02a8e/include/mesos/master/quota.proto ---------------------------------------------------------------------- diff --git a/include/mesos/master/quota.proto b/include/mesos/master/quota.proto new file mode 100644 index 0000000..d2e3a45 --- /dev/null +++ b/include/mesos/master/quota.proto @@ -0,0 +1,39 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import "mesos/mesos.proto"; + +package mesos.master; + + +/** + * QuotaInfo describes the guaranteed resource allocation that a role + * may rely on (i.e. minimum share a role is entitled to receive). + */ +// TODO(joerg84): Add limits, i.e. upper bounds of resources that a +// role is allowed to use. +message QuotaInfo { + // Quota is granted per role and not per framework, similar to + // dynamic reservations. + optional string role = 1; + + // Resources which are guaranteed to be allocatable by role. + // NOTE: Each guarantees.role must match the above role and + // resource names must be unique. + repeated Resource guarantee = 3; +} http://git-wip-us.apache.org/repos/asf/mesos/blob/30b02a8e/src/Makefile.am ---------------------------------------------------------------------- diff --git a/src/Makefile.am b/src/Makefile.am index 8aa4566..f060998 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -170,6 +170,9 @@ MAINTENANCE_PROTO = \ ALLOCATOR_PROTO = \ $(top_srcdir)/include/mesos/master/allocator.proto +QUOTA_PROTO = \ + $(top_srcdir)/include/mesos/master/quota.proto + MODULE_PROTO = \ $(top_srcdir)/include/mesos/module/module.proto @@ -202,6 +205,8 @@ CXX_PROTOS = \ ../include/mesos/maintenance/maintenance.pb.h \ master/allocator.pb.cc \ ../include/mesos/master/allocator.pb.h \ + master/quota.pb.cc \ + ../include/mesos/master/quota.pb.h \ module/module.pb.cc \ ../include/mesos/module/module.pb.h \ scheduler/scheduler.pb.cc \ @@ -315,11 +320,11 @@ maintenance/%.pb.cc ../include/mesos/maintenance/%.pb.h: $(MAINTENANCE_PROTO) $(PROTOC) $(PROTOCFLAGS) --cpp_out=../include $^ mv ../include/mesos/maintenance/*.pb.cc $(@D) -master/%.pb.cc ../include/mesos/master/%.pb.h: $(ALLOCATOR_PROTO) +master/%.pb.cc ../include/mesos/master/%.pb.h: $(top_srcdir)/include/mesos/master/%.proto $(MKDIR_P) $(@D) $(MKDIR_P) ../include/mesos/master $(PROTOC) $(PROTOCFLAGS) --cpp_out=../include $^ - mv ../include/mesos/master/*.pb.cc $(@D) + mv ../include/mesos/master/$(*F).pb.cc $(@D) module/%.pb.cc ../include/mesos/module/%.pb.h: $(MODULE_PROTO) $(MKDIR_P) $(@D) @@ -613,9 +618,13 @@ masterdir = $(pkgincludedir)/master master_HEADERS = \ $(top_srcdir)/include/mesos/master/allocator.hpp \ - $(top_srcdir)/include/mesos/master/allocator.proto + $(top_srcdir)/include/mesos/master/allocator.proto \ + $(top_srcdir)/include/mesos/master/quota.hpp \ + $(top_srcdir)/include/mesos/master/quota.proto -nodist_master_HEADERS = ../include/mesos/master/allocator.pb.h +nodist_master_HEADERS = \ + ../include/mesos/master/allocator.pb.h \ + ../include/mesos/master/quota.pb.h moduledir = $(pkgincludedir)/module @@ -988,6 +997,7 @@ lib_LTLIBRARIES += libmesos.la # Include as part of the distribution. libmesos_la_SOURCES = \ $(ALLOCATOR_PROTO) \ + $(QUOTA_PROTO) \ $(CONTAINERIZER_PROTO) \ $(FETCHER_PROTO) \ $(MAINTENANCE_PROTO) \ @@ -1008,7 +1018,7 @@ libmesos_la_LDFLAGS = -release $(PACKAGE_VERSION) libmesos_la_LIBTOOLFLAGS = --tag=CXX # Add the convenience library. -libmesos_la_LIBADD = \ +libmesos_la_LIBADD = \ libmesos_no_3rdparty.la \ -lsvn_subr-1 \ -lsvn_delta-1 \
