Package org.elasticsearch.test
Class VersionUtils
java.lang.Object
org.elasticsearch.test.VersionUtils
Utilities for selecting versions in tests
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<org.elasticsearch.Version>Returns an immutable, sorted list containing all released versions.static List<org.elasticsearch.Version>Returns an immutable, sorted list containing all unreleased versions.static List<org.elasticsearch.Version>Returns an immutable, sorted list containing all versions, both released and unreleased.static org.elasticsearch.VersioncompatibleFutureVersion(org.elasticsearch.Version version) returns the first future compatible versionstatic org.elasticsearch.VersionReturns the oldest releasedVersionstatic org.elasticsearch.VersionReturns the releasedVersionbefore theVersion.CURRENTwhere the minor version is less than the currents minor version.static org.elasticsearch.VersionGet the released version beforeVersion.CURRENT.static org.elasticsearch.VersiongetPreviousVersion(org.elasticsearch.Version version) Get the released version beforeversion.static org.elasticsearch.VersionmaxCompatibleVersion(org.elasticsearch.Version version) Returns the maximumVersionthat is compatible with the given version.static org.elasticsearch.VersionrandomCompatibleVersion(Random random, org.elasticsearch.Version version) Returns a randomVersionfrom all available versions, that is compatible with the given version.static org.elasticsearch.VersionrandomIndexCompatibleVersion(Random random) Returns a random version index compatible with the current version.static org.elasticsearch.VersionrandomPreviousCompatibleVersion(Random random, org.elasticsearch.Version version) Returns a random version index compatible with the given version, but not the given version.static org.elasticsearch.VersionrandomVersion(Random random) Returns a randomVersionfrom all available versions.static org.elasticsearch.VersionrandomVersionBetween(Random random, org.elasticsearch.Version minVersion, org.elasticsearch.Version maxVersion) Returns a randomVersionbetweenminVersionandmaxVersion(inclusive).
-
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. -
getPreviousVersion
public static org.elasticsearch.Version getPreviousVersion(org.elasticsearch.Version version) Get the released version beforeversion. -
getPreviousVersion
public static org.elasticsearch.Version getPreviousVersion()Get the released version beforeVersion.CURRENT. -
getPreviousMinorVersion
public static org.elasticsearch.Version getPreviousMinorVersion()Returns the releasedVersionbefore theVersion.CURRENTwhere the minor version is less than the currents minor version. -
getFirstVersion
public static org.elasticsearch.Version getFirstVersion()Returns the oldest releasedVersion -
randomVersion
Returns a randomVersionfrom all available versions. -
randomCompatibleVersion
public static org.elasticsearch.Version randomCompatibleVersion(Random random, org.elasticsearch.Version version) Returns a randomVersionfrom all available versions, that is compatible with the given version. -
randomVersionBetween
public static org.elasticsearch.Version randomVersionBetween(Random random, @Nullable org.elasticsearch.Version minVersion, @Nullable org.elasticsearch.Version maxVersion) Returns a randomVersionbetweenminVersionandmaxVersion(inclusive). -
compatibleFutureVersion
public static org.elasticsearch.Version compatibleFutureVersion(org.elasticsearch.Version version) returns the first future compatible version -
maxCompatibleVersion
public static org.elasticsearch.Version maxCompatibleVersion(org.elasticsearch.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.elasticsearch.Version randomPreviousCompatibleVersion(Random random, org.elasticsearch.Version version) Returns a random version index compatible with the given version, but not the given version.
-