mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guangya Liu <gyliu...@gmail.com>
Subject Re: Review Request 51999: Refactor parsing of resources.
Date Sun, 02 Oct 2016 01:56:39 GMT

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




include/mesos/resources.hpp (line 172)
<https://reviews.apache.org/r/51999/#comment218921>

    Not a `JSON string` but `JSON Array`



include/mesos/resources.hpp (line 174)
<https://reviews.apache.org/r/51999/#comment218922>

    Not `from text` but from `JSON Array`



include/mesos/resources.hpp (line 181)
<https://reviews.apache.org/r/51999/#comment218924>

    s/text/resourcesJSON



include/mesos/resources.hpp (line 186)
<https://reviews.apache.org/r/51999/#comment218925>

    s/fromJSONString/fromJSONArray



src/common/resources.cpp (line 528)
<https://reviews.apache.org/r/51999/#comment219267>

    I think it is not good to update here in this patch as I cannot see the reason why do
we want to update here in this patch, can we move this update to the patch where it is needed?



src/common/resources.cpp (line 586)
<https://reviews.apache.org/r/51999/#comment218926>

    As the API `fromJSONString(fromJSONArry as I proposed)` will also be called by agent to
parse agent resource flags, so here may not



src/common/resources.cpp (line 593)
<https://reviews.apache.org/r/51999/#comment219268>

    As the `fromJSONString` (I prefer we rename this as fromJSONArray) will also be called
in containerizer to parse resources from agent flag, so here we also need to call `validateCommandLineResources`
to make sure there is no persistent volume, revocable resources etc.
    
    Also if we add the `validateCommandLineResources` here we can remove it from #553 to #556.



src/common/resources.cpp (lines 638 - 639)
<https://reviews.apache.org/r/51999/#comment219269>

    I think we do not need validate here as here the `Resource` is get from `name, value,
role`.



src/common/resources.cpp (line 646)
<https://reviews.apache.org/r/51999/#comment219270>

    Seems we still need `validateCommandLineResources` here as `fromSimpleString` will also
be called in containerizer when parsing resources from agent flag, we should make sure there
is no persistent volume, revocable etc.
    
    After add `validateCommandLineResources` here, we can remove the validation from #553
to #556


- Guangya Liu


On 九月 28, 2016, 7:24 p.m., Anindya Sinha wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51999/
> -----------------------------------------------------------
> 
> (Updated 九月 28, 2016, 7:24 p.m.)
> 
> 
> Review request for mesos and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-6062
>     https://issues.apache.org/jira/browse/MESOS-6062
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Refactored `Resources::parse()` into 2 separate static functions:
> 1. Resources::fromJSONString() to parse JSON representation of
>    resources.
> 2. Resources::fromSimpleString() to parse text representation of
>    resources.
> 
> Since these 2 new functions return a `Try<vector<Resource>>`, the
> existing `Resources::parse()` implicitly converts that to a
> `Resources` object. This refactor is done to retrieve all resources
> (include empty resources) required for auto detection of root
> and MOUNT disks.
> 
> 
> Diffs
> -----
> 
>   include/mesos/resources.hpp 3ef8cacee529addc745b4aeb6398d7606c61b749 
>   include/mesos/v1/resources.hpp ef56b4960b103a3efd916fab64796aa334ba44c6 
>   src/common/resources.cpp 0774ff0669e831494d5b12b88e19dfa0a4a3f757 
>   src/tests/resources_tests.cpp 3e493007d6d1d8194d07035aaa1cde28dedf2b5a 
>   src/v1/resources.cpp 62a644ebbd13cfc0862bd118ba16c43e0f6aaf90 
> 
> Diff: https://reviews.apache.org/r/51999/diff/
> 
> 
> Testing
> -------
> 
> All tests passed.
> 
> 
> Thanks,
> 
> Anindya Sinha
> 
>


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