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

Ship it!



include/mesos/resources.hpp
<https://reviews.apache.org/r/29018/#comment108282>

    Maybe this could be a bit more succinct:
    
    ```
    // This is an abstraction for describing a transformation that can
    // be applied to Resources. Transformations cannot not alter the
    // quantity, or the static role of the resources.
    //
    // TODO(jieyu): Enforce the transformation invariants fully!
    class Transformation
    {
    public:
      ...
      
      // Returns the result of the transformation, applied to 'resources'.
      // Returns an Error if the transformation cannot be applied.
      Try<Resources> operator () (const Resources& resources) const;
    };
    ```



include/mesos/resources.hpp
<https://reviews.apache.org/r/29018/#comment108283>

    Maybe mention the all-or-nothing nature:
    
    ```
    // Represents a sequence of transformations, the transformations
    // are applied in an all-or-nothing manner.
    class CompositeTransformation : public Transformation
    {
    };
    ```



include/mesos/resources.hpp
<https://reviews.apache.org/r/29018/#comment108287>

    You need an include for vector now?



src/common/resources.cpp
<https://reviews.apache.org/r/29018/#comment108286>

    Unused?



src/common/resources.cpp
<https://reviews.apache.org/r/29018/#comment108285>

    "transformations"?



src/common/resources.cpp
<https://reviews.apache.org/r/29018/#comment108280>

    Thanks, could this be:
    
    ```
    Try<Resources> applied = apply(resources);
    
    if (applied.isSome()) {
      // Additional checks.
    }
    
    return applied;
    ```



src/common/resources.cpp
<https://reviews.apache.org/r/29018/#comment108281>

    newline here?


- Ben Mahler


On Dec. 16, 2014, 9:10 p.m., Jie Yu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/29018/
> -----------------------------------------------------------
> 
> (Updated Dec. 16, 2014, 9:10 p.m.)
> 
> 
> Review request for mesos and Ben Mahler.
> 
> 
> Bugs: MESOS-2030
>     https://issues.apache.org/jira/browse/MESOS-2030
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Added abstraction for resources transformation. Split from 
> https://reviews.apache.org/r/28720/.
> 
> 
> Diffs
> -----
> 
>   include/mesos/resources.hpp 296553af93ec8457dad04ac018f03f36df654fdc 
>   src/common/resources.cpp 9bf7ae9148d6db2829cc2866ac048fe018ae2c92 
> 
> Diff: https://reviews.apache.org/r/29018/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Jie Yu
> 
>

Reply via email to