[ 
https://issues.apache.org/jira/browse/MESOS-3781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15237546#comment-15237546
 ] 

Vinod Kone commented on MESOS-3781:
-----------------------------------

I took a look at the review you posted and discussed w/ [~bmahler] on better 
ways to do it.

Here is what I've in mind

--> First do a review where you change the Flag *variables* but keep the old 
*names*. For example

{code}
  add(&Flags::authenticate_agents,
         "authenticate_slaves",
         "......help string.....",
         false);
{code}

Note that this needs changes in master.cpp and other files where these flags 
are accessed.

2) Another review where we add support for Flags::add() to take multiple names 
instead of a single name as argument. This is similar to the multi-name support 
in python's argparse.

{code}
  template <typename T1, typename T2, typename F>
  void add(
      T1* t1,
      const std::vector<std::string>& names,
      const std::string& help,
      const T2& t2,
      F validate);
{code}

Note this would need changes to FlagsBase and Flag classes.
{code}
 struct Flag
 {
...
-  std::string name;
+  std::vector<std::string> names;
...
}

struct FlagsBase
{
...
-  std::map<std::string, Flag> flags_;
+  std::map<std::string, std::shared_ptr<Flag>> flags_;
...
}
{code}

Note that we need a shared_ptr in FlagsBase because multiple flag names can 
correspond to the same Flag object.

3) Another review to update master binary flags that contain "slave" keyword to 
have an additional name with "agent" keyword. Example

{code}
  add(&Flags::authenticate_agents,
      {"authenticate_slaves", "authenticated_agents"},
      "If `true`, only authenticated slaves are allowed to register.\n"
      "If `false`, unauthenticated slaves are also allowed to register.\n"
      "--authenticate_slaves flag is *DEPRECATED* in favor of 
--authenticate_agents.",
      false);
{code}

4) Another review to update slave binary flags as above.

How does that sound?

> Replace Master/Slave Terminology Phase I - Add duplicate agent flags 
> ---------------------------------------------------------------------
>
>                 Key: MESOS-3781
>                 URL: https://issues.apache.org/jira/browse/MESOS-3781
>             Project: Mesos
>          Issue Type: Task
>            Reporter: Diana Arroyo
>            Assignee: Jay Guo
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to