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 Details

    • m_fPrimary

      protected boolean m_fPrimary
      Flag 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

      public int compare(Object o1, Object o2)
      Specified by:
      compare in interface Comparator