> 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?
> 
> Jie Yu wrote:
>     Shared<T> will free the pointer properly when all references go way.
>     
>     > RateLimiter::acquire() is not const
>     
>     You can make 'acquire()' a const function.

Thanks! I updated this patch and submitted another one 
https://reviews.apache.org/r/45794/ to change `RateLimiter::acquire()` to be 
`const`. BTW, is there any other projects depending on libprocess/stout? Should 
we be cautious of modifying these two projects?


- Jay


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


On April 6, 2016, 3:28 a.m., Jay Guo wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45381/
> -----------------------------------------------------------
> 
> (Updated April 6, 2016, 3:28 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 55d3b341361bed25f3aa966d77060c88be29e5b0 
>   src/slave/http.cpp 7a872c6e21b115500c5291b7cb9fb240ec9dc8ed 
>   src/slave/monitor.hpp 70a7c88fefd4577f53f85e3eccdd6b69ab6f3acd 
>   src/slave/monitor.cpp 5c1dd354595e67e5eb8888603c5d49850f84b84b 
>   src/slave/slave.hpp 3ba335fcd31a92af9609023daae328b7f4bf5e59 
>   src/slave/slave.cpp 60f93ca2c6251190d5dadfd543f0e5c5fbee1214 
>   src/tests/limiter.hpp baf396c138113abbf984879fbc2e8fade5e9feac 
>   src/tests/mesos.hpp 3b565b45f45c84aba42aa6fb29b21f8306c49861 
>   src/tests/mesos.cpp cf38dbb05908800b3a771318fa6922548c86c1f2 
>   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