Xapian::DatabaseMaster Class Reference

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

#include <replication.h>

Collaboration diagram for Xapian::DatabaseMaster:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 DatabaseMaster (const std::string &path_)
 Create a new DatabaseMaster for the database at the specified path.
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.
std::string get_description () const
 Return a string describing this object.

Private Attributes

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


Detailed Description

Access to a master database for replication.

Definition at line 62 of file replication.h.


Constructor & Destructor Documentation

Xapian::DatabaseMaster::DatabaseMaster ( const std::string &  path_  )  [inline]

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 72 of file replication.h.


Member Function Documentation

string DatabaseMaster::get_description (  )  const

Return a string describing this object.

Definition at line 106 of file replication.cc.

References path.

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:
fd An open file descriptor to write the changes to.
start_revision The 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.
info If non-NULL, the supplied structure will be updated to reflect the changes written to the file descriptor.

Definition at line 63 of file replication.cc.

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

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


Member Data Documentation

std::string Xapian::DatabaseMaster::path [private]

The path to the master database.

Definition at line 64 of file replication.h.

Referenced by get_description(), and write_changesets_to_fd().


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

Documentation for Xapian (version 1.2.9).
Generated on 10 May 2012 by Doxygen 1.5.9.