NAME

Genezzo::BufCa::BufCaElt - Buffer Cache Element

SYNOPSIS

DESCRIPTION

A Buffer Cache Element contains an actual datablock plus some minimal state information: the blocksize, whether the block is in use, and whether the contents have been modified. BufCaElt clients can use GetInfo() to store and retrieve a hash of arbitrary information for each block.

ARGUMENTS

FUNCTIONS

GetInfo - return a reference to the info hash. BCFile uses this hash to store the filenum/blocknum info associated with the current BufCaElt.
_dirty - set/clear the "dirty" bit. Used to indicate if buffer has been modified.
_postinit - Pass a callback to the DirtyScalar tie so the "dirty" bit gets set automatically whenever the buffer is modified. Also, pass a reference to $self so DirtyScalar can use GetInfo to find the current filenum/blocknum and any other interesting information.
_pin - used to pin/unpin a block in the cache via the PinScalar tie. Blocks that are actively referenced must remain "pinned" in the buffer cache, but unreferenced blocks can be freed. If they are "dirty", the modified buffer must be written to disk, else the BufCaElt can simply be re-used.

EXPORT

LIMITATIONS

various

TODO

get fileno, blockno info
deal with multiple pins on same block sanely. We shouldn't be maintaining a reference count scheme here. Shouldn't pin be <= 1, and the destroy cb should set it to zero when last reference is garbage collected?

AUTHOR

Jeffrey I. Cohen, jcohen@genezzo.com

SEE ALSO

perl(1).

Copyright (c) 2003, 2004, 2005 Jeffrey I Cohen. All rights reserved.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Address bug reports and comments to: jcohen@genezzo.com

For more information, please visit the Genezzo homepage at http://www.genezzo.com

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 199:

'=item' outside of any '=over'

Around line 217:

You forgot a '=back' before '=head2'