xapian-core
1.4.26
|
Base class for database replicator objects. More...
#include <databasereplicator.h>
Public Member Functions | |
virtual | ~DatabaseReplicator () |
Destroy the replicator. More... | |
virtual bool | check_revision_at_least (const std::string &rev, const std::string &target) const =0 |
Check if the revision of the database is at least that of a target. More... | |
virtual std::string | apply_changeset_from_conn (RemoteConnection &conn, double end_time, bool db_valid) const =0 |
Read and apply the next changeset. More... | |
virtual std::string | get_uuid () const =0 |
Get a UUID for the replica. More... | |
Static Public Member Functions | |
static DatabaseReplicator * | open (const std::string &path) |
Open a DatabaseReplicator for the given path. More... | |
Protected Member Functions | |
DatabaseReplicator () | |
Constructor to allow construction of subclasses from the open() method. More... | |
Private Member Functions | |
DatabaseReplicator (const DatabaseReplicator &) | |
Copies are not allowed. More... | |
void | operator= (const DatabaseReplicator &) |
Assignment is not allowed. More... | |
Base class for database replicator objects.
This is subclassed by each database backend which supports replication.
Definition at line 38 of file databasereplicator.h.
|
private |
Copies are not allowed.
|
inlineprotected |
Constructor to allow construction of subclasses from the open() method.
Definition at line 49 of file databasereplicator.h.
References apply_changeset_from_conn(), check_revision_at_least(), RealTime::end_time(), get_uuid(), open(), and ~DatabaseReplicator().
|
virtual |
Destroy the replicator.
Definition at line 44 of file databasereplicator.cc.
Referenced by DatabaseReplicator().
|
pure virtual |
Read and apply the next changeset.
conn | The remote connection manager. |
end_time | The time to timeout at. |
db_valid | Whether the database is known to be valid at the start of the changeset. If this is true, some additional checks are performed. |
Implemented in GlassDatabaseReplicator, and ChertDatabaseReplicator.
Referenced by DatabaseReplicator().
|
pure virtual |
Check if the revision of the database is at least that of a target.
rev | The database revision. |
target | The target revision. |
Implemented in GlassDatabaseReplicator, and ChertDatabaseReplicator.
Referenced by DatabaseReplicator().
|
pure virtual |
Get a UUID for the replica.
If the UUID cannot be read (for example, because the database is not valid), this should return the empty string, rather than raising an exception.
Implemented in GlassDatabaseReplicator, and ChertDatabaseReplicator.
Referenced by DatabaseReplicator().
|
static |
Open a DatabaseReplicator for the given path.
The type of the database at the path is automatically detected.
Definition at line 49 of file databasereplicator.cc.
References file_exists(), and LOGCALL_STATIC.
Referenced by DatabaseReplicator().
|
private |
Assignment is not allowed.