mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From haosdent huang <haosd...@gmail.com>
Subject Re: Review Request 49137: Implement v1 operator API GET_FRAMEWORK call.
Date Tue, 28 Jun 2016 08:45:31 GMT


> On June 28, 2016, 6:14 a.m., Vinod Kone wrote:
> > src/master/http.cpp, line 1358
> > <https://reviews.apache.org/r/49137/diff/5/?file=1431412#file1431412line1358>
> >
> >     don't use `auto` here because the type is not clear from this expression.
> 
> zhou xing wrote:
>     If I reaplace auto with hashmap<ExecutorID, ExecutorInfo>, I got the following
compile error:
>     
>     '''
>     ../../src/master/http.cpp:1274:16: error: too many arguments provided to
>           function-like macro invocation
>                    framework.executors) {
>                    ^
>     ../../3rdparty/stout/include/stout/foreach.hpp:51:9: note: macro 'foreachpair'
>           defined here
>     #define foreachpair(KEY, VALUE, ELEMS)
>     '''
>     
>     I checked the code of foreachpair, seems it does not accept more than 1 template
params?
> 
> zhou xing wrote:
>     another solution I can see is to use the following code to go through all the executors:
>     
>     ```
>       const hashset<SlaveID>& slaveIds = framework.executors.keys();
>       foreach (const SlaveID& slaveId, slaveIds) {
>         const hashmap<ExecutorID, ExecutorInfo>& executorsMap =
>             framework.executors.get(slaveId).get();
>     
>         foreachvalue (const ExecutorInfo& info, executorsMap) {
>           // Skip unauthorized executors.
>           if (!approveViewExecutorInfo(executorsApprover,
>                                        info,
>                                        framework.info)) {
>             continue;
>           }
>     
>           mesos::master::Response::GetFrameworks::Executor executor;
>           executor.mutable_info()->CopyFrom(executor);
>           executor.mutable_agent_id()->set_value(slaveId.value());
>     
>           _framework.mutable_executors()->Add()->CopyFrom(executor);
>         }
>       }
>       ```
>       I prefer to keep 'auto', as it is not that complex.   What do you think?

Looks like the comma in `const hashmap<ExecutorID, ExecutorInfo>&` make compiler
confuse.


- haosdent


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


On June 28, 2016, 8:11 a.m., zhou xing wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49137/
> -----------------------------------------------------------
> 
> (Updated June 28, 2016, 8:11 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, haosdent huang, and Vinod Kone.
> 
> 
> Bugs: mesos-5492
>     https://issues.apache.org/jira/browse/mesos-5492
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implemented getFrameworks method in http.cpp.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp d583bbeb186974135999eaddbab96e69635dcc7c 
>   src/master/master.hpp ba271e7a175529c59abd8bb92536eb5bf0136a40 
>   src/tests/api_tests.cpp 7b5c761751e4b28e3966ac8180fb19ce00fc8f30 
> 
> Diff: https://reviews.apache.org/r/49137/diff/
> 
> 
> Testing
> -------
> 
> make
> make check
> 
> 
> Thanks,
> 
> zhou xing
> 
>


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