Class 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 Detail

      • m_fPrimary

        protected boolean m_fPrimary
        Flag for primary or backup load comparison.
    • Constructor Detail

      • 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 Detail

      • isPrimary

        public boolean isPrimary()
        Return true iff the comparator should use the primary load.
        Returns:
        true iff the comparator should use the primary load