Class PriorityComparator

All Implemented Interfaces:

public abstract class PriorityComparator extends Object implements Comparator<ShardRouting>
A comparator that compares ShardRouting instances based on various properties. Instances are ordered as follows.
  1. First, system indices are ordered before non-system indices
  2. Then indices are ordered by their priority, in descending order (index.priority)
  3. Then newer indices are ordered before older indices, based on their creation date. This benefits time-series indices, where newer indices are considered more urgent (index.creation_date)
  4. Lastly the index names are compared, which is useful when a date is baked into the index name, e.g. logstash-2015.05.03