xapian-core  1.4.27
Public Member Functions | Private Attributes | List of all members
MyCompactor Class Reference
+ Inheritance diagram for MyCompactor:
+ Collaboration diagram for MyCompactor:

Public Member Functions

 MyCompactor ()
 
void set_quiet (bool quiet_)
 
void set_status (const string &table, const string &status) override
 Update progress. More...
 
string resolve_duplicate_metadata (const string &key, size_t n, const string tags[]) override
 Resolve multiple user metadata entries with the same key. More...
 
- Public Member Functions inherited from Xapian::Compactor
 Compactor ()
 
virtual ~Compactor ()
 
void set_block_size (size_t block_size)
 Set the block size to use for tables in the output database. More...
 
void set_renumber (bool renumber)
 Set whether to preserve existing document id values. More...
 
void set_multipass (bool multipass)
 Set whether to merge postlists in multiple passes. More...
 
void set_compaction_level (compaction_level compaction)
 Set the compaction level. More...
 
void set_destdir (const std::string &destdir)
 Set where to write the output. More...
 
void add_source (const std::string &srcdir)
 Add a source database. More...
 
void compact ()
 Perform the actual compaction/merging operation. More...
 

Private Attributes

bool quiet
 

Additional Inherited Members

- Public Types inherited from Xapian::Compactor
enum  compaction_level { STANDARD = 0, FULL = 1, FULLER = 2 }
 Compaction level. More...
 

Detailed Description

Definition at line 62 of file xapian-compact.cc.

Constructor & Destructor Documentation

◆ MyCompactor()

MyCompactor::MyCompactor ( )
inline

Definition at line 66 of file xapian-compact.cc.

Member Function Documentation

◆ resolve_duplicate_metadata()

string MyCompactor::resolve_duplicate_metadata ( const string &  key,
size_t  num_tags,
const string  tags[] 
)
overridevirtual

Resolve multiple user metadata entries with the same key.

When merging, if the same user metadata key is set in more than one input, then this method is called to allow this to be resolving in an appropriate way.

The default implementation just returns tags[0].

For multipass this will currently get called multiple times for the same key if there are duplicates to resolve in each pass, but this may change in the future.

Since 1.4.6, an implementation of this method can return an empty string to indicate that the appropriate result is to not set a value for this user metadata key in the output database. In older versions, you should not return an empty string.

Parameters
keyThe metadata key with duplicate entries.
num_tagsHow many tags there are.
tagsAn array of num_tags strings containing the tags to merge.

Reimplemented from Xapian::Compactor.

Definition at line 90 of file xapian-compact.cc.

◆ set_quiet()

void MyCompactor::set_quiet ( bool  quiet_)
inline

Definition at line 68 of file xapian-compact.cc.

References tags.

Referenced by main().

◆ set_status()

void MyCompactor::set_status ( const string &  table,
const string &  status 
)
overridevirtual

Update progress.

Subclass this method if you want to get progress updates during compaction. This is called for each table first with empty status, And then one or more times with non-empty status.

The default implementation does nothing.

Parameters
tableThe table currently being compacted.
statusA status message.

Reimplemented from Xapian::Compactor.

Definition at line 79 of file xapian-compact.cc.

Member Data Documentation

◆ quiet

bool MyCompactor::quiet
private

Definition at line 63 of file xapian-compact.cc.


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