> On Sept. 14, 2016, 10:59 p.m., Benjamin Bannier wrote: > > src/common/resources.cpp, line 1745 > > <https://reviews.apache.org/r/51517/diff/2/?file=1495047#file1495047line1745> > > > > It would be great if you could avoid using `default` when switching > > over enum values. See https://issues.apache.org/jira/browse/MESOS-3754 for > > some background. > > Anindya Sinha wrote: > Done at both call sites.
Sorry for being unclear, but I think since these enums are just glorified names for integers you still need to handle unknown values. What about a pattern like this: ostream& operator<<(ostream& stream, const Resource::DiskInfo::Source& source) { switch (source.type()) { case Resource::DiskInfo::Source::MOUNT: return stream << "MOUNT:" + source.mount().root(); case Resource::DiskInfo::Source::PATH: return stream << "PATH:" + source.path().root(); } UNREACHABLE(); } > On Sept. 14, 2016, 10:59 p.m., Benjamin Bannier wrote: > > src/v1/resources.cpp, line 1748 > > <https://reviews.apache.org/r/51517/diff/2/?file=1495049#file1495049line1748> > > > > It would be great if you could avoid using `default` when switching > > over enum values. See https://issues.apache.org/jira/browse/MESOS-3754 for > > some background. Ditto. - Benjamin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/51517/#review148967 ----------------------------------------------------------- On Sept. 14, 2016, 11:42 p.m., Anindya Sinha wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/51517/ > ----------------------------------------------------------- > > (Updated Sept. 14, 2016, 11:42 p.m.) > > > Review request for mesos and Jiang Yan Xu. > > > Bugs: MESOS-6060 > https://issues.apache.org/jira/browse/MESOS-6060 > > > Repository: mesos > > > Description > ------- > > We also log the disk type (MOUNT or PATH) for each persistent disk as > well as the root path for these disks while logging resources. Note > that this is logged only when source is present, otherwise there is > no additional content logged. > > > Diffs > ----- > > src/common/resources.cpp f841e91b81975a887e64a76a709708ed7946025f > src/tests/resources_tests.cpp f627862870279e5a778aa83e1ddcaa88c27ba1cb > src/v1/resources.cpp 4410a8f95ef0ebe6ec7aee38cd47f6f83f863867 > > Diff: https://reviews.apache.org/r/51517/diff/ > > > Testing > ------- > > All tests passed. > > > Thanks, > > Anindya Sinha > >