Drizzled Public API Documentation

replication_services.h
1 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3  *
4  * Copyright (C) 2008-2009 Sun Microsystems, Inc.
5  * Copyright (C) 2009-2010 Jay Pipes <jaypipes@gmail.com>
6  *
7  * Authors:
8  *
9  * Jay Pipes <jaypipes@gmail.com>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; version 2 of the License.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23  */
24 
25 #pragma once
26 
27 #include <drizzled/atomics.h>
28 #include <drizzled/plugin/replication.h>
29 
30 #include <string>
31 #include <vector>
32 #include <utility>
33 
34 #include <drizzled/visibility.h>
35 #include <drizzled/common_fwd.h>
36 
37 static const char DEFAULT_USE_REPLICATOR[]= "default";
38 
39 namespace drizzled {
40 
47 {
48 public:
49  typedef uint64_t GlobalTransactionId;
57  {
58  TRANSACTION= 1, /* A GPB Transaction Message */
59  BLOB= 2 /* A BLOB value */
60  };
61  typedef std::pair<plugin::TransactionReplicator *, plugin::TransactionApplier *> ReplicationPair;
62  typedef std::vector<ReplicationPair> ReplicationStreams;
75  static bool evaluateRegisteredPlugins();
83  static plugin::ReplicationReturnCode pushTransactionMessage(Session &in_session, message::Transaction &to_push);
84 
90  static bool isActive();
91 
95  static ReplicationStreams &getReplicationStreams();
96 
103  static void attachReplicator(plugin::TransactionReplicator *in_replicator);
104 
111  static void detachReplicator(plugin::TransactionReplicator *in_replicator);
112 
120  static void attachApplier(plugin::TransactionApplier *in_applier, const std::string &requested_replicator);
121 
128  static void detachApplier(plugin::TransactionApplier *in_applier);
129 
134  static uint64_t getLastAppliedTimestamp();
135 };
136 
137 } /* namespace drizzled */
138 
#define DRIZZLED_API
Definition: visibility.h:62
Visibility Control Macros.