Genezzo::SpaceMan::SMFile.pm - File Space Management
Maintain a block header for each file with information on space usage. Each file is composed of *extents*, groups of contiguous blocks. The free extent list is composed of a number of blocknumber/extent length pairs, e.g. the row:
FreeExtents 39:12 19:2
indicates that the current file has free space starting at block 39 of 12 contiguous blocks, plus space of 2 contiguous block starting at block 19.
When an object requests space, SMFile tries to find an exact match in the free list. If it cannot, it carves the requested size from a larger free extent.
return the current active block (insert high water mark) for an object
iterate over the set of *used* blocks for an object. Ignores unused blocks in last extent
count of all blocks associated with the object. Includes allocated, *unused* blocks, plus empty blocks (i.e. blocks with no rows).
check if block is associated with an object
return all of an object's blocks to the freelist
write the contents of block zero to disk. Need to handle case of extent lists spread over multiple blocks.
Jeffrey I. Cohen, jcohen@genezzo.com
perl(1).
Copyright (c) 2003-2007 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Address bug reports and comments to: jcohen@genezzo.com
For more information, please visit the Genezzo homepage at http://www.genezzo.com
To install Genezzo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Genezzo
CPAN shell
perl -MCPAN -e shell install Genezzo
For more information on module installation, please visit the detailed CPAN module installation guide.