mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jiang Yan Xu <...@jxu.me>
Subject Re: Review Request 51517: Added MOUNT or PATH disk type in logging resources.
Date Wed, 14 Sep 2016 22:43:56 GMT


> On Sept. 14, 2016, 1: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.
> 
> Benjamin Bannier wrote:
>     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();
>         }

This style LGTM. Just to clarify, "since these enums are just glorified names" you mean because
we haven't turned on `-Wswitch`? In the proposed new style we use `UNREACHABLE();` for readability
and not for "unknown values" right?


- Jiang Yan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51517/#review148967
-----------------------------------------------------------


On Sept. 14, 2016, 3:32 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, 3:32 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
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message