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

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

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

origin: com.orientechnologies/orientdb-core

@Override
public void onStartup() {
 if (INSTANCE == null)
  INSTANCE = new ORecordSaveThreadLocal();
}
origin: com.orientechnologies/orientdb-core

public static ORecord getLast() {
 return INSTANCE.get();
}
origin: com.orientechnologies/orientdb-core

 public static void removeLast() {
  INSTANCE.set(null);
 }
}
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;
}
origin: com.orientechnologies/orientdb-core

public static void setLast(final ORecord document) {
 INSTANCE.set(document);
}
com.orientechnologies.orient.core.serialization.serializer.recordORecordSaveThreadLocal

Javadoc

Thread local to store last document to save. This is used by Auto Merge Conflict Strategy o get he pending record (not visible at storage level).

Most used methods

  • getLast
  • <init>
  • get
  • set

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • 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
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top PhpStorm plugins
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