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


Great! This was badly needed :D


src/common/resources.hpp
<https://reviews.apache.org/r/8145/#comment29262>

    This vector of pairs looks a bit rough for a caller to use.
    
    1. Any reason to not use uint16_t? It is the true size of port numbers, 
using uint64_t might require some error handling on the caller.
    
    2. Could we just use a std::set or hashset of the ports available?
    
    This might be a bit high on the memory front:
    maximum size = (65536 ports * 2 bytes / 1024) = 128KB + overhead.
    But expected case would definitely be no more than a quarter of that.
    
    I think we should do this for simplicity.
    
    Longer term, if performance / memory warrants it, we could have a Ranges 
abstraction that only stores the ranges and provides set membership checks?



src/common/resources.hpp
<https://reviews.apache.org/r/8145/#comment29263>

    Too bad we didn't just store a map of <resource.name, resource> so we could 
avoid all this looping =/


- Ben Mahler


On Nov. 20, 2012, 11:53 p.m., Vinod Kone wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/8145/
> -----------------------------------------------------------
> 
> (Updated Nov. 20, 2012, 11:53 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Ben Mahler.
> 
> 
> Description
> -------
> 
> Added helpers to extract specific resources: cpus,mem, disk and ports.
> 
> I wanted these as part of a fix I am going to make to the slave, to properly 
> deal with resources specified via command line.
> 
> Hopefully, once we make the resources first class, we don't need these 
> helpers?
> 
> 
> Diffs
> -----
> 
>   src/common/resources.hpp 5237b6031919aaed2d742bc095e537e83bf9f3fd 
>   src/tests/resources_tests.cpp 83e93482a6800724d51aeae91e57d2a2b52b37b6 
> 
> Diff: https://reviews.apache.org/r/8145/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Vinod Kone
> 
>

Reply via email to