xapian-core  1.4.30
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GlassDatabaseReplicator Class Reference

#include <glass_databasereplicator.h>

+ Inheritance diagram for GlassDatabaseReplicator:
+ Collaboration diagram for GlassDatabaseReplicator:

Public Member Functions

 GlassDatabaseReplicator (const std::string &db_dir_)
 
 ~GlassDatabaseReplicator ()
 
bool check_revision_at_least (const std::string &rev, const std::string &target) const
 Virtual methods of DatabaseReplicator. More...
 
std::string apply_changeset_from_conn (RemoteConnection &conn, double end_time, bool valid) const
 Read and apply the next changeset. More...
 
std::string get_uuid () const
 Get a UUID for the replica. More...
 
- Public Member Functions inherited from Xapian::DatabaseReplicator
virtual ~DatabaseReplicator ()
 Destroy the replicator. More...
 

Private Member Functions

void process_changeset_chunk_version (std::string &buf, RemoteConnection &conn, double end_time) const
 Process a chunk which holds a version file. More...
 
void process_changeset_chunk_blocks (Glass::table_type table, unsigned v, std::string &buf, RemoteConnection &conn, double end_time) const
 Process a chunk which holds a list of changed blocks in the database. More...
 
void commit () const
 

Private Attributes

std::string db_dir
 Path of database. More...
 
int fds [Glass::MAX_]
 File descriptors for writing to each table. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Xapian::DatabaseReplicator
static DatabaseReplicatoropen (const std::string &path)
 Open a DatabaseReplicator for the given path. More...
 
- Protected Member Functions inherited from Xapian::DatabaseReplicator
 DatabaseReplicator ()
 Constructor to allow construction of subclasses from the open() method. More...
 

Detailed Description

Definition at line 29 of file glass_databasereplicator.h.

Constructor & Destructor Documentation

◆ GlassDatabaseReplicator()

GlassDatabaseReplicator::GlassDatabaseReplicator ( const std::string &  db_dir_)
explicit

Definition at line 67 of file glass_databasereplicator.cc.

References fds.

◆ ~GlassDatabaseReplicator()

GlassDatabaseReplicator::~GlassDatabaseReplicator ( )

Definition at line 88 of file glass_databasereplicator.cc.

References close(), fds, and Glass::MAX_.

Member Function Documentation

◆ apply_changeset_from_conn()

string GlassDatabaseReplicator::apply_changeset_from_conn ( RemoteConnection conn,
double  end_time,
bool  db_valid 
) const
virtual

◆ check_revision_at_least()

bool GlassDatabaseReplicator::check_revision_at_least ( const std::string &  rev,
const std::string &  target 
) const
virtual

Virtual methods of DatabaseReplicator.

Implements Xapian::DatabaseReplicator.

Definition at line 99 of file glass_databasereplicator.cc.

References LOGCALL, RETURN, and unpack_uint().

◆ commit()

void GlassDatabaseReplicator::commit ( ) const
private

Definition at line 74 of file glass_databasereplicator.cc.

References close(), fds, io_sync(), and Glass::MAX_.

Referenced by apply_changeset_from_conn().

◆ get_uuid()

string GlassDatabaseReplicator::get_uuid ( ) const
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.

Implements Xapian::DatabaseReplicator.

Definition at line 339 of file glass_databasereplicator.cc.

References db_dir, GlassVersion::get_uuid_string(), LOGCALL, GlassVersion::read(), and RETURN.

◆ process_changeset_chunk_blocks()

void GlassDatabaseReplicator::process_changeset_chunk_blocks ( Glass::table_type  table,
unsigned  v,
std::string &  buf,
RemoteConnection conn,
double  end_time 
) const
private

◆ process_changeset_chunk_version()

void GlassDatabaseReplicator::process_changeset_chunk_version ( std::string &  buf,
RemoteConnection conn,
double  end_time 
) const
private

Member Data Documentation

◆ db_dir

std::string GlassDatabaseReplicator::db_dir
private

◆ fds

int GlassDatabaseReplicator::fds[Glass::MAX_]
mutableprivate

File descriptors for writing to each table.

The corresponding entry is -1 if that table is not yet opened.

Definition at line 38 of file glass_databasereplicator.h.

Referenced by commit(), GlassDatabaseReplicator(), process_changeset_chunk_blocks(), and ~GlassDatabaseReplicator().


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