Package org.apache.cassandra.utils
Class CassandraVersion
java.lang.Object
org.apache.cassandra.utils.CassandraVersion
- All Implemented Interfaces:
Comparable<CassandraVersion>
Implements versioning used in Cassandra and CQL.
Note: The following code uses a slight variation from the semver document (http://semver.org).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CassandraVersionstatic final CassandraVersionstatic final CassandraVersionstatic final CassandraVersionstatic final CassandraVersionfinal Supplier<CassandraVersion>final intfinal intfinal intstatic final CassandraVersionUsed to indicate that no previous version information was found.final intstatic final CassandraVersionUsed to indicate that there was a previous version written to the legacy (pre 1.2) system.Versions table, but that we cannot read it. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(CassandraVersion other) intcompareTo(CassandraVersion other, boolean compareToPatchOnly) booleangetBuild()inthashCode()toString()
-
Field Details
-
CASSANDRA_5_0
-
CASSANDRA_4_1
-
CASSANDRA_4_0
-
CASSANDRA_4_0_RC2
-
CASSANDRA_3_4
-
UNREADABLE_VERSION
Used to indicate that there was a previous version written to the legacy (pre 1.2) system.Versions table, but that we cannot read it. Suffice to say, any upgrade should proceed through 1.2.x before upgrading to the current version. -
NULL_VERSION
Used to indicate that no previous version information was found. When encountered, we assume that Cassandra was not previously installed and we're in the process of starting a fresh node. -
major
public final int major -
minor
public final int minor -
patch
public final int patch -
hotfix
public final int hotfix -
familyLowerBound
-
-
Constructor Details
-
CassandraVersion
Parse a version from a string.- Parameters:
version- the string to parse- Throws:
IllegalArgumentException- if the provided string does not represent a version
-
-
Method Details
-
getPreRelease
-
getBuild
-
compareTo
- Specified by:
compareToin interfaceComparable<CassandraVersion>
-
compareTo
-
equals
-
hashCode
public int hashCode() -
toString
-
toMajorMinorString
-