Lucy::Index::DataWriter - Write data to an index.
# Abstract base class.
DataWriter is an abstract base class for writing index data, generally in segment-sized chunks. Each component of an index -- e.g. stored fields, lexicon, postings, deletions -- is represented by a DataWriter/DataReader pair.
Components may be specified per index by subclassing Architecture.
my $writer = MyDataWriter->new( snapshot => $snapshot, # required segment => $segment, # required polyreader => $polyreader, # required );
Process a document, previously inverted by
Add content from an existing segment into the one currently being written.
Complete the segment: close all streams, store metadata, etc.
Every writer must specify a file format revision number, which should increment each time the format changes. Responsibility for revision checking is left to the companion DataReader.
Remove a segment's data. The default implementation is a no-op, as all files within the segment directory will be automatically deleted. Subclasses which manage their own files outside of the segment system should override this method and use it as a trigger for cleaning up obsolete data.
Move content from an existing segment into the one currently being written.
The default implementation calls add_segment() then delete_segment().
Arbitrary metadata to be serialized and stored by the Segment. The default implementation supplies a Hash with a single key-value pair for "format".
Accessor for "snapshot" member var.
Accessor for "segment" member var.
Accessor for "polyreader" member var.
Accessor for "schema" member var.
Accessor for "folder" member var.
Lucy::Index::DataWriter isa Lucy::Object::Obj.