> On Aug. 22, 2016, 7 p.m., Jie Yu wrote: > > src/local/local.cpp, lines 343-350 > > <https://reviews.apache.org/r/51272/diff/1/?file=1480481#file1480481line343> > > > > I'd suggest we move this logic down below. more readable to me (current > > logic is broken into two pieces). > > ``` > > // ... > > if (flags.num_slaves > 1) { > > LOG(WARNING) << ...; > > > > flags.launcher = "posix"; > > } > > ```
Agreed I'd rather have the logic in one place, however: (1) then we'd be printing out a lot of log messages (one for each agent) and (2) we'd still have logic in two places because we'll need to pull out a 'num_slaves' variable (or 'launcher' variable, as I did here) above the loop because 'flags' gets overriden within the loop and I didn't want to make a bigger change by renaming 'flags'. So, either we leave it, rename the inner 'flags', or do you have another suggestion? > On Aug. 22, 2016, 7 p.m., Jie Yu wrote: > > src/slave/containerizer/mesos/containerizer.cpp, line 232 > > <https://reviews.apache.org/r/51272/diff/1/?file=1480482#file1480482line232> > > > > I would use the following. Looks more readable to me. > > ``` > > if (flags_.launcher != "posix" && flags_.launcher != "windows") > > ``` Agreed! - Benjamin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/51272/#review146399 ----------------------------------------------------------- On Aug. 22, 2016, 4:53 a.m., Benjamin Hindman wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/51272/ > ----------------------------------------------------------- > > (Updated Aug. 22, 2016, 4:53 a.m.) > > > Review request for mesos, Jie Yu and Kevin Klues. > > > Repository: mesos > > > Description > ------- > > Refactored the agent 'launcher' flag to always have a value. > > > Diffs > ----- > > src/local/local.cpp 1e1d246790a0d44d1baf802b903dc4f2bde1ac63 > src/slave/containerizer/mesos/containerizer.cpp > 77a502f853e3e04ea8e274419544601778be9421 > src/slave/flags.hpp 1a006663e7cc58ee548b3dda686cfbac0c240baa > src/slave/flags.cpp 0f2be1700f41b74da4ea1ce699a81ec33cf92a9a > > Diff: https://reviews.apache.org/r/51272/diff/ > > > Testing > ------- > > > Thanks, > > Benjamin Hindman > >
