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



src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
<https://reviews.apache.org/r/17430/#comment61989>

    Thinking out loud, a helper function reduces some duplication, and wrapping 
in a HashMultimap puts the values in a Set for you (so you can skip the 
ImmutableSet.copyOf later):
    
      private static <T> Multimap<String, IJobKey> mapByRole(
          Iterable<T> entities,
          Function<T, IJobKey> keyExtractor) {
    
        return HashMultimap.create(
            Multimaps.index(Iterables.transform(tasks, keyExtractor)));
      }
    
    Then, your calling code is:
    
      Multimap<String, IJobKey> jobsByRole = mapByRole(
          Storage.weaklyConsistentFetchTasks(storage, Query.unscoped()),
          Tasks.SCHEDULED_TO_JOB_KEY);
      Multimap<String, IJobKey> cronJobsByRole =
          mapByRole(cronJobManager.getJobs(), JobKeys.FROM_CONFIG);
    
    (note: you'll want to tweak line wrapping, trying to make it pretty in the 
comment box here)



src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
<https://reviews.apache.org/r/17430/#comment61988>

    Does this test reproduce the bug?  I would have expected to see something 
like two tasks in the same job resulting in a job count of 1.


- Bill Farner


On Jan. 27, 2014, 11:45 p.m., Suman Karumuri wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/17430/
> -----------------------------------------------------------
> 
> (Updated Jan. 27, 2014, 11:45 p.m.)
> 
> 
> Review request for Aurora, Kevin Sweeney and Bill Farner.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Updated test cases to catch this bug.
> 
> 
> Diffs
> -----
> 
>   
> src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
>  cf9099f307efa23ca34634e3512d9cdbebfa82f2 
>   
> src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
>  6cefdfad469a9b69a5291ad46be1df14b443472e 
> 
> Diff: https://reviews.apache.org/r/17430/diff/
> 
> 
> Testing
> -------
> 
> gradle clean build
> gradle run - tested in local UI.
> 
> 
> Thanks,
> 
> Suman Karumuri
> 
>

Reply via email to