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


Please excuse me if this seems like nit-picking, i'm just searching for ways to 
simplify this code.  It's already conceptually complicated, i'm just hoping we 
can make the code as simple as it can be.


src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java
<https://reviews.apache.org/r/27317/#comment100491>

    Line break style doesn't match project convention (we try to split up the 
chained call).  How about this:
    
        Map<IJobKey, IJobUpdate> updatesByKey = Maps.newHashMap(
            fetchActiveJobUpdates(storeProvider.getJobUpdateStore(), role)
            .uniqueIndex(UPDATE_TO_JOB_KEY));



src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java
<https://reviews.apache.org/r/27317/#comment100493>

    AFAICT you know at this point whether `requestedUpdate` needs to be added 
to `updatesByKey`.  Can you do it here rather than two levels down the stack, 
and sae the parameter?



src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java
<https://reviews.apache.org/r/27317/#comment100495>

    Is there a reason we don't use `Resources` here?  Seems like you could 
leverage it for the ITaskConfig->Resources translation and addition, then 
you're only in need of the Resources->IResourceAggregate step.
    
    AFAICT you'll get to remove some private helpers from this class, and this 
loop becomes more concise:
    ```java
    Resources sum = Resources.NONE;  // Need to create this
    for (..) {
      
      sum = Resources.sum(sum, Resources.from(task));
    }
    ```


- Bill Farner


On Oct. 29, 2014, 12:20 a.m., Maxim Khutornenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27317/
> -----------------------------------------------------------
> 
> (Updated Oct. 29, 2014, 12:20 a.m.)
> 
> 
> Review request for Aurora, Kevin Sweeney and Bill Farner.
> 
> 
> Bugs: AURORA-825
>     https://issues.apache.org/jira/browse/AURORA-825
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Cron job consumption is now calculated as MAX(SUM(template), SUM(tasks)). 
> This is rolled up into overall role consumption for reporting and quota 
> checks.
> 
> 
> Diffs
> -----
> 
>   src/main/java/org/apache/aurora/scheduler/quota/QuotaInfo.java 
> d4e0f5335c9ebd8da97cb9634152b46c2bd9affe 
>   src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java 
> 3fbab8b27403a416e86c97970eb6124c8a34c38c 
>   src/test/java/org/apache/aurora/scheduler/quota/QuotaManagerImplTest.java 
> 2fe257416e8fc11be3ebf0dabbf4f63628b3c670 
> 
> Diff: https://reviews.apache.org/r/27317/diff/
> 
> 
> Testing
> -------
> 
> ./gradlew -Pq build
> 
> 
> Thanks,
> 
> Maxim Khutornenko
> 
>

Reply via email to