> On Nov. 17, 2016, 5:20 p.m., Jiang Yan Xu wrote: > > src/examples/persistent_volume_framework.cpp, line 201 > > <https://reviews.apache.org/r/45962/diff/20/?file=1556467#file1556467line201> > > > > Consolidate this with `case Shard::STAGING`? > > > > We can just do: > > > > ``` > > if (shard.launched == 0) { > > // Create volume, add to `operations`. > > // Update info in Shard. > > // Add producer task to operations. > > } else { > > // Modify volume to RO. > > // Add consumer task to operations. > > } > > ```
To do this, we need to init `Shard` with state of `Shard::STAGING`. I do not think we should init state to `Shard::STAGING` (syntactically incorrect). So, either we have a `Shard::INIT` (like we had before) or use the fact that `Shard.state` is `None()`. So, if we do not want to add back `Shard::INIT`, we would need to handle the case of the 1st task outside the `switch`. - Anindya ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/45962/#review156082 ----------------------------------------------------------- On Nov. 18, 2016, 5:13 a.m., Anindya Sinha wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/45962/ > ----------------------------------------------------------- > > (Updated Nov. 18, 2016, 5:13 a.m.) > > > Review request for mesos, Greg Mann, Jie Yu, and Jiang Yan Xu. > > > Bugs: MESOS-4431 > https://issues.apache.org/jira/browse/MESOS-4431 > > > Repository: mesos > > > Description > ------- > > Updated a persistent volume test framework to include shared volumes. > > > Diffs > ----- > > src/examples/persistent_volume_framework.cpp > 9d45bb496c4cf378af429b5aa970bf81450e482a > > Diff: https://reviews.apache.org/r/45962/diff/ > > > Testing > ------- > > New test framework for shared resources added. > Tests successful. > > > Thanks, > > Anindya Sinha > >