> On Nov. 17, 2016, 9:20 a.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. > > } > > ``` > > Anindya Sinha wrote: > 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`.
Summarizing offline discussion: my intention was to eliminate states that are not "actionable" (the code sets them but doesn't act differently based on them). Anindya's point was that as state machines we better have a distinct start and end state. We can add Shard::INIT back. - Jiang Yan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/45962/#review156082 ----------------------------------------------------------- On Nov. 28, 2016, 4:25 p.m., Anindya Sinha wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/45962/ > ----------------------------------------------------------- > > (Updated Nov. 28, 2016, 4:25 p.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 > >
