ensembl-hive  2.7.0
Bio::EnsEMBL::DBSQL::Support::FullIdCache Class Reference
+ Inheritance diagram for Bio::EnsEMBL::DBSQL::Support::FullIdCache:

Public Member Functions

public Hash build_cache ()
 
public put ()
 
public remove ()
 
public clear_cache ()
 
public Object get_by_additional_lookup ()
 
public ArrayRef get_all_by_additional_lookup ()
 
public void remove_from_additional_lookup ()
 
public HashRef compute_keys ()
 
public void add_to_additional_lookups ()
 
protected HashRef _additional_lookup ()
 
- 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 ()
 

Detailed Description

Synopsis

my $obj = $cache->get(21);

Description

An implementation of caching which uses a raw hash to hold all available
values from an adaptor. Useful for working with a controlled vocabulary
table where cardinality is low.

Provides extra functionality to compute additional lookup keys.

Definition at line 22 of file FullIdCache.pm.

Member Function Documentation

◆ _additional_lookup()

protected HashRef Bio::EnsEMBL::DBSQL::Support::FullIdCache::_additional_lookup ( )
  Description : Returns the additional lookup hash
  Example     :
Example of additional hash structure (key is
lookup name, second key is value to search for
and value is an array of dbIDs)
{
logic_name => {
xrefalignment => [1]
},
display_label => {
'Xref Alignment' => [1]
}
}
  Returntype  : HashRef
  Exceptions  : none
  Caller      : BaseAdaptors
  Status      : Beta
 
Code:
click to view

◆ add_to_additional_lookups()

public void Bio::EnsEMBL::DBSQL::Support::FullIdCache::add_to_additional_lookups ( )
  Arg [1]     : String The key used in the primary lookup hash. Normally
                a DB identifier
  Arg [2]     : Object The object to add to the additional lookups
  Description : Internally calls the compute_keys() method and adds
                the object to the _additional_lookup() hash.
  Returntype  : None
  Exceptions  : Thrown if additional lookups are not supported
  Caller      : BaseAdaptors
  Status      : Beta
 
Code:
click to view

◆ build_cache()

public Hash Bio::EnsEMBL::DBSQL::Support::FullIdCache::build_cache ( )
  Description: Builds a cache keyed by dbID and populated from a call
               using generic_fetch()
  Returntype : Hash
  Exceptions : None
  Caller     : BaseAdaptors
  Status     : Beta
 
Code:
click to view

◆ clear_cache()

public Bio::EnsEMBL::DBSQL::Support::FullIdCache::clear_cache ( )

Undocumented method

Code:
click to view

◆ compute_keys()

public HashRef Bio::EnsEMBL::DBSQL::Support::FullIdCache::compute_keys ( )
  Arg [1]     : Object The object to compute keys from
  Description : Override to provide support for additional key lookup. The
                keys of the hash should represent the lookup name and the
                value is the computed key.
  Example     :
Example of returning hash not of its usage. Proposed Analysis encoding
{ logic_name => 'xrefalignment', display_label => 'Xref Alignment'}
  Returntype  : HashRef key is the lookup name and value is the computed key
  Exceptions  : none
  Caller      : BaseAdaptors
  Status      : Beta
 
Code:
click to view

◆ get_all_by_additional_lookup()

public ArrayRef Bio::EnsEMBL::DBSQL::Support::FullIdCache::get_all_by_additional_lookup ( )
  Arg [1]     : String key of the lookup to search for the value in
  Arg [2]     : String value to search for. We expect exact lookups in the hash
  Description : Returns an array of all the objects linked to the value
                in the specified lookup.
  Example     :
my $array = $cache->get_all_by_additional_lookup('logic_name', 'xrefchecksum');
  Returntype  : ArrayRef of objects keyed agains the second argument
  Exceptions  : Throws an exception if there are more than one ID linked to the
                value lookup. Also thrown if additional lookups are not supported
  Caller      : BaseAdaptors
  Status      : Beta
 
Code:
click to view

◆ get_by_additional_lookup()

public Object Bio::EnsEMBL::DBSQL::Support::FullIdCache::get_by_additional_lookup ( )
  Arg [1]     : String key of the lookup to search for the value in
  Arg [2]     : String value to search for. We expect exact lookups in the hash
  Description : Returns the object linked to the value in the specified lookup.
  Example     :
my $analysis = $cache->get_by_additional_lookup('logic_name', 'xrefchecksum');
  Returntype  : Object a single object
  Exceptions  : Throws an exception if there are more than one ID linked to the
                value lookup. Also thrown if additional lookups are not supported 
  Caller      : BaseAdaptors
  Status      : Beta
 
Code:
click to view

◆ put()

public Bio::EnsEMBL::DBSQL::Support::FullIdCache::put ( )

Undocumented method

Code:
click to view

◆ remove()

public Bio::EnsEMBL::DBSQL::Support::FullIdCache::remove ( )

Undocumented method

Code:
click to view

◆ remove_from_additional_lookup()

public void Bio::EnsEMBL::DBSQL::Support::FullIdCache::remove_from_additional_lookup ( )
  Arg [1]     : String The lookup key to remove from the additional lookup hash
  Arg [2]     : Object The object to remove from the additional lookup hash
  Description : Re-computes the additional keys for this object 
  Example     :
$cache->remove_Object_from_additional_lookup($lookup_key, $object);
  Returntype  : None
  Exceptions  : Thrown if we do not support additional lookups
  Caller      : BaseAdaptors
  Status      : Beta
 
Code:
click to view

The documentation for this class was generated from the following file:
usage
public usage()
Bio::EnsEMBL::DBSQL::Support::FullIdCache::remove
public remove()
Bio::EnsEMBL::DBSQL::Support::FullIdCache::clear_cache
public clear_cache()
Bio::EnsEMBL::DBSQL::Support::FullIdCache::build_cache
public Hash build_cache()
Bio::EnsEMBL::DBSQL::Support::FullIdCache::remove_from_additional_lookup
public void remove_from_additional_lookup()
Bio::EnsEMBL::DBSQL::Support::FullIdCache::compute_keys
public HashRef compute_keys()
Bio::EnsEMBL::DBSQL::Support::FullIdCache::get_by_additional_lookup
public Object get_by_additional_lookup()
Bio::EnsEMBL::DBSQL::Support::BaseCache::cache
public Hash cache()
Bio::EnsEMBL::DBSQL::Support::FullIdCache::put
public put()
Bio::EnsEMBL::DBSQL::Support::FullIdCache::get_all_by_additional_lookup
public ArrayRef get_all_by_additional_lookup()
Bio::EnsEMBL::DBSQL::Support::FullIdCache::add_to_additional_lookups
public void add_to_additional_lookups()
Bio::EnsEMBL::DBSQL::Support::BaseCache::new
public Bio::EnsEMBL::DBSQL::Support::BaseCache new()
Bio::EnsEMBL::DBSQL::Support::BaseCache::get
public Scalar get()
Bio::EnsEMBL::DBSQL::Support::FullIdCache
Definition: FullIdCache.pm:22
Bio::EnsEMBL::DBSQL::Support::FullIdCache::_additional_lookup
protected HashRef _additional_lookup()