Tabnine Logo
ORecordSaveThreadLocal.getLast
Code IndexAdd Tabnine to your IDE (free)

How to use
getLast
method
in
com.orientechnologies.orient.core.serialization.serializer.record.ORecordSaveThreadLocal

Best Java code snippets using com.orientechnologies.orient.core.serialization.serializer.record.ORecordSaveThreadLocal.getLast (Showing top 2 results out of 315)

origin: org.sonatype.nexus/nexus-orient

/**
 * Returns a record containing the original in-conflict changes.
 */
private ODocument getChangeRecord(final ORecordId rid, final byte[] content) {
 // check the 'record-save' cache as it's likely already there
 ODocument record = (ODocument) ORecordSaveThreadLocal.getLast();
 if (record == null || !rid.equals(record.getIdentity())) {
  record = new ODocument(rid).fromStream(content);
 }
 return record;
}
origin: com.orientechnologies/orientdb-core

@Override
public byte[] onUpdate(OStorage storage, byte iRecordType, final ORecordId rid, final int iRecordVersion,
  final byte[] iRecordContent, final AtomicInteger iDatabaseVersion) {
 if (iRecordType == ODocument.RECORD_TYPE) {
  // No need lock, is already inside a lock. Use database to read temporary objects too
  OStorageOperationResult<ORawBuffer> res = storage.readRecord(rid, null, false, false, null);
  final ODocument storedRecord = new ODocument(rid).fromStream(res.getResult().getBuffer());
  ODocument newRecord = (ODocument) ORecordSaveThreadLocal.getLast();
  if (newRecord == null || !newRecord.getIdentity().equals(rid))
   newRecord = new ODocument(rid).fromStream(iRecordContent);
  storedRecord.merge(newRecord, true, true);
  iDatabaseVersion.set(Math.max(iDatabaseVersion.get(), iRecordVersion) + 1);
  return storedRecord.toStream();
 } else
  // NO DOCUMENT, CANNOT MERGE SO RELY TO THE VERSION CHECK
  checkVersions(rid, iRecordVersion, iDatabaseVersion.get());
 return null;
}
com.orientechnologies.orient.core.serialization.serializer.recordORecordSaveThreadLocalgetLast

Popular methods of ORecordSaveThreadLocal

  • <init>
  • get
  • set

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Top plugins for WebStorm
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