Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

cache::cachemetadata(3pm) [debian man page]

Cache::CacheMetaData(3pm)				User Contributed Perl Documentation				 Cache::CacheMetaData(3pm)

NAME
Cache::CacheMetaData -- data about objects in the cache DESCRIPTION
The CacheMetaData object is used by size aware caches to keep track of the state of the cache and effeciently return information such as an objects size or an ordered list of indentifiers to be removed when a cache size is being limited. End users will not normally use CacheMetaData directly. SYNOPSIS
use Cache::CacheMetaData; my $cache_meta_data = new Cache::CacheMetaData( ); foreach my $key ( $cache->get_keys( ) ) { my $object = $cache->get_object( $key ) or next; $cache_meta_data->insert( $object ); } my $current_size = $cache_meta_data->get_cache_size( ); my @removal_list = $cache_meta_data->build_removal_list( ); METHODS
new( ) Construct a new Cache::CacheMetaData object insert( $object ) Inform the CacheMetaData about the object $object in the cache. remove( $key ) Inform the CacheMetaData that the object specified by $key is no longer in the cache. build_removal_list( ) Create a list of the keys in the cache, ordered as follows: 1) objects that expire now 2) objects expiring at a particular time, with ties broken by the time at which they were least recently accessed 3) objects that never expire, sub ordered by the time at which they were least recently accessed NOTE: This could be improved further by taking the size into account on accessed_at ties. However, this type of tie is unlikely in normal usage. build_object_size( $key ) Return the size of an object specified by $key. PROPERTIES
get_cache_size The total size of the objects in the cache SEE ALSO
Cache::Cache, Cache::CacheSizer, Cache::SizeAwareCache AUTHOR
Original author: DeWitt Clinton <dewitt@unto.net> Last author: $Author: dclinton $ Copyright (C) 2001-2003 DeWitt Clinton perl v5.12.4 2009-03-01 Cache::CacheMetaData(3pm)

Check Out this Related Man Page

Cache::SizeAwareCache(3pm)				User Contributed Perl Documentation				Cache::SizeAwareCache(3pm)

NAME
Cache::SizeAwareCache -- extends the Cache interface. DESCRIPTION
The SizeAwareCache interface is implemented by classes that support all of the Cache::Cache interface in addition to the limit_size and max_size features of a size aware cache. The default cache size limiting algorithm works by removing cache objects in the following order until the desired limit is reached: 1) objects that have expired 2) objects that are least recently accessed 3) objects that that expire next SYNOPSIS
use Cache::SizeAwareCache; use vars qw( @ISA ); @ISA = qw( Cache::SizeAwareCache ); CONSTANTS
Please see Cache::Cache for standard constants $NO_MAX_SIZE The cache has no size restrictions METHODS
Please see Cache::Cache for the standard methods limit_size( $new_size ) Attempt to resize the cache such that the total disk usage is under the $new_size parameter. $new_size represents t size (in bytes) that the cache should be limited to. Note that this is only a one time adjustment. To maintain the cache size, consider using the max_size option, although it is considered very expensive, and can often be better achieved by peridocally calling limit_size. OPTIONS
Please see Cache::Cache for the standard options max_size Sets the max_size property (size in bytes), which is described in detail below. Defaults to $NO_MAX_SIZE. PROPERTIES
Please see Cache::Cache for standard properties (get|set)_max_size If this property is set, then the cache will try not to exceed the max size value (in bytes) specified. NOTE: This causes the size of the cache to be checked on every set, and can be considered *very* expensive in some implementations. A good alternative approach is leave max_size as $NO_MAX_SIZE and to periodically limit the size of the cache by calling the limit_size( $size ) method. SEE ALSO
Cache::Cache AUTHOR
Original author: DeWitt Clinton <dewitt@unto.net> Last author: $Author: dclinton $ Copyright (C) 2001-2003 DeWitt Clinton perl v5.12.4 2009-03-01 Cache::SizeAwareCache(3pm)
Man Page