Class OAbstractRecordCache

java.lang.Object
com.orientechnologies.orient.core.cache.OAbstractRecordCache
Direct Known Subclasses:
OLocalRecordCache

public abstract class OAbstractRecordCache extends Object
Cache of documents. Delegates real work on storing to ORecordCache implementation passed at creation time leaving only DB specific functionality
Author:
Luca Garulli (l.garulli--(at)--orientdb.com)
  • Field Details

    • underlying

      protected ORecordCache underlying
    • profilerPrefix

      protected String profilerPrefix
    • profilerMetadataPrefix

      protected String profilerMetadataPrefix
    • excludedCluster

      protected int excludedCluster
  • Constructor Details

    • OAbstractRecordCache

      public OAbstractRecordCache(ORecordCache impl)
      Create cache backed by given implementation
      Parameters:
      impl - actual implementation of cache
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Tell whether cache is enabled
      Returns:
      true if cache enabled at call time, otherwise - false
    • setEnable

      public void setEnable(boolean enable)
      Switch cache state between enabled and disabled
      Parameters:
      enable - pass true to enable, otherwise - false
    • freeRecord

      public ORecord freeRecord(ORID rid)
      Remove record with specified identifier
      Parameters:
      rid - unique identifier of record
      Returns:
      record stored in cache if any, otherwise - null
    • freeCluster

      public void freeCluster(int cid)
      Remove all records belonging to specified cluster
      Parameters:
      cid - identifier of cluster
    • deleteRecord

      public void deleteRecord(ORID rid)
      Remove record entry
      Parameters:
      rid - unique record identifier
    • clear

      public void clear()
      Clear the entire cache by removing all the entries
    • getSize

      public int getSize()
      Total number of cached entries
      Returns:
      non-negative integer
    • startup

      public void startup()
      All operations running at cache initialization stage
    • shutdown

      public void shutdown()
      All operations running at cache destruction stage
    • clearRecords

      public void clearRecords()