Class OLocalRecordCache
java.lang.Object
com.orientechnologies.orient.core.cache.OAbstractRecordCache
com.orientechnologies.orient.core.cache.OLocalRecordCache
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)
-
Field Summary
Fields inherited from class com.orientechnologies.orient.core.cache.OAbstractRecordCache
excludedCluster, profilerMetadataPrefix, profilerPrefix, underlying -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the entire cache by removing all the entriesvoiddeleteRecord(ORID rid) Removes record with specified identifier from both primary and secondary cachesfindRecord(ORID rid) Looks up for record in cache by it's identifier.voidInvalidates the cache emptying all the records.voidshutdown()All operations running at cache destruction stagevoidstartup()All operations running at cache initialization stagetoString()voidupdateRecord(ORecord record) Pushes record to cache.Methods inherited from class com.orientechnologies.orient.core.cache.OAbstractRecordCache
clearRecords, freeCluster, freeRecord, getSize, isEnabled, setEnable
-
Constructor Details
-
OLocalRecordCache
public OLocalRecordCache()
-
-
Method Details
-
startup
public void startup()Description copied from class:OAbstractRecordCacheAll operations running at cache initialization stage- Overrides:
startupin classOAbstractRecordCache
-
updateRecord
Pushes record to cache. Identifier of record used as access key- Parameters:
record- record that should be cached
-
findRecord
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
Removes record with specified identifier from both primary and secondary caches- Overrides:
deleteRecordin classOAbstractRecordCache- Parameters:
rid- unique identifier of record
-
shutdown
public void shutdown()Description copied from class:OAbstractRecordCacheAll operations running at cache destruction stage- Overrides:
shutdownin classOAbstractRecordCache
-
clear
public void clear()Description copied from class:OAbstractRecordCacheClear the entire cache by removing all the entries- Overrides:
clearin classOAbstractRecordCache
-
invalidate
public void invalidate()Invalidates the cache emptying all the records. -
toString
-