
public interface ORecordCache
public class CustomCache implements OCache {
public CustomCache(int initialLimit) {
// some actions to do basic initialization of cache instance
...
}
//implementation of interface
...
}
As reference implementation used ORecordCacheWeakRefs| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Remove all records from cache
|
boolean |
disable()
Disable cache.
|
boolean |
enable()
Enable cache
|
ORecord |
get(ORID id)
Look up for record in cache by it's identifier
|
boolean |
isEnabled()
Tell whether cache is enabled
|
Collection<ORID> |
keys()
Keys of all stored in cache records
|
ORecord |
put(ORecord record)
Push record to cache.
|
ORecord |
remove(ORID id)
Remove record with specified identifier
|
void |
shutdown()
All operations running at cache destruction stage
|
int |
size()
Total number of stored records
|
void |
startup()
All operations running at cache initialization stage
|
void startup()
void shutdown()
boolean isEnabled()
true if cache enabled at call time, otherwise - falseboolean enable()
true - if enabled, false - otherwise (already enabled)boolean disable()
true - if disabled, false - otherwise (already disabled)ORecord get(ORID id)
id - unique identifier of recordnullORecord put(ORecord record)
record - record that should be cachedORecord remove(ORID id)
id - unique identifier of recordnullvoid clear()
int size()
Collection<ORID> keys()
Copyright © 2009–2025 OrientDB. All rights reserved.