> On Oct. 19, 2017, 10:42 p.m., Chun-Hung Hsiao wrote: > > src/common/resources.cpp > > Line 1765 (original), 1765 (patched) > > <https://reviews.apache.org/r/63105/diff/1/?file=1862325#file1862325line1765> > > > > We need a separated validation function. A resource provider will do > > the following: > > ``` > > Option<Error> error = Resources::validateOperation(operation); > > if (error.isSome()) { > > Update operation status: OFFER_OPERATION_ERROR; > > } > > > > Do the actual operation, e.g., call CSI. > > if (actual operation fails) { > > Update oeration status: OFFER_OPERATION_FAILED; > > } > > > > checkpointedResources.apply(target resource); > > Update operation status: OFFER_OPERATION_FINISHED; > > ``` > > Can you separate the validation logic from `Resources::apply` and > > provide an interface? > > > > We can also use the new validation functions in > > `src/common/resource_utils.cpp`
Hmm discussed with Jie and now it seems to me that the validation will be done on the master. Then I think for SLRP a single `apply()` is sufficient. - Chun-Hung ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/63105/#review188775 ----------------------------------------------------------- On Oct. 18, 2017, 2:36 p.m., Jan Schlicht wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/63105/ > ----------------------------------------------------------- > > (Updated Oct. 18, 2017, 2:36 p.m.) > > > Review request for mesos, Benjamin Bannier and Jie Yu. > > > Bugs: MESOS-7594 > https://issues.apache.org/jira/browse/MESOS-7594 > > > Repository: mesos > > > Description > ------- > > Added 'apply' handlers for storage operations. > > > Diffs > ----- > > src/common/resources.cpp 7ee4dae1389e037531aec533a3d235ee06443ea8 > > > Diff: https://reviews.apache.org/r/63105/diff/1/ > > > Testing > ------- > > make check > > > Thanks, > > Jan Schlicht > >
