Lucene++ - a full-featured, c++ search engine
API Documentation


Loading...
Searching...
No Matches
Data Structures | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
Lucene::CompoundFileWriter Class Reference

Combines multiple files into a single compound file. The file format: VInt fileCount {Directory} fileCount entries with the following structure: int64_t dataOffset String fileName {File Data} fileCount entries with the raw data of the corresponding file. More...

#include <CompoundFileWriter.h>

+ Inheritance diagram for Lucene::CompoundFileWriter:

Data Structures

struct  FileEntry
 

Public Member Functions

 CompoundFileWriter (const DirectoryPtr &dir, const String &name, const CheckAbortPtr &checkAbort=CheckAbortPtr())
 
virtual ~CompoundFileWriter ()
 
virtual String getClassName ()
 
boost::shared_ptr< CompoundFileWritershared_from_this ()
 
DirectoryPtr getDirectory ()
 Returns the directory of the compound file.
 
String getName ()
 Returns the name of the compound file.
 
void addFile (const String &file)
 Add a source stream. file is the string by which the sub-stream will be known in the compound stream.
 
void close ()
 Merge files with the extensions added up to now. All files with these extensions are combined sequentially into the compound stream. After successful merge, the source are deleted.files.
 
- Public Member Functions inherited from Lucene::LuceneObject
virtual ~LuceneObject ()
 
virtual void initialize ()
 Called directly after instantiation to create objects that depend on this object being fully constructed.
 
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Return clone of this object.
 
virtual int32_t hashCode ()
 Return hash code for this object.
 
virtual bool equals (const LuceneObjectPtr &other)
 Return whether two objects are equal.
 
virtual int32_t compareTo (const LuceneObjectPtr &other)
 Compare two objects.
 
virtual String toString ()
 Returns a string representation of the object.
 
- Public Member Functions inherited from Lucene::LuceneSync
virtual ~LuceneSync ()
 
virtual SynchronizePtr getSync ()
 Return this object synchronize lock.
 
virtual LuceneSignalPtr getSignal ()
 Return this object signal.
 
virtual void lock (int32_t timeout=0)
 Lock this object using an optional timeout.
 
virtual void unlock ()
 Unlock this object.
 
virtual bool holdsLock ()
 Returns true if this object is currently locked by current thread.
 
virtual void wait (int32_t timeout=0)
 Wait for signal using an optional timeout.
 
virtual void notifyAll ()
 Notify all threads waiting for signal.
 

Static Public Member Functions

static String _getClassName ()
 

Protected Member Functions

void copyFile (const FileEntry &source, const IndexOutputPtr &os, ByteArray buffer)
 Copy the contents of the file with specified extension into the provided output stream. Use the provided buffer for moving data to reduce memory allocation.
 
- Protected Member Functions inherited from Lucene::LuceneObject
 LuceneObject ()
 

Protected Attributes

DirectoryWeakPtr _directory
 
String fileName
 
HashSet< String > ids
 
Collection< FileEntryentries
 
bool merged
 
CheckAbortPtr checkAbort
 
- Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr objectLock
 
LuceneSignalPtr objectSignal
 

Detailed Description

Combines multiple files into a single compound file. The file format: VInt fileCount {Directory} fileCount entries with the following structure: int64_t dataOffset String fileName {File Data} fileCount entries with the raw data of the corresponding file.

The fileCount integer indicates how many files are contained in this compound file. The {directory} that follows has that many entries. Each directory entry contains a long pointer to the start of this file's data section, and a string with that file's name.

Constructor & Destructor Documentation

◆ CompoundFileWriter()

Lucene::CompoundFileWriter::CompoundFileWriter ( const DirectoryPtr dir,
const String &  name,
const CheckAbortPtr checkAbort = CheckAbortPtr() 
)

◆ ~CompoundFileWriter()

virtual Lucene::CompoundFileWriter::~CompoundFileWriter ( )
virtual

Member Function Documentation

◆ _getClassName()

static String Lucene::CompoundFileWriter::_getClassName ( )
inlinestatic

◆ addFile()

void Lucene::CompoundFileWriter::addFile ( const String &  file)

Add a source stream. file is the string by which the sub-stream will be known in the compound stream.

◆ close()

void Lucene::CompoundFileWriter::close ( )

Merge files with the extensions added up to now. All files with these extensions are combined sequentially into the compound stream. After successful merge, the source are deleted.files.

◆ copyFile()

void Lucene::CompoundFileWriter::copyFile ( const FileEntry source,
const IndexOutputPtr os,
ByteArray  buffer 
)
protected

Copy the contents of the file with specified extension into the provided output stream. Use the provided buffer for moving data to reduce memory allocation.

◆ getClassName()

virtual String Lucene::CompoundFileWriter::getClassName ( )
inlinevirtual

◆ getDirectory()

DirectoryPtr Lucene::CompoundFileWriter::getDirectory ( )

Returns the directory of the compound file.

◆ getName()

String Lucene::CompoundFileWriter::getName ( )

Returns the name of the compound file.

◆ shared_from_this()

boost::shared_ptr< CompoundFileWriter > Lucene::CompoundFileWriter::shared_from_this ( )
inline

Field Documentation

◆ _directory

DirectoryWeakPtr Lucene::CompoundFileWriter::_directory
protected

◆ checkAbort

CheckAbortPtr Lucene::CompoundFileWriter::checkAbort
protected

◆ entries

Collection<FileEntry> Lucene::CompoundFileWriter::entries
protected

◆ fileName

String Lucene::CompoundFileWriter::fileName
protected

◆ ids

HashSet<String> Lucene::CompoundFileWriter::ids
protected

◆ merged

bool Lucene::CompoundFileWriter::merged
protected

The documentation for this class was generated from the following file:

clucene.sourceforge.net