MogileFS::Plugin::FileRefs - MogileFS extension
This module provides MogileFS with additional functionality to keep track of multiple uses of an individual dkey. This may be useful for implementing de-duplication in your application.
Takes domain id, dkey, and your reference as arguments.
Creates an association from a key to your reference.
Deletes an association from a key to your reference.
Takes domain id, old dkey and new dkey.
Atomically renames a dkey provided there are no references to it.
Takes domain id, dkey.
Lists all the references against a dkey.
Care has been taken to ensure that it is possible to remove a file, without the danger of a reference being added to it during the deletion process. add_file_ref take a lock, keyed to the domain and key of the reference added. rename_if_no_refs also takes a lock which it holds between checking the reference count and actually doing the renaming, ensuring a reference cannot sneak in.
rename_if_no_refs
If a lock cannot be obtained within the timeout period, a get_key_lock_fail error is returned.
get_key_lock_fail
MogileFS::Server
Dave Lambley, <davel@state51.co.uk>
Copyright (C) 2012 Oscar Music and Media
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.
To install MogileFS::Plugin::FileRefs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MogileFS::Plugin::FileRefs
CPAN shell
perl -MCPAN -e shell install MogileFS::Plugin::FileRefs
For more information on module installation, please visit the detailed CPAN module installation guide.