> On April 9, 2015, 3:06 a.m., Bill Farner wrote:
> > src/main/java/org/apache/aurora/scheduler/async/TaskScheduler.java, lines 
> > 251-252
> > <https://reviews.apache.org/r/32907/diff/1/?file=918480#file918480line251>
> >
> >     Does this fail if the pending task was deleted?  It's probably fine to 
> > let expiration handle invalidation in that case, but just check that this 
> > doesn't NPE or similar.

We raise a different TaskDeleted event in that case, so it should never be the 
case that slaveId is null. That said, I agree it's not obvious here what the 
StateManager logic is. Added a null check and a test case.


> On April 9, 2015, 3:06 a.m., Bill Farner wrote:
> > src/main/java/org/apache/aurora/scheduler/async/preemptor/BiCache.java, 
> > line 39
> > <https://reviews.apache.org/r/32907/diff/1/?file=918481#file918481line39>
> >
> >     "A bi-directional cache of items.  Entries are..."

Done.


> On April 9, 2015, 3:06 a.m., Bill Farner wrote:
> > src/main/java/org/apache/aurora/scheduler/async/preemptor/BiCache.java, 
> > lines 83-90
> > <https://reviews.apache.org/r/32907/diff/1/?file=918481#file918481line83>
> >
> >     Consider exposing a `size()` function on `BiCache` and pushing the stat 
> > up to alleaviate the need to plumb the stat name through.  At that point i 
> > think you can reasonably remove `BiCacheSettings` and inject just the 
> > expiry time.

I actually like the current version as it avoids code duplication and prevents 
metric-less use of the cache.


> On April 9, 2015, 3:06 a.m., Bill Farner wrote:
> > src/main/java/org/apache/aurora/scheduler/async/preemptor/BiCache.java, 
> > line 122
> > <https://reviews.apache.org/r/32907/diff/1/?file=918481#file918481line122>
> >
> >     Consider s/Iterable/Set/, or at least Collection here so you don't need 
> > to do Iterables.isEmpty at the call site.

Done.


> On April 9, 2015, 3:06 a.m., Bill Farner wrote:
> > src/main/java/org/apache/aurora/scheduler/async/preemptor/Preemptor.java, 
> > line 82
> > <https://reviews.apache.org/r/32907/diff/1/?file=918484#file918484line82>
> >
> >     Please document the justification for getting the last element.

There is no ordering requirement enforced here. Changed it to iterator().next() 
to avoid second guessing.


> On April 9, 2015, 3:06 a.m., Bill Farner wrote:
> > src/test/java/org/apache/aurora/scheduler/async/TaskSchedulerImplTest.java, 
> > line 132
> > <https://reviews.apache.org/r/32907/diff/1/?file=918486#file918486line132>
> >
> >     Since the BiCache is completely controlled by TaskScheduler, consider 
> > using a real instance rather than a mock.  If this makes tests harder to 
> > write or read, though, don't bother.

That was the original implementation that I had problems with reaching 100% 
block coverage. This way it's easier to manipulate underlying conditions and is 
consistent with using mocks for other dependencies.


> On April 9, 2015, 3:06 a.m., Bill Farner wrote:
> > src/test/java/org/apache/aurora/scheduler/async/preemptor/BiCacheTest.java, 
> > line 30
> > <https://reviews.apache.org/r/32907/diff/1/?file=918488#file918488line30>
> >
> >     One more test case: key collision behavior with identical and different 
> > values

The former is covered by testMultipleValues(). The latter is identical to 
regular cache behavior but added a test anyway.


> On April 9, 2015, 3:06 a.m., Bill Farner wrote:
> > src/test/java/org/apache/aurora/scheduler/async/preemptor/BiCacheTest.java, 
> > line 57
> > <https://reviews.apache.org/r/32907/diff/1/?file=918488#file918488line57>
> >
> >     Is there not a compiler warning on the lack of type witness on 
> > ImmutableSet.of()?

Nope.


- Maxim


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


On April 6, 2015, 11:51 p.m., Maxim Khutornenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/32907/
> -----------------------------------------------------------
> 
> (Updated April 6, 2015, 11:51 p.m.)
> 
> 
> Review request for Aurora, Bill Farner and Zameer Manji.
> 
> 
> Bugs: AURORA-1219
>     https://issues.apache.org/jira/browse/AURORA-1219
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Current preemption model assumes tracking preemption slots/reservations by 
> taskId. This reduces preemption efficiency as it only takes a specific taskId 
> scheduling round to claim the PreemptionSlot and then subsequently make a 
> slave reservation. 
> 
> This diff generalizes the preemption pool by TaskGroupKey. Preemption slots 
> are now created and cached by TaskGroupKey and are available to _any_ task 
> from the same TaskGroup. 
> 
> This change should also simplify the algorithm in 
> https://reviews.apache.org/r/32597/.
> 
> 
> Diffs
> -----
> 
>   src/main/java/org/apache/aurora/scheduler/async/AsyncModule.java 
> e87dda47a355654c66f6f54fb25a4d9a7f68422d 
>   src/main/java/org/apache/aurora/scheduler/async/TaskScheduler.java 
> ebc520ebb4dddbc69b2b4a6f9174c1451d61887a 
>   src/main/java/org/apache/aurora/scheduler/async/preemptor/BiCache.java 
> PRE-CREATION 
>   
> src/main/java/org/apache/aurora/scheduler/async/preemptor/PendingTaskProcessor.java
>  67ad5d7f9909bc892301c19586561b6cdbfe79e6 
>   
> src/main/java/org/apache/aurora/scheduler/async/preemptor/PreemptionSlotCache.java
>  b5a42a0a0498f06a382576e2c3a839bbb7f1d2b1 
>   src/main/java/org/apache/aurora/scheduler/async/preemptor/Preemptor.java 
> 77617ec11119a2bcd062d5b80cd2b4c58dc80514 
>   
> src/main/java/org/apache/aurora/scheduler/async/preemptor/PreemptorModule.java
>  1092c055588363794b37a965fb2f17a6e50d92d7 
>   src/test/java/org/apache/aurora/scheduler/async/TaskSchedulerImplTest.java 
> c5643d9d99fc46d55fd6c48161230139fb7f12b8 
>   src/test/java/org/apache/aurora/scheduler/async/TaskSchedulerTest.java 
> 88c0163170ebc25995d9ef8b1543335a4322bb8e 
>   src/test/java/org/apache/aurora/scheduler/async/preemptor/BiCacheTest.java 
> PRE-CREATION 
>   
> src/test/java/org/apache/aurora/scheduler/async/preemptor/PendingTaskProcessorTest.java
>  bcd1b4e854f5ea227268c73156bc97c7c937c1de 
>   
> src/test/java/org/apache/aurora/scheduler/async/preemptor/PreemptionSlotCacheTest.java
>  80bd13a192bda64759b5a93749ec47ddfeae504a 
>   
> src/test/java/org/apache/aurora/scheduler/async/preemptor/PreemptorImplTest.java
>  281f4e02650727aa5d0a35a09dcf0eb823ad1b50 
> 
> Diff: https://reviews.apache.org/r/32907/diff/
> 
> 
> Testing
> -------
> 
> ./gradlew -Pq build
> Manual testing in vagrant.
> 
> 
> Thanks,
> 
> Maxim Khutornenko
> 
>

Reply via email to