1 package DBM::Deep::Iterator::File::BucketList;
6 use warnings FATAL => 'all';
10 DBM::Deep::Iterator::BucketList
14 This is an internal-use-only object for L<DBM::Deep/>. It acts as the mediator
15 between the L<DBM::Deep::Iterator/> object and a L<DBM::Deep::Engine::Sector::BucketList/>
20 This object, despite the implied class hiearchy, does B<NOT> inherit from
21 L<DBM::Deep::Iterator/>. Instead, it delegates to it, essentially acting as a
22 facade over it. L<DBM::Deep::Iterator/get_next_key> will instantiate one of
23 these objects as needed to handle an BucketList sector.
29 The constructor takes a hashref of params and blesses it into the invoking class. The
30 hashref is assumed to have the following elements:
34 =item * iterator (of type L<DBM::Deep::Iterator/>
36 =item * sector (of type L<DBM::Deep::Engine::Sector::BucketList/>
43 my $self = bless $_[1] => $_[0];
44 $self->{curr_index} = 0;
50 This takes no arguments.
52 This returns true/false indicating whether this sector has any more elements that can be
59 return $self->{curr_index} >= $self->{iterator}{engine}->max_buckets;
62 =head2 get_next_iterator()
64 This takes no arguments.
66 This returns the next key pointed to by this bucketlist. This value is suitable for
67 returning by FIRSTKEY or NEXTKEY().
69 If the bucketlist is exhausted, it returns nothing.
76 return if $self->at_end;
78 my $idx = $self->{curr_index}++;
80 my $data_loc = $self->{sector}->get_data_location_for({
85 #XXX Do we want to add corruption checks here?
86 return $self->{sector}->get_key_for( $idx )->data;