aurora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Wickman" <wick...@gmail.com>
Subject Re: Review Request 16444: Client side changes for the client quota check.
Date Fri, 03 Jan 2014 17:35:25 GMT

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



src/main/python/apache/aurora/client/api/quota_check.py
<https://reviews.apache.org/r/16444/#comment59487>

    add newline
    
    (2 newlines between toplevel statements)



src/main/python/apache/aurora/client/api/quota_check.py
<https://reviews.apache.org/r/16444/#comment59489>

    i'm confused -- how does this work with released=None, since you do requested = self._subtract(acquired,
released) and afaict there is no released = released or Quota(0,0,0)



src/main/python/apache/aurora/client/api/quota_check.py
<https://reviews.apache.org/r/16444/#comment59488>

    2sp



src/main/python/apache/aurora/client/api/updater.py
<https://reviews.apache.org/r/16444/#comment59490>

    'list' should never be used as a variable name since it's a builtin.
    
    instead it should probably be s/list/instances/ and s/item/instance/
    
    also consider creating a Quota wrapper class that implements __add__ and __sub__, since
you've already implemented it in quota_checker.  this way you can just do
    
    def _aggregate_quota(instances, config_map):
      return sum(config_map[instance] for instance in instances)
    
    and in quota_check instead of self._subtract and self._add, you can just do the fluent
+ and -.



src/test/python/apache/aurora/client/api/test_quota_check.py
<https://reviews.apache.org/r/16444/#comment59491>

    2nl


- Brian Wickman


On Jan. 3, 2014, 1:23 a.m., Maxim Khutornenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/16444/
> -----------------------------------------------------------
> 
> (Updated Jan. 3, 2014, 1:23 a.m.)
> 
> 
> Review request for Aurora, Mark Chu-Carroll, Bill Farner, and Brian Wickman.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Quota checks should be done outside of populateJobConfig(). This is needed to properly
account for the released resources to prevent failures in job updates approaching their quota
limits.
> 
> Part 1: schema and client related changes.
> 
> 
> Diffs
> -----
> 
>   src/main/python/apache/aurora/client/api/BUILD 9af74e9746500e7b388fc0b7fe7186fca0daefd3

>   src/main/python/apache/aurora/client/api/quota_check.py PRE-CREATION 
>   src/main/python/apache/aurora/client/api/updater.py e364f26005d5194f2c8fea8c267fe2708c59d50b

>   src/main/python/apache/aurora/client/commands/BUILD 556d00aab633106a98cbfb4b1ee2d8e755627c04

>   src/main/python/apache/aurora/client/commands/core.py 45204b58ed14fdb83d31afe0fa4598f1b539062b

>   src/main/thrift/org/apache/aurora/gen/api.thrift 480b8f472bcfbe547a91c41638250350a0110334

>   src/test/python/apache/aurora/client/api/BUILD c5326752c9841a3f3cb8c9cc57f29f675e345788

>   src/test/python/apache/aurora/client/api/test_quota_check.py PRE-CREATION 
>   src/test/python/apache/aurora/client/api/test_updater.py 5843bb4d3698abc5c4a48ee6eaf2be85e9415a06

>   src/test/python/apache/aurora/client/commands/test_update.py ccc3ee9d97de4373b05ad2de8d88939510c2f052

> 
> Diff: https://reviews.apache.org/r/16444/diff/
> 
> 
> Testing
> -------
> 
> ./pants src/test/python/twitter/aurora/client:all
> 
> 
> Thanks,
> 
> Maxim Khutornenko
> 
>


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