KinoSearch::Store::LockFactoryKinoSearch::Store::LockFactory Perl module can create Locks. | |
Download |
KinoSearch::Store::LockFactory Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Marvin Humphrey
- Publisher web site:
- http://search.cpan.org/~creamyg/KinoSearch-0.162/lib/KinoSearch/Search/SearchServer.pm
KinoSearch::Store::LockFactory Tags
KinoSearch::Store::LockFactory Description
KinoSearch::Store::LockFactory Perl module can create Locks. KinoSearch::Store::LockFactory Perl module can create Locks.SYNOPSIS use Sys::Hostname; my $hostname = hostname(); die "Can't get unique hostname" unless $hostname; my $invindex = MySchema->open('/path/to/invindex/on/nfs/volume'); my $lock_factory = KinoSearch::Store::LockFactory->new( folder => $invindex->get_folder, agent_id => $hostname, ); my $index_reader = KinoSearch::Index::IndexReader->new( invindex => $invindex, lock_factory => $lock_factory, );Normally, LockFactory is an internal class, quietly doing its work behind the scenes. On shared volumes, however, the locking mechanism fails, and manual intervention becomes necessary.Both reading and writing applications accessing an index on a shared volume need to identify themselves with an agent_id, typically the hostname. Knowing the hostname makes it possible to tell which lockfiles belong to other machines and therefore must not be zapped when their pid can't be found.SubclassingLockFactory spins off Lock and SharedLock objects at the request of other KinoSearch classes. If the behavior of Lock and SharedLock do not suit your needs, you may substitute a custom subclass of LockFactory which spins off your own Lock subclasses.CONSTRUCTOR my $lock_factory = KinoSearch::Store::LockFactory->new( folder => $folder, # required agent_id => $hostname, # required );Create a LockFactory. Takes named parameters.folder - A KinoSearch::Store::Folder.agent_id - An identifying string -- typically, the hostname. Requirements: · Perl
KinoSearch::Store::LockFactory Related Software