Class VersionUtils

java.lang.Object
org.opensearch.test.VersionUtils

public class VersionUtils extends Object
Utilities for selecting versions in tests
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static org.opensearch.Version
    Deprecated.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<org.opensearch.Version>
    Returns an immutable, sorted list containing all legacy versions; released and unreleased
    static List<org.opensearch.Version>
    Returns an immutable, sorted list containing all opensearch versions; released and unreleased
    static List<org.opensearch.Version>
    Returns an immutable, sorted list containing all released versions.
    static List<org.opensearch.Version>
    Returns an immutable, sorted list containing all unreleased versions.
    static List<org.opensearch.Version>
    Returns an immutable, sorted list containing all versions, both released and unreleased.
    static org.opensearch.Version
    compatibleFutureVersion(org.opensearch.Version version)
    returns the first future compatible version
    static org.opensearch.Version
    Returns the oldest released Version
    static org.opensearch.Version
    getFirstVersionOfMajor(List<org.opensearch.Version> versions, int major)
     
    static org.opensearch.Version
    Returns the released Version before the Version.CURRENT where the minor version is less than the currents minor version.
    static org.opensearch.Version
    Get the version before Version.CURRENT.
    static org.opensearch.Version
    getPreviousVersion(org.opensearch.Version version)
    Get the version before version.
    static org.opensearch.Version
    getVersion(byte major, byte minor, byte revision)
    Returns a Version with a given major, minor and revision version.
    static org.opensearch.Version
    incompatibleFutureVersion(org.opensearch.Version version)
    returns the first future incompatible version
    static org.opensearch.Version
    lastFirstReleasedMinorFromMajor(List<org.opensearch.Version> allVersions, int major)
    Returns the first released (e.g., patch version 0) Version of the last minor from the requested major version e.g., for version 1.0.0 this would be legacy version (7.10.0); the first release (patch 0), of the last minor (for 7.x that is minor version 10) for the desired major version (7)
    static org.opensearch.Version
    maxCompatibleVersion(org.opensearch.Version version)
    Returns the maximum Version that is compatible with the given version.
    static org.opensearch.Version
    randomCompatibleVersion(Random random, org.opensearch.Version version)
    Returns a random Version from all available versions, that is compatible with the given version.
    static org.opensearch.Version
    Returns a random version index compatible with the current version.
    static org.opensearch.LegacyESVersion
    Return a random LegacyESVersion from all available legacy versions.
    static org.opensearch.Version
    Return a random Version from all available opensearch versions.
    static org.opensearch.Version
    randomPreviousCompatibleVersion(Random random, org.opensearch.Version version)
    Returns a random version index compatible with the given version, but not the given version.
    static org.opensearch.Version
    Returns a random Version from all available versions.
    static org.opensearch.Version
    randomVersionBetween(Random random, org.opensearch.Version minVersion, org.opensearch.Version maxVersion)
    Returns a random Version between minVersion and maxVersion (inclusive).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • V_1_0_0

      @Deprecated public static org.opensearch.Version V_1_0_0
      Deprecated.
  • Constructor Details

    • VersionUtils

      public VersionUtils()
  • Method Details

    • allReleasedVersions

      public static List<org.opensearch.Version> allReleasedVersions()
      Returns an immutable, sorted list containing all released versions.
    • allUnreleasedVersions

      public static List<org.opensearch.Version> allUnreleasedVersions()
      Returns an immutable, sorted list containing all unreleased versions.
    • allVersions

      public static List<org.opensearch.Version> allVersions()
      Returns an immutable, sorted list containing all versions, both released and unreleased.
    • allOpenSearchVersions

      public static List<org.opensearch.Version> allOpenSearchVersions()
      Returns an immutable, sorted list containing all opensearch versions; released and unreleased
    • allLegacyVersions

      public static List<org.opensearch.Version> allLegacyVersions()
      Returns an immutable, sorted list containing all legacy versions; released and unreleased
    • getPreviousVersion

      public static org.opensearch.Version getPreviousVersion(org.opensearch.Version version)
      Get the version before version.
    • getPreviousVersion

      public static org.opensearch.Version getPreviousVersion()
      Get the version before Version.CURRENT.
    • getPreviousMinorVersion

      public static org.opensearch.Version getPreviousMinorVersion()
      Returns the released Version before the Version.CURRENT where the minor version is less than the currents minor version.
    • getFirstVersion

      public static org.opensearch.Version getFirstVersion()
      Returns the oldest released Version
    • getFirstVersionOfMajor

      public static org.opensearch.Version getFirstVersionOfMajor(List<org.opensearch.Version> versions, int major)
    • randomVersion

      public static org.opensearch.Version randomVersion(Random random)
      Returns a random Version from all available versions.
    • randomOpenSearchVersion

      public static org.opensearch.Version randomOpenSearchVersion(Random random)
      Return a random Version from all available opensearch versions.
    • randomLegacyVersion

      public static org.opensearch.LegacyESVersion randomLegacyVersion(Random random)
      Return a random LegacyESVersion from all available legacy versions.
    • lastFirstReleasedMinorFromMajor

      public static org.opensearch.Version lastFirstReleasedMinorFromMajor(List<org.opensearch.Version> allVersions, int major)
      Returns the first released (e.g., patch version 0) Version of the last minor from the requested major version e.g., for version 1.0.0 this would be legacy version (7.10.0); the first release (patch 0), of the last minor (for 7.x that is minor version 10) for the desired major version (7)
    • randomCompatibleVersion

      public static org.opensearch.Version randomCompatibleVersion(Random random, org.opensearch.Version version)
      Returns a random Version from all available versions, that is compatible with the given version.
    • randomVersionBetween

      public static org.opensearch.Version randomVersionBetween(Random random, @Nullable org.opensearch.Version minVersion, @Nullable org.opensearch.Version maxVersion)
      Returns a random Version between minVersion and maxVersion (inclusive).
    • incompatibleFutureVersion

      public static org.opensearch.Version incompatibleFutureVersion(org.opensearch.Version version)
      returns the first future incompatible version
    • compatibleFutureVersion

      public static org.opensearch.Version compatibleFutureVersion(org.opensearch.Version version)
      returns the first future compatible version
    • maxCompatibleVersion

      public static org.opensearch.Version maxCompatibleVersion(org.opensearch.Version version)
      Returns the maximum Version that is compatible with the given version.
    • randomIndexCompatibleVersion

      public static org.opensearch.Version randomIndexCompatibleVersion(Random random)
      Returns a random version index compatible with the current version.
    • randomPreviousCompatibleVersion

      public static org.opensearch.Version randomPreviousCompatibleVersion(Random random, org.opensearch.Version version)
      Returns a random version index compatible with the given version, but not the given version.
    • getVersion

      public static org.opensearch.Version getVersion(byte major, byte minor, byte revision)
      Returns a Version with a given major, minor and revision version. Build version is skipped for the sake of simplicity.