Class OLocalRecordCache

java.lang.Object
com.orientechnologies.orient.core.cache.OAbstractRecordCache
com.orientechnologies.orient.core.cache.OLocalRecordCache

public class OLocalRecordCache extends OAbstractRecordCache
Local cache. it's one to one with record database instances. It is needed to avoid cases when several instances of the same record will be loaded by user from the same database.
Author:
Luca Garulli (l.garulli--(at)--orientdb.com)
  • Constructor Details

    • OLocalRecordCache

      public OLocalRecordCache()
  • Method Details

    • startup

      public void startup()
      Description copied from class: OAbstractRecordCache
      All operations running at cache initialization stage
      Overrides:
      startup in class OAbstractRecordCache
    • updateRecord

      public void updateRecord(ORecord record)
      Pushes record to cache. Identifier of record used as access key
      Parameters:
      record - record that should be cached
    • findRecord

      public ORecord findRecord(ORID rid)
      Looks up for record in cache by it's identifier. Optionally look up in secondary cache and update primary with found record
      Parameters:
      rid - unique identifier of record
      Returns:
      record stored in cache if any, otherwise - null
    • deleteRecord

      public void deleteRecord(ORID rid)
      Removes record with specified identifier from both primary and secondary caches
      Overrides:
      deleteRecord in class OAbstractRecordCache
      Parameters:
      rid - unique identifier of record
    • shutdown

      public void shutdown()
      Description copied from class: OAbstractRecordCache
      All operations running at cache destruction stage
      Overrides:
      shutdown in class OAbstractRecordCache
    • clear

      public void clear()
      Description copied from class: OAbstractRecordCache
      Clear the entire cache by removing all the entries
      Overrides:
      clear in class OAbstractRecordCache
    • invalidate

      public void invalidate()
      Invalidates the cache emptying all the records.
    • toString

      public String toString()
      Overrides:
      toString in class Object