Repository: mesos Updated Branches: refs/heads/1.0.x 99bdf297b -> c3128a58a
Renamed GET_LEADING_MASTER to GET_MASTER in v1 operator API. Review: https://reviews.apache.org/r/50211 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/86cf57f5 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/86cf57f5 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/86cf57f5 Branch: refs/heads/1.0.x Commit: 86cf57f579624e18f8475db808f866f531167cc8 Parents: 99bdf29 Author: Vinod Kone <vinodk...@gmail.com> Authored: Tue Jul 19 17:24:17 2016 -0700 Committer: Vinod Kone <vinodk...@gmail.com> Committed: Tue Jul 19 18:18:26 2016 -0700 ---------------------------------------------------------------------- include/mesos/master/master.proto | 13 +++++-------- include/mesos/v1/master/master.proto | 13 +++++-------- src/master/http.cpp | 14 +++++++------- src/master/master.hpp | 2 +- src/master/validation.cpp | 2 +- src/tests/api_tests.cpp | 8 ++++---- 6 files changed, 23 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/86cf57f5/include/mesos/master/master.proto ---------------------------------------------------------------------- diff --git a/include/mesos/master/master.proto b/include/mesos/master/master.proto index d82b245..5eb1d40 100644 --- a/include/mesos/master/master.proto +++ b/include/mesos/master/master.proto @@ -65,7 +65,7 @@ message Call { GET_WEIGHTS = 16; // Retrieves the information about role weights. UPDATE_WEIGHTS = 17; - GET_LEADING_MASTER = 18; // Retrieves the leading master information. + GET_MASTER = 18; // Retrieves the master's information. SUBSCRIBE = 19; // Subscribes the master to receive events. @@ -228,7 +228,7 @@ message Response { GET_WEIGHTS = 15; // See 'GetWeights' below. - GET_LEADING_MASTER = 16; // See 'GetLeadingMaster' below. + GET_MASTER = 16; // See 'GetMaster' below. GET_MAINTENANCE_STATUS = 17; // See 'GetMaintenanceStatus' below. GET_MAINTENANCE_SCHEDULE = 18; // See 'GetMaintenanceSchedule' below. @@ -384,11 +384,8 @@ message Response { repeated WeightInfo weight_infos = 1; } - // Contains the leading master information. - // NOTE: This is broken currently "on the cloud" (e.g. EC2) as it stores the - // private IP address, unless advertise_ip points to an externally accessible - // IP. - message GetLeadingMaster { + // Contains the master's information. + message GetMaster { optional MasterInfo master_info = 1; } @@ -424,7 +421,7 @@ message Response { optional GetTasks get_tasks = 14; optional GetRoles get_roles = 15; optional GetWeights get_weights = 16; - optional GetLeadingMaster get_leading_master = 17; + optional GetMaster get_master = 17; optional GetMaintenanceStatus get_maintenance_status = 18; optional GetMaintenanceSchedule get_maintenance_schedule = 19; optional GetQuota get_quota = 20; http://git-wip-us.apache.org/repos/asf/mesos/blob/86cf57f5/include/mesos/v1/master/master.proto ---------------------------------------------------------------------- diff --git a/include/mesos/v1/master/master.proto b/include/mesos/v1/master/master.proto index 711a664..a537551 100644 --- a/include/mesos/v1/master/master.proto +++ b/include/mesos/v1/master/master.proto @@ -65,7 +65,7 @@ message Call { GET_WEIGHTS = 16; // Retrieves the information about role weights. UPDATE_WEIGHTS = 17; - GET_LEADING_MASTER = 18; // Retrieves the leading master information. + GET_MASTER = 18; // Retrieves the master's information. SUBSCRIBE = 19; // Subscribes the master to receive events. @@ -229,7 +229,7 @@ message Response { GET_WEIGHTS = 15; // See 'GetWeights' below. - GET_LEADING_MASTER = 16; // See 'GetLeadingMaster' below. + GET_MASTER = 16; // See 'GetMaster' below. GET_MAINTENANCE_STATUS = 17; // See 'GetMaintenanceStatus' below. GET_MAINTENANCE_SCHEDULE = 18; // See 'GetMaintenanceSchedule' below. @@ -385,11 +385,8 @@ message Response { repeated WeightInfo weight_infos = 1; } - // Contains the leading master information. - // NOTE: This is broken currently "on the cloud" (e.g. EC2) as it stores the - // private IP address, unless advertise_ip points to an externally accessible - // IP. - message GetLeadingMaster { + // Contains the master's information. + message GetMaster { optional MasterInfo master_info = 1; } @@ -425,7 +422,7 @@ message Response { optional GetTasks get_tasks = 14; optional GetRoles get_roles = 15; optional GetWeights get_weights = 16; - optional GetLeadingMaster get_leading_master = 17; + optional GetMaster get_master = 17; optional GetMaintenanceStatus get_maintenance_status = 18; optional GetMaintenanceSchedule get_maintenance_schedule = 19; optional GetQuota get_quota = 20; http://git-wip-us.apache.org/repos/asf/mesos/blob/86cf57f5/src/master/http.cpp ---------------------------------------------------------------------- diff --git a/src/master/http.cpp b/src/master/http.cpp index 8b7e917..d07e2a5 100644 --- a/src/master/http.cpp +++ b/src/master/http.cpp @@ -549,8 +549,8 @@ Future<Response> Master::Http::api( case mesos::master::Call::UPDATE_WEIGHTS: return weightsHandler.update(call, principal, acceptType); - case mesos::master::Call::GET_LEADING_MASTER: - return getLeadingMaster(call, principal, acceptType); + case mesos::master::Call::GET_MASTER: + return getMaster(call, principal, acceptType); case mesos::master::Call::RESERVE_RESOURCES: return reserveResources(call, principal, acceptType); @@ -1958,21 +1958,21 @@ Future<Response> Master::Http::setLoggingLevel( } -Future<Response> Master::Http::getLeadingMaster( +Future<Response> Master::Http::getMaster( const mesos::master::Call& call, const Option<string>& principal, ContentType contentType) const { - CHECK_EQ(mesos::master::Call::GET_LEADING_MASTER, call.type()); + CHECK_EQ(mesos::master::Call::GET_MASTER, call.type()); mesos::master::Response response; - response.set_type(mesos::master::Response::GET_LEADING_MASTER); + response.set_type(mesos::master::Response::GET_MASTER); // It is guaranteed that this master has been elected as the leader. CHECK(master->elected()); - response.mutable_get_leading_master()->mutable_master_info()->CopyFrom( - master->info()); + response.mutable_get_master()->mutable_master_info()->CopyFrom( + master->info()); return OK(serialize(contentType, evolve(response)), stringify(contentType)); http://git-wip-us.apache.org/repos/asf/mesos/blob/86cf57f5/src/master/master.hpp ---------------------------------------------------------------------- diff --git a/src/master/master.hpp b/src/master/master.hpp index 845f2f6..46621b8 100644 --- a/src/master/master.hpp +++ b/src/master/master.hpp @@ -1430,7 +1430,7 @@ private: const Option<std::string>& principal, ContentType contentType) const; - process::Future<process::http::Response> getLeadingMaster( + process::Future<process::http::Response> getMaster( const mesos::master::Call& call, const Option<std::string>& principal, ContentType contentType) const; http://git-wip-us.apache.org/repos/asf/mesos/blob/86cf57f5/src/master/validation.cpp ---------------------------------------------------------------------- diff --git a/src/master/validation.cpp b/src/master/validation.cpp index 50ba372..0c63c94 100644 --- a/src/master/validation.cpp +++ b/src/master/validation.cpp @@ -135,7 +135,7 @@ Option<Error> validate( } return None(); - case mesos::master::Call::GET_LEADING_MASTER: + case mesos::master::Call::GET_MASTER: return None(); case mesos::master::Call::RESERVE_RESOURCES: { http://git-wip-us.apache.org/repos/asf/mesos/blob/86cf57f5/src/tests/api_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/api_tests.cpp b/src/tests/api_tests.cpp index 4cb7072..5809e99 100644 --- a/src/tests/api_tests.cpp +++ b/src/tests/api_tests.cpp @@ -900,13 +900,13 @@ TEST_P(MasterAPITest, GetRoles) } -TEST_P(MasterAPITest, GetLeadingMaster) +TEST_P(MasterAPITest, GetMaster) { Try<Owned<cluster::Master>> master = this->StartMaster(); ASSERT_SOME(master); v1::master::Call v1Call; - v1Call.set_type(v1::master::Call::GET_LEADING_MASTER); + v1Call.set_type(v1::master::Call::GET_MASTER); ContentType contentType = GetParam(); @@ -915,9 +915,9 @@ TEST_P(MasterAPITest, GetLeadingMaster) AWAIT_READY(v1Response); ASSERT_TRUE(v1Response->IsInitialized()); - ASSERT_EQ(v1::master::Response::GET_LEADING_MASTER, v1Response->type()); + ASSERT_EQ(v1::master::Response::GET_MASTER, v1Response->type()); ASSERT_EQ(master.get()->getMasterInfo().ip(), - v1Response->get_leading_master().master_info().ip()); + v1Response->get_master().master_info().ip()); }