Drizzled Public API Documentation

zeromq_log.h
00001 /* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2011 Marcus Eriksson
00005  *
00006  *  Authors:
00007  *
00008  *  Marcus Eriksson <krummas@gmail.com>
00009  *
00010  *  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public License
00021  *  along with this program; if not, write to the Free Software
00022  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00023  */
00024 
00025 
00026 #pragma once
00027 
00028 #include <drizzled/replication_services.h>
00029 #include <drizzled/plugin/transaction_applier.h>
00030 #include <string>
00031 #include <zmq.h>
00032 
00033 namespace drizzle_plugin
00034 {
00035 
00043 class ZeroMQLog :
00044   public drizzled::plugin::TransactionApplier 
00045 {
00046 private:
00047   void *_socket;
00048   pthread_mutex_t publishLock;
00049   std::string getSchemaName(const drizzled::message::Transaction &txn);
00050 public:
00051 
00061   ZeroMQLog(const std::string &name, const std::string &endpoint);
00062   ~ZeroMQLog();
00063 
00073   drizzled::plugin::ReplicationReturnCode
00074   apply(drizzled::Session &session, const drizzled::message::Transaction &to_apply);
00075 
00076 };
00077 
00078 } /* namespace drizzle_plugin */
00079