View on
MetaCPAN
search.cpan.org is shutting down
For details read Perl NOC. After June 25th this page will redirect to MetaCPAN.org
Jeffrey Cohen > Genezzo > Genezzo::SpaceMan::SMExtent.pm

Download:
Genezzo-0.72.tar.gz

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Source  

NAME ^

Genezzo::SpaceMan::SMExtent.pm - Extent Space Management

SYNOPSIS ^

DESCRIPTION ^

This module contains the space management hooks for Genezzo::Block::RDBlock basic block operations. Any insert/update/delete operation which modifies a block might change the space usage. All minor changes are reflected in the local block XHP (eXtent Header Position) record. Any changes greater than ~30% are reflected in the extent header XHA (eXtent Header _A_), which has a bitvec to track every block in the extent. Larger changes must propagate to the segment header (or subheader) X1A (eXtent FIRST _A_), which tracks space usage for every extent in the segment.

Space management must balance efficient space usage against update costs/concurrency issues. Frequently updating the extent headers and segment headers provides more accurate information on actual block usage, but these blocks become a point of contention when multiple updates are running simultaneously. If the extent and segment headers are updated infrequently, space managment might allocate new extents unnecessarily because it doesn't know that free space is still available, or worst-case, it may attempt to re-use blocks which are already full. The basic pushhash (see Genezzo::PushHash::hph routines are designed to be robust if an operation runs out of space, so this situation is not insurmountable.

Need hooks to update segment header. Allocating space without updating the segment header is fine, since the operation to obtain new free blocks can view the list of extents with free blocks in the segment header, and then it can probe the extent headers to check if space is still available. The converse problem is that deletes may free up blocks or even entire extents, and this information must get back to the segment header so it knows that space is available. At minimum, an operation which causes an extent to transition from full to at least one block free should update the segment header.

FUNCTIONS ^

_track_usage

update local block XHP (eXtent Header Position) with new percent used

block_push_hook

call track_usage to update after new row pushed in block

block_store_hook

call track_usage to update after new row stored in block

block_delete_hook

call track_usage to update after row deleted from block

block_pre_untie_hook

if current block is the extent header, update now, else setup Contrib data structs to pass usage info to post_untie

block_post_untie_hook

use the usage info from pre_untie to update the extent header

block_post_tie_hook

store the initial usage info for the block. block_pre_untie_hook will compare the current usage with the previous in order to determine whether the extent header update is necessary.

EXPORT

TODO ^

better error handling
better error handling

AUTHOR ^

Jeffrey I. Cohen, jcohen@genezzo.com

SEE ALSO ^

Genezzo::Block::RDBlock, perl(1).

Copyright (c) 2006, 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

syntax highlighting: