Package org.duracloud.mill.ltp
Class MorselComparator
- java.lang.Object
-
- org.duracloud.mill.ltp.MorselComparator
-
- All Implemented Interfaces:
Comparator<Morsel>
public class MorselComparator extends Object implements Comparator<Morsel>
The prioritization strategy for theMorselQueue. The intention is to ensure that spaces that have been started get worked before spaces that haven't. Also, ideally morsels from different accounts are evenly dispersed throughout the queue. So, given those motivations, here's an initial stab at the logic. 1. Morsels with non-null markers should go first. 2. Otherwise, order by space followed by domain.- Author:
- Daniel Bernstein Date: Nov 7, 2013
-
-
Constructor Summary
Constructors Constructor Description MorselComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Morsel o1, Morsel o2)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
compare
public int compare(Morsel o1, Morsel o2)
- Specified by:
comparein interfaceComparator<Morsel>
-
-