xapian-core  1.4.26
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
Xapian::DatabaseReplicator Class Referenceabstract

Base class for database replicator objects. More...

#include <databasereplicator.h>

+ Inheritance diagram for Xapian::DatabaseReplicator:

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 DatabaseReplicatoropen (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...
 

Detailed Description

Base class for database replicator objects.

This is subclassed by each database backend which supports replication.

Definition at line 38 of file databasereplicator.h.

Constructor & Destructor Documentation

◆ DatabaseReplicator() [1/2]

Xapian::DatabaseReplicator::DatabaseReplicator ( const DatabaseReplicator )
private

Copies are not allowed.

◆ DatabaseReplicator() [2/2]

Xapian::DatabaseReplicator::DatabaseReplicator ( )
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().

◆ ~DatabaseReplicator()

Xapian::DatabaseReplicator::~DatabaseReplicator ( )
virtual

Destroy the replicator.

Definition at line 44 of file databasereplicator.cc.

Referenced by DatabaseReplicator().

Member Function Documentation

◆ apply_changeset_from_conn()

virtual std::string Xapian::DatabaseReplicator::apply_changeset_from_conn ( RemoteConnection conn,
double  end_time,
bool  db_valid 
) const
pure virtual

Read and apply the next changeset.

Parameters
connThe remote connection manager.
end_timeThe time to timeout at.
db_validWhether 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().

◆ check_revision_at_least()

virtual bool Xapian::DatabaseReplicator::check_revision_at_least ( const std::string &  rev,
const std::string &  target 
) const
pure virtual

Check if the revision of the database is at least that of a target.

Parameters
revThe database revision.
targetThe target revision.

Implemented in GlassDatabaseReplicator, and ChertDatabaseReplicator.

Referenced by DatabaseReplicator().

◆ get_uuid()

virtual std::string Xapian::DatabaseReplicator::get_uuid ( ) const
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().

◆ open()

DatabaseReplicator * Xapian::DatabaseReplicator::open ( const std::string &  path)
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().

◆ operator=()

void Xapian::DatabaseReplicator::operator= ( const DatabaseReplicator )
private

Assignment is not allowed.


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