Package org.opensearch
Class Version
java.lang.Object
org.opensearch.Version
- All Implemented Interfaces:
Comparable<Version>
,ToXContent
,ToXContentFragment
- Direct Known Subclasses:
LegacyESVersion
@PublicApi(since="1.0.0")
public class Version
extends Object
implements Comparable<Version>, ToXContentFragment
OpenSearch Version Class
- Opensearch.api:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal byte
static final Version
final int
final org.apache.lucene.util.Version
final byte
static final int
final byte
final byte
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final Version
static final int
Fields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
int
compareMajor
(Version other) int
static int
computeID
(int major, int minor, int revision, int build) static int
computeLegacyID
(int major, int minor, int revision, int build) protected Version
boolean
static Version
fromId
(int id) static Version
fromString
(String version) Returns the version given its string representation, current version if the argument is null or emptygetDeclaredVersions
(Class<?> versionClass) Extracts a sorted list of declared version constants from a class.int
hashCode()
boolean
isAlpha()
Returns true iff this version is an alpha version Note: This has been introduced in version 5 of the OpenSearch predecessor.boolean
isBeta()
boolean
isCompatible
(Version version) Returnstrue
iff both version are compatible.boolean
isRC()
boolean
static void
protected int
maskId
(int id) this is used to ensure the version id for new versions of OpenSearch are always less than the predecessor versionsstatic Version
Returns the maximum version between the 2static Version
Returns the minimum version between the 2.Returns the minimum compatible version based on the current version.Returns the minimum created index version that this version supports.boolean
boolean
onOrBefore
(Version version) static boolean
stringHasLength
(String str) Check that the given String is neithernull
nor of length 0.toString()
toXContent
(XContentBuilder builder, ToXContent.Params params) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opensearch.core.xcontent.ToXContentFragment
isFragment
-
Field Details
-
V_EMPTY_ID
public static final int V_EMPTY_ID- See Also:
-
V_EMPTY
-
V_1_0_0
-
V_1_1_0
-
V_1_2_0
-
V_1_2_1
-
V_1_2_2
-
V_1_2_3
-
V_1_2_4
-
V_1_2_5
-
V_1_3_0
-
V_1_3_1
-
V_1_3_2
-
V_1_3_3
-
V_1_3_4
-
V_1_3_5
-
V_1_3_6
-
V_1_3_7
-
V_1_3_8
-
V_1_3_9
-
V_1_3_10
-
V_1_3_11
-
V_1_3_12
-
V_1_3_13
-
V_1_3_14
-
V_2_0_0
-
V_2_0_1
-
V_2_0_2
-
V_2_1_0
-
V_2_1_1
-
V_2_2_0
-
V_2_2_1
-
V_2_2_2
-
V_2_3_0
-
V_2_3_1
-
V_2_4_0
-
V_2_4_1
-
V_2_4_2
-
V_2_5_0
-
V_2_5_1
-
V_2_6_0
-
V_2_6_1
-
V_2_7_0
-
V_2_7_1
-
V_2_8_0
-
V_2_8_1
-
V_2_9_0
-
V_2_9_1
-
V_2_10_0
-
V_2_10_1
-
V_2_11_0
-
CURRENT
-
MASK
public static final int MASK- See Also:
-
id
public final int id -
major
public final byte major -
minor
public final byte minor -
revision
public final byte revision -
build
public final byte build -
luceneVersion
public final org.apache.lucene.util.Version luceneVersion
-
-
Method Details
-
fromId
-
computeLegacyID
public static int computeLegacyID(int major, int minor, int revision, int build) -
computeID
public static int computeID(int major, int minor, int revision, int build) -
min
Returns the minimum version between the 2. -
max
Returns the maximum version between the 2 -
fromString
Returns the version given its string representation, current version if the argument is null or empty -
after
-
onOrAfter
-
before
-
onOrBefore
-
compareMajor
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Version>
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceToXContent
- Throws:
IOException
-
minimumCompatibilityVersion
Returns the minimum compatible version based on the current version. Ie a node needs to have at least the return version in order to communicate with a node running the current version. The returned version is in most of the cases the smallest major version release unless the current version is a beta or RC release then the version itself is returned. -
computeMinCompatVersion
-
maskId
protected int maskId(int id) this is used to ensure the version id for new versions of OpenSearch are always less than the predecessor versions -
minimumIndexCompatibilityVersion
Returns the minimum created index version that this version supports. Indices created with lower versions can't be used with this version. This should also be used for file based serialization backwards compatibility ie. on serialization code that is used to read / write file formats like transaction logs, cluster state, and index metadata. -
isCompatible
Returnstrue
iff both version are compatible. Otherwisefalse
-
main
-
toString
-
equals
-
hashCode
public int hashCode() -
isBeta
public boolean isBeta() -
isAlpha
public boolean isAlpha()Returns true iff this version is an alpha version Note: This has been introduced in version 5 of the OpenSearch predecessor. Previous versions will never have an alpha version. -
isRC
public boolean isRC() -
isRelease
public boolean isRelease() -
getDeclaredVersions
Extracts a sorted list of declared version constants from a class. The argument would normally be Version.class but is exposed for testing with other classes-containing-version-constants. -
stringHasLength
Check that the given String is neithernull
nor of length 0. Note: Will returntrue
for a String that purely consists of whitespace.
-