-
-
24 Dec 2009 00:10:44 UTC
- Development release
- Distribution: KinoSearch
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (5)
- Testers (68 / 0 / 15)
- Kwalitee
Bus factor: 0- License: perl_5
- Activity
24 month- Tools
- Download (809.92KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Marvin Humphrey <marvin at rectangular dot com>
- Dependencies
- JSON::XS
- Lingua::Stem::Snowball
- Lingua::StopWords
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
KinoSearch::Index::IndexManager - Policies governing index updating, locking, and file deletion.
SYNOPSIS
use Sys::Hostname qw( hostname ); my $hostname = hostname() or die "Can't get unique hostname"; my $manager = KinoSearch::Index::IndexManager->new( hostname => $hostname, ); # Index time: my $indexer = KinoSearch::Indexer->new( index => '/path/to/index', manager => $manager, ); # Search time: my $reader = KinoSearch::Index::IndexReader->open( index => '/path/to/index', manager => $manager, ); my $searcher = KinoSearch::Searcher->new( index => $reader );
DESCRIPTION
Policies governing index updating, locking, and file deletion.
IndexManager is an advanced-usage class for controlling index locking, updating, merging, and deletion behaviors.
IndexManager and Architecture are complementary classes: Architecture is used to define traits and behaviors which cannot change for the life of an index; IndexManager is used for defining rules which may change from process to process.
CONSTRUCTORS
new( [labeled params] )
my $manager = KinoSearch::Index::IndexManager->new( hostname => $hostname, # default: "" );
hostname - An identifier which should be unique per-machine.
lock_factory - A LockFactory.
METHODS
make_write_lock()
Create the Lock which controls access to modifying the logical content of the index.
recycle( [labeled params] )
Return an array of SegReaders representing segments that should be consolidated. Implementations must balance index-time churn against search-time degradation due to segment proliferation. The default implementation prefers small segments or segments with a high proportion of deletions.
reader - A PolyReader.
del_writer - A DeletionsWriter.
cutoff - A segment number which all returned SegReaders must exceed.
optimize - A boolean indicating whether to spend extra time optimizing the index for search-time performance.
set_folder(folder)
Setter for
folder
member, needed by several methods. Typical clients (Indexer, IndexReader) will use this method to install their own Folder instance.get_folder()
Getter for
folder
member.get_hostname()
Getter for
hostname
member.set_write_lock_timeout(timeout)
Setter for write lock timeout. Default: 1000 milliseconds.
get_write_lock_timeout()
Getter for write lock timeout.
set_write_lock_interval(timeout)
Setter for write lock retry interval. Default: 100 milliseconds.
get_write_lock_interval()
Getter for write lock retry interval.
INHERITANCE
KinoSearch::Index::IndexManager isa KinoSearch::Obj.
COPYRIGHT AND LICENSE
Copyright 2005-2009 Marvin Humphrey
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install KSx::Simple, copy and paste the appropriate command in to your terminal.
cpanm KSx::Simple
perl -MCPAN -e shell install KSx::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.