Yan Xu created MESOS-1112:
-----------------------------
Summary: Refactor the Registrar to push the operations to the
caller to simplify the interface
Key: MESOS-1112
URL: https://issues.apache.org/jira/browse/MESOS-1112
Project: Mesos
Issue Type: Improvement
Reporter: Yan Xu
Assignee: Yan Xu
Fix For: 0.19.0
So instead of replicating the following SlaveInfo specific methods for other
data types
{code}
process::Future<bool> admit(const SlaveInfo& info);
process::Future<bool> readmit(const SlaveInfo& info);
process::Future<bool> remove(const SlaveInfo& info);
{code}
we would just have one generic {{apply(const Operation&)}}.
>From [~bmahler]'s
>[TODO|https://github.com/apache/mesos/blob/f6a4d6605644a0dcff090ea0a803e97a1cfbb24a/src/master/registrar.cpp#L60]:
{code}
// In this design, operations can be maintained in a separate
// header and added independently of the Registrar logic.
Registrar
{
Future<Registrar> recover(const MasterInfo&);
Future<bool> apply(const Operation&);
}
Registrar registrar(flags, state);
Future<bool> admit = registrar.apply(Admit(slaveInfo));
Future<bool> readmit = registrar.apply(Redmit(slaveInfo));
Future<bool> remove = registrar.apply(Remove(slaveInfo));
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)