FlatFile-DataStore
view release on metacpan or search on metacpan
lib/FlatFile/DataStore.pm view on Meta::CPAN
datamax=1G (1 Gig)
Finally, with 'M' or 'G', you can use fractions, e.g.
datamax=.5M (500_000)
datamax=1.9G (1_900_000_000)
=item keymax
The keymax parameter gives the number of record keys that may be stored
in a key file. This simply limits the size of the key files, e.g.,
keymax=10_000
The maximum bytes would be:
keymax * (preamble length + recsep length)
The numeric value may use underscores and 'M' or 'G' as described above
for datamax.
=item tocmax
The tocmax parameter gives the number of data file entries that may be stored
in a toc (table of contents) file. This simply limits the size of the toc
files, e.g.,
tocmax=10_000
Each (fairly short) line in a toc file describes a single data file, so
you would need a tocmax only in the extreme case of a datastore with
thousands or millions of data files.
The numeric value may use underscores and 'M' or 'G' as described above
for datamax.
=item dirmax
The dirmax parameter gives the number of files (and directories) that
may be stored in a datastore directory, e.g.,
dirmax=300
This allows a large number of data files (and key/toc files) to be
created without there being too many files in a single directory.
(The numeric value may use underscores and 'M' or 'G' as described above
for datamax.)
If you specify dirmax without dirlev (see below), dirlev will default
to 1.
Without dirmax and dirlev, a datastore's data files (and key/toc files)
will reside in the same directory as the uri file, and the module will
not limit how many you may create (though the size of your filesystem
might).
With dirmax and dirlev, these files will reside in subdirectories.
Giving a value for dirmax will also limit the number of data files (and
key/toc files) a datastore may have, by this formula:
max files = dirmax ** (dirlev + 1)
So dirmax=300 and dirlev=1 would result in a limit of 90,000 data
files. If you go to dirlev=2, the limit becomes 27,000,000, which is
why you're unlikely to need a dirlev greater than 2.
=item dirlev
The dirlev parameter gives the number of levels of directories that a
datastore may use, e.g.,
dirlev=1
You can give a dirlev without a dirmax, which would store the data
files (and key/toc files) in subdirectories, but wouldn't limit how
many files may be in each directory.
=item userdata
The userdata parameter is similar to the userdata parameter in the call
to new(). It specifies the default value to use if the application
does not provide a value when creating, updating, or deleting a
record.
Those provided values will override the value given in the call to new(),
which will override the value given here in the uri.
If you don't specify a default value here or in the call to new(), the
value defaults to a null string (which would be padded with spaces).
userdata=:
The example is contrived for a hypothetical datastore that doesn't need
this field. Since the field is required, the above setting will always
store a colon (and the user parameter might be C<user=1-:>).
=back
=head1 CAVEATS
This module is still in an experimental state. The tests are sparse.
When I start using it in production, I'll bump the version to 1.00.
Until then (afterwards, too) please use with care.
=head1 AUTHOR
Brad Baxter, E<lt>bbaxter@cpan.orgE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2011 by Brad Baxter
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.8 or,
at your option, any later version of Perl 5 you may have available.
=cut
( run in 0.811 second using v1.01-cache-2.11-cpan-39bf76dae61 )