Tabnine Logo
NumericVersion.getVersion
Code IndexAdd Tabnine to your IDE (free)

How to use
getVersion
method
in
org.infinispan.container.versioning.NumericVersion

Best Java code snippets using org.infinispan.container.versioning.NumericVersion.getVersion (Showing top 6 results out of 315)

origin: org.infinispan/infinispan-server-hotrod

public static long extractVersion(CacheEntry ce) {
 if (ce == null) return -1;
 EntryVersion entryVersion = ce.getMetadata().version();
 long version = 0;
 if (entryVersion != null) {
   if (entryVersion instanceof NumericVersion) {
    version = NumericVersion.class.cast(entryVersion).getVersion();
   }
   if (entryVersion instanceof SimpleClusteredVersion) {
    version = SimpleClusteredVersion.class.cast(entryVersion).getVersion();
   }
 }
 return version;
}
origin: org.infinispan/infinispan-server-memcached

private ByteBuf buildSingleGetWithVersionResponse(byte[] k, CacheEntry<byte[], byte[]> entry) {
 byte[] v = entry.getValue();
 // TODO: Would be nice for EntryVersion to allow retrieving the version itself...
 byte[] version = String.valueOf(((NumericVersion) entry.getMetadata().version()).getVersion()).getBytes();
 ByteBuf buf = buildGetHeaderBegin(k, entry, version.length + 1 + END_SIZE);
 buf.writeByte(SP); // 1
 buf.writeBytes(version); // version.length
 writeGetHeaderData(v, buf);
 return writeGetHeaderEnd(buf);
}
origin: org.infinispan/infinispan-server-hotrod

@Override
public byte[] convert(byte[] key, byte[] oldValue, Metadata oldMetadata, byte[] newValue, Metadata newMetadata, EventType eventType) {
 int capacity = UnsignedNumeric.sizeUnsignedInt(key.length) + key.length +
    (newValue != null ? UnsignedNumeric.sizeUnsignedInt(newValue.length) + newValue.length + 8 : 0);
 if (newValue == null && returnOldValue && oldValue != null) {
   capacity += UnsignedNumeric.sizeUnsignedInt(oldValue.length) + oldValue.length + 8;
 }
 byte[] out = new byte[capacity];
 int offset = UnsignedNumeric.writeUnsignedInt(out, 0, key.length);
 offset += putBytes(key, offset, out);
 if (newValue != null) {
   offset += UnsignedNumeric.writeUnsignedInt(out, offset, newValue.length);
   offset += putBytes(newValue, offset, out);
   putLong(((NumericVersion) newMetadata.version()).getVersion(), offset, out);
 }
 if (newValue == null && returnOldValue && oldValue != null) {
   offset += UnsignedNumeric.writeUnsignedInt(out, offset, oldValue.length);
   offset += putBytes(oldValue, offset, out);
   putLong(((NumericVersion) newMetadata.version()).getVersion(), offset, out);
 }
 return out;
}
origin: org.infinispan/infinispan-server-hotrod

private long serverDataVersion(byte[] k, Cache cache) {
 CacheEntry cacheEntry = cache.getAdvancedCache().getCacheEntry(k);
 Metadata metadata = cacheEntry.getMetadata();
 EntryVersion version = metadata.version();
 return ((NumericVersion) version).getVersion();
}
origin: org.infinispan/infinispan-server-hotrod

@CacheEntryCreated
@CacheEntryModified
@CacheEntryRemoved
@CacheEntryExpired
public void onCacheEvent(CacheEntryEvent<byte[], byte[]> event) {
  if (isSendEvent(event)) {
   long version;
   Metadata metadata;
   if ((metadata = event.getMetadata()) != null && metadata.version() != null) {
     version = ((NumericVersion) metadata.version()).getVersion();
   } else {
     version = 0;
   }
   Object k = event.getKey();
   Object v = event.getValue();
   sendEvent((byte[]) k, (byte[]) v, version, event);
  }
}
origin: org.infinispan/infinispan-server-hotrod

long version;
if (numericVersion != null) {
 version = numericVersion.getVersion();
} else {
 version = 0;
org.infinispan.container.versioningNumericVersiongetVersion

Popular methods of NumericVersion

  • <init>
  • compareTo

Popular in Java

  • Making http requests using okhttp
  • startActivity (Activity)
  • setScale (BigDecimal)
  • getSharedPreferences (Context)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now