|
ensembl-hive
2.7.0
|
Inheritance diagram for Bio::EnsEMBL::DBSQL::Support::LruIdCache:Public Member Functions | |
| public Bio::EnsEMBL::DBSQL::Support::BaseCache | new () |
| public Int | lru_size () |
| public Bio::EnsEMBL::Utils::Cache | build_cache () |
| public Scalar | get () |
| public ArrayRef | get_by_list () |
Public Member Functions inherited from Bio::EnsEMBL::DBSQL::Support::BaseCache | |
| public Bio::EnsEMBL::DBSQL::Support::BaseCache | new () |
| public Bio::EnsEMBL::DBSQL::BaseAdaptor | adaptor () |
| public Hash | cache () |
| public void | delete_cache () |
| public Scalar | get () |
| public ArrayRef | get_by_list () |
| public ArrayRef | get_by_sql () |
| public Scalar | put () |
| public Scalar | remove () |
| public void | clear_cache () |
| public List | cache_keys () |
| public List | cached_values () |
| public Int | size () |
| public Hash | build_cache () |
An implementation of caching which uses the oldest accessed key as the value to be ejected from the cache when the maximum size has been hit. See the following page for more information about this algorithm http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used
Definition at line 27 of file LruIdCache.pm.
| public Bio::EnsEMBL::Utils::Cache Bio::EnsEMBL::DBSQL::Support::LruIdCache::build_cache | ( | ) |
Description: Returns an instance of Bio::EnsEMBL::Utils::Cache and sized according to the return value in lru_cache() Returntype : Bio::EnsEMBL::Utils::Cache Exceptions : none Caller : BaseAdaptors Status : Beta
Code:
| public Scalar Bio::EnsEMBL::DBSQL::Support::LruIdCache::get | ( | ) |
Arg [1] : String key to retrieve Example :
Description: Retrieves the value held in the cache. If the value is not in
the cache we will retrieve the value from
_uncached_fetch_by_dbID and then store that value
Returntype : Scalar value held in the cache or nothing if the ID was not present
Exceptions : If key was undefined
Caller : BaseAdaptors
Status : Beta
Code:
| public ArrayRef Bio::EnsEMBL::DBSQL::Support::LruIdCache::get_by_list | ( | ) |
Arg [1] : ArrayRef keys to retrieve Arg [2] : Bio::EnsEMBL::Slice optional attribute for _uncached_fetch_all_by_dbID_list() delegation Example :
Description: Attempts to retrieve all values currently available in the cache,
fetches any remaining values and stores these in the cache.
Returntype : ArrayRef of found values
Exceptions : None
Caller : BaseAdaptors
Status : Beta
Code:
| public Int Bio::EnsEMBL::DBSQL::Support::LruIdCache::lru_size | ( | ) |
Arg [1] : Int size of the cache Example :
Description: Resets the size of the cache and forces a rebuild of the cache
object to apply this new sizing. Also functions as a getter
Returntype : Int
Exceptions : none
Caller : BaseAdaptors
Status : Beta
Code:
| public Bio::EnsEMBL::DBSQL::Support::BaseCache Bio::EnsEMBL::DBSQL::Support::LruIdCache::new | ( | ) |
Arg [1] : Bio::EnsEMBL::DBSQL::BaseAdaptor $db_adaptor Arg [2] : Int size of the cache. Defaults to 1000 Example :
Description: Creates a new cache class instance Returntype : Bio::EnsEMBL::DBSQL::Support::BaseCache Exceptions : none Caller : BaseAdaptors Status : Beta
Code: