|
ensembl-hive
2.8.1
|
Inheritance diagram for Bio::EnsEMBL::DBSQL::Support::BaseCache:Public Member Functions | |
| 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 () |
A base class used for holding methods common to all cache implementations. Never use this class to do direct caching instead use one of the following =over 8 =item Bio::EnsEMBL::DBSQL::Support::LruIdCache =item Bio::EnsEMBL::DBSQL::Support::FullIdCache =back To provide exta functionality to the caches you should override one of the above classes and extend. Caches work when you use inheritence by composition in their target adaptor.
Definition at line 55 of file BaseCache.pm.
| public Bio::EnsEMBL::DBSQL::BaseAdaptor Bio::EnsEMBL::DBSQL::Support::BaseCache::adaptor | ( | ) |
Arg [1] : Bio::EnsEMBL::DBSQL::BaseAdaptor $db_adaptor Description: Getter setter for the adaptor this serves as an ID cacher for Returntype : Bio::EnsEMBL::DBSQL::BaseAdaptor Exceptions : none Caller : BaseAdaptors Status : Beta
Code:
| public Hash Bio::EnsEMBL::DBSQL::Support::BaseCache::build_cache | ( | ) |
Description: Implement to return the required type of cache Returntype : Hash Exceptions : None Caller : BaseAdaptors Status : Beta
Code:
| public Hash Bio::EnsEMBL::DBSQL::Support::BaseCache::cache | ( | ) |
Description: Returns back a Hash implementing object and also calls
build_cache() for an initialise on demand system
Returntype : Hash
Exceptions : none
Caller : BaseAdaptors and internal
Status : Beta
Code:
| public List Bio::EnsEMBL::DBSQL::Support::BaseCache::cache_keys | ( | ) |
Example :
Description: Returns all keys held by the cache Returntype : List of all available keys Exceptions : None Caller : BaseAdaptors Status : Beta
Code:
| public List Bio::EnsEMBL::DBSQL::Support::BaseCache::cached_values | ( | ) |
Example :
Description: Returns all values held by the cache Returntype : List of all available values Exceptions : None Caller : BaseAdaptors Status : Beta
Code:
| public void Bio::EnsEMBL::DBSQL::Support::BaseCache::clear_cache | ( | ) |
Example :
Description: Removes all values from the cache but does not delete the cache
instance
Returntype : None
Exceptions : None
Caller : BaseAdaptors
Status : Beta
Code:
| public void Bio::EnsEMBL::DBSQL::Support::BaseCache::delete_cache | ( | ) |
Example :
Description: Deletes the cache. Normally used to trigger a build_cache() call Returntype : none Exceptions : none Caller : BaseAdaptors Status : Beta
Code:
| public Scalar Bio::EnsEMBL::DBSQL::Support::BaseCache::get | ( | ) |
Arg [1] : String key to retrieve Example :
Description: Retrieves the value held in the cache. Can return undef if the
value could not be found
Returntype : Scalar value held in the cache or nothing
Exceptions : If key was undefined
Caller : BaseAdaptors
Status : Beta
Code:
| public ArrayRef Bio::EnsEMBL::DBSQL::Support::BaseCache::get_by_list | ( | ) |
Arg [1] : ArrayRef keys to retrieve Example :
Description: Retrieves the values held in the cache. If a key cannot be
found you get no entry in the resulting array returned.
Returntype : ArrayRef of found values
Exceptions : If the given ArrayRef was undefined
Caller : BaseAdaptors
Status : Beta
Code:
| public ArrayRef Bio::EnsEMBL::DBSQL::Support::BaseCache::get_by_sql | ( | ) |
Arg [1] : String SQL to execute. Should return the key of this cache in column 1 Arg [2] : ArrayRef Parameters to bind to the specified query Example :
Description: Executes the given SQL statement against the construnction adaptor's
backing database. The found IDs are then passed into get_by_list()
where the elements are returned should the cache hold them. Remember if the cache is un-aware of the key or the specific
implementation used cannot perform database lookups based on cache misses
you will not be able to retrieve the object in question.
Returntype : ArrayRef of found values
Exceptions : Thrown if SQL and parameters are empty and not the expected types. All
other exceptions come from DBI/SQL operations.
Caller : BaseAdaptors
Status : Beta
Code:
| public Bio::EnsEMBL::DBSQL::Support::BaseCache Bio::EnsEMBL::DBSQL::Support::BaseCache::new | ( | ) |
Arg [1] : Bio::EnsEMBL::DBSQL::BaseAdaptor $db_adaptor Example :
Description: Creates a new cache class which handles all the basics of
working with a cache apart from what that cache implementation
is (apart from a hash)
Returntype : Bio::EnsEMBL::DBSQL::Support::BaseCache
Exceptions : none
Caller : BaseAdaptors
Status : Beta
Code:
| public Scalar Bio::EnsEMBL::DBSQL::Support::BaseCache::put | ( | ) |
Arg [1] : String key to store Arg [2] : Scalar value to store Example :
Description: Stores a value in the cache. Returns the previous value held
under that key if one existed
Returntype : Scalar of the previously held value if one existed
Exceptions : If key was undefined
Caller : BaseAdaptors
Status : Beta
Code:
| public Scalar Bio::EnsEMBL::DBSQL::Support::BaseCache::remove | ( | ) |
Arg [1] : String key to remove Example :
Description: Removes the supplied key from the cache Returntype : Scalar value held in the cache or nothing Exceptions : If key was undefined Caller : BaseAdaptors Status : Beta
Code:
| public Int Bio::EnsEMBL::DBSQL::Support::BaseCache::size | ( | ) |
Example :
Description: Returns the number of keys currrently held by the cache Returntype : Int $size Exceptions : None Caller : BaseAdaptors Status : Beta
Code: