#include <flint_databasereplicator.h>


Public Member Functions | |
| FlintDatabaseReplicator (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, int changes_fd) 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, int changes_fd) const |
| Process a chunk which holds a list of changed blocks in the database. | |
Private Attributes | |
| std::string | db_dir |
| Path of database. | |
| unsigned int | max_changesets |
| The maximum number of changesets which should be kept in the database. | |
Definition at line 29 of file flint_databasereplicator.h.
| FlintDatabaseReplicator::FlintDatabaseReplicator | ( | const std::string & | db_dir_ | ) |
| string FlintDatabaseReplicator::apply_changeset_from_conn | ( | RemoteConnection & | conn, | |
| double | end_time, | |||
| bool | valid | |||
| ) | const [virtual] |
Virtual methods of DatabaseReplicator.
Implements Xapian::DatabaseReplicator.
Definition at line 237 of file flint_databasereplicator.cc.
References AssertEq, CHANGES_MAGIC_STRING, CHANGES_VERSION, CONST_STRLEN, create_changeset_file(), db_dir, F_pack_uint(), F_unpack_string(), F_unpack_uint(), RemoteConnection::get_message_chunk(), RemoteConnection::get_message_chunked(), FlintTable::get_open_revision_number(), FlintLock::lock(), LOGCALL, max_changesets, FlintTable::open(), process_changeset_chunk_base(), process_changeset_chunk_blocks(), REASONABLE_CHANGESET_SIZE, REPL_REPLY_CHANGESET, RETURN, startswith(), Xapian::Internal::str(), FlintLock::SUCCESS, and write_and_clear_changes().
| bool FlintDatabaseReplicator::check_revision_at_least | ( | const std::string & | rev, | |
| const std::string & | target | |||
| ) | const [virtual] |
Virtual methods of DatabaseReplicator.
Implements Xapian::DatabaseReplicator.
Definition at line 65 of file flint_databasereplicator.cc.
References F_unpack_uint(), LOGCALL, and RETURN.
| string FlintDatabaseReplicator::get_uuid | ( | ) | const [virtual] |
Virtual methods of DatabaseReplicator.
Implements Xapian::DatabaseReplicator.
Definition at line 373 of file flint_databasereplicator.cc.
References db_dir, FlintVersion::get_uuid_string(), LOGCALL, FlintVersion::read_and_check(), and RETURN.
| void FlintDatabaseReplicator::process_changeset_chunk_base | ( | const std::string & | tablename, | |
| std::string & | buf, | |||
| RemoteConnection & | conn, | |||
| double | end_time, | |||
| int | changes_fd | |||
| ) | const [private] |
Process a chunk which holds a base block.
Definition at line 89 of file flint_databasereplicator.cc.
References db_dir, F_unpack_uint(), RemoteConnection::get_message_chunk(), io_sync(), io_write(), msvc_posix_open(), msvc_posix_rename(), O_BINARY, Xapian::DatabaseReplicator::open(), unlink(), and write_and_clear_changes().
Referenced by apply_changeset_from_conn().
| void FlintDatabaseReplicator::process_changeset_chunk_blocks | ( | const std::string & | tablename, | |
| std::string & | buf, | |||
| RemoteConnection & | conn, | |||
| double | end_time, | |||
| int | changes_fd | |||
| ) | const [private] |
Process a chunk which holds a list of changed blocks in the database.
Definition at line 164 of file flint_databasereplicator.cc.
References db_dir, F_unpack_uint(), 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 write_and_clear_changes().
Referenced by apply_changeset_from_conn().
std::string FlintDatabaseReplicator::db_dir [private] |
Path of database.
Definition at line 33 of file flint_databasereplicator.h.
Referenced by apply_changeset_from_conn(), get_uuid(), process_changeset_chunk_base(), and process_changeset_chunk_blocks().
unsigned int FlintDatabaseReplicator::max_changesets [private] |
The maximum number of changesets which should be kept in the database.
Definition at line 37 of file flint_databasereplicator.h.
Referenced by apply_changeset_from_conn(), and FlintDatabaseReplicator().