public final class Version extends Object implements Comparable<Version>
| Modifier and Type | Field and Description |
|---|---|
static Version |
CURRENT
This constant must be set to the most current version of GFE/GFXD.
|
static short |
CURRENT_ORDINAL
A lot of versioning code needs access to the current version's ordinal
|
static Version |
GFE_56 |
static Version |
GFE_57 |
static Version |
GFE_58 |
static Version |
GFE_603 |
static Version |
GFE_61 |
static Version |
GFE_65 |
static Version |
GFE_651 |
static Version |
GFE_6516 |
static Version |
GFE_66 |
static Version |
GFE_662 |
static Version |
GFE_6622 |
static Version |
GFE_70 |
static Version |
GFE_701 |
static Version |
GFE_7099
This is the GemFire conterpart of GFXD_1099 for testing rolling upgrades
and it uses the same ordinal as GFE_701 to maintain compatibility with the
ordinals being used on GemFireXD branch.
|
static Version |
GFE_71 |
static Version |
GFE_75 |
static Version |
GFXD_10 |
static Version |
GFXD_101 |
static Version |
GFXD_1011 |
static Version |
GFXD_13 |
static Version |
GFXD_1302 |
static Version |
GFXD_14 |
static Version |
GFXD_20 |
static short |
NOT_SUPPORTED_ORDINAL |
static int |
NUM_OF_VERSIONS |
static Version |
SQLF_1099
This version is an intermediate one created to test rolling upgrades.
|
static Version |
SQLF_11
SQLFire 1.1 has a separate version since it has changed the RowFormatter
formatting for ALTER TABLE add/drop column support.
|
static Version |
TEST_VERSION |
static Version |
TOKEN |
static String |
Version_REMOTE_VERSION_NOT_SUPPORTED |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(short other)
Finds the Version instance corresponding to the given ordinal and returns
the result of compareTo(Version)
|
int |
compareTo(Version o) |
boolean |
compatibleWith(Version version)
Returns whether this
Version is compatible with the input
Version |
int |
compressedSize()
Fixed number of bytes required for serializing this version when
"compressed" flag is true in
writeOrdinal(DataOutput, boolean). |
boolean |
equals(Object other) |
boolean |
equals(Version other) |
static Version |
fromBytes(byte[] bytes) |
static Version |
fromOrdinal(short ordinal,
boolean forGFEClients)
Return the
Version represented by specified ordinal |
static Version |
fromOrdinalCheck(short ordinal,
boolean returnNullForCurrent)
Return the
Version represented by specified ordinal while not
throwing exception if given ordinal is higher than any known ones. |
static Version |
fromOrdinalOrCurrent(short ordinal)
return the version corresponding to the given ordinal, or CURRENT if the
ordinal isn't valid
|
Version |
getGemFireVersion() |
short |
getMajorVersion() |
String |
getMethodSuffix() |
short |
getMinorVersion() |
String |
getName() |
short |
getPatch() |
String |
getProductName() |
short |
getRelease() |
int |
hashCode() |
short |
ordinal() |
static short |
readOrdinal(DataInput in)
Reads ordinal as written by
writeOrdinal(java.io.DataOutput, short, boolean) from given
DataInput. |
static short |
readOrdinalFromInputStream(InputStream is)
Reads ordinal as written by
writeOrdinal(java.io.DataOutput, short, boolean) from given
InputStream. |
static Version |
readVersion(DataInput in,
boolean returnNullForCurrent)
|
byte[] |
toBytes() |
String |
toString()
Returns a string representation for this
Version. |
static String |
toString(short ordinal) |
static int |
uncompressedSize()
Fixed number of bytes required for serializing this version when
"compressed" flag is false in
writeOrdinal(DataOutput, boolean). |
static void |
writeOrdinal(ByteBuffer buffer,
short ordinal,
boolean compressed)
Write the given ordinal (result of
ordinal()) to given
ByteBuffer. |
void |
writeOrdinal(DataOutput out,
boolean compressed)
|
static void |
writeOrdinal(DataOutput out,
short ordinal,
boolean compressed)
Write the given ordinal (result of
ordinal()) to given
DataOutput. |
public static final String Version_REMOTE_VERSION_NOT_SUPPORTED
public static final int NUM_OF_VERSIONS
public static final Version TOKEN
public static final Version GFE_56
public static final Version GFE_57
public static final Version GFE_58
public static final Version GFE_603
public static final Version GFE_61
public static final Version GFE_65
public static final Version GFE_651
public static final Version GFE_6516
public static final Version GFE_66
public static final Version GFE_662
public static final Version GFE_6622
public static final Version GFE_70
public static final Version GFE_701
public static final Version SQLF_1099
GFXD_11 in all respects except for artifical
changes in a couple of P2P messages and marking as compatible with GFE_701.public static final Version GFE_7099
public static final Version SQLF_11
public static final Version GFE_71
public static final Version GFE_75
public static final Version GFXD_10
public static final Version GFXD_101
public static final Version GFXD_1011
public static final Version GFXD_13
public static final Version GFXD_1302
public static final Version GFXD_14
public static final Version GFXD_20
public static final Version CURRENT
public static final short CURRENT_ORDINAL
public static final short NOT_SUPPORTED_ORDINAL
public static final Version TEST_VERSION
public static Version fromOrdinal(short ordinal, boolean forGFEClients) throws UnsupportedGFXDVersionException
Version represented by specified ordinalUnsupportedGFXDVersionExceptionpublic static Version fromOrdinalOrCurrent(short ordinal)
ordinal - public static void writeOrdinal(DataOutput out, short ordinal, boolean compressed) throws IOException
ordinal()) to given
DataOutput. This keeps the serialization of ordinal compatible with
previous versions writing a single byte to DataOutput when possible, and a
token with 2 bytes if it is large.out - the DataOutput to write the ordinal write toordinal - the version to be writtencompressed - if true, then use single byte for ordinal < 128, and three bytes
for beyond that, else always use three bytes where the first byte
is TOKEN_ORDINAL; former mode is useful for
interoperatibility with previous versions while latter to use
fixed size for writing version; typically former will be used for
P2P/client-server communications while latter for persisting to
disk; we use the token to ensure that
readOrdinal(DataInput) can deal with both
compressed/uncompressed cases seemlesslyIOExceptionpublic final void writeOrdinal(DataOutput out, boolean compressed) throws IOException
Version's ordinal (result of ordinal()) to
given DataOutput. This keeps the serialization of ordinal
compatible with previous versions writing a single byte to DataOutput when
possible, and a token with 2 bytes if it is large.out - the DataOutput to write the ordinal write tocompressed - if true, then use single byte for ordinal < 128, and three bytes
for beyond that, else always use three bytes where the first byte
is TOKEN_ORDINAL; former mode is useful for
interoperatibility with previous versions while latter to use
fixed size for writing version; typically former will be used for
P2P/client-server communications while latter for persisting to
disk; we use the token to ensure that
readOrdinal(DataInput) can deal with both
compressed/uncompressed cases seemlesslyIOExceptionpublic static final int uncompressedSize()
writeOrdinal(DataOutput, boolean).public final int compressedSize()
writeOrdinal(DataOutput, boolean).public static void writeOrdinal(ByteBuffer buffer, short ordinal, boolean compressed) throws IOException
ordinal()) to given
ByteBuffer. This keeps the serialization of ordinal compatible with
previous versions writing a single byte to DataOutput when possible, and a
token with 2 bytes if it is large.buffer - the ByteBuffer to write the ordinal write toordinal - the version to be writtencompressed - if true, then use single byte for ordinal < 128, and three bytes
for beyond that, else always use three bytes where the first byte
is TOKEN_ORDINALIOExceptionpublic static short readOrdinal(DataInput in) throws IOException
writeOrdinal(java.io.DataOutput, short, boolean) from given
DataInput.IOExceptionpublic static Version readVersion(DataInput in, boolean returnNullForCurrent) throws UnsupportedGFXDVersionException, IOException
Version reading from given DataInput as
serialized by writeOrdinal(DataOutput, boolean).
If the incoming ordinal is greater than or equal to current ordinal then
this will return null or CURRENT indicating that version is same
as that of CURRENT assuming that peer will support this JVM.
This method is not meant to be used for client-server protocol since
servers cannot support higher version clients, rather is only meant for
P2P/JGroups messaging where a mixed version of servers can be running at
the same time. Similarly cannot be used when recovering from disk since
higher version data cannot be read.in - the DataInput to read the version fromreturnNullForCurrent - if true then return null if incoming version >= CURRENT
else return CURRENTUnsupportedGFXDVersionExceptionIOExceptionpublic static Version fromOrdinalCheck(short ordinal, boolean returnNullForCurrent) throws UnsupportedGFXDVersionException
Version represented by specified ordinal while not
throwing exception if given ordinal is higher than any known ones.UnsupportedGFXDVersionExceptionpublic static short readOrdinalFromInputStream(InputStream is) throws IOException
writeOrdinal(java.io.DataOutput, short, boolean) from given
InputStream. Returns -1 on end of stream.IOExceptionpublic Version getGemFireVersion()
public final String getMethodSuffix()
public final String getProductName()
public final String getName()
public final short getMajorVersion()
public final short getMinorVersion()
public final short getRelease()
public final short getPatch()
public final short ordinal()
public boolean compatibleWith(Version version)
Version is compatible with the input
Versionversion - The Version to compareVersion is compatible with the input
Versionpublic final int compareTo(short other)
other - the ordinal of the other Version objectpublic final int compareTo(Version o)
compareTo in interface Comparable<Version>public String toString()
Version.public static String toString(short ordinal)
public byte[] toBytes()
public static Version fromBytes(byte[] bytes) throws UnsupportedGFXDVersionException
UnsupportedGFXDVersionExceptionpublic boolean equals(Version other)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.