/** * Constructs a DSFIDNotFoundException object with message string. * * @param msg * exception message */ public DSFIDNotFoundException(String msg, int dsfid) { super(msg); this.dsfid = dsfid; this.versionOrdinal = Version.CURRENT.ordinal(); }
public void setVersion(Version v) { this.versionOrdinal = v.ordinal(); }
public final void setVersionObjectForTest(Version v) { this.version = v.ordinal(); this.versionObj = v; netMbr.setVersion(v); }
public int getNumberOfClientsAtVersion(Version version) { return numOfClientsPerVersion.get(version.ordinal()); }
public int getNumberOfClientsAtOrAboveVersion(Version version) { int number = 0; for (int i = version.ordinal(); i < numOfClientsPerVersion.length(); i++) { number += numOfClientsPerVersion.get(i); } return number; }
public void fromData(DataInput in) throws IOException, ClassNotFoundException { fromDataPre_GFE_9_0_0_0(in); // just in case this is just a non-versioned read // from a file we ought to check the version if (this.version >= Version.GFE_90.ordinal()) { try { netMbr.readAdditionalData(in); } catch (EOFException e) { // nope - it's from a pre-GEODE client or WAN site } } }
/** * Finds the Version instance corresponding to the given ordinal and returns * the result of compareTo(Version) * @param other the ordinal of the other Version object * @return negative if this version is older, positive if this version is newer, 0 if this is the same version */ public final int compareTo(short other) { // first try to find the actual Version object Version v = fromOrdinalNoThrow(other, false); if (v == null) { // failing that we use the old method of comparing Versions: return this.ordinal() - other; } return compareTo(v); }
public void toData(DataOutput out) throws IOException { toDataPre_GFE_9_0_0_0(out); if (this.version >= Version.GFE_90.ordinal()) { getNetMember().writeAdditionalData(out); } }
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(); } } }
metadata.set(new Text(Meta.GEMFIRE_VERSION.name()), new Text(String.valueOf(version.ordinal()))); Option optMeta = SequenceFile.Writer.metadata(metadata);
private void writeProductVersionRecord(Version version, OplogFile olf) throws IOException { this.opState.initialize(version.ordinal()); writeOpLogBytes(olf, false, true); olf.currSize += getOpStateSize(); this.dirHolder.incrementTotalOplogSize(getOpStateSize()); }
private void writeGemfireVersion(Version version) { lock.lock(); try { ByteBuffer bb = getIFWriteBuffer(1+3+1); bb.put(IFREC_GEMFIRE_VERSION); Version.writeOrdinal(bb, version.ordinal(), false); bb.put(END_OF_RECORD_ID); writeIFRecord(bb, false); // don't do stats for these small records } catch (IOException ex) { DiskAccessException dae = new DiskAccessException(LocalizedStrings.DiskInitFile_FAILED_INIT_FILE_WRITE_BECAUSE_0.toLocalizedString(ex), this.parent); if (!this.compactInProgress) { this.parent.handleDiskAccessException(dae); } throw dae; } finally { lock.unlock(); } } }
if (this.version >= Version.GFE_90.ordinal()) { try { netMbr.readAdditionalData(in);
this.vmKind, this.vmViewId, this.name, this.groups, this.durableClientAttributes); netMbr = MemberFactory.newNetMember(inetAddr, port, sbEnabled, elCoord, InternalDataSerializer.getVersionForDataStream(in).ordinal(), attr);
private void _readEssentialData(DataInput in) throws IOException, ClassNotFoundException { this.isPartial = true; InetAddress inetAddr = DataSerializer.readInetAddress(in); int port = in.readInt(); this.hostName = SocketCreator.resolve_dns? SocketCreator.getHostName(inetAddr) : inetAddr.getHostAddress(); int flags = in.readUnsignedByte(); boolean sbEnabled = (flags & SB_ENABLED_MASK) != 0; boolean elCoord = (flags & COORD_ENABLED_MASK) != 0; this.vmKind = in.readUnsignedByte(); if (this.vmKind == DistributionManager.LONER_DM_TYPE) { this.uniqueTag = DataSerializer.readString(in); } else { String str = DataSerializer.readString(in); if (str != null) { // backward compatibility from earlier than 6.5 this.vmViewId = Integer.parseInt(str); } } this.name = DataSerializer.readString(in); MemberAttributes attr = new MemberAttributes(this.dcPort, this.vmPid, this.vmKind, this.vmViewId, this.name, this.groups, this.durableClientAttributes); netMbr = MemberFactory.newNetMember(inetAddr, port, sbEnabled, elCoord, InternalDataSerializer.getVersionForDataStream(in).ordinal(), attr); synchPayload(); if (InternalDataSerializer.getVersionForDataStream(in).compareTo(Version.GFE_90)>=0) { netMbr.readAdditionalData(in); } }
Version.writeOrdinal(dos, ServerHandShakeProcessor.currentServerVersion.ordinal(), true);
/** * Removes an existing <code>CacheClientProxy</code> from the list of known * client proxies * * @param proxy * The <code>CacheClientProxy</code> to remove */ protected void removeClientProxy(CacheClientProxy proxy) { // this._logger.info(LocalizedStrings.DEBUG, "removing client proxy " + proxy, new Exception("stack trace")); ClientProxyMembershipID client = proxy.getProxyID(); this._clientProxies.remove(client); this._connectionListener.queueRemoved(); ((GemFireCacheImpl)this.getCache()).cleanupForClient(this, client); if (!(proxy.clientConflation == HandShake.CONFLATION_ON)) { ClientHealthMonitor chm = ClientHealthMonitor.getInstance(); if (chm != null) { chm.numOfClientsPerVersion .decrementAndGet(proxy.getVersion().ordinal()); } } }
private void doHandshake() { //hitesh:to create new connection handshake if (verifyClientConnection()) { // Initialize the commands after the handshake so that the version // can be used. initializeCommands(); //its initialized in verifyClientConnection call if(getCommunicationMode() != Acceptor.GATEWAY_TO_GATEWAY) initializeClientUserAuths(); } if (TEST_VERSION_AFTER_HANDSHAKE_FLAG) { Assert.assertTrue((this.handshake.getVersion().ordinal() == testVersionAfterHandshake), "Found different version after handshake"); TEST_VERSION_AFTER_HANDSHAKE_FLAG = false; } }
/** * Adds a new <code>CacheClientProxy</code> to the list of known client * proxies * * @param proxy * The <code>CacheClientProxy</code> to add */ protected void addClientProxy(CacheClientProxy proxy) throws IOException { // this._logger.info(LocalizedStrings.DEBUG, "adding client proxy " + proxy); getCache(); // ensure cache reference is up to date so firstclient state is correct this._clientProxies.put(proxy.getProxyID(), proxy); // Remove this proxy from the init proxy list. removeClientInitProxy(proxy); this._connectionListener.queueAdded(proxy.getProxyID()); if (!(proxy.clientConflation == HandShake.CONFLATION_ON)) { // Delta not supported with conflation ON ClientHealthMonitor chm = ClientHealthMonitor.getInstance(); /* * #41788 - If the client connection init starts while cache/member is * shutting down, ClientHealthMonitor.getInstance() might return null. */ if (chm != null) { chm.numOfClientsPerVersion.incrementAndGet(proxy.getVersion().ordinal()); } } this.timedOutDurableClientProxies.remove(proxy.getProxyID()); }