xapian-core  1.4.27
Public Member Functions | Private Attributes | List of all members
Xapian::DatabaseMaster Class Reference

Access to a master database for replication. More...

#include <replication.h>

+ Collaboration diagram for Xapian::DatabaseMaster:

Public Member Functions

 DatabaseMaster (const std::string &path_)
 Create a new DatabaseMaster for the database at the specified path. More...
 
void write_changesets_to_fd (int fd, const std::string &start_revision, ReplicationInfo *info) const
 Write a set of changesets for upgrading the database to a file. More...
 
std::string get_description () const
 Return a string describing this object. More...
 

Private Attributes

std::string path
 The path to the master database. More...
 

Detailed Description

Access to a master database for replication.

Definition at line 61 of file replication.h.

Constructor & Destructor Documentation

◆ DatabaseMaster()

Xapian::DatabaseMaster::DatabaseMaster ( const std::string &  path_)
inlineexplicit

Create a new DatabaseMaster for the database at the specified path.

The database isn't actually opened until a set of changesets is requested.

Definition at line 71 of file replication.h.

Member Function Documentation

◆ get_description()

string DatabaseMaster::get_description ( ) const

Return a string describing this object.

Definition at line 114 of file replication.cc.

References description_append().

◆ write_changesets_to_fd()

void DatabaseMaster::write_changesets_to_fd ( int  fd,
const std::string &  start_revision,
ReplicationInfo info 
) const

Write a set of changesets for upgrading the database to a file.

The changesets will be such that, if they are applied in order to a copy of the database at the start revision, a copy of the database at the current revision (i.e. the revision which the database object is currently open at) will be produced.

If suitable changesets have been stored in the database, this will write the appropriate changesets, in order. If suitable changesets are not available, this will write a copy of sufficient blocks of the database to reconstruct the current revision.

This will therefore potentially write a very large amount of data to the file descriptor.

Parameters
fdAn open file descriptor to write the changes to.
start_revisionThe starting revision of the database that the changesets are to be applied to. Specify an empty string to get a "creation" changeset, which includes the creation of the database. The revision will include the unique identifier for the database, if one is available.
infoIf non-NULL, the supplied structure will be updated to reflect the changes written to the file descriptor.

Definition at line 70 of file replication.cc.

References Xapian::ReplicationInfo::clear(), decode_length_and_check(), Xapian::Error::get_msg(), Xapian::Database::internal, LOGCALL_VOID, REPL_REPLY_FAIL, Xapian::revision(), and RemoteConnection::send_message().

Referenced by get_changeset(), and ReplicateTcpServer::handle_one_connection().

Member Data Documentation

◆ path

std::string Xapian::DatabaseMaster::path
private

The path to the master database.

Definition at line 63 of file replication.h.


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