#include <brass_databasereplicator.h>


Public Member Functions | |
| BrassDatabaseReplicator (const std::string &db_dir_) | |
| bool | check_revision_at_least (const std::string &rev, const std::string &target) const |
| Virtual methods of DatabaseReplicator. | |
| std::string | apply_changeset_from_conn (RemoteConnection &conn, double end_time, bool valid) const |
| Virtual methods of DatabaseReplicator. | |
| std::string | get_uuid () const |
| Virtual methods of DatabaseReplicator. | |
Private Member Functions | |
| void | process_changeset_chunk_base (const std::string &tablename, std::string &buf, RemoteConnection &conn, double end_time) const |
| Process a chunk which holds a base block. | |
| void | process_changeset_chunk_blocks (const std::string &tablename, std::string &buf, RemoteConnection &conn, double end_time) const |
| Process a chunk which holds a list of changed blocks in the database. | |
Private Attributes | |
| std::string | db_dir |
| Path of database. | |
Definition at line 28 of file brass_databasereplicator.h.
| BrassDatabaseReplicator::BrassDatabaseReplicator | ( | const std::string & | db_dir_ | ) |
Definition at line 53 of file brass_databasereplicator.cc.
| string BrassDatabaseReplicator::apply_changeset_from_conn | ( | RemoteConnection & | conn, | |
| double | end_time, | |||
| bool | valid | |||
| ) | const [virtual] |
Virtual methods of DatabaseReplicator.
Implements Xapian::DatabaseReplicator.
Definition at line 227 of file brass_databasereplicator.cc.
References AssertEq, CHANGES_MAGIC_STRING, CHANGES_VERSION, db_dir, RemoteConnection::get_message_chunk(), RemoteConnection::get_message_chunked(), BrassTable::get_open_revision_number(), FlintLock::lock(), LOGCALL, BrassTable::open(), pack_uint(), process_changeset_chunk_base(), process_changeset_chunk_blocks(), REASONABLE_CHANGESET_SIZE, REPL_REPLY_CHANGESET, RETURN, startswith(), Xapian::Internal::str(), FlintLock::SUCCESS, FlintLock::throw_databaselockerror(), unpack_string(), and unpack_uint().
| bool BrassDatabaseReplicator::check_revision_at_least | ( | const std::string & | rev, | |
| const std::string & | target | |||
| ) | const [virtual] |
Virtual methods of DatabaseReplicator.
Implements Xapian::DatabaseReplicator.
Definition at line 59 of file brass_databasereplicator.cc.
References LOGCALL, RETURN, and unpack_uint().
| string BrassDatabaseReplicator::get_uuid | ( | ) | const [virtual] |
Virtual methods of DatabaseReplicator.
Implements Xapian::DatabaseReplicator.
Definition at line 353 of file brass_databasereplicator.cc.
References db_dir, BrassVersion::get_uuid_string(), LOGCALL, BrassVersion::read_and_check(), and RETURN.
| void BrassDatabaseReplicator::process_changeset_chunk_base | ( | const std::string & | tablename, | |
| std::string & | buf, | |||
| RemoteConnection & | conn, | |||
| double | end_time | |||
| ) | const [private] |
Process a chunk which holds a base block.
Definition at line 83 of file brass_databasereplicator.cc.
References db_dir, RemoteConnection::get_message_chunk(), io_sync(), io_write(), msvc_posix_open(), msvc_posix_rename(), O_BINARY, Xapian::DatabaseReplicator::open(), unlink(), and unpack_uint().
Referenced by apply_changeset_from_conn().
| void BrassDatabaseReplicator::process_changeset_chunk_blocks | ( | const std::string & | tablename, | |
| std::string & | buf, | |||
| RemoteConnection & | conn, | |||
| double | end_time | |||
| ) | const [private] |
Process a chunk which holds a list of changed blocks in the database.
Definition at line 155 of file brass_databasereplicator.cc.
References db_dir, file_exists(), RemoteConnection::get_message_chunk(), io_sync(), io_write(), msvc_posix_open(), O_BINARY, Xapian::DatabaseReplicator::open(), REASONABLE_CHANGESET_SIZE, Xapian::Internal::str(), and unpack_uint().
Referenced by apply_changeset_from_conn().
std::string BrassDatabaseReplicator::db_dir [private] |
Path of database.
Definition at line 32 of file brass_databasereplicator.h.
Referenced by apply_changeset_from_conn(), get_uuid(), process_changeset_chunk_base(), and process_changeset_chunk_blocks().