> On Jan. 13, 2015, 11:29 p.m., Vinod Kone wrote: > > src/master/master.cpp, line 1337 > > <https://reviews.apache.org/r/29869/diff/1/?file=820049#file820049line1337> > > > > We should consider using 'OneOf' protobuf type to get this check for > > free. > > > > https://developers.google.com/protocol-buffers/docs/proto#oneof > > Ben Mahler wrote: > That's a 2.6.0 feature: > https://github.com/google/protobuf/releases/tag/v2.6.0
aha. was wondering why we haven't used it before. > On Jan. 13, 2015, 11:29 p.m., Vinod Kone wrote: > > src/master/master.cpp, lines 1380-1381 > > <https://reviews.apache.org/r/29869/diff/1/?file=820049#file820049line1380> > > > > Curious, why you want acceptOffers() call into this method instead of > > the current way. I imagine each operation to be implemented as a > > function/method, similar to what you did in Master::call(). > > Ben Mahler wrote: > Yep, that's what we're aiming for, we're thinking of running through the > operations and creating a chain of computation. maybe i'm reading the comment wrong, but isn't the end goal here not to remove Master::launchTasks() method but to remove the installation of LaunchTasksMessage? in my mind, the fully implemented receive() will look like this: ``` void Master::receive( const UPID& from, const FrameworkInfo& frameworkInfo, const scheduler::Call::Accept& accept) { for (const Operation operation, accept.operations()) { switch (operation.type()) { case Offer::Operation::LAUNCH: launchTasks(...); break; case Offer::Operation::RESERVE: reserveResources(...); break; case Offer::Operation::UNRESERVE: unreserveResources(...); break; case Offer::Operation::Create: createVolume(...); break; case Offer::Operation::Destroy: destroyVolume(...); break; } } } ``` - Vinod ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29869/#review67970 ----------------------------------------------------------- On Jan. 14, 2015, 1:25 a.m., Ben Mahler wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/29869/ > ----------------------------------------------------------- > > (Updated Jan. 14, 2015, 1:25 a.m.) > > > Review request for mesos, Jie Yu, Michael Park, and Vinod Kone. > > > Repository: mesos-git > > > Description > ------- > > This is an initial stub that only handles accepting offers. > > The plan (per the TODO) is to have a single path for launching tasks through > `acceptOffers`, as opposed to `launchTasks`. > > > Diffs > ----- > > src/master/master.hpp 26116aff1e965501c8d94ea0b5bd1be37f944887 > src/master/master.cpp 63ca19ab9618feccd93a2335f9287122a4665c5e > > Diff: https://reviews.apache.org/r/29869/diff/ > > > Testing > ------- > > The code path currently cannot be executed. Tests will be added once the > scheduler driver supports accepting offers. > > make check > > > Thanks, > > Ben Mahler > >
