Package org.elasticsearch
Class Version
java.lang.Object
org.elasticsearch.Version
- All Implemented Interfaces:
java.lang.Comparable<Version>
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
public class Version extends java.lang.Object implements java.lang.Comparable<Version>, org.elasticsearch.common.xcontent.ToXContentFragment
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and Type Method Description boolean
after(Version version)
boolean
before(Version version)
int
compareTo(Version other)
boolean
equals(java.lang.Object o)
static Version
fromId(int id)
static Version
fromString(java.lang.String version)
Returns the version given its string representation, current version if the argument is null or emptystatic java.util.List<Version>
getDeclaredVersions(java.lang.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 elasticsearch version 5.boolean
isBeta()
boolean
isCompatible(Version version)
Returnstrue
iff both version are compatible.boolean
isRC()
boolean
isRelease()
static void
main(java.lang.String[] args)
static Version
max(Version version1, Version version2)
Returns the maximum version between the 2static Version
min(Version version1, Version version2)
Returns the minimum version between the 2.Version
minimumCompatibilityVersion()
Returns the minimum compatible version based on the current version.Version
minimumIndexCompatibilityVersion()
Returns the minimum created index version that this version supports.boolean
onOrAfter(Version version)
boolean
onOrBefore(Version version)
static Version
readVersion(StreamInput in)
java.lang.String
toString()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
static void
writeVersion(Version version, StreamOutput out)
-
Field Details
-
V_EMPTY_ID
public static final int V_EMPTY_ID- See Also:
- Constant Field Values
-
V_EMPTY
-
V_6_0_0_alpha1
-
V_6_0_0_alpha2
-
V_6_0_0_beta1
-
V_6_0_0_beta2
-
V_6_0_0_rc1
-
V_6_0_0_rc2
-
V_6_0_0
-
V_6_0_1
-
V_6_1_0
-
V_6_1_1
-
V_6_1_2
-
V_6_1_3
-
V_6_1_4
-
V_6_2_0
-
V_6_2_1
-
V_6_2_2
-
V_6_2_3
-
V_6_2_4
-
V_6_3_0
-
V_6_3_1
-
V_6_3_2
-
V_6_4_0
-
V_6_4_1
-
V_6_4_2
-
V_6_4_3
-
V_6_5_0
-
V_6_5_1
-
V_6_5_2
-
V_6_5_3
-
V_6_5_4
-
V_6_6_0
-
V_6_6_1
-
V_6_6_2
-
V_6_7_0
-
V_6_7_1
-
V_6_7_2
-
V_6_8_0
-
V_6_8_1
-
V_6_8_2
-
V_6_8_3
-
V_6_8_4
-
V_6_8_5
-
V_6_8_6
-
V_6_8_7
-
V_6_8_8
-
V_6_8_9
-
V_6_8_10
-
V_6_8_11
-
V_6_8_12
-
V_6_8_13
-
V_6_8_14
-
V_6_8_15
-
V_7_0_0
-
V_7_0_1
-
V_7_1_0
-
V_7_1_1
-
V_7_2_0
-
V_7_2_1
-
V_7_3_0
-
V_7_3_1
-
V_7_3_2
-
V_7_4_0
-
V_7_4_1
-
V_7_4_2
-
V_7_5_0
-
V_7_5_1
-
V_7_5_2
-
V_7_6_0
-
V_7_6_1
-
V_7_6_2
-
V_7_7_0
-
V_7_7_1
-
V_7_8_0
-
V_7_8_1
-
V_7_9_0
-
V_7_9_1
-
V_7_9_2
-
V_7_9_3
-
V_7_10_0
-
V_7_10_1
-
V_7_10_2
-
V_7_11_0
-
V_7_11_1
-
V_7_11_2
-
CURRENT
-
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
-
readVersion
- Throws:
java.io.IOException
-
fromId
-
writeVersion
- Throws:
java.io.IOException
-
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
-
compareTo
- Specified by:
compareTo
in interfacejava.lang.Comparable<Version>
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
java.io.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. -
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
public static void main(java.lang.String[] args) -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
isBeta
public boolean isBeta() -
isAlpha
public boolean isAlpha()Returns true iff this version is an alpha version Note: This has been introduced in elasticsearch version 5. 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.
-