Class OAbstractRecordCache
java.lang.Object
com.orientechnologies.orient.core.cache.OAbstractRecordCache
- Direct Known Subclasses:
OLocalRecordCache
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 Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected Stringprotected Stringprotected ORecordCache -
Constructor Summary
ConstructorsConstructorDescriptionCreate cache backed by given implementation -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the entire cache by removing all the entriesvoidvoiddeleteRecord(ORID rid) Remove record entryvoidfreeCluster(int cid) Remove all records belonging to specified clusterfreeRecord(ORID rid) Remove record with specified identifierintgetSize()Total number of cached entriesbooleanTell whether cache is enabledvoidsetEnable(boolean enable) Switch cache state between enabled and disabledvoidshutdown()All operations running at cache destruction stagevoidstartup()All operations running at cache initialization stage
-
Field Details
-
underlying
-
profilerPrefix
-
profilerMetadataPrefix
-
excludedCluster
protected int excludedCluster
-
-
Constructor Details
-
OAbstractRecordCache
Create cache backed by given implementation- Parameters:
impl- actual implementation of cache
-
-
Method Details
-
isEnabled
public boolean isEnabled()Tell whether cache is enabled- Returns:
trueif cache enabled at call time, otherwise -false
-
setEnable
public void setEnable(boolean enable) Switch cache state between enabled and disabled- Parameters:
enable- passtrueto enable, otherwise -false
-
freeRecord
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
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()
-