mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anand Mazumdar <an...@apache.org>
Subject Re: Review Request 48094: Implemented GET_ROLES Call in v1 master API.
Date Sun, 19 Jun 2016 04:01:58 GMT

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


Fix it, then Ship it!




Thanks for the patience Abhishek. I would commit this shortly with the following fixes.


src/master/http.cpp (line 1452)
<https://reviews.apache.org/r/48094/#comment203606>

    I renamed the continuation variable later in this scope to `role_`. This allowed us to
use `role` instead of `getRole` which is more intuitive to the reader.



src/tests/api_tests.cpp (lines 420 - 421)
<https://reviews.apache.org/r/48094/#comment203609>

    Modified the resources string to:
    
    ```cpp
    slaveFlags.resources =
      "cpus(role1):0.5;mem(role1):512;ports(role1):[31000-31001];"
      "disk(role1):1024;gpus(role1):1";
    ```
    
    This allows us to do explicitly check for resources later more cleanly later i.e.:
    
    ```cpp
     ASSERT_EQ(v1::Resources::parse(slaveFlags.resources.get()).get(),
               v1Response->get_roles().roles(1).resources());
    ```



src/tests/api_tests.cpp (lines 456 - 475)
<https://reviews.apache.org/r/48094/#comment203608>

    I cleaned this up a bit as per my earlier comment to explicitly assume the order and make
the test less verbose:
    
    ```cpp
    ASSERT_EQ(2, v1Response->get_roles().roles().size());
    EXPECT_EQ("role1", v1Response->get_roles().roles(1).name());
    EXPECT_EQ(2.5, v1Response->get_roles().roles(1).weight());
    ASSERT_EQ(v1::Resources::parse(slaveFlags.resources.get()).get(),
              v1Response->get_roles().roles(1).resources());
    ```
    
    Also, since we were not testing for "role2" resources, I would remove it.


- Anand Mazumdar


On June 18, 2016, 4:21 p.m., Abhishek Dasgupta wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/48094/
> -----------------------------------------------------------
> 
> (Updated June 18, 2016, 4:21 p.m.)
> 
> 
> Review request for mesos, Anand Mazumdar and Vinod Kone.
> 
> 
> Bugs: MESOS-5494
>     https://issues.apache.org/jira/browse/MESOS-5494
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implemented GET_ROLES Call in v1 master API.
> 
> 
> Diffs
> -----
> 
>   include/mesos/master/master.proto fa92240 
>   include/mesos/mesos.proto e4c5bd3 
>   include/mesos/v1/master/master.proto 59e978f 
>   include/mesos/v1/mesos.proto 9be22f0 
>   src/master/http.cpp a6beb17 
>   src/master/master.hpp 618d928 
>   src/tests/api_tests.cpp afa5ffa 
> 
> Diff: https://reviews.apache.org/r/48094/diff/
> 
> 
> Testing
> -------
> 
> On Ubuntu 16.04:
> 
> sudo GTEST_FILTER="*MasterAPITest.*" make -j2 check
> 
> 
> Thanks,
> 
> Abhishek Dasgupta
> 
>


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