mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Mahler <bmah...@apache.org>
Subject Re: Review Request 70061: Added method `fromScalarResources` in `ResourceQuantities`.
Date Wed, 27 Feb 2019 16:28:37 GMT

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



Can you place https://reviews.apache.org/r/70062/ as the first patch in front of this one?
That would make the absence semantics clear when looking at this patch..


src/common/resource_quantities.hpp
Lines 91 (patched)
<https://reviews.apache.org/r/70061/#comment299182>

    This seems prone to misreading? I would expect that it mandates that all the provided
resources are scalar, however it doesn't and it just drops any non-scalars. Seems unintuitive?
    
    Why do we need this? Why not just compose together?
    
    ```
      static ResourceQuantities fromResources(const Resources& resources);
      
      Resource quantities = ResourceQuantities::fromResources(r.scalars());
    ```
    
    Any reason not to have construction from `Resources` as a constructor?


- Benjamin Mahler


On Feb. 27, 2019, 1:28 a.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70061/
> -----------------------------------------------------------
> 
> (Updated Feb. 27, 2019, 1:28 a.m.)
> 
> 
> Review request for mesos and Benjamin Mahler.
> 
> 
> Bugs: MESOS-9608
>     https://issues.apache.org/jira/browse/MESOS-9608
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This method takes all the scalar type `Resource` entries in
> the `Resources` and combine them to a `ResourceQuantities`.
> Only the resource name and its scalar value are used and the
> rest of the meta-data is ignored. Non-scalar resource entries
> are silently dropped. Since internal resources are always
> validated to have positive scalar values, this conversion will
> always succeed.
> 
> Also added a dedicated test.
> 
> 
> Diffs
> -----
> 
>   src/common/resource_quantities.hpp 31ce7b98a8256173d6ad26e2f095373a01d7baae 
>   src/common/resource_quantities.cpp 1c8eec03580abf86df4ce947c517a74b0a8e09a7 
>   src/tests/resource_quantities_tests.cpp 435a4949b95e9a83be73781388eb4be9c7da695b 
> 
> 
> Diff: https://reviews.apache.org/r/70061/diff/1/
> 
> 
> Testing
> -------
> 
> make check
> Also added a dedicated test
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


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