Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

kiokudb::linker(3pm) [debian man page]

KiokuDB::Linker(3pm)					User Contributed Perl Documentation				      KiokuDB::Linker(3pm)

NAME
KiokuDB::Linker - Relinks live objects from storage entries SYNOPSIS
# mostly internal DESCRIPTION
The linker reconnects entry data, recreating the connected object graph in memory. The linkage process starts with an ID (or several IDs) to be loaded passed to the "get_or_load_objects" method. This ID will first be searched for in the live object set (KiokuDB::LiveObjects). If the object is already live, then it will be returned as is. If the object is not live, then the corresponding entry is fetched from the backend, and expanded into an actual instance. Expansion consults the KiokuDB::TypeMap using KiokuDB::TypeMap::Resolver, to find the correct typemap entry (see "COLLAPSING STRATEGIES" in KiokuDB::Collapser and KiokuDB::TypeMap), and that is used for the actual expansion. Most of the grunt work is delegated by the entries back to the linker using the "inflate_data" method, which handles circular structures, retrying of tied structures, etc. Inflated objects are registered with KiokuDB::LiveObjects, and get inserted into the current live object scope (KiokuDB::LiveObjects::Scope). The scope's job is to maintain a reference count of at least 1 for any loaded object, until it is destroyed itself. This ensures that weak references are not destroyed prematurely, but allows their use in order to avoid memory leaks. perl v5.12.4 2010-10-11 KiokuDB::Linker(3pm)

Check Out this Related Man Page

KiokuDB::LiveObjects(3pm)				User Contributed Perl Documentation				 KiokuDB::LiveObjects(3pm)

NAME
KiokuDB::LiveObjects - Live object set tracking SYNOPSIS
$live_objects->insert( $entry => $object ); $live_objects->insert( $id => $object ); my $id = $live_objects->object_to_id( $object ); my $obj = $live_objects->id_to_object( $id ); my $scope = $live_objects->new_scope; DESCRIPTION
This object keeps track of the set of live objects, their associated IDs, and the storage entries. ATTRIBUTES
clear_leaks Boolean. Defaults to false. If true, when the last known scope is removed but some objects are still live they will be removed from the live object set. Note that this does NOT prevent leaks (memory cannot be reclaimed), it merely prevents stale objects from staying loaded. leak_tracker This is a coderef or object. If any objects are leaked (see "clear_leaks") then the this can be used to report them, or to break the circular structure. When an object is provided the "leaked_objects" method is called. The coderef is simply invoked with the objects as arguments. Triggered after "clear_leaks" causes "clear" to be called. For example, to break cycles you can use Data::Structure::Util's "circular_off" function: use Data::Structure::Util qw(circular_off); $dir->live_objects->leak_tracker(sub { my @leaked_objects = @_; circular_off($_) for @leaked_objects; }); keep_entries EXPERIMENTAL When true (the default), KiokuDB::Entries loaded from the backend or created by the collapser are kept around. This results in a considerable memory overhead, so it's no longer required. METHODS
insert Takes pairs, id or entry as the key, and object as the value, registering the objects. objects_to_ids object_to_id Given objects, returns their IDs, or undef for objects which not registered. objects_to_entries object_to_entry Given objects, find the corresponding entries. ids_to_objects id_to_object Given IDs, find the corresponding objects. ids_to_entries Given IDs, find the corresponding entries. update_entries Given entries, replaces the live entries of the corresponding objects with the newly updated ones. The objects must already be in the live object set. This method is called on a successful transaction commit. new_scope Creates a new KiokuDB::LiveObjects::Scope, with the current scope as its parent. current_scope The current KiokuDB::LiveObjects::Scope instance. This is the scope into which newly registered objects are pushed. new_txn Creates a new KiokuDB::LiveObjects::TXNScope, with the current txn scope as its parent. txn_scope The current KiokuDB::LiveObjects::TXNScope. clear Forces a clear of the live object set. This removes all objects and entries, and can be useful in the case of leaks (to prevent false positives on lookups). Note that this does not actually break the circular structures, so the leak is unresolved, but the objects are no longer considered live by the KiokuDB instance. live_entries live_objects live_ids Enumerates the live entries, objects or ids. rollback_entries Called by "rollback" in KiokuDB::LiveObjects::TXNScope. remove Removes entries from the live object set. remove_scope $scope Removes a scope from the set of known scopes. Also calls "detach_scope", and calls "KiokuDB::LiveObjects::Scope/clear" on the scope itself. detach_scope $scope Detaches $scope if it's the current scope. This prevents "push" from being called on this scope object implicitly anymore. perl v5.12.4 2011-03-31 KiokuDB::LiveObjects(3pm)
Man Page