Class NamenodePriorityComparator

java.lang.Object
org.apache.hadoop.hdfs.server.federation.resolver.NamenodePriorityComparator
All Implemented Interfaces:
Serializable, Comparator<FederationNamenodeContext>

public class NamenodePriorityComparator extends Object implements Comparator<FederationNamenodeContext>, Serializable
Compares NNs in the same namespace and prioritizes by their status. The priorities are:
  • ACTIVE
  • STANDBY
  • UNAVAILABLE
When two NNs have the same state, the last modification date is the tie breaker, newest has priority. Expired NNs are excluded.
See Also: