> On Dec. 2, 2014, 11:09 p.m., Maxim Khutornenko wrote: > > src/main/java/org/apache/aurora/scheduler/async/preemptor/CachedClusterState.java, > > line 58 > > <https://reviews.apache.org/r/28607/diff/1/?file=780416#file780416line58> > > > > Would it make sense to do it conditionally, i.e.: > > ```java > > if (!Tasks.SLAVE_ASSIGNED_STATES.contains(stateChange.getNewState()) { > > Iterables.remove... > > } else { > > victims.put... > > } > > ``` > > Bill Farner wrote: > That would introduce duplicates, e.g. PENDING -> ASSIGNED -> RUNNING > would result in 2 entries for the task. > > Maxim Khutornenko wrote: > Why not use a HashMultimap to store victims then? I don't see anything in > the PreemptionVictim that would be different between task state transitions.
Sure, that works for me. Done. - Bill ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/28607/#review63598 ----------------------------------------------------------- On Dec. 3, 2014, 1:39 a.m., Bill Farner wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/28607/ > ----------------------------------------------------------- > > (Updated Dec. 3, 2014, 1:39 a.m.) > > > Review request for Aurora, Maxim Khutornenko and Zameer Manji. > > > Bugs: AURORA-121 > https://issues.apache.org/jira/browse/AURORA-121 > > > Repository: aurora > > > Description > ------- > > Add a caching ClusterState implementation. > > > Diffs > ----- > > > src/main/java/org/apache/aurora/scheduler/async/preemptor/CachedClusterState.java > PRE-CREATION > src/main/java/org/apache/aurora/scheduler/async/preemptor/ClusterState.java > 3524dc595e7b61a531912843f90b01a87bc57cc4 > > src/main/java/org/apache/aurora/scheduler/async/preemptor/PreemptorModule.java > 489c0bfa22aae14fbd3fd2ee9e5bd32b7c3aafa5 > > src/test/java/org/apache/aurora/scheduler/async/preemptor/CachedClusterStateTest.java > PRE-CREATION > > Diff: https://reviews.apache.org/r/28607/diff/ > > > Testing > ------- > > > Thanks, > > Bill Farner > >