> On Oct. 17, 2016, 11:45 a.m., Stephan Erb wrote:
> > src/main/java/org/apache/aurora/scheduler/metadata/NearestFit.java, line 144
> > <https://reviews.apache.org/r/51993/diff/4/?file=1538875#file1538875line144>
> >
> >     This split looks kind of magic. What does it do?

Joiner.on(...) would return a comma separated string of reasons. I need to 
convert that to a List<String>. I am splitting the comma separated string 
(returned by Joiner.on(...)) with <any number of spaces before> comma <any 
number of spaces after> so that I end up with a String[] of reasons. I pass 
this String[] of reasons to Arrays.asList(...) to generate a List<String>.

I will comment that line of code so that it is understandable as to what I am 
doing.


> On Oct. 17, 2016, 11:45 a.m., Stephan Erb wrote:
> > src/main/java/org/apache/aurora/scheduler/http/PendingTasks.java, lines 
> > 67-70
> > <https://reviews.apache.org/r/51993/diff/4/?file=1538874#file1538874line67>
> >
> >     I am not sure if I understand this code correctly. How does this ensure 
> > we attatch the `reason` to the correct taskgroup in the json.

In NearestFit#getPendingReasons(...) I am using a LinkedHashMap<> to maintain 
insertion order and filling it in the order of items in taskGroups.getGroups().
So, the order in which the reasons are filled in, is the same as the order of 
items in taskGroups.getGroups().
This is why I can be sure that the reason would correspond to the correct 
pendingtask.

I can make a small change, where I am picking the value corresponding to the 
right key. In fact it would be much more clearer that way.


- Pradyumna


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


On Oct. 15, 2016, 6:56 p.m., Pradyumna Kaushik wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51993/
> -----------------------------------------------------------
> 
> (Updated Oct. 15, 2016, 6:56 p.m.)
> 
> 
> Review request for Aurora and Joshua Cohen.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Added the 'reason' to the /pendingTasks endpoint
> 
> 
> Diffs
> -----
> 
>   config/legacy_untested_classes.txt ee4d3d7e537356ae99ba3a90a3631749067662f3 
>   src/main/java/org/apache/aurora/scheduler/http/PendingTasks.java 
> c80e0c8adf80e12082a6952ae79b7d9cc960c5b6 
>   src/main/java/org/apache/aurora/scheduler/metadata/NearestFit.java 
> f783e7ff220573915524a1efc27141193d19fa6c 
>   src/main/java/org/apache/aurora/scheduler/scheduling/TaskGroup.java 
> 5d319557057e27fd5fc6d3e553e9ca9139399c50 
>   src/main/java/org/apache/aurora/scheduler/scheduling/TaskGroups.java 
> d390c07522d22e43d79ce4370985f3643ef021ca 
>   src/test/java/org/apache/aurora/scheduler/http/OffersTest.java 
> 9e3573252cf37153180b1fc5ab9150bab0299c99 
>   src/test/java/org/apache/aurora/scheduler/http/PendingTasksTest.java 
> PRE-CREATION 
>   src/test/java/org/apache/aurora/scheduler/metadata/NearestFitTest.java 
> d9b3cc672f42c50b2a2a142733d26c0725bbc864 
> 
> Diff: https://reviews.apache.org/r/51993/diff/
> 
> 
> Testing
> -------
> 
> ./build-support/jenkins/build.sh
> ./src/test/sh/org/apache/aurora/e2e/test_end_to_end.sh
> 
> 
> Thanks,
> 
> Pradyumna Kaushik
> 
>

Reply via email to