#include <LogicalTxnParticipant.h>
Inheritance diagram for LogicalTxnParticipant:
Public Member Functions | |
virtual | ~LogicalTxnParticipant () |
virtual LogicalTxnClassId | getParticipantClassId () const=0 |
| |
virtual void | describeParticipant (ByteOutputStream &logStream)=0 |
Called by LogicalTxn the first time an action is logged for this participant. | |
virtual void | undoLogicalAction (LogicalActionType actionType, ByteInputStream &logStream)=0 |
Performs undo for one logical action during rollback or recovery. | |
virtual void | redoLogicalAction (LogicalActionType actionType, ByteInputStream &logStream)=0 |
Performs redo for one logical action during recovery. | |
Protected Member Functions | |
LogicalTxnParticipant () | |
LogicalTxn * | getLogicalTxn () |
| |
bool | isLoggingEnabled () const |
| |
Private Member Functions | |
void | clearLogicalTxn () |
void | enableLogging (bool) |
Private Attributes | |
LogicalTxn * | pTxn |
bool | loggingEnabled |
Friends | |
class | LogicalTxn |
Definition at line 35 of file LogicalTxnParticipant.h.
LogicalTxnParticipant::LogicalTxnParticipant | ( | ) | [explicit, protected] |
Definition at line 30 of file LogicalTxnParticipant.cpp.
References enableLogging(), and pTxn.
00031 { 00032 enableLogging(false); 00033 pTxn = NULL; 00034 }
LogicalTxnParticipant::~LogicalTxnParticipant | ( | ) | [virtual] |
void LogicalTxnParticipant::clearLogicalTxn | ( | ) | [private] |
Definition at line 45 of file LogicalTxnParticipant.cpp.
References enableLogging(), and pTxn.
Referenced by LogicalTxn::forgetAllParticipants().
00046 { 00047 assert(pTxn); 00048 enableLogging(false); 00049 pTxn = NULL; 00050 }
void LogicalTxnParticipant::enableLogging | ( | bool | ) | [private] |
Definition at line 40 of file LogicalTxnParticipant.cpp.
References loggingEnabled.
Referenced by clearLogicalTxn(), LogicalTxnParticipant(), and LogicalTxn::rollbackToSavepoint().
00041 { 00042 loggingEnabled = enabled; 00043 }
LogicalTxn * LogicalTxnParticipant::getLogicalTxn | ( | ) | [inline, protected] |
Definition at line 111 of file LogicalTxnParticipant.h.
References pTxn.
Referenced by LogicalTxnTest::commit(), BTreeWriter::deleteCurrent(), FtrsTableWriter::execute(), DatabaseTest::executeIncrementAction(), BTreeWriter::insertTupleFromBuffer(), LogicalTxnTest::rollbackFull(), LogicalTxnTest::testActions(), LogicalTxnTest::testCheckpointCommitSavepoint(), LogicalTxnTest::testRollbackSavepoint(), LogicalTxnTest::testTxn(), and LogicalTxnTest::testTxnIdSequence().
00112 { 00113 return pTxn; 00114 }
bool LogicalTxnParticipant::isLoggingEnabled | ( | ) | const [inline, protected] |
Definition at line 116 of file LogicalTxnParticipant.h.
References loggingEnabled.
Referenced by BTreeWriter::deleteCurrent(), FtrsTableWriter::execute(), BTreeWriter::insertTupleFromBuffer(), and BTreeWriter::updateCurrent().
00117 { 00118 return loggingEnabled; 00119 }
virtual LogicalTxnClassId LogicalTxnParticipant::getParticipantClassId | ( | ) | const [pure virtual] |
Implemented in BTreeWriter, FtrsTableWriter, DatabaseTest, and LogicalTxnTest.
virtual void LogicalTxnParticipant::describeParticipant | ( | ByteOutputStream & | logStream | ) | [pure virtual] |
Called by LogicalTxn the first time an action is logged for this participant.
The participant must implement this by writing a description of itself to the given output stream. This information must be sufficient for reconstructing the participant during recovery.
logStream | stream to which the participant description should be written |
Implemented in BTreeWriter, FtrsTableWriter, DatabaseTest, and LogicalTxnTest.
virtual void LogicalTxnParticipant::undoLogicalAction | ( | LogicalActionType | actionType, | |
ByteInputStream & | logStream | |||
) | [pure virtual] |
Performs undo for one logical action during rollback or recovery.
The implementation must consume ALL log data for this action, even if some of it turns out to be unneeded.
actionType | the type of action to undo; the rest of the action parameters should be read from the LogicalTxn's input stream | |
logStream | stream from which to read action data |
Implemented in BTreeWriter, FtrsTableWriter, DatabaseTest, and LogicalTxnTest.
Referenced by LogicalRecoveryTxn::undoActions().
virtual void LogicalTxnParticipant::redoLogicalAction | ( | LogicalActionType | actionType, | |
ByteInputStream & | logStream | |||
) | [pure virtual] |
Performs redo for one logical action during recovery.
The implementation must consume ALL log data for this action, even if some of it turns out to be unneeded.
actionType | the type of action to redo; the rest of the action parameters should be read from the LogicalTxn's input stream | |
logStream | stream from which to read action data |
Implemented in BTreeWriter, FtrsTableWriter, DatabaseTest, and LogicalTxnTest.
Referenced by LogicalRecoveryTxn::redoActions().
friend class LogicalTxn [friend] |
Definition at line 37 of file LogicalTxnParticipant.h.
LogicalTxn* LogicalTxnParticipant::pTxn [private] |
Definition at line 39 of file LogicalTxnParticipant.h.
Referenced by LogicalTxn::beginLogicalAction(), clearLogicalTxn(), FtrsTableWriter::execute(), DatabaseTest::executeCheckpointedTxn(), DatabaseTest::executeForceTxn(), DatabaseTest::executeIncrementTxn(), getLogicalTxn(), LogicalTxnParticipant(), and LogicalTxnTest::testTxn().
bool LogicalTxnParticipant::loggingEnabled [private] |
Definition at line 41 of file LogicalTxnParticipant.h.
Referenced by enableLogging(), and isLoggingEnabled().