> On June 27, 2016, 12:36 a.m., Anand Mazumdar wrote: > > src/master/http.cpp, lines 1505-1506 > > <https://reviews.apache.org/r/49225/diff/1/?file=1430126#file1430126line1505> > > > > Do we need this explicit check here? I can understand why we > > introduced/need it in `GET_LEADER` but why here? Bad Copy/Paste? > > Abhishek Dasgupta wrote: > Haha..No, it was not bad copy/paste.. I did it deliberately.. in > reserve() function, you can find : > // When current master is not the leader, redirect to the leading > master. > if (!master->elected()) { > return redirect(request); > } > > So, I put this check in reserveResource() function as reservation is done > through elected master. Still, you want me to remove this check?
Yep Kill it. The other handler functions don't have it either. > On June 27, 2016, 12:36 a.m., Anand Mazumdar wrote: > > src/tests/api_tests.cpp, lines 567-568 > > <https://reviews.apache.org/r/49225/diff/1/?file=1430128#file1430128line567> > > > > Do we need the explicit `static_cast` here? Why doesn't `CopyFrom()` > > work directly? > > Abhishek Dasgupta wrote: > Did not quite get it: > This error is inevitably coming if we use CopyFrom directly : > no matching function for call to > ‘google::protobuf::RepeatedPtrField<mesos::v1::Resource>::CopyFrom(mesos::Resources&) > > Are you suggesting any design change here?? My bad, I thought the implicit conversion from `Resource` -> `RepeatedPtrField` would kick in here. https://github.com/apache/mesos/blob/master/include/mesos/resources.hpp#L364 Dropping this. - Anand ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/49225/#review139506 ----------------------------------------------------------- On June 27, 2016, 8:19 a.m., Abhishek Dasgupta wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/49225/ > ----------------------------------------------------------- > > (Updated June 27, 2016, 8:19 a.m.) > > > Review request for mesos, Anand Mazumdar and Vinod Kone. > > > Bugs: MESOS-5499 > https://issues.apache.org/jira/browse/MESOS-5499 > > > Repository: mesos > > > Description > ------- > > Implemented RESERVE_RESOURCES Call in v1 master API. > > > Diffs > ----- > > src/master/http.cpp d55aa05c76bb2b1fb17b795510fd50c021cdb995 > src/master/master.hpp 648f1a217cc7bbb154a9d7a2a8b2c5d02087af03 > src/tests/api_tests.cpp 7f16f43c3968cd56cf93951489079032093beaeb > > Diff: https://reviews.apache.org/r/49225/diff/ > > > Testing > ------- > > > Thanks, > > Abhishek Dasgupta > >
