com.gemstone.gemfire.internal.shared.Version.fromOrdinal()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(69)

本文整理了Java中com.gemstone.gemfire.internal.shared.Version.fromOrdinal()方法的一些代码示例,展示了Version.fromOrdinal()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.fromOrdinal()方法的具体详情如下:
包路径:com.gemstone.gemfire.internal.shared.Version
类名称:Version
方法名:fromOrdinal

Version.fromOrdinal介绍

暂无

代码示例

代码示例来源:origin: io.snappydata/gemfire-core

@Override
public DataInputStream getVersionedDataInputStream(DataInputStream instream,
  short version) throws IOException {
 try {
  Version mcastVersion = Version.fromOrdinal(version, false);
  return new VersionedDataInputStream(instream, mcastVersion);
 } catch (UnsupportedGFXDVersionException e) {
  throw new IOException("Unexpected exception during deserialization", e);
 }
}

代码示例来源:origin: io.snappydata/gemfire-core

in = new VersionedDataInputStream(in, Version.fromOrdinal(serverVersion, false)); 
try {
 Object response = DataSerializer.readObject(in);

代码示例来源:origin: io.snappydata/gemfire-core

@Override
public DataOutputStream getVersionedDataOutputStream(DataOutputStream dos, short version) throws IOException {
 try {
  return new VersionedDataOutputStream(dos, Version.fromOrdinal(version, false));
 } catch (UnsupportedGFXDVersionException e) {
  throw new IOException("Unexpected exception during serialization", e);
 }
}

代码示例来源:origin: io.snappydata/gemfire-core

fos = new FileOutputStream(gossipFile);
oos = new ObjectOutputStream(fos);
vos = new VersionedObjectOutput(oos, Version.fromOrdinal((short)
  FILE_FORMAT_TO_GEMFIRE_VERSION_MAP.get(FILE_FORMAT_VERSION),
  false));

代码示例来源:origin: io.snappydata/gemfire-core

clientVersion = Version.fromOrdinal(clientVersionOrdinal, true);

代码示例来源:origin: io.snappydata/gemfire-core

Version clientVersion = null;
try {
 clientVersion = Version.fromOrdinal(clientVersionOrdinal, true);
 if (this._logger.fineEnabled()) {
  this._logger.fine(this + ": Registering client with version: "

代码示例来源:origin: io.snappydata/gemfire-junit

/** basic marshaling test for a Message */
public void testMessageVersioning() throws Exception {
 Version v = Version.fromOrdinal((short)(Version.CURRENT.ordinal()-1), false);
 VersionedIpAddress src = new VersionedIpAddress("localhost", 12345, v);
 Message m = new Message(true);
 m.setSrc(src);
 m.setVersion(v.ordinal()); // set the serialization version
 VersionedHeader header = new VersionedHeader();
 m.putHeader(HEADER_NAME, header);
 ByteArrayOutputStream bos = new ByteArrayOutputStream();
 DataOutputStream out = new DataOutputStream(bos);
 m.writeTo(out);
 Assert.assertTrue(header.serializedVersion == v, "expected header to serialize with older version");
 Assert.assertTrue(src.serializedVersion == v, "expected src address to serialize with older version");
 out.close();
 byte[] result = bos.toByteArray();
 
 ByteArrayInputStream bis = new ByteArrayInputStream(result);
 DataInputStream in = new DataInputStream(bis);
 m = new Message(true);
 m.setVersion(v.ordinal());
 m.readFrom(in);
 header = (VersionedHeader)m.getHeader(HEADER_NAME);
 Assert.assertTrue(header != null, "expected to find a VersionedHeader");
 Assert.assertTrue(header.serializedVersion == v, "expected header to be deserialized with an older version");
 // Deserialization of Messages create IpAddress instances directly, so we can't expect the
 // message to contain a VersionedIpAddress.
}

代码示例来源:origin: io.snappydata/gemfire-core

private Version readProductVersionRecord(DataInput dis, File f)
  throws IOException {
 Version recoveredGFVersion;
 short ver = Version.readOrdinal(dis);
 try {
  recoveredGFVersion = Version.fromOrdinal(ver, false);
 } catch (UnsupportedGFXDVersionException e) {
  throw new DiskAccessException(LocalizedStrings
    .Oplog_UNEXPECTED_PRODUCT_VERSION_0.toLocalizedString(ver), e,
    getParent());
 }
 if (DiskStoreImpl.TRACE_RECOVERY) {
  logger.info(LocalizedStrings.DEBUG, "TRACE_RECOVERY version=" + recoveredGFVersion);
 }
 readEndOfRecord(dis);
 return recoveredGFVersion;
}

代码示例来源:origin: io.snappydata/gemfire-core

/**
 * Handle a {@link DSFIDNotFoundException} indicating a message type is not
 * implemented on another server (for example due to different product
 * version).
 */
protected synchronized void processException(DistributionMessage msg,
  DSFIDNotFoundException ex, ReplyException replyEx) {
 final LogWriterI18n log = this.system.getLogWriterI18n();
 final short versionOrdinal = ex.getProductVersionOrdinal();
 String versionStr = null;
 try {
  Version version = Version.fromOrdinal(versionOrdinal, false);
  versionStr = version.toString();
 } catch (UnsupportedGFXDVersionException e) {
 }
 if (versionStr == null) {
  versionStr = "Ordinal=" + versionOrdinal;
 }
 log.severe(LocalizedStrings.ReplyProcessor21_UNKNOWN_DSFID_ERROR,
   new Object[] { ex.getUnknownDSFID(), msg.getSender(), versionStr }, ex);
 processException(msg, replyEx);
}

代码示例来源:origin: io.snappydata/gemfire-core

log.getLogWriter().fine("Locator reading request from " +
   sock.getInetAddress() + " with version " +
   Version.fromOrdinal(versionOrdinal, false));
input = new VersionedDataInputStream(input, Version.fromOrdinal(
    versionOrdinal, false));
request = DataSerializer.readObject(input);
 if (versionOrdinal != Version.CURRENT_GFE_ORDINAL) {
  output = new VersionedDataOutputStream(output,
    Version.fromOrdinal(versionOrdinal, false));

代码示例来源:origin: io.snappydata/gemfire-core

in = new VersionedDataInputStream(in, Version.fromOrdinal(msg.getVersion(), false));
} catch (UnsupportedGFXDVersionException e) {
 throw new IOException("Unexpected exception during deserialization", e);
 if (0 < msg.getVersion()  &&  msg.getVersion() < Version.CURRENT_ORDINAL) {
  try {
   dis = new VersionedDataInputStream(bais, Version.fromOrdinal(msg.getVersion(), false));
  } catch (UnsupportedGFXDVersionException e) {
   throw new IOException("Unexpected exception during deserialization", e);

代码示例来源:origin: io.snappydata/gemfire-junit

TestUDP udp = new TestUDP();
Version v = Version.fromOrdinal((short)(Version.CURRENT.ordinal()-1), false);
VersionedIpAddress src = new VersionedIpAddress("localhost", 12345, v);
VersionedIpAddress dest = new VersionedIpAddress("localhost", 12347, v);

代码示例来源:origin: io.snappydata/gemfirexd

if (versionOrdinal > 0) {
try {
 this.gfxdClientVersion = Version.fromOrdinal(
   versionOrdinal, false);

代码示例来源:origin: io.snappydata/gemfirexd-core

if (versionOrdinal > 0) {
try {
 this.gfxdClientVersion = Version.fromOrdinal(
   versionOrdinal, false);

代码示例来源:origin: io.snappydata/snappydata-store-core

if (versionOrdinal > 0) {
try {
 this.gfxdClientVersion = Version.fromOrdinal(
   versionOrdinal, false);

代码示例来源:origin: io.snappydata/gemfire-core

gfversion = Version.fromOrdinal(ver, false);
} catch (UnsupportedGFXDVersionException e) {
 throw new DiskAccessException(LocalizedStrings

相关文章