Branch data Line data Source code
1 : : /** @file brass_databasereplicator.h
2 : : * @brief Support for brass database replication
3 : : */
4 : : /* Copyright 2008 Lemur Consulting Ltd
5 : : * Copyright 2009,2010 Olly Betts
6 : : *
7 : : * This program is free software; you can redistribute it and/or
8 : : * modify it under the terms of the GNU General Public License as
9 : : * published by the Free Software Foundation; either version 2 of the
10 : : * License, or (at your option) any later version.
11 : : *
12 : : * This program is distributed in the hope that it will be useful,
13 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 : : * GNU General Public License for more details.
16 : : *
17 : : * You should have received a copy of the GNU General Public License
18 : : * along with this program; if not, write to the Free Software
19 : : * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20 : : * USA
21 : : */
22 : :
23 : : #ifndef XAPIAN_INCLUDED_BRASS_DATABASEREPLICATOR_H
24 : : #define XAPIAN_INCLUDED_BRASS_DATABASEREPLICATOR_H
25 : :
26 : : #include "databasereplicator.h"
27 : :
28 [ + - ][ # # ]: 59 : class BrassDatabaseReplicator : public Xapian::DatabaseReplicator {
29 : : private:
30 : : /** Path of database.
31 : : */
32 : : std::string db_dir;
33 : :
34 : : /** Process a chunk which holds a base block.
35 : : */
36 : : void process_changeset_chunk_base(const std::string & tablename,
37 : : std::string & buf,
38 : : RemoteConnection & conn,
39 : : double end_time) const;
40 : :
41 : : /** Process a chunk which holds a list of changed blocks in the
42 : : * database.
43 : : */
44 : : void process_changeset_chunk_blocks(const std::string & tablename,
45 : : std::string & buf,
46 : : RemoteConnection & conn,
47 : : double end_time) const;
48 : :
49 : : public:
50 : : BrassDatabaseReplicator(const std::string & db_dir_);
51 : :
52 : : /** Virtual methods of DatabaseReplicator. */
53 : : //@{
54 : : bool check_revision_at_least(const std::string & rev,
55 : : const std::string & target) const;
56 : : std::string apply_changeset_from_conn(RemoteConnection & conn,
57 : : double end_time,
58 : : bool valid) const;
59 : : std::string get_uuid() const;
60 : : //@}
61 : : };
62 : :
63 : : #endif /* XAPIAN_INCLUDED_BRASS_DATABASEREPLICATOR_H */
|