00001 /* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*- 00002 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 00003 * 00004 * Copyright (C) 2008-2009 Sun Microsystems, Inc. 00005 * 00006 * Authors: 00007 * 00008 * Jay Pipes <joinfu@sun.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 00031 #pragma once 00032 00033 #include <drizzled/replication_services.h> 00034 00035 #include <string> 00036 00040 class TransactionLogEntry 00041 { 00042 public: 00043 TransactionLogEntry(drizzled::ReplicationServices::MessageType in_type, 00044 off_t in_offset, 00045 size_t length); 00046 ~TransactionLogEntry(); 00050 const char *getTypeAsString() const; 00054 off_t getOffset() const; 00058 size_t getLengthInBytes() const; 00059 private: 00060 enum drizzled::ReplicationServices::MessageType type; 00061 off_t offset; 00062 size_t length; 00063 }; 00064 00065 class TransactionLogTransactionEntry 00066 { 00067 public: 00068 TransactionLogTransactionEntry(off_t in_offset, 00069 const drizzled::message::Transaction &transaction, 00070 uint32_t in_checksum); 00071 ~TransactionLogTransactionEntry(); 00075 off_t getOffset() const; 00079 uint32_t getServerId() const; 00083 uint64_t getStartTimestamp() const; 00087 uint64_t getEndTimestamp() const; 00091 uint64_t getTransactionId() const; 00095 uint64_t getNumStatements() const; 00099 uint32_t getChecksum() const; 00100 private: 00101 off_t offset; 00102 uint32_t server_id; 00103 uint64_t transaction_id; 00104 uint64_t start_timestamp; 00105 uint64_t end_timestamp; 00106 uint32_t num_statements; 00107 uint32_t checksum; 00108 }; 00109