xapian-core  1.4.25
chert_databasereplicator.h
Go to the documentation of this file.
1 
4 /* Copyright 2008 Lemur Consulting Ltd
5  * Copyright 2010 Richard Boulton
6  * Copyright 2010,2011 Olly Betts
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of the
11  * License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
21  * USA
22  */
23 
24 #ifndef XAPIAN_INCLUDED_CHERT_DATABASEREPLICATOR_H
25 #define XAPIAN_INCLUDED_CHERT_DATABASEREPLICATOR_H
26 
28 
30  private:
33  std::string db_dir;
34 
37  unsigned int max_changesets;
38 
41  void process_changeset_chunk_base(const std::string & tablename,
42  std::string & buf,
43  RemoteConnection & conn,
44  double end_time,
45  int changes_fd) const;
46 
50  void process_changeset_chunk_blocks(const std::string & tablename,
51  std::string & buf,
52  RemoteConnection & conn,
53  double end_time,
54  int changes_fd) const;
55 
56  public:
57  explicit ChertDatabaseReplicator(const std::string & db_dir_);
58 
61  bool check_revision_at_least(const std::string & rev,
62  const std::string & target) const;
64  double end_time,
65  bool valid) const;
66  std::string get_uuid() const;
68 };
69 
70 #endif /* XAPIAN_INCLUDED_CHERT_DATABASEREPLICATOR_H */
unsigned int max_changesets
The maximum number of changesets which should be kept in the database.
A RemoteConnection object provides a bidirectional connection to another RemoteConnection object on a...
XAPIAN_REVISION_TYPE rev
Revision number of a database.
Definition: types.h:133
double end_time(double timeout)
Return the end time for a timeout in timeout seconds.
Definition: realtime.h:95
bool check_revision_at_least(const std::string &rev, const std::string &target) const
Virtual methods of DatabaseReplicator.
std::string db_dir
Path of database.
Base class for database replicator objects.
Class to manage replication of databases.
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.
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.
std::string get_uuid() const
Virtual methods of DatabaseReplicator.
ChertDatabaseReplicator(const std::string &db_dir_)
std::string apply_changeset_from_conn(RemoteConnection &conn, double end_time, bool valid) const
Virtual methods of DatabaseReplicator.