Genezzo::Index::bt2 0.64 review

Download
by rbytes.net on

Genezzo::Index::bt2 is a basic btree built of row directory blocks. construct comparison/equality callbacks my $cmp1 = sub

License: Perl Artistic License
File size: 451K
Developer: Jeffrey I. Cohen
0 stars award from rbytes.net

Genezzo::Index::bt2 is a basic btree built of row directory blocks.

construct comparison/equality callbacks

my $cmp1 = sub
{
my ($k1, $k2) = @_;

# NOTE: use "spaceship" (-1,0,1) comparison with
# short-circuit OR (which returns 0 or VALUE, not 0 or 1)
# to perform multi-column key comparison
# a la Schwartzian Transform

return (
( ($k1->[0] $k2->[0])
|| ($k1->[1] $k2->[1])) == -1
);
};

my $eq1 = sub
{
my ($k1, $k2) = @_;
return (($k1->[0] == $k2->[0])
&& ($k1->[1] == $k2->[1])
);
};

SYNOPSIS

use Genezzo::Index::bt?;

my $tt = Genezzo::Index::btree->new();

$tt->insert(1, "hi");
$tt->insert(7, "there");

This btree algorithm is a bottom-up implementation based upon ideas from Chapter 16 of "Algorithms in C++ (third edition)", by Robert Sedgewick, 1998 and Chapter 15, "Access Paths", of "Transaction Processing: Concepts and Techniques" by Jim Gray and Andreas Reuter, 1993. The pedagogical examples use a fixed number of entries per node, or fixed-size keys in each block, but this implementation has significant extensions to support variable numbers of variably-sized keys in fixed-size disk blocks, with the associated error handling, plus support for reverse scans.

Requirements:
Perl

Genezzo::Index::bt2 0.64 keywords