1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008-2009 Sun Microsystems, Inc.
8
* Jay Pipes <joinfu@sun.com>
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
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.
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
28
* Defines a simple structure representing a transaction log entry.
33
#include <drizzled/replication_services.h>
38
* Represents a single entry in the transaction log.
40
class TransactionLogEntry
43
TransactionLogEntry(drizzled::ReplicationServices::MessageType in_type,
46
~TransactionLogEntry();
48
* Returns a string representation of the entry type
50
const char *getTypeAsString() const;
52
* Returns the entry's offset in the log
54
off_t getOffset() const;
56
* Returns the length of the entry in bytes
58
size_t getLengthInBytes() const;
60
enum drizzled::ReplicationServices::MessageType type; ///< The type of the entry
61
off_t offset; ///< Offset into the log file
62
size_t length; ///< Length in bytes of the entry
65
class TransactionLogTransactionEntry
68
TransactionLogTransactionEntry(off_t in_offset,
69
const drizzled::message::Transaction &transaction,
70
uint32_t in_checksum);
71
~TransactionLogTransactionEntry();
73
* Returns the entry's offset in the log
75
off_t getOffset() const;
77
* Returns the transaction's server ID
79
uint32_t getServerId() const;
81
* Returns the transaction's start timestamp
83
uint64_t getStartTimestamp() const;
85
* Returns the transaction's end timestamp
87
uint64_t getEndTimestamp() const;
89
* Returns the transaction's ID
91
uint64_t getTransactionId() const;
93
* Returns the number of statements in the transaction
95
uint64_t getNumStatements() const;
97
* Returns the checksum for the transaction message bytes
99
uint32_t getChecksum() const;
101
off_t offset; ///< Offset into the log file
102
uint32_t server_id; ///< The server ID that this transaction came from
103
uint64_t transaction_id; ///< The transaction's ID
104
uint64_t start_timestamp; ///< The transaction's start timestamp
105
uint64_t end_timestamp; ///< The transaction's end timestamp
106
uint32_t num_statements; ///< Number of Statements in the transaction
107
uint32_t checksum; ///< Checksum of the transaction message bytes