> On Feb. 6, 2015, 1:25 a.m., Ben Mahler wrote: > > src/master/master.cpp, lines 4787-4792 > > <https://reviews.apache.org/r/30694/diff/1/?file=851240#file851240line4787> > > > > Hm.. relying on this error to determine whether the volume applies to > > checkpointed resources seems a bit implicit. How do we know it's not due to > > some other error? :) > > > > Have you considered something like the following approach: > > > > ``` > > // There should be an easy way to get the slave's current total > > resources > > // (checkpointed + non-checkpointed) since we likely need to use this > > // elsewhere too (e.g. http endpoints). > > Resources slaveResources; // checkpointed + non-checkopinted > > > > // Add the volumes. > > Try<Resources> resources = slaveResources.apply(operation.create()); > > > > CHECK_SOME(resources); > > > > slaveResources = resources.get(); > > slave->checkpointedResources = slaveResources.filter(checkpointFilter); > > ``` > > > > This approach should work for the DESTROY case as well, thoughts?
Refactored. Much better. Let me know! - Jie ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/30694/#review71316 ----------------------------------------------------------- On Feb. 6, 2015, 7:47 p.m., Jie Yu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/30694/ > ----------------------------------------------------------- > > (Updated Feb. 6, 2015, 7:47 p.m.) > > > Review request for mesos, Ben Mahler, Michael Park, and Vinod Kone. > > > Bugs: MESOS-2100 > https://issues.apache.org/jira/browse/MESOS-2100 > > > Repository: mesos > > > Description > ------- > > Fixed bugs in CREATE/DESTROY operation handlers and added tests. > > > Diffs > ----- > > include/mesos/resources.hpp 3b57568c10233a0c692787de6464f21af5eaadf4 > src/Makefile.am 93537d17d3c7604a8532ee1453e405630c481ddc > src/master/master.hpp dcfd38ae2fa9e1bd0b477e9719724dba37114d30 > src/master/master.cpp 234bbecc4205036d790b026abd59100eb188f913 > src/tests/persistent_volume_tests.cpp PRE-CREATION > > Diff: https://reviews.apache.org/r/30694/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Jie Yu > >
