Class VersionUtils
java.lang.Object
org.opensearch.test.VersionUtils
Utilities for selecting versions in tests
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<org.opensearch.Version> Returns an immutable, sorted list containing all legacy versions; released and unreleasedstatic List<org.opensearch.Version> Returns an immutable, sorted list containing all opensearch versions; released and unreleasedstatic 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.VersioncompatibleFutureVersion(org.opensearch.Version version) returns the first future compatible versionstatic org.opensearch.VersionReturns the oldest releasedVersionstatic org.opensearch.VersiongetFirstVersionOfMajor(List<org.opensearch.Version> versions, int major) static org.opensearch.VersionReturns the releasedVersionbefore theVersion.CURRENTwhere the minor version is less than the currents minor version.static org.opensearch.VersionGet the version beforeVersion.CURRENT.static org.opensearch.VersiongetPreviousVersion(org.opensearch.Version version) Get the version beforeversion.static org.opensearch.VersiongetVersion(byte major, byte minor, byte revision) Returns aVersionwith a given major, minor and revision version.static org.opensearch.VersionincompatibleFutureVersion(org.opensearch.Version version) returns the first future incompatible versionstatic org.opensearch.VersionlastFirstReleasedMinorFromMajor(List<org.opensearch.Version> allVersions, int major) Returns the first released (e.g., patch version 0)Versionof 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.VersionmaxCompatibleVersion(org.opensearch.Version version) Returns the maximumVersionthat is compatible with the given version.static org.opensearch.VersionrandomCompatibleVersion(Random random, org.opensearch.Version version) Returns a randomVersionfrom all available versions, that is compatible with the given version.static org.opensearch.VersionrandomIndexCompatibleVersion(Random random) Returns a random version index compatible with the current version.static org.opensearch.LegacyESVersionrandomLegacyVersion(Random random) Return a randomLegacyESVersionfrom all available legacy versions.static org.opensearch.VersionrandomOpenSearchVersion(Random random) Return a randomVersionfrom all available opensearch versions.static org.opensearch.VersionrandomPreviousCompatibleVersion(Random random, org.opensearch.Version version) Returns a random version index compatible with the given version, but not the given version.static org.opensearch.VersionrandomVersion(Random random) Returns a randomVersionfrom all available versions.static org.opensearch.VersionrandomVersionBetween(Random random, org.opensearch.Version minVersion, org.opensearch.Version maxVersion) Returns a randomVersionbetweenminVersionandmaxVersion(inclusive).
-
Field Details
-
V_1_0_0
Deprecated.
-
-
Constructor Details
-
VersionUtils
public VersionUtils()
-
-
Method Details
-
allReleasedVersions
Returns an immutable, sorted list containing all released versions. -
allUnreleasedVersions
Returns an immutable, sorted list containing all unreleased versions. -
allVersions
Returns an immutable, sorted list containing all versions, both released and unreleased. -
allOpenSearchVersions
Returns an immutable, sorted list containing all opensearch versions; released and unreleased -
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 beforeversion. -
getPreviousVersion
public static org.opensearch.Version getPreviousVersion()Get the version beforeVersion.CURRENT. -
getPreviousMinorVersion
public static org.opensearch.Version getPreviousMinorVersion()Returns the releasedVersionbefore theVersion.CURRENTwhere the minor version is less than the currents minor version. -
getFirstVersion
public static org.opensearch.Version getFirstVersion()Returns the oldest releasedVersion -
getFirstVersionOfMajor
public static org.opensearch.Version getFirstVersionOfMajor(List<org.opensearch.Version> versions, int major) -
randomVersion
Returns a randomVersionfrom all available versions. -
randomOpenSearchVersion
Return a randomVersionfrom all available opensearch versions. -
randomLegacyVersion
Return a randomLegacyESVersionfrom 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)Versionof 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 randomVersionfrom 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 randomVersionbetweenminVersionandmaxVersion(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 maximumVersionthat is compatible with the given version. -
randomIndexCompatibleVersion
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 aVersionwith a given major, minor and revision version. Build version is skipped for the sake of simplicity.
-