> On March 31, 2016, 7:14 p.m., Jie Yu wrote:
> > src/slave/slave.hpp, line 550
> > <https://reviews.apache.org/r/45381/diff/2/?file=1319827#file1319827line550>
> >
> >     Can you move this field to Http class because this is a limiter for the 
> > http endpoint. Also, `limiter` sounds too general. Maybe rename it?
> >     
> >     ```
> >     class Http {
> >     private:
> >       Slave* slave;
> >       RateLimiter statisticsLimiter;
> >     }
> >     
> >     ```
> 
> Jay Guo wrote:
>     Renamed it.
>     
>     Although there is a problem moving it to http class: `Http http = 
> Http(this);` yields compilation error since RateLimiter class copy operator 
> is deleted.
> 
> Jie Yu wrote:
>     You can use Shared<RateLimiter> instead.
> 
> Jay Guo wrote:
>     `Shared<RateLimiter>` takes a pointer to RateLimiter, which needs to be 
> freed properly, as well as its underlying `RateLimiterProcess`. I get some 
> segmentation fault with it. Some hints would be appreciated. While I'm trying 
> to figure it out, there is another concern that `RateLimiter::acquire()` is 
> not `const`, yet `Shared` enforces `const`. Is `const_cast` a good practice 
> in Mesos codebase?

Shared<T> will free the pointer properly when all references go way.

> RateLimiter::acquire() is not const

You can make 'acquire()' a const function.


- Jie


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


On April 2, 2016, 10:31 a.m., Jay Guo wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45381/
> -----------------------------------------------------------
> 
> (Updated April 2, 2016, 10:31 a.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> These two endpoints and their underlying logics are moved from
> ResourceMonitorProcess to slave process. ResourceMonitor is removed.
> 
> 
> Diffs
> -----
> 
>   src/CMakeLists.txt ff225c0d51a32b03a1b5f2ba31718ec2305c7ced 
>   src/Makefile.am f22ae5b3bd9336a56c802e0e51d39d6cb675caf2 
>   src/slave/http.cpp 7a872c6e21b115500c5291b7cb9fb240ec9dc8ed 
>   src/slave/monitor.hpp 70a7c88fefd4577f53f85e3eccdd6b69ab6f3acd 
>   src/slave/monitor.cpp 5c1dd354595e67e5eb8888603c5d49850f84b84b 
>   src/slave/slave.hpp 3ba335fcd31a92af9609023daae328b7f4bf5e59 
>   src/slave/slave.cpp fc77f594d16a9fb2ca001e089d74e2c0ffeb5baa 
>   src/tests/mesos.hpp 98f97101d89cb91ca5e773e7a91f04ee1b8a0d88 
>   src/tests/mesos.cpp 77d49cc65e08f040b0d2010cd083928e4ff8b7cd 
>   src/tests/monitor_tests.cpp 5dcb2481ff2f1a7caf54036bc3e60c78feb982b1 
>   src/tests/oversubscription_tests.cpp 
> ba036810758d99a6fb0034c5e2bc7829e2343a44 
>   src/tests/slave_tests.cpp 57fc50360eae85819ae6ce714b0c3c4c1867b2b8 
> 
> Diff: https://reviews.apache.org/r/45381/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> https://issues.apache.org/jira/browse/MESOS-4891
> 
> 
> Thanks,
> 
> Jay Guo
> 
>

Reply via email to