java.lang.Object
java.lang.Enum<SnapshotSortKey>
org.elasticsearch.action.admin.cluster.snapshots.get.SnapshotSortKey
All Implemented Interfaces:
Serializable, Comparable<SnapshotSortKey>, Constable

public enum SnapshotSortKey extends Enum<SnapshotSortKey>
Sort key for snapshots e.g. returned from the get-snapshots API. All values break ties using SnapshotInfo.snapshotId() (i.e. by name).
  • Enum Constant Details

    • START_TIME

      public static final SnapshotSortKey START_TIME
      Sort by snapshot start time.
    • NAME

      public static final SnapshotSortKey NAME
      Sort by snapshot name.
    • DURATION

      public static final SnapshotSortKey DURATION
      Sort by snapshot duration (end time minus start time).
    • INDICES

      public static final SnapshotSortKey INDICES
      Sort by number of indices in the snapshot.
    • SHARDS

      public static final SnapshotSortKey SHARDS
      Sort by number of shards in the snapshot.
    • FAILED_SHARDS

      public static final SnapshotSortKey FAILED_SHARDS
      Sort by number of failed shards in the snapshot.
    • REPOSITORY

      public static final SnapshotSortKey REPOSITORY
      Sort by repository name.
  • Method Details

    • values

      public static SnapshotSortKey[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SnapshotSortKey valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Overrides:
      toString in class Enum<SnapshotSortKey>
    • getSnapshotInfoComparator

      public final Comparator<SnapshotInfo> getSnapshotInfoComparator(SortOrder sortOrder)
      Returns:
      a Comparator which sorts SnapshotInfo instances according to this sort key.
    • of

      public static SnapshotSortKey of(String name)