Public Member Functions | |
TransactionLogIndex (TransactionLog &in_log) | |
uint64_t | getMinEndTimestamp () const |
uint64_t | getMaxEndTimestamp () const |
uint64_t | getMinTransactionId () const |
uint64_t | getMaxTransactionId () const |
uint64_t | getNumLogEntries () const |
uint64_t | getNumTransactionEntries () const |
bool | hasError () const |
const std::string & | getErrorMessage () const |
TransactionLog::Entries & | getEntries () |
TransactionLog::TransactionEntries & | getTransactionEntries () |
void | addEntry (const TransactionLogEntry &entry, const drizzled::message::Transaction &transaction, uint32_t checksum) |
void | clear () |
size_t | getTransactionEntriesSizeInBytes () |
size_t | getEntriesSizeInBytes () |
size_t | getSizeInBytes () |
Private Member Functions | |
TransactionLogIndex (const TransactionLogIndex &other) | |
TransactionLogIndex & | operator= (const TransactionLogIndex &other) |
void | open () |
void | clearError () |
Private Attributes | |
TransactionLog & | log |
The transaction log instance. | |
int | index_file |
File descriptor for the transaction log on-disk index file. | |
const std::string | index_file_path |
Filename of the on-disk transaction log index. | |
bool | has_error |
Index is in error mode? | |
std::string | error_message |
Current error message. | |
uint64_t | min_end_timestamp |
Minimum end timestamp in log. | |
uint64_t | max_end_timestamp |
Maximim end timestamp in log. | |
uint64_t | min_transaction_id |
Minimum transaction ID in log. | |
uint64_t | max_transaction_id |
Maximum transaction ID in log. | |
TransactionLog::Entries | entries |
Collection of information about the entries in the log. | |
TransactionLog::TransactionEntries | transaction_entries |
pthread_mutex_t | index_lock |
The global index lock. |
Definition at line 41 of file transaction_log_index.h.
void TransactionLogIndex::addEntry | ( | const TransactionLogEntry & | entry, |
const drizzled::message::Transaction & | transaction, | ||
uint32_t | checksum | ||
) |
Adds a new entry to the index of type Transaction message.
[in] | The | transaction log entry |
[in] | The | transaction message |
[in] | The | checksum for the transaction message bytes |
Definition at line 159 of file transaction_log_index.cc.
References entries, TransactionLogEntry::getOffset(), index_lock, max_end_timestamp, max_transaction_id, min_end_timestamp, and min_transaction_id.
Referenced by TransactionLogApplier::apply().
void TransactionLogIndex::clear | ( | ) |
Clears all data out of the transaction log index.
No locks are taken here. Currently only used in debugging.
Definition at line 69 of file transaction_log_index.cc.
References clearError(), entries, index_lock, max_end_timestamp, max_transaction_id, min_end_timestamp, and min_transaction_id.
void TransactionLogIndex::clearError | ( | ) | [private] |
Clears the internal error state
Definition at line 92 of file transaction_log_index.cc.
References error_message, and has_error.
Referenced by clear().
TransactionLog::Entries & TransactionLogIndex::getEntries | ( | ) |
Returns a reference to the index's collection of log entry objects
Definition at line 133 of file transaction_log_index.cc.
References entries.
const std::string & TransactionLogIndex::getErrorMessage | ( | ) | const |
Returns the current error message
Definition at line 98 of file transaction_log_index.cc.
References error_message.
uint64_t TransactionLogIndex::getMaxEndTimestamp | ( | ) | const |
Returns the maximum end timestamp of a transaction in the transaction log.
Definition at line 108 of file transaction_log_index.cc.
References max_end_timestamp.
uint64_t TransactionLogIndex::getMaxTransactionId | ( | ) | const |
Returns the maximum transaction ID of a transaction in the transaction log.
Definition at line 118 of file transaction_log_index.cc.
References max_transaction_id.
uint64_t TransactionLogIndex::getMinEndTimestamp | ( | ) | const |
Returns the minimum end timestamp of a transaction in the transaction log.
Definition at line 103 of file transaction_log_index.cc.
References min_end_timestamp.
uint64_t TransactionLogIndex::getMinTransactionId | ( | ) | const |
Returns the minimum transaction ID of a transaction in the transaction log.
Definition at line 113 of file transaction_log_index.cc.
References min_transaction_id.
uint64_t TransactionLogIndex::getNumLogEntries | ( | ) | const |
Returns the total number of entries in the transaction log
Definition at line 123 of file transaction_log_index.cc.
References entries.
uint64_t TransactionLogIndex::getNumTransactionEntries | ( | ) | const |
Returns the total number of transaction entries in the transaction log
Definition at line 128 of file transaction_log_index.cc.
TransactionLog::TransactionEntries & TransactionLogIndex::getTransactionEntries | ( | ) |
Returns a reference to the index's collection of transaction entry objects
Definition at line 138 of file transaction_log_index.cc.
bool TransactionLogIndex::hasError | ( | ) | const |
Returns whether the index encountered an error on its last action.
Definition at line 87 of file transaction_log_index.cc.
References has_error.
void TransactionLogIndex::open | ( | ) | [private] |
Helper function to open/create the index from the transaction log.
Definition at line 82 of file transaction_log_index.cc.