Package org.apache.ignite.lang
Class IgniteProductVersion
- java.lang.Object
-
- org.apache.ignite.lang.IgniteProductVersion
-
- All Implemented Interfaces:
Externalizable
,Serializable
,Comparable<IgniteProductVersion>
public class IgniteProductVersion extends Object implements Comparable<IgniteProductVersion>, Externalizable
Represents node version.Node version can be acquired via
ClusterNode.version()
method.Two versions are compared in the following order: major number, minor number, maintenance number, revision timestamp.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
REV_HASH_SIZE
Size of therevHash
static int
SIZE_IN_BYTES
Size in bytes of serialized: 3 bytes (maj, min, maintenance version), 8 bytes - timestamp
-
Constructor Summary
Constructors Constructor Description IgniteProductVersion()
Empty constructor required byExternalizable
.IgniteProductVersion(byte major, byte minor, byte maintenance, long revTs, byte[] revHash)
IgniteProductVersion(byte major, byte minor, byte maintenance, String stage, long revTs, byte[] revHash)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(@NotNull IgniteProductVersion o)
int
compareToIgnoreTimestamp(@NotNull IgniteProductVersion o)
boolean
equals(Object o)
static IgniteProductVersion
fromString(String verStr)
Tries to parse product version from it's string representation.boolean
greaterThanEqual(int major, int minor, int maintenance)
int
hashCode()
byte
maintenance()
Gets maintenance version number.byte
major()
Gets major version number.byte
minor()
Gets minor version number.void
readExternal(ObjectInput in)
Date
releaseDate()
Gets release date.byte[]
revisionHash()
Gets revision hash.long
revisionTimestamp()
Gets revision timestamp.String
stage()
String
toString()
void
writeExternal(ObjectOutput out)
-
-
-
Field Detail
-
REV_HASH_SIZE
public static final int REV_HASH_SIZE
Size of therevHash
- See Also:
- Constant Field Values
-
SIZE_IN_BYTES
public static final int SIZE_IN_BYTES
Size in bytes of serialized: 3 bytes (maj, min, maintenance version), 8 bytes - timestamp- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IgniteProductVersion
public IgniteProductVersion()
Empty constructor required byExternalizable
.
-
IgniteProductVersion
public IgniteProductVersion(byte major, byte minor, byte maintenance, long revTs, byte[] revHash)
- Parameters:
major
- Major version number.minor
- Minor version number.maintenance
- Maintenance version number.revTs
- Revision timestamp.revHash
- Revision hash.
-
IgniteProductVersion
public IgniteProductVersion(byte major, byte minor, byte maintenance, String stage, long revTs, byte[] revHash)
- Parameters:
major
- Major version number.minor
- Minor version number.maintenance
- Maintenance version number.stage
- Stage of development.revTs
- Revision timestamp.revHash
- Revision hash.
-
-
Method Detail
-
major
public byte major()
Gets major version number.- Returns:
- Major version number.
-
minor
public byte minor()
Gets minor version number.- Returns:
- Minor version number.
-
maintenance
public byte maintenance()
Gets maintenance version number.- Returns:
- Maintenance version number.
-
stage
public String stage()
- Returns:
- Stage of development.
-
revisionTimestamp
public long revisionTimestamp()
Gets revision timestamp.- Returns:
- Revision timestamp.
-
revisionHash
public byte[] revisionHash()
Gets revision hash.- Returns:
- Revision hash.
-
releaseDate
public Date releaseDate()
Gets release date.- Returns:
- Release date.
-
greaterThanEqual
public boolean greaterThanEqual(int major, int minor, int maintenance)
- Parameters:
major
- Major version number.minor
- Minor version number.maintenance
- Maintenance version number.- Returns:
True
if this version is greater or equal than the one passed in.
-
compareTo
public int compareTo(@NotNull @NotNull IgniteProductVersion o)
- Specified by:
compareTo
in interfaceComparable<IgniteProductVersion>
-
compareToIgnoreTimestamp
public int compareToIgnoreTimestamp(@NotNull @NotNull IgniteProductVersion o)
- Parameters:
o
- Other version.- Returns:
- Compare result.
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
fromString
public static IgniteProductVersion fromString(String verStr)
Tries to parse product version from it's string representation.- Parameters:
verStr
- String representation of version.- Returns:
- Product version.
-
-