Class Utils.Version
- java.lang.Object
-
- org.apache.accumulo.core.file.rfile.bcfile.Utils.Version
-
- All Implemented Interfaces:
Comparable<Utils.Version>
- Enclosing class:
- Utils
public static final class Utils.Version extends Object implements Comparable<Utils.Version>
A generic Version class. We suggest applications built on top of TFile use this class to maintain version information in their meta blocks. A version number consists of a major version and a minor version. The suggested usage of major and minor version number is to increment major version number when the new storage format is not backward compatible, and increment the minor version otherwise.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Utils.Version that)
boolean
compatibleWith(Utils.Version other)
Test compatibility.boolean
equals(Object other)
int
getMajor()
Get the major version.int
getMinor()
Get the minor version.int
hashCode()
static int
size()
Get the size of the serialized Version object.String
toString()
void
write(DataOutput out)
Write the object to a DataOutput.
-
-
-
Constructor Detail
-
Version
public Version(DataInput in) throws IOException
Construct the Version object by reading from the input stream.- Parameters:
in
- input stream- Throws:
IOException
-
Version
public Version(short major, short minor)
Constructor.- Parameters:
major
- major version.minor
- minor version.
-
-
Method Detail
-
write
public void write(DataOutput out) throws IOException
Write the object to a DataOutput. The serialized format of the Version is major version followed by minor version, both as big-endian short integers.- Parameters:
out
- The DataOutput object.- Throws:
IOException
-
getMajor
public int getMajor()
Get the major version.- Returns:
- Major version.
-
getMinor
public int getMinor()
Get the minor version.- Returns:
- The minor version.
-
size
public static int size()
Get the size of the serialized Version object.- Returns:
- serialized size of the version object.
-
compatibleWith
public boolean compatibleWith(Utils.Version other)
Test compatibility.- Parameters:
other
- The Version object to test compatibility with.- Returns:
- true if both versions have the same major version number; false otherwise.
-
compareTo
public int compareTo(Utils.Version that)
- Specified by:
compareTo
in interfaceComparable<Utils.Version>
-
-