Package com.tangosol.net.partition
Class SimpleAssignmentStrategy.AnalysisContext.LoadComparator
java.lang.Object
com.tangosol.net.partition.SimpleAssignmentStrategy.AnalysisContext.LoadComparator
- All Implemented Interfaces:
Comparator
- Enclosing class:
SimpleAssignmentStrategy.AnalysisContext
public class SimpleAssignmentStrategy.AnalysisContext.LoadComparator
extends Object
implements Comparator
LoadComparator is a Comparator that can be used to compare two Member
objects based on their partition load (as defined by the
LoadCalculator).
A member is ordered "lower" than another member if it has a lower member load (as determined by the LoadCalculator). Members with equivalent loads are ordered equivalently.
Note: This comparator does not define an ordering that is "consistent with equals". If used in a context requiring such a natural ordering, it should be chained with comparator that does provide a natural ordering.
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Flag for primary or backup load comparison. -
Constructor Summary
-
Method Summary
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
-
Field Details
-
m_fPrimary
protected boolean m_fPrimaryFlag for primary or backup load comparison.
-
-
Constructor Details
-
LoadComparator
public LoadComparator(boolean fPrimary) Construct a LoadComparator.- Parameters:
fPrimary
- true if the comparator should use the primary load, or false for backup load
-
-
Method Details
-
isPrimary
public boolean isPrimary()Return true iff the comparator should use the primary load.- Returns:
- true iff the comparator should use the primary load
-
compare
- Specified by:
compare
in interfaceComparator
-