/** * Return the <code>Version</code> reading from given {@link DataInput} as * serialized by {@link #writeOrdinal(DataOutput, boolean)}. * * If the incoming ordinal is greater than or equal to current ordinal then * this will return null or {@link #CURRENT} indicating that version is same * as that of {@link #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. * * @param in * the {@link DataInput} to read the version from * @param returnNullForCurrent * if true then return null if incoming version >= {@link #CURRENT} * else return {@link #CURRENT} */ public static Version readVersion(DataInput in, boolean returnNullForCurrent) throws IOException { return fromOrdinalNoThrow(readOrdinal(in), returnNullForCurrent); }
@Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.versionOrdinal = Version.readOrdinal(in); int flags = in.readShort(); this.splitBrainEnabled = (flags & SB_ENABLED) != 0; this.preferredForCoordinator = (flags & PREFERRED_FOR_COORD) != 0; this.inetAddr = DataSerializer.readInetAddress(in); this.udpPort = in.readInt(); this.vmViewId = in.readInt(); this.directPort = in.readInt(); this.memberWeight = in.readByte(); this.vmKind = in.readByte(); this.processId = in.readInt(); this.name = DataSerializer.readString(in); this.groups = DataSerializer.readStringArray(in); this.uuidMSBs = in.readLong(); this.uuidLSBs = in.readLong(); }
private void readVersion(int flags, DataInput in) throws IOException { if ((flags & VERSION_MASK) != 0) { this.version = Version.readOrdinal(in); this.versionObj = Version.fromOrdinalNoThrow(this.version, false); } else { // prior to 7.1 member IDs did not serialize their version information Version v = InternalDataSerializer.getVersionForDataStreamOrNull(in); if (v != null) { this.versionObj = v; this.version = v.ordinal(); } } }
private Version readProductVersionRecord(DataInput dis, File f) throws IOException { Version recoveredGFVersion; short ver = Version.readOrdinal(dis); try { recoveredGFVersion = Version.fromOrdinal(ver, false); } catch (UnsupportedVersionException e) { throw new DiskAccessException(LocalizedStrings.Oplog_UNEXPECTED_PRODUCT_VERSION_0.toLocalizedString(ver), e, getParent()); } logger.trace(LogMarker.PERSIST_RECOVERY, "version={}", recoveredGFVersion); readEndOfRecord(dis); return recoveredGFVersion; }
short clientVersionOrdinal = Version.readOrdinal(dis); Version clientVersion = null; try {
jgmsg.getOffset(), jgmsg.getLength())); short ordinal = Version.readOrdinal(dis);
(acceptanceCode == REPLY_EXCEPTION_AUTHENTICATION_REQUIRED || acceptanceCode == REPLY_EXCEPTION_AUTHENTICATION_FAILED)) { short wanSiteVersion = Version.readOrdinal(dis); conn.setWanSiteVersion(wanSiteVersion);
short ver = Version.readOrdinal(dis); readEndOfRecord(dis); if (logger.isTraceEnabled(LogMarker.PERSIST_RECOVERY)) {