xapian-core  1.4.21
glass_databasereplicator.h
Go to the documentation of this file.
1 
4 /* Copyright 2008 Lemur Consulting Ltd
5  * Copyright 2009,2010,2011,2014 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_GLASS_DATABASEREPLICATOR_H
24 #define XAPIAN_INCLUDED_GLASS_DATABASEREPLICATOR_H
25 
27 #include "glass_defs.h"
28 
32  std::string db_dir;
33 
38  mutable int fds[Glass::MAX_];
39 
42  void process_changeset_chunk_version(std::string & buf,
43  RemoteConnection & conn,
44  double end_time) const;
45 
50  unsigned v,
51  std::string & buf,
52  RemoteConnection & conn,
53  double end_time) const;
54 
55  void commit() const;
56 
57  public:
58  explicit GlassDatabaseReplicator(const std::string & db_dir_);
59 
61 
64  bool check_revision_at_least(const std::string & rev,
65  const std::string & target) const;
67  double end_time,
68  bool valid) const;
69  std::string get_uuid() const;
71 };
72 
73 #endif /* XAPIAN_INCLUDED_GLASS_DATABASEREPLICATOR_H */
A RemoteConnection object provides a bidirectional connection to another RemoteConnection object on a...
bool check_revision_at_least(const std::string &rev, const std::string &target) const
Virtual methods of DatabaseReplicator.
XAPIAN_REVISION_TYPE rev
Revision number of a database.
Definition: types.h:133
table_type
Definition: glass_defs.h:46
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.
double end_time(double timeout)
Return the end time for a timeout in timeout seconds.
Definition: realtime.h:95
int fds[Glass::MAX_]
File descriptors for writing to each table.
Definitions, types, etc for use inside glass.
std::string db_dir
Path of database.
GlassDatabaseReplicator(const std::string &db_dir_)
Base class for database replicator objects.
Class to manage replication of databases.
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.
void process_changeset_chunk_version(std::string &buf, RemoteConnection &conn, double end_time) const
Process a chunk which holds a version file.