xapian-core
1.4.27
|
Access to a master database for replication. More...
#include <replication.h>
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... | |
Access to a master database for replication.
Definition at line 61 of file replication.h.
|
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.
string DatabaseMaster::get_description | ( | ) | const |
Return a string describing this object.
Definition at line 114 of file replication.cc.
References description_append().
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.
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 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().
|
private |
The path to the master database.
Definition at line 63 of file replication.h.