Drizzled Public API Documentation

drizzled::ReplicationServices Class Reference

#include <replication_services.h>

List of all members.

Public Types

enum  MessageType { TRANSACTION = 1, BLOB = 2 }
typedef uint64_t GlobalTransactionId
typedef std::pair
< plugin::TransactionReplicator
*, plugin::TransactionApplier * > 
ReplicationPair
typedef std::vector
< ReplicationPair > 
ReplicationStreams

Public Member Functions

bool evaluateRegisteredPlugins ()
plugin::ReplicationReturnCode pushTransactionMessage (Session &in_session, message::Transaction &to_push)
 ReplicationServices ()
bool isActive () const
ReplicationStreams & getReplicationStreams ()
void attachReplicator (plugin::TransactionReplicator *in_replicator)
void detachReplicator (plugin::TransactionReplicator *in_replicator)
void attachApplier (plugin::TransactionApplier *in_applier, const std::string &requested_replicator)
void detachApplier (plugin::TransactionApplier *in_applier)
uint64_t getLastAppliedTimestamp () const

Static Public Member Functions

static ReplicationServicessingleton ()

Private Types

typedef std::vector
< plugin::TransactionReplicator * > 
Replicators
typedef std::vector< std::pair
< std::string,
plugin::TransactionApplier * > > 
Appliers

Private Member Functions

void normalizeReplicatorName (std::string &name)

Private Attributes

bool is_active
atomic< uint64_t > last_applied_timestamp
Replicators replicators
Appliers appliers
ReplicationStreams replication_streams

Detailed Description

This is a class which manages transforming internal transactional events into GPB messages and sending those events out through registered replicators and appliers.

Definition at line 58 of file replication_services.h.


Member Enumeration Documentation

Types of messages that can go in the transaction log file. Every time something is written into the transaction log, it is preceded by a header containing the type of message which follows.

Definition at line 68 of file replication_services.h.


Constructor & Destructor Documentation


Member Function Documentation

void drizzled::ReplicationServices::attachApplier ( plugin::TransactionApplier in_applier,
const std::string &  requested_replicator 
)

Attaches a applier to our internal collection of appliers.

Parameters:
Pointerto a applier to attach/register
Thename of the replicator to pair with

Definition at line 153 of file replication_services.cc.

References appliers.

Attaches a replicator to our internal collection of replicators.

Parameters:
Pointerto a replicator to attach/register

Definition at line 143 of file replication_services.cc.

References replicators.

Detaches/unregisters a applier with our internal collection of appliers.

Parameters:
Pointerto the applier to detach

Definition at line 158 of file replication_services.cc.

Detaches/unregisters a replicator with our internal collection of replicators.

Parameters:
Pointerto the replicator to detach

Definition at line 148 of file replication_services.cc.

References replicators.

Method which is called after plugins have been loaded but before the first client connects. It determines if the registration of applier and replicator plugins is proper and pairs the applier and requested replicator plugins into the replication streams.

Todo:

This is only necessary because we don't yet have plugin dependency tracking...

Definition at line 78 of file replication_services.cc.

References appliers, is_active, normalizeReplicatorName(), replication_streams, and replicators.

Returns the timestamp of the last Transaction which was sent to an applier.

ReplicationServices::ReplicationStreams & drizzled::ReplicationServices::getReplicationStreams ( )

Returns the list of replication streams

Definition at line 197 of file replication_services.cc.

References replication_streams.

void drizzled::ReplicationServices::normalizeReplicatorName ( std::string &  name) [private]

Strips underscores and lowercases supplied replicator name or requested name, and appends the suffix "replicator" if missing...

Definition at line 60 of file replication_services.cc.

Referenced by evaluateRegisteredPlugins().

Singleton method Returns the singleton instance of ReplicationServices

Definition at line 106 of file replication_services.h.


Member Data Documentation

Our collection of registered applier plugins and their requested replicator plugin names

Definition at line 178 of file replication_services.h.

Referenced by attachApplier(), and evaluateRegisteredPlugins().

Atomic boolean set to true if any *active* replicators or appliers are actually registered.

Definition at line 169 of file replication_services.h.

Referenced by evaluateRegisteredPlugins(), and isActive().

The timestamp of the last time a Transaction message was successfully applied (sent to an Applier)

Definition at line 174 of file replication_services.h.

Referenced by pushTransactionMessage().

Our replication streams

Definition at line 180 of file replication_services.h.

Referenced by evaluateRegisteredPlugins(), getReplicationStreams(), and pushTransactionMessage().

Our collection of registered replicator plugins

Definition at line 176 of file replication_services.h.

Referenced by attachReplicator(), detachReplicator(), and evaluateRegisteredPlugins().


The documentation for this class was generated from the following files: