Class LoomVersion
- All Implemented Interfaces:
Serializable, Comparable<LoomVersion>
Supports semantic versioning (major.minor.patch) plus protocol version negotiation. Used during peer handshake to determine compatibility and select protocol version for serialization/deserialization of messages and WAL entries.
Backward compatibility: - CURRENT_VERSION represents the version of this build - MIN_COMPATIBLE_VERSION is the minimum version this build can talk to - Rolling upgrades are supported when versions differ but MIN_COMPATIBLE_VERSION constraints are met
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLoomVersion(String version) LoomVersion(String version, int protocolVersion) LoomVersion(String version, int protocolVersion, String minimumCompatibleVersion) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(LoomVersion other) Comparator based on semantic versioning: major, then minor, then patch.static LoomVersioncurrent()Create a LoomVersion from the current build version.booleanisCompatibleWith(LoomVersion other) Check if this version is compatible with another version.intmajor()static LoomVersionCreate a LoomVersion from minimum compatible version.intminor()intpatch()int
-
Field Details
-
CURRENT_VERSION
- See Also:
-
MIN_COMPATIBLE_VERSION
- See Also:
-
PROTOCOL_VERSION
public static final int PROTOCOL_VERSION- See Also:
-
-
Constructor Details
-
LoomVersion
-
LoomVersion
-
LoomVersion
-
-
Method Details
-
current
Create a LoomVersion from the current build version. -
minCompatible
Create a LoomVersion from minimum compatible version. -
major
public int major() -
minor
public int minor() -
patch
public int patch() -
protocolVersion
public int protocolVersion() -
isCompatibleWith
Check if this version is compatible with another version.This check is directional. The other version must satisfy this version's advertised minimum compatible version. A full bidirectional compatibility check requires both
a.isCompatibleWith(b)andb.isCompatibleWith(a).Two versions are compatible if: 1. Both major versions are equal (major version is breaking change) 2. The other version is >= this version's advertised minimum compatible version
- Parameters:
other- The other version to check compatibility with- Returns:
- true if versions are compatible, false otherwise
-
compareTo
Comparator based on semantic versioning: major, then minor, then patch. For example: 1.0.0 invalid input: '<' 1.0.1 invalid input: '<' 1.1.0 invalid input: '<' 2.0.0- Specified by:
compareToin interfaceComparable<LoomVersion>
-