> On Nov. 13, 2015, 11:11 p.m., Jie Yu wrote: > > src/master/master.cpp, lines 2737-2738 > > <https://reviews.apache.org/r/39987/diff/5/?file=1124800#file1124800line2737> > > > > This temp variable does not seem to be necessary. Can you just do: > > > > ``` > > LOG(INFO) << "Authorizing principal '" > > << (principal.isSome() ? principal.get() : "ANY") > > << "' to reserve resources"; > > ```
The temp variable isn't strictly necessary, but it does save us from extra checks of `principal.isSome()`. We have to do a little extra work either way: either we allocate a string to save what we find in `principal` the first time, or we have to check `principal.isSome()` multiple times. I don't know for sure, but my intuition is that checking `principal.isSome()` an extra time is more efficient, so I've switched to your suggestion. Thanks! > On Nov. 13, 2015, 11:11 p.m., Jie Yu wrote: > > src/master/master.cpp, line 2754 > > <https://reviews.apache.org/r/39987/diff/5/?file=1124800#file1124800line2754> > > > > We don't use tailing period for log messages. Please do a sweep to fix > > all of them. I changed this one; I'll make a sweep through the rest of the reviews to check for others, and mark this issue as Fixed afterward. > On Nov. 13, 2015, 11:11 p.m., Jie Yu wrote: > > src/master/master.cpp, lines 2794-2799 > > <https://reviews.apache.org/r/39987/diff/5/?file=1124800#file1124800line2794> > > > > Can you just stringify(unreserve.resources()) below when calling > > LOG(INFO)? Yep, great call! Done. > On Nov. 13, 2015, 11:11 p.m., Jie Yu wrote: > > src/master/master.cpp, lines 2802-2804 > > <https://reviews.apache.org/r/39987/diff/5/?file=1124800#file1124800line2802> > > > > Ditto above. No need for the 'principalString' temp variable. Ditto above. - Greg ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/39987/#review106518 ----------------------------------------------------------- On Nov. 13, 2015, 11:32 p.m., Greg Mann wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/39987/ > ----------------------------------------------------------- > > (Updated Nov. 13, 2015, 11:32 p.m.) > > > Review request for mesos, Adam B, Jie Yu, Michael Park, and Till Toenshoff. > > > Bugs: MESOS-3062 > https://issues.apache.org/jira/browse/MESOS-3062 > > > Repository: mesos > > > Description > ------- > > Added 'Master::authorize(Un)reserveResources()' for Reserve/Unreserve. > Note: this review is continued from https://reviews.apache.org/r/37125/ > > > Diffs > ----- > > src/master/master.hpp ead8520b7108a0f2c3a0bb11ae7b543897d111a2 > src/master/master.cpp 7bac0fea4bcd040307fdfdcd002387d5baee46d1 > > Diff: https://reviews.apache.org/r/39987/diff/ > > > Testing > ------- > > This is the third in a chain of 5 patches. `make check` was used to test > after all patches were applied. > > > Thanks, > > Greg Mann > >
